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.
 
 
 

13433 lines
486 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/v1beta1"
  8. // ...
  9. // containerService, err := container.New(oauthHttpClient)
  10. package container // import "google.golang.org/api/container/v1beta1"
  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:v1beta1"
  41. const apiName = "container"
  42. const apiVersion = "v1beta1"
  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.Aggregated = NewProjectsAggregatedService(s)
  72. rs.Locations = NewProjectsLocationsService(s)
  73. rs.Zones = NewProjectsZonesService(s)
  74. return rs
  75. }
  76. type ProjectsService struct {
  77. s *Service
  78. Aggregated *ProjectsAggregatedService
  79. Locations *ProjectsLocationsService
  80. Zones *ProjectsZonesService
  81. }
  82. func NewProjectsAggregatedService(s *Service) *ProjectsAggregatedService {
  83. rs := &ProjectsAggregatedService{s: s}
  84. rs.UsableSubnetworks = NewProjectsAggregatedUsableSubnetworksService(s)
  85. return rs
  86. }
  87. type ProjectsAggregatedService struct {
  88. s *Service
  89. UsableSubnetworks *ProjectsAggregatedUsableSubnetworksService
  90. }
  91. func NewProjectsAggregatedUsableSubnetworksService(s *Service) *ProjectsAggregatedUsableSubnetworksService {
  92. rs := &ProjectsAggregatedUsableSubnetworksService{s: s}
  93. return rs
  94. }
  95. type ProjectsAggregatedUsableSubnetworksService struct {
  96. s *Service
  97. }
  98. func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
  99. rs := &ProjectsLocationsService{s: s}
  100. rs.Clusters = NewProjectsLocationsClustersService(s)
  101. rs.Operations = NewProjectsLocationsOperationsService(s)
  102. return rs
  103. }
  104. type ProjectsLocationsService struct {
  105. s *Service
  106. Clusters *ProjectsLocationsClustersService
  107. Operations *ProjectsLocationsOperationsService
  108. }
  109. func NewProjectsLocationsClustersService(s *Service) *ProjectsLocationsClustersService {
  110. rs := &ProjectsLocationsClustersService{s: s}
  111. rs.NodePools = NewProjectsLocationsClustersNodePoolsService(s)
  112. return rs
  113. }
  114. type ProjectsLocationsClustersService struct {
  115. s *Service
  116. NodePools *ProjectsLocationsClustersNodePoolsService
  117. }
  118. func NewProjectsLocationsClustersNodePoolsService(s *Service) *ProjectsLocationsClustersNodePoolsService {
  119. rs := &ProjectsLocationsClustersNodePoolsService{s: s}
  120. return rs
  121. }
  122. type ProjectsLocationsClustersNodePoolsService struct {
  123. s *Service
  124. }
  125. func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
  126. rs := &ProjectsLocationsOperationsService{s: s}
  127. return rs
  128. }
  129. type ProjectsLocationsOperationsService struct {
  130. s *Service
  131. }
  132. func NewProjectsZonesService(s *Service) *ProjectsZonesService {
  133. rs := &ProjectsZonesService{s: s}
  134. rs.Clusters = NewProjectsZonesClustersService(s)
  135. rs.Operations = NewProjectsZonesOperationsService(s)
  136. return rs
  137. }
  138. type ProjectsZonesService struct {
  139. s *Service
  140. Clusters *ProjectsZonesClustersService
  141. Operations *ProjectsZonesOperationsService
  142. }
  143. func NewProjectsZonesClustersService(s *Service) *ProjectsZonesClustersService {
  144. rs := &ProjectsZonesClustersService{s: s}
  145. rs.NodePools = NewProjectsZonesClustersNodePoolsService(s)
  146. return rs
  147. }
  148. type ProjectsZonesClustersService struct {
  149. s *Service
  150. NodePools *ProjectsZonesClustersNodePoolsService
  151. }
  152. func NewProjectsZonesClustersNodePoolsService(s *Service) *ProjectsZonesClustersNodePoolsService {
  153. rs := &ProjectsZonesClustersNodePoolsService{s: s}
  154. return rs
  155. }
  156. type ProjectsZonesClustersNodePoolsService struct {
  157. s *Service
  158. }
  159. func NewProjectsZonesOperationsService(s *Service) *ProjectsZonesOperationsService {
  160. rs := &ProjectsZonesOperationsService{s: s}
  161. return rs
  162. }
  163. type ProjectsZonesOperationsService struct {
  164. s *Service
  165. }
  166. // AcceleratorConfig: AcceleratorConfig represents a Hardware
  167. // Accelerator request.
  168. type AcceleratorConfig struct {
  169. // AcceleratorCount: The number of the accelerator cards exposed to an
  170. // instance.
  171. AcceleratorCount int64 `json:"acceleratorCount,omitempty,string"`
  172. // AcceleratorType: The accelerator type resource name. List of
  173. // supported accelerators
  174. // [here](/compute/docs/gpus/#Introduction)
  175. AcceleratorType string `json:"acceleratorType,omitempty"`
  176. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  177. // unconditionally include in API requests. By default, fields with
  178. // empty values are omitted from API requests. However, any non-pointer,
  179. // non-interface field appearing in ForceSendFields will be sent to the
  180. // server regardless of whether the field is empty or not. This may be
  181. // used to include empty fields in Patch requests.
  182. ForceSendFields []string `json:"-"`
  183. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  184. // include in API requests with the JSON null value. By default, fields
  185. // with empty values are omitted from API requests. However, any field
  186. // with an empty value appearing in NullFields will be sent to the
  187. // server as null. It is an error if a field in this list has a
  188. // non-empty value. This may be used to include null fields in Patch
  189. // requests.
  190. NullFields []string `json:"-"`
  191. }
  192. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  193. type NoMethod AcceleratorConfig
  194. raw := NoMethod(*s)
  195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  196. }
  197. // AddonsConfig: Configuration for the addons that can be automatically
  198. // spun up in the
  199. // cluster, enabling additional functionality.
  200. type AddonsConfig struct {
  201. // HorizontalPodAutoscaling: Configuration for the horizontal pod
  202. // autoscaling feature, which
  203. // increases or decreases the number of replica pods a replication
  204. // controller
  205. // has based on the resource usage of the existing pods.
  206. HorizontalPodAutoscaling *HorizontalPodAutoscaling `json:"horizontalPodAutoscaling,omitempty"`
  207. // HttpLoadBalancing: Configuration for the HTTP (L7) load balancing
  208. // controller addon, which
  209. // makes it easy to set up HTTP load balancers for services in a
  210. // cluster.
  211. HttpLoadBalancing *HttpLoadBalancing `json:"httpLoadBalancing,omitempty"`
  212. // KubernetesDashboard: Configuration for the Kubernetes Dashboard.
  213. KubernetesDashboard *KubernetesDashboard `json:"kubernetesDashboard,omitempty"`
  214. // NetworkPolicyConfig: Configuration for NetworkPolicy. This only
  215. // tracks whether the addon
  216. // is enabled or not on the Master, it does not track whether network
  217. // policy
  218. // is enabled for the nodes.
  219. NetworkPolicyConfig *NetworkPolicyConfig `json:"networkPolicyConfig,omitempty"`
  220. // ForceSendFields is a list of field names (e.g.
  221. // "HorizontalPodAutoscaling") to unconditionally include in API
  222. // requests. By default, fields with empty values are omitted from API
  223. // requests. However, any non-pointer, non-interface field appearing in
  224. // ForceSendFields will be sent to the server regardless of whether the
  225. // field is empty or not. This may be used to include empty fields in
  226. // Patch requests.
  227. ForceSendFields []string `json:"-"`
  228. // NullFields is a list of field names (e.g. "HorizontalPodAutoscaling")
  229. // to include in API requests with the JSON null value. By default,
  230. // fields with empty values are omitted from API requests. However, any
  231. // field with an empty value appearing in NullFields will be sent to the
  232. // server as null. It is an error if a field in this list has a
  233. // non-empty value. This may be used to include null fields in Patch
  234. // requests.
  235. NullFields []string `json:"-"`
  236. }
  237. func (s *AddonsConfig) MarshalJSON() ([]byte, error) {
  238. type NoMethod AddonsConfig
  239. raw := NoMethod(*s)
  240. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  241. }
  242. // AutoUpgradeOptions: AutoUpgradeOptions defines the set of options for
  243. // the user to control how
  244. // the Auto Upgrades will proceed.
  245. type AutoUpgradeOptions struct {
  246. // AutoUpgradeStartTime: [Output only] This field is set when upgrades
  247. // are about to commence
  248. // with the approximate start time for the upgrades,
  249. // in
  250. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  251. AutoUpgradeStartTime string `json:"autoUpgradeStartTime,omitempty"`
  252. // Description: [Output only] This field is set when upgrades are about
  253. // to commence
  254. // with the description of the upgrade.
  255. Description string `json:"description,omitempty"`
  256. // ForceSendFields is a list of field names (e.g.
  257. // "AutoUpgradeStartTime") to unconditionally include in API requests.
  258. // By default, fields with empty values are omitted from API requests.
  259. // However, any non-pointer, non-interface field appearing in
  260. // ForceSendFields will be sent to the server regardless of whether the
  261. // field is empty or not. This may be used to include empty fields in
  262. // Patch requests.
  263. ForceSendFields []string `json:"-"`
  264. // NullFields is a list of field names (e.g. "AutoUpgradeStartTime") to
  265. // include in API requests with the JSON null value. By default, fields
  266. // with empty values are omitted from API requests. However, any field
  267. // with an empty value appearing in NullFields will be sent to the
  268. // server as null. It is an error if a field in this list has a
  269. // non-empty value. This may be used to include null fields in Patch
  270. // requests.
  271. NullFields []string `json:"-"`
  272. }
  273. func (s *AutoUpgradeOptions) MarshalJSON() ([]byte, error) {
  274. type NoMethod AutoUpgradeOptions
  275. raw := NoMethod(*s)
  276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  277. }
  278. // BinaryAuthorization: Configuration for Binary Authorization.
  279. type BinaryAuthorization struct {
  280. // Enabled: Enable Binary Authorization for this cluster. If enabled,
  281. // all container
  282. // images will be validated by Google Binauthz.
  283. Enabled bool `json:"enabled,omitempty"`
  284. // ForceSendFields is a list of field names (e.g. "Enabled") to
  285. // unconditionally include in API requests. By default, fields with
  286. // empty values are omitted from API requests. However, any non-pointer,
  287. // non-interface field appearing in ForceSendFields will be sent to the
  288. // server regardless of whether the field is empty or not. This may be
  289. // used to include empty fields in Patch requests.
  290. ForceSendFields []string `json:"-"`
  291. // NullFields is a list of field names (e.g. "Enabled") to include in
  292. // API requests with the JSON null value. By default, fields with empty
  293. // values are omitted from API requests. However, any field with an
  294. // empty value appearing in NullFields will be sent to the server as
  295. // null. It is an error if a field in this list has a non-empty value.
  296. // This may be used to include null fields in Patch requests.
  297. NullFields []string `json:"-"`
  298. }
  299. func (s *BinaryAuthorization) MarshalJSON() ([]byte, error) {
  300. type NoMethod BinaryAuthorization
  301. raw := NoMethod(*s)
  302. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  303. }
  304. // CancelOperationRequest: CancelOperationRequest cancels a single
  305. // operation.
  306. type CancelOperationRequest struct {
  307. // Name: The name (project, location, operation id) of the operation to
  308. // cancel.
  309. // Specified in the format 'projects/*/locations/*/operations/*'.
  310. Name string `json:"name,omitempty"`
  311. // OperationId: Deprecated. The server-assigned `name` of the
  312. // operation.
  313. // This field has been deprecated and replaced by the name field.
  314. OperationId string `json:"operationId,omitempty"`
  315. // ProjectId: Deprecated. The Google Developers Console [project ID or
  316. // project
  317. // number](https://support.google.com/cloud/answer/6158840).
  318. // This
  319. // field has been deprecated and replaced by the name field.
  320. ProjectId string `json:"projectId,omitempty"`
  321. // Zone: Deprecated. The name of the Google Compute
  322. // Engine
  323. // [zone](/compute/docs/zones#available) in which the operation
  324. // resides.
  325. // This field has been deprecated and replaced by the name field.
  326. Zone string `json:"zone,omitempty"`
  327. // ForceSendFields is a list of field names (e.g. "Name") to
  328. // unconditionally include in API requests. By default, fields with
  329. // empty values are omitted from API requests. However, any non-pointer,
  330. // non-interface field appearing in ForceSendFields will be sent to the
  331. // server regardless of whether the field is empty or not. This may be
  332. // used to include empty fields in Patch requests.
  333. ForceSendFields []string `json:"-"`
  334. // NullFields is a list of field names (e.g. "Name") to include in API
  335. // requests with the JSON null value. By default, fields with empty
  336. // values are omitted from API requests. However, any field with an
  337. // empty value appearing in NullFields will be sent to the server as
  338. // null. It is an error if a field in this list has a non-empty value.
  339. // This may be used to include null fields in Patch requests.
  340. NullFields []string `json:"-"`
  341. }
  342. func (s *CancelOperationRequest) MarshalJSON() ([]byte, error) {
  343. type NoMethod CancelOperationRequest
  344. raw := NoMethod(*s)
  345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  346. }
  347. // CidrBlock: CidrBlock contains an optional name and one CIDR block.
  348. type CidrBlock struct {
  349. // CidrBlock: cidr_block must be specified in CIDR notation.
  350. CidrBlock string `json:"cidrBlock,omitempty"`
  351. // DisplayName: display_name is an optional field for users to identify
  352. // CIDR blocks.
  353. DisplayName string `json:"displayName,omitempty"`
  354. // ForceSendFields is a list of field names (e.g. "CidrBlock") to
  355. // unconditionally include in API requests. By default, fields with
  356. // empty values are omitted from API requests. However, any non-pointer,
  357. // non-interface field appearing in ForceSendFields will be sent to the
  358. // server regardless of whether the field is empty or not. This may be
  359. // used to include empty fields in Patch requests.
  360. ForceSendFields []string `json:"-"`
  361. // NullFields is a list of field names (e.g. "CidrBlock") to include in
  362. // API requests with the JSON null value. By default, fields with empty
  363. // values are omitted from API requests. However, any field with an
  364. // empty value appearing in NullFields will be sent to the server as
  365. // null. It is an error if a field in this list has a non-empty value.
  366. // This may be used to include null fields in Patch requests.
  367. NullFields []string `json:"-"`
  368. }
  369. func (s *CidrBlock) MarshalJSON() ([]byte, error) {
  370. type NoMethod CidrBlock
  371. raw := NoMethod(*s)
  372. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  373. }
  374. // ClientCertificateConfig: Configuration for client certificates on the
  375. // cluster.
  376. type ClientCertificateConfig struct {
  377. // IssueClientCertificate: Issue a client certificate.
  378. IssueClientCertificate bool `json:"issueClientCertificate,omitempty"`
  379. // ForceSendFields is a list of field names (e.g.
  380. // "IssueClientCertificate") to unconditionally include in API requests.
  381. // By default, fields with empty values are omitted from API requests.
  382. // However, any non-pointer, non-interface field appearing in
  383. // ForceSendFields will be sent to the server regardless of whether the
  384. // field is empty or not. This may be used to include empty fields in
  385. // Patch requests.
  386. ForceSendFields []string `json:"-"`
  387. // NullFields is a list of field names (e.g. "IssueClientCertificate")
  388. // to include in API requests with the JSON null value. By default,
  389. // fields with empty values are omitted from API requests. However, any
  390. // field with an empty value appearing in NullFields will be sent to the
  391. // server as null. It is an error if a field in this list has a
  392. // non-empty value. This may be used to include null fields in Patch
  393. // requests.
  394. NullFields []string `json:"-"`
  395. }
  396. func (s *ClientCertificateConfig) MarshalJSON() ([]byte, error) {
  397. type NoMethod ClientCertificateConfig
  398. raw := NoMethod(*s)
  399. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  400. }
  401. // Cluster: A Google Kubernetes Engine cluster.
  402. type Cluster struct {
  403. // AddonsConfig: Configurations for the various addons available to run
  404. // in the cluster.
  405. AddonsConfig *AddonsConfig `json:"addonsConfig,omitempty"`
  406. // BinaryAuthorization: Configuration for Binary Authorization.
  407. BinaryAuthorization *BinaryAuthorization `json:"binaryAuthorization,omitempty"`
  408. // ClusterIpv4Cidr: The IP address range of the container pods in this
  409. // cluster,
  410. // in
  411. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  412. //
  413. // notation (e.g. `10.96.0.0/14`). Leave blank to have
  414. // one automatically chosen or specify a `/14` block in `10.0.0.0/8`.
  415. ClusterIpv4Cidr string `json:"clusterIpv4Cidr,omitempty"`
  416. // CreateTime: [Output only] The time the cluster was created,
  417. // in
  418. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  419. CreateTime string `json:"createTime,omitempty"`
  420. // CurrentMasterVersion: [Output only] The current software version of
  421. // the master endpoint.
  422. CurrentMasterVersion string `json:"currentMasterVersion,omitempty"`
  423. // CurrentNodeCount: [Output only] The number of nodes currently in the
  424. // cluster.
  425. CurrentNodeCount int64 `json:"currentNodeCount,omitempty"`
  426. // CurrentNodeVersion: [Output only] The current version of the node
  427. // software components.
  428. // If they are currently at multiple versions because they're in the
  429. // process
  430. // of being upgraded, this reflects the minimum version of all nodes.
  431. CurrentNodeVersion string `json:"currentNodeVersion,omitempty"`
  432. // Description: An optional description of this cluster.
  433. Description string `json:"description,omitempty"`
  434. // EnableKubernetesAlpha: Kubernetes alpha features are enabled on this
  435. // cluster. This includes alpha
  436. // API groups (e.g. v1beta1) and features that may not be production
  437. // ready in
  438. // the kubernetes version of the master and nodes.
  439. // The cluster has no SLA for uptime and master/node upgrades are
  440. // disabled.
  441. // Alpha enabled clusters are automatically deleted thirty days
  442. // after
  443. // creation.
  444. EnableKubernetesAlpha bool `json:"enableKubernetesAlpha,omitempty"`
  445. // Endpoint: [Output only] The IP address of this cluster's master
  446. // endpoint.
  447. // The endpoint can be accessed from the internet
  448. // at
  449. // `https://username:password@endpoint/`.
  450. //
  451. // See the `masterAuth` property of this resource for username
  452. // and
  453. // password information.
  454. Endpoint string `json:"endpoint,omitempty"`
  455. // ExpireTime: [Output only] The time the cluster will be
  456. // automatically
  457. // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text
  458. // format.
  459. ExpireTime string `json:"expireTime,omitempty"`
  460. // InitialClusterVersion: The initial Kubernetes version for this
  461. // cluster. Valid versions are those
  462. // found in validMasterVersions returned by getServerConfig. The
  463. // version can
  464. // be upgraded over time; such upgrades are reflected
  465. // in
  466. // currentMasterVersion and currentNodeVersion.
  467. //
  468. // Users may specify either explicit versions offered by
  469. // Kubernetes Engine or version aliases, which have the following
  470. // behavior:
  471. //
  472. // - "latest": picks the highest valid Kubernetes version
  473. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  474. // version
  475. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  476. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  477. // - "","-": picks the default Kubernetes version
  478. InitialClusterVersion string `json:"initialClusterVersion,omitempty"`
  479. // InitialNodeCount: The number of nodes to create in this cluster. You
  480. // must ensure that your
  481. // Compute Engine <a href="/compute/docs/resource-quotas">resource
  482. // quota</a>
  483. // is sufficient for this number of instances. You must also have
  484. // available
  485. // firewall and routes quota.
  486. // For requests, this field should only be used in lieu of a
  487. // "node_pool" object, since this configuration (along with
  488. // the
  489. // "node_config") will be used to create a "NodePool" object with
  490. // an
  491. // auto-generated name. Do not use this and a node_pool at the same
  492. // time.
  493. InitialNodeCount int64 `json:"initialNodeCount,omitempty"`
  494. // InstanceGroupUrls: Deprecated. Use node_pools.instance_group_urls.
  495. InstanceGroupUrls []string `json:"instanceGroupUrls,omitempty"`
  496. // IpAllocationPolicy: Configuration for cluster IP allocation.
  497. IpAllocationPolicy *IPAllocationPolicy `json:"ipAllocationPolicy,omitempty"`
  498. // LabelFingerprint: The fingerprint of the set of labels for this
  499. // cluster.
  500. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  501. // LegacyAbac: Configuration for the legacy ABAC authorization mode.
  502. LegacyAbac *LegacyAbac `json:"legacyAbac,omitempty"`
  503. // Location: [Output only] The name of the Google Compute
  504. // Engine
  505. // [zone](/compute/docs/regions-zones/regions-zones#available)
  506. // or
  507. // [region](/compute/docs/regions-zones/regions-zones#available) in
  508. // which
  509. // the cluster resides.
  510. Location string `json:"location,omitempty"`
  511. // Locations: The list of Google Compute
  512. // Engine
  513. // [locations](/compute/docs/zones#available) in which the cluster's
  514. // nodes
  515. // should be located.
  516. Locations []string `json:"locations,omitempty"`
  517. // LoggingService: The logging service the cluster should use to write
  518. // logs.
  519. // Currently available options:
  520. //
  521. // * `logging.googleapis.com` - the Google Cloud Logging service.
  522. // * `none` - no logs will be exported from the cluster.
  523. // * if left as an empty string,`logging.googleapis.com` will be used.
  524. LoggingService string `json:"loggingService,omitempty"`
  525. // MaintenancePolicy: Configure the maintenance policy for this cluster.
  526. MaintenancePolicy *MaintenancePolicy `json:"maintenancePolicy,omitempty"`
  527. // MasterAuth: The authentication information for accessing the master
  528. // endpoint.
  529. MasterAuth *MasterAuth `json:"masterAuth,omitempty"`
  530. // MasterAuthorizedNetworksConfig: The configuration options for master
  531. // authorized networks feature.
  532. MasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `json:"masterAuthorizedNetworksConfig,omitempty"`
  533. // MasterIpv4CidrBlock: The IP prefix in CIDR notation to use for the
  534. // hosted master network.
  535. // This prefix will be used for assigning private IP addresses to
  536. // the
  537. // master or set of masters, as well as the ILB VIP.
  538. MasterIpv4CidrBlock string `json:"masterIpv4CidrBlock,omitempty"`
  539. // MonitoringService: The monitoring service the cluster should use to
  540. // write metrics.
  541. // Currently available options:
  542. //
  543. // * `monitoring.googleapis.com` - the Google Cloud Monitoring
  544. // service.
  545. // * `none` - no metrics will be exported from the cluster.
  546. // * if left as an empty string, `monitoring.googleapis.com` will be
  547. // used.
  548. MonitoringService string `json:"monitoringService,omitempty"`
  549. // Name: The name of this cluster. The name must be unique within this
  550. // project
  551. // and zone, and can be up to 40 characters with the following
  552. // restrictions:
  553. //
  554. // * Lowercase letters, numbers, and hyphens only.
  555. // * Must start with a letter.
  556. // * Must end with a number or a letter.
  557. Name string `json:"name,omitempty"`
  558. // Network: The name of the Google Compute
  559. // Engine
  560. // [network](/compute/docs/networks-and-firewalls#networks) to which
  561. // the
  562. // cluster is connected. If left unspecified, the `default` network
  563. // will be used. On output this shows the network ID instead of
  564. // the name.
  565. Network string `json:"network,omitempty"`
  566. // NetworkConfig: Configuration for cluster networking.
  567. NetworkConfig *NetworkConfig `json:"networkConfig,omitempty"`
  568. // NetworkPolicy: Configuration options for the NetworkPolicy feature.
  569. NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"`
  570. // NodeConfig: Parameters used in creating the cluster's nodes.
  571. // See `nodeConfig` for the description of its properties.
  572. // For requests, this field should only be used in lieu of a
  573. // "node_pool" object, since this configuration (along with
  574. // the
  575. // "initial_node_count") will be used to create a "NodePool" object with
  576. // an
  577. // auto-generated name. Do not use this and a node_pool at the same
  578. // time.
  579. // For responses, this field will be populated with the node
  580. // configuration of
  581. // the first node pool.
  582. //
  583. // If unspecified, the defaults are used.
  584. NodeConfig *NodeConfig `json:"nodeConfig,omitempty"`
  585. // NodeIpv4CidrSize: [Output only] The size of the address space on each
  586. // node for hosting
  587. // containers. This is provisioned from within the
  588. // `container_ipv4_cidr`
  589. // range.
  590. NodeIpv4CidrSize int64 `json:"nodeIpv4CidrSize,omitempty"`
  591. // NodePools: The node pools associated with this cluster.
  592. // This field should not be set if "node_config" or "initial_node_count"
  593. // are
  594. // specified.
  595. NodePools []*NodePool `json:"nodePools,omitempty"`
  596. // PodSecurityPolicyConfig: Configuration for the PodSecurityPolicy
  597. // feature.
  598. PodSecurityPolicyConfig *PodSecurityPolicyConfig `json:"podSecurityPolicyConfig,omitempty"`
  599. // PrivateCluster: If this is a private cluster setup. Private clusters
  600. // are clusters that, by
  601. // default have no external IP addresses on the nodes and where nodes
  602. // and the
  603. // master communicate over private IP addresses.
  604. PrivateCluster bool `json:"privateCluster,omitempty"`
  605. // ResourceLabels: The resource labels for the cluster to use to
  606. // annotate any related
  607. // Google Compute Engine resources.
  608. ResourceLabels map[string]string `json:"resourceLabels,omitempty"`
  609. // SelfLink: [Output only] Server-defined URL for the resource.
  610. SelfLink string `json:"selfLink,omitempty"`
  611. // ServicesIpv4Cidr: [Output only] The IP address range of the
  612. // Kubernetes services in
  613. // this cluster,
  614. // in
  615. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  616. //
  617. // notation (e.g. `1.2.3.4/29`). Service addresses are
  618. // typically put in the last `/16` from the container CIDR.
  619. ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"`
  620. // Status: [Output only] The current status of this cluster.
  621. //
  622. // Possible values:
  623. // "STATUS_UNSPECIFIED" - Not set.
  624. // "PROVISIONING" - The PROVISIONING state indicates the cluster is
  625. // being created.
  626. // "RUNNING" - The RUNNING state indicates the cluster has been
  627. // created and is fully
  628. // usable.
  629. // "RECONCILING" - The RECONCILING state indicates that some work is
  630. // actively being done on
  631. // the cluster, such as upgrading the master or node software. Details
  632. // can
  633. // be found in the `statusMessage` field.
  634. // "STOPPING" - The STOPPING state indicates the cluster is being
  635. // deleted.
  636. // "ERROR" - The ERROR state indicates the cluster may be unusable.
  637. // Details
  638. // can be found in the `statusMessage` field.
  639. // "DEGRADED" - The DEGRADED state indicates the cluster requires user
  640. // action to restore
  641. // full functionality. Details can be found in the `statusMessage`
  642. // field.
  643. Status string `json:"status,omitempty"`
  644. // StatusMessage: [Output only] Additional information about the current
  645. // status of this
  646. // cluster, if available.
  647. StatusMessage string `json:"statusMessage,omitempty"`
  648. // Subnetwork: The name of the Google Compute
  649. // Engine
  650. // [subnetwork](/compute/docs/subnetworks) to which the
  651. // cluster is connected. On output this shows the subnetwork ID instead
  652. // of
  653. // the name.
  654. Subnetwork string `json:"subnetwork,omitempty"`
  655. // Zone: [Output only] The name of the Google Compute
  656. // Engine
  657. // [zone](/compute/docs/zones#available) in which the
  658. // cluster
  659. // resides.
  660. // This field is deprecated, use location instead.
  661. Zone string `json:"zone,omitempty"`
  662. // ServerResponse contains the HTTP response code and headers from the
  663. // server.
  664. googleapi.ServerResponse `json:"-"`
  665. // ForceSendFields is a list of field names (e.g. "AddonsConfig") to
  666. // unconditionally include in API requests. By default, fields with
  667. // empty values are omitted from API requests. However, any non-pointer,
  668. // non-interface field appearing in ForceSendFields will be sent to the
  669. // server regardless of whether the field is empty or not. This may be
  670. // used to include empty fields in Patch requests.
  671. ForceSendFields []string `json:"-"`
  672. // NullFields is a list of field names (e.g. "AddonsConfig") to include
  673. // in API requests with the JSON null value. By default, fields with
  674. // empty values are omitted from API requests. However, any field with
  675. // an empty value appearing in NullFields will be sent to the server as
  676. // null. It is an error if a field in this list has a non-empty value.
  677. // This may be used to include null fields in Patch requests.
  678. NullFields []string `json:"-"`
  679. }
  680. func (s *Cluster) MarshalJSON() ([]byte, error) {
  681. type NoMethod Cluster
  682. raw := NoMethod(*s)
  683. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  684. }
  685. // ClusterUpdate: ClusterUpdate describes an update to the cluster.
  686. // Exactly one update can
  687. // be applied to a cluster with each request, so at most one field can
  688. // be
  689. // provided.
  690. type ClusterUpdate struct {
  691. // DesiredAddonsConfig: Configurations for the various addons available
  692. // to run in the cluster.
  693. DesiredAddonsConfig *AddonsConfig `json:"desiredAddonsConfig,omitempty"`
  694. // DesiredBinaryAuthorization: The desired configuration options for the
  695. // Binary Authorization feature.
  696. DesiredBinaryAuthorization *BinaryAuthorization `json:"desiredBinaryAuthorization,omitempty"`
  697. // DesiredImageType: The desired image type for the node pool.
  698. // NOTE: Set the "desired_node_pool" field as well.
  699. DesiredImageType string `json:"desiredImageType,omitempty"`
  700. // DesiredLocations: The desired list of Google Compute
  701. // Engine
  702. // [locations](/compute/docs/zones#available) in which the cluster's
  703. // nodes
  704. // should be located. Changing the locations a cluster is in will
  705. // result
  706. // in nodes being either created or removed from the cluster, depending
  707. // on
  708. // whether locations are being added or removed.
  709. //
  710. // This list must always include the cluster's primary zone.
  711. DesiredLocations []string `json:"desiredLocations,omitempty"`
  712. // DesiredMasterAuthorizedNetworksConfig: The desired configuration
  713. // options for master authorized networks feature.
  714. DesiredMasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `json:"desiredMasterAuthorizedNetworksConfig,omitempty"`
  715. // DesiredMasterVersion: The Kubernetes version to change the master to.
  716. // The only valid value is the
  717. // latest supported version.
  718. //
  719. // Users may specify either explicit versions offered by
  720. // Kubernetes Engine or version aliases, which have the following
  721. // behavior:
  722. //
  723. // - "latest": picks the highest valid Kubernetes version
  724. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  725. // version
  726. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  727. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  728. // - "-": picks the default Kubernetes version
  729. DesiredMasterVersion string `json:"desiredMasterVersion,omitempty"`
  730. // DesiredMonitoringService: The monitoring service the cluster should
  731. // use to write metrics.
  732. // Currently available options:
  733. //
  734. // * "monitoring.googleapis.com" - the Google Cloud Monitoring service
  735. // * "none" - no metrics will be exported from the cluster
  736. DesiredMonitoringService string `json:"desiredMonitoringService,omitempty"`
  737. // DesiredNodePoolAutoscaling: Autoscaler configuration for the node
  738. // pool specified in
  739. // desired_node_pool_id. If there is only one pool in the
  740. // cluster and desired_node_pool_id is not provided then
  741. // the change applies to that single node pool.
  742. DesiredNodePoolAutoscaling *NodePoolAutoscaling `json:"desiredNodePoolAutoscaling,omitempty"`
  743. // DesiredNodePoolId: The node pool to be upgraded. This field is
  744. // mandatory if
  745. // "desired_node_version", "desired_image_family"
  746. // or
  747. // "desired_node_pool_autoscaling" is specified and there is more than
  748. // one
  749. // node pool on the cluster.
  750. DesiredNodePoolId string `json:"desiredNodePoolId,omitempty"`
  751. // DesiredNodeVersion: The Kubernetes version to change the nodes to
  752. // (typically an
  753. // upgrade).
  754. //
  755. // Users may specify either explicit versions offered by
  756. // Kubernetes Engine or version aliases, which have the following
  757. // behavior:
  758. //
  759. // - "latest": picks the highest valid Kubernetes version
  760. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  761. // version
  762. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  763. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  764. // - "-": picks the Kubernetes master version
  765. DesiredNodeVersion string `json:"desiredNodeVersion,omitempty"`
  766. // DesiredPodSecurityPolicyConfig: The desired configuration options for
  767. // the PodSecurityPolicy feature.
  768. DesiredPodSecurityPolicyConfig *PodSecurityPolicyConfig `json:"desiredPodSecurityPolicyConfig,omitempty"`
  769. // ForceSendFields is a list of field names (e.g. "DesiredAddonsConfig")
  770. // to unconditionally include in API requests. By default, fields with
  771. // empty values are omitted from API requests. However, any non-pointer,
  772. // non-interface field appearing in ForceSendFields will be sent to the
  773. // server regardless of whether the field is empty or not. This may be
  774. // used to include empty fields in Patch requests.
  775. ForceSendFields []string `json:"-"`
  776. // NullFields is a list of field names (e.g. "DesiredAddonsConfig") to
  777. // include in API requests with the JSON null value. By default, fields
  778. // with empty values are omitted from API requests. However, any field
  779. // with an empty value appearing in NullFields will be sent to the
  780. // server as null. It is an error if a field in this list has a
  781. // non-empty value. This may be used to include null fields in Patch
  782. // requests.
  783. NullFields []string `json:"-"`
  784. }
  785. func (s *ClusterUpdate) MarshalJSON() ([]byte, error) {
  786. type NoMethod ClusterUpdate
  787. raw := NoMethod(*s)
  788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  789. }
  790. // CompleteIPRotationRequest: CompleteIPRotationRequest moves the
  791. // cluster master back into single-IP mode.
  792. type CompleteIPRotationRequest struct {
  793. // ClusterId: Deprecated. The name of the cluster.
  794. // This field has been deprecated and replaced by the name field.
  795. ClusterId string `json:"clusterId,omitempty"`
  796. // Name: The name (project, location, cluster id) of the cluster to
  797. // complete IP
  798. // rotation. Specified in the format
  799. // 'projects/*/locations/*/clusters/*'.
  800. Name string `json:"name,omitempty"`
  801. // ProjectId: Deprecated. The Google Developers Console [project ID or
  802. // project
  803. // number](https://developers.google.com/console/help/new/#projec
  804. // tnumber).
  805. // This field has been deprecated and replaced by the name field.
  806. ProjectId string `json:"projectId,omitempty"`
  807. // Zone: Deprecated. The name of the Google Compute
  808. // Engine
  809. // [zone](/compute/docs/zones#available) in which the
  810. // cluster
  811. // resides.
  812. // This field has been deprecated and replaced by the name field.
  813. Zone string `json:"zone,omitempty"`
  814. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  815. // unconditionally include in API requests. By default, fields with
  816. // empty values are omitted from API requests. However, any non-pointer,
  817. // non-interface field appearing in ForceSendFields will be sent to the
  818. // server regardless of whether the field is empty or not. This may be
  819. // used to include empty fields in Patch requests.
  820. ForceSendFields []string `json:"-"`
  821. // NullFields is a list of field names (e.g. "ClusterId") to include in
  822. // API requests with the JSON null value. By default, fields with empty
  823. // values are omitted from API requests. However, any field with an
  824. // empty value appearing in NullFields will be sent to the server as
  825. // null. It is an error if a field in this list has a non-empty value.
  826. // This may be used to include null fields in Patch requests.
  827. NullFields []string `json:"-"`
  828. }
  829. func (s *CompleteIPRotationRequest) MarshalJSON() ([]byte, error) {
  830. type NoMethod CompleteIPRotationRequest
  831. raw := NoMethod(*s)
  832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  833. }
  834. // CreateClusterRequest: CreateClusterRequest creates a cluster.
  835. type CreateClusterRequest struct {
  836. // Cluster: A
  837. // [cluster
  838. // resource](/container-engine/reference/rest/v1beta1/projects.z
  839. // ones.clusters)
  840. Cluster *Cluster `json:"cluster,omitempty"`
  841. // Parent: The parent (project and location) where the cluster will be
  842. // created.
  843. // Specified in the format 'projects/*/locations/*'.
  844. Parent string `json:"parent,omitempty"`
  845. // ProjectId: Deprecated. The Google Developers Console [project ID or
  846. // project
  847. // number](https://support.google.com/cloud/answer/6158840).
  848. // This
  849. // field has been deprecated and replaced by the parent field.
  850. ProjectId string `json:"projectId,omitempty"`
  851. // Zone: Deprecated. The name of the Google Compute
  852. // Engine
  853. // [zone](/compute/docs/zones#available) in which the
  854. // cluster
  855. // resides.
  856. // This field has been deprecated and replaced by the parent field.
  857. Zone string `json:"zone,omitempty"`
  858. // ForceSendFields is a list of field names (e.g. "Cluster") to
  859. // unconditionally include in API requests. By default, fields with
  860. // empty values are omitted from API requests. However, any non-pointer,
  861. // non-interface field appearing in ForceSendFields will be sent to the
  862. // server regardless of whether the field is empty or not. This may be
  863. // used to include empty fields in Patch requests.
  864. ForceSendFields []string `json:"-"`
  865. // NullFields is a list of field names (e.g. "Cluster") to include in
  866. // API requests with the JSON null value. By default, fields with empty
  867. // values are omitted from API requests. However, any field with an
  868. // empty value appearing in NullFields will be sent to the server as
  869. // null. It is an error if a field in this list has a non-empty value.
  870. // This may be used to include null fields in Patch requests.
  871. NullFields []string `json:"-"`
  872. }
  873. func (s *CreateClusterRequest) MarshalJSON() ([]byte, error) {
  874. type NoMethod CreateClusterRequest
  875. raw := NoMethod(*s)
  876. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  877. }
  878. // CreateNodePoolRequest: CreateNodePoolRequest creates a node pool for
  879. // a cluster.
  880. type CreateNodePoolRequest struct {
  881. // ClusterId: Deprecated. The name of the cluster.
  882. // This field has been deprecated and replaced by the parent field.
  883. ClusterId string `json:"clusterId,omitempty"`
  884. // NodePool: The node pool to create.
  885. NodePool *NodePool `json:"nodePool,omitempty"`
  886. // Parent: The parent (project, location, cluster id) where the node
  887. // pool will be
  888. // created. Specified in the
  889. // format
  890. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  891. Parent string `json:"parent,omitempty"`
  892. // ProjectId: Deprecated. The Google Developers Console [project ID or
  893. // project
  894. // number](https://developers.google.com/console/help/new/#projec
  895. // tnumber).
  896. // This field has been deprecated and replaced by the parent field.
  897. ProjectId string `json:"projectId,omitempty"`
  898. // Zone: Deprecated. The name of the Google Compute
  899. // Engine
  900. // [zone](/compute/docs/zones#available) in which the
  901. // cluster
  902. // resides.
  903. // This field has been deprecated and replaced by the parent field.
  904. Zone string `json:"zone,omitempty"`
  905. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  906. // unconditionally include in API requests. By default, fields with
  907. // empty values are omitted from API requests. However, any non-pointer,
  908. // non-interface field appearing in ForceSendFields will be sent to the
  909. // server regardless of whether the field is empty or not. This may be
  910. // used to include empty fields in Patch requests.
  911. ForceSendFields []string `json:"-"`
  912. // NullFields is a list of field names (e.g. "ClusterId") to include in
  913. // API requests with the JSON null value. By default, fields with empty
  914. // values are omitted from API requests. However, any field with an
  915. // empty value appearing in NullFields will be sent to the server as
  916. // null. It is an error if a field in this list has a non-empty value.
  917. // This may be used to include null fields in Patch requests.
  918. NullFields []string `json:"-"`
  919. }
  920. func (s *CreateNodePoolRequest) MarshalJSON() ([]byte, error) {
  921. type NoMethod CreateNodePoolRequest
  922. raw := NoMethod(*s)
  923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  924. }
  925. // DailyMaintenanceWindow: Time window specified for daily maintenance
  926. // operations.
  927. type DailyMaintenanceWindow struct {
  928. // Duration: [Output only] Duration of the time window, automatically
  929. // chosen to be
  930. // smallest possible in the given scenario.
  931. Duration string `json:"duration,omitempty"`
  932. // StartTime: Time within the maintenance window to start the
  933. // maintenance operations.
  934. // It must be in format "HH:MM”, where HH : [00-23] and MM : [00-59]
  935. // GMT.
  936. StartTime string `json:"startTime,omitempty"`
  937. // ForceSendFields is a list of field names (e.g. "Duration") to
  938. // unconditionally include in API requests. By default, fields with
  939. // empty values are omitted from API requests. However, any non-pointer,
  940. // non-interface field appearing in ForceSendFields will be sent to the
  941. // server regardless of whether the field is empty or not. This may be
  942. // used to include empty fields in Patch requests.
  943. ForceSendFields []string `json:"-"`
  944. // NullFields is a list of field names (e.g. "Duration") to include in
  945. // API requests with the JSON null value. By default, fields with empty
  946. // values are omitted from API requests. However, any field with an
  947. // empty value appearing in NullFields will be sent to the server as
  948. // null. It is an error if a field in this list has a non-empty value.
  949. // This may be used to include null fields in Patch requests.
  950. NullFields []string `json:"-"`
  951. }
  952. func (s *DailyMaintenanceWindow) MarshalJSON() ([]byte, error) {
  953. type NoMethod DailyMaintenanceWindow
  954. raw := NoMethod(*s)
  955. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  956. }
  957. // Empty: A generic empty message that you can re-use to avoid defining
  958. // duplicated
  959. // empty messages in your APIs. A typical example is to use it as the
  960. // request
  961. // or the response type of an API method. For instance:
  962. //
  963. // service Foo {
  964. // rpc Bar(google.protobuf.Empty) returns
  965. // (google.protobuf.Empty);
  966. // }
  967. //
  968. // The JSON representation for `Empty` is empty JSON object `{}`.
  969. type Empty struct {
  970. // ServerResponse contains the HTTP response code and headers from the
  971. // server.
  972. googleapi.ServerResponse `json:"-"`
  973. }
  974. // HorizontalPodAutoscaling: Configuration options for the horizontal
  975. // pod autoscaling feature, which
  976. // increases or decreases the number of replica pods a replication
  977. // controller
  978. // has based on the resource usage of the existing pods.
  979. type HorizontalPodAutoscaling struct {
  980. // Disabled: Whether the Horizontal Pod Autoscaling feature is enabled
  981. // in the cluster.
  982. // When enabled, it ensures that a Heapster pod is running in the
  983. // cluster,
  984. // which is also used by the Cloud Monitoring service.
  985. Disabled bool `json:"disabled,omitempty"`
  986. // ForceSendFields is a list of field names (e.g. "Disabled") to
  987. // unconditionally include in API requests. By default, fields with
  988. // empty values are omitted from API requests. However, any non-pointer,
  989. // non-interface field appearing in ForceSendFields will be sent to the
  990. // server regardless of whether the field is empty or not. This may be
  991. // used to include empty fields in Patch requests.
  992. ForceSendFields []string `json:"-"`
  993. // NullFields is a list of field names (e.g. "Disabled") to include in
  994. // API requests with the JSON null value. By default, fields with empty
  995. // values are omitted from API requests. However, any field with an
  996. // empty value appearing in NullFields will be sent to the server as
  997. // null. It is an error if a field in this list has a non-empty value.
  998. // This may be used to include null fields in Patch requests.
  999. NullFields []string `json:"-"`
  1000. }
  1001. func (s *HorizontalPodAutoscaling) MarshalJSON() ([]byte, error) {
  1002. type NoMethod HorizontalPodAutoscaling
  1003. raw := NoMethod(*s)
  1004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1005. }
  1006. // HttpLoadBalancing: Configuration options for the HTTP (L7) load
  1007. // balancing controller addon,
  1008. // which makes it easy to set up HTTP load balancers for services in a
  1009. // cluster.
  1010. type HttpLoadBalancing struct {
  1011. // Disabled: Whether the HTTP Load Balancing controller is enabled in
  1012. // the cluster.
  1013. // When enabled, it runs a small pod in the cluster that manages the
  1014. // load
  1015. // balancers.
  1016. Disabled bool `json:"disabled,omitempty"`
  1017. // ForceSendFields is a list of field names (e.g. "Disabled") to
  1018. // unconditionally include in API requests. By default, fields with
  1019. // empty values are omitted from API requests. However, any non-pointer,
  1020. // non-interface field appearing in ForceSendFields will be sent to the
  1021. // server regardless of whether the field is empty or not. This may be
  1022. // used to include empty fields in Patch requests.
  1023. ForceSendFields []string `json:"-"`
  1024. // NullFields is a list of field names (e.g. "Disabled") to include in
  1025. // API requests with the JSON null value. By default, fields with empty
  1026. // values are omitted from API requests. However, any field with an
  1027. // empty value appearing in NullFields will be sent to the server as
  1028. // null. It is an error if a field in this list has a non-empty value.
  1029. // This may be used to include null fields in Patch requests.
  1030. NullFields []string `json:"-"`
  1031. }
  1032. func (s *HttpLoadBalancing) MarshalJSON() ([]byte, error) {
  1033. type NoMethod HttpLoadBalancing
  1034. raw := NoMethod(*s)
  1035. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1036. }
  1037. // IPAllocationPolicy: Configuration for controlling how IPs are
  1038. // allocated in the cluster.
  1039. type IPAllocationPolicy struct {
  1040. // AllowRouteOverlap: If true, allow allocation of cluster CIDR ranges
  1041. // that overlap with certain
  1042. // kinds of network routes. By default we do not allow cluster CIDR
  1043. // ranges to
  1044. // intersect with any user declared routes. With allow_route_overlap ==
  1045. // true,
  1046. // we allow overlapping with CIDR ranges that are larger than the
  1047. // cluster CIDR
  1048. // range.
  1049. //
  1050. // If this field is set to true, then cluster and services CIDRs must
  1051. // be
  1052. // fully-specified (e.g. `10.96.0.0/14`, but not `/14`), which means:
  1053. // 1) When `use_ip_aliases` is true, `cluster_ipv4_cidr_block` and
  1054. // `services_ipv4_cidr_block` must be fully-specified.
  1055. // 2) When `use_ip_aliases` is false, `cluster.cluster_ipv4_cidr` muse
  1056. // be
  1057. // fully-specified.
  1058. AllowRouteOverlap bool `json:"allowRouteOverlap,omitempty"`
  1059. // ClusterIpv4Cidr: This field is deprecated, use
  1060. // cluster_ipv4_cidr_block.
  1061. ClusterIpv4Cidr string `json:"clusterIpv4Cidr,omitempty"`
  1062. // ClusterIpv4CidrBlock: The IP address range for the cluster pod IPs.
  1063. // If this field is set, then
  1064. // `cluster.cluster_ipv4_cidr` must be left blank.
  1065. //
  1066. // This field is only applicable when `use_ip_aliases` is true.
  1067. //
  1068. // Set to blank to have a range chosen with the default size.
  1069. //
  1070. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1071. // specific
  1072. // netmask.
  1073. //
  1074. // Set to
  1075. // a
  1076. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1077. //
  1078. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1079. // (e.g.
  1080. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1081. // range
  1082. // to use.
  1083. ClusterIpv4CidrBlock string `json:"clusterIpv4CidrBlock,omitempty"`
  1084. // ClusterSecondaryRangeName: The name of the secondary range to be used
  1085. // for the cluster CIDR
  1086. // block. The secondary range will be used for pod IP
  1087. // addresses. This must be an existing secondary range associated
  1088. // with the cluster subnetwork.
  1089. //
  1090. // This field is only applicable with use_ip_aliases
  1091. // and
  1092. // create_subnetwork is false.
  1093. ClusterSecondaryRangeName string `json:"clusterSecondaryRangeName,omitempty"`
  1094. // CreateSubnetwork: Whether a new subnetwork will be created
  1095. // automatically for the cluster.
  1096. //
  1097. // This field is only applicable when `use_ip_aliases` is true.
  1098. CreateSubnetwork bool `json:"createSubnetwork,omitempty"`
  1099. // NodeIpv4Cidr: This field is deprecated, use node_ipv4_cidr_block.
  1100. NodeIpv4Cidr string `json:"nodeIpv4Cidr,omitempty"`
  1101. // NodeIpv4CidrBlock: The IP address range of the instance IPs in this
  1102. // cluster.
  1103. //
  1104. // This is applicable only if `create_subnetwork` is true.
  1105. //
  1106. // Set to blank to have a range chosen with the default size.
  1107. //
  1108. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1109. // specific
  1110. // netmask.
  1111. //
  1112. // Set to
  1113. // a
  1114. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1115. //
  1116. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1117. // (e.g.
  1118. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1119. // range
  1120. // to use.
  1121. NodeIpv4CidrBlock string `json:"nodeIpv4CidrBlock,omitempty"`
  1122. // ServicesIpv4Cidr: This field is deprecated, use
  1123. // services_ipv4_cidr_block.
  1124. ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"`
  1125. // ServicesIpv4CidrBlock: The IP address range of the services IPs in
  1126. // this cluster. If blank, a range
  1127. // will be automatically chosen with the default size.
  1128. //
  1129. // This field is only applicable when `use_ip_aliases` is true.
  1130. //
  1131. // Set to blank to have a range chosen with the default size.
  1132. //
  1133. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1134. // specific
  1135. // netmask.
  1136. //
  1137. // Set to
  1138. // a
  1139. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1140. //
  1141. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1142. // (e.g.
  1143. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1144. // range
  1145. // to use.
  1146. ServicesIpv4CidrBlock string `json:"servicesIpv4CidrBlock,omitempty"`
  1147. // ServicesSecondaryRangeName: The name of the secondary range to be
  1148. // used as for the services
  1149. // CIDR block. The secondary range will be used for service
  1150. // ClusterIPs. This must be an existing secondary range associated
  1151. // with the cluster subnetwork.
  1152. //
  1153. // This field is only applicable with use_ip_aliases
  1154. // and
  1155. // create_subnetwork is false.
  1156. ServicesSecondaryRangeName string `json:"servicesSecondaryRangeName,omitempty"`
  1157. // SubnetworkName: A custom subnetwork name to be used if
  1158. // `create_subnetwork` is true. If
  1159. // this field is empty, then an automatic name will be chosen for the
  1160. // new
  1161. // subnetwork.
  1162. SubnetworkName string `json:"subnetworkName,omitempty"`
  1163. // UseIpAliases: Whether alias IPs will be used for pod IPs in the
  1164. // cluster.
  1165. UseIpAliases bool `json:"useIpAliases,omitempty"`
  1166. // ForceSendFields is a list of field names (e.g. "AllowRouteOverlap")
  1167. // to unconditionally include in API requests. By default, fields with
  1168. // empty values are omitted from API requests. However, any non-pointer,
  1169. // non-interface field appearing in ForceSendFields will be sent to the
  1170. // server regardless of whether the field is empty or not. This may be
  1171. // used to include empty fields in Patch requests.
  1172. ForceSendFields []string `json:"-"`
  1173. // NullFields is a list of field names (e.g. "AllowRouteOverlap") to
  1174. // include in API requests with the JSON null value. By default, fields
  1175. // with empty values are omitted from API requests. However, any field
  1176. // with an empty value appearing in NullFields will be sent to the
  1177. // server as null. It is an error if a field in this list has a
  1178. // non-empty value. This may be used to include null fields in Patch
  1179. // requests.
  1180. NullFields []string `json:"-"`
  1181. }
  1182. func (s *IPAllocationPolicy) MarshalJSON() ([]byte, error) {
  1183. type NoMethod IPAllocationPolicy
  1184. raw := NoMethod(*s)
  1185. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1186. }
  1187. // KubernetesDashboard: Configuration for the Kubernetes Dashboard.
  1188. type KubernetesDashboard struct {
  1189. // Disabled: Whether the Kubernetes Dashboard is enabled for this
  1190. // cluster.
  1191. Disabled bool `json:"disabled,omitempty"`
  1192. // ForceSendFields is a list of field names (e.g. "Disabled") to
  1193. // unconditionally include in API requests. By default, fields with
  1194. // empty values are omitted from API requests. However, any non-pointer,
  1195. // non-interface field appearing in ForceSendFields will be sent to the
  1196. // server regardless of whether the field is empty or not. This may be
  1197. // used to include empty fields in Patch requests.
  1198. ForceSendFields []string `json:"-"`
  1199. // NullFields is a list of field names (e.g. "Disabled") to include in
  1200. // API requests with the JSON null value. By default, fields with empty
  1201. // values are omitted from API requests. However, any field with an
  1202. // empty value appearing in NullFields will be sent to the server as
  1203. // null. It is an error if a field in this list has a non-empty value.
  1204. // This may be used to include null fields in Patch requests.
  1205. NullFields []string `json:"-"`
  1206. }
  1207. func (s *KubernetesDashboard) MarshalJSON() ([]byte, error) {
  1208. type NoMethod KubernetesDashboard
  1209. raw := NoMethod(*s)
  1210. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1211. }
  1212. // LegacyAbac: Configuration for the legacy Attribute Based Access
  1213. // Control authorization
  1214. // mode.
  1215. type LegacyAbac struct {
  1216. // Enabled: Whether the ABAC authorizer is enabled for this cluster.
  1217. // When enabled,
  1218. // identities in the system, including service accounts, nodes,
  1219. // and
  1220. // controllers, will have statically granted permissions beyond
  1221. // those
  1222. // provided by the RBAC configuration or IAM.
  1223. Enabled bool `json:"enabled,omitempty"`
  1224. // ForceSendFields is a list of field names (e.g. "Enabled") to
  1225. // unconditionally include in API requests. By default, fields with
  1226. // empty values are omitted from API requests. However, any non-pointer,
  1227. // non-interface field appearing in ForceSendFields will be sent to the
  1228. // server regardless of whether the field is empty or not. This may be
  1229. // used to include empty fields in Patch requests.
  1230. ForceSendFields []string `json:"-"`
  1231. // NullFields is a list of field names (e.g. "Enabled") to include in
  1232. // API requests with the JSON null value. By default, fields with empty
  1233. // values are omitted from API requests. However, any field with an
  1234. // empty value appearing in NullFields will be sent to the server as
  1235. // null. It is an error if a field in this list has a non-empty value.
  1236. // This may be used to include null fields in Patch requests.
  1237. NullFields []string `json:"-"`
  1238. }
  1239. func (s *LegacyAbac) MarshalJSON() ([]byte, error) {
  1240. type NoMethod LegacyAbac
  1241. raw := NoMethod(*s)
  1242. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1243. }
  1244. // ListClustersResponse: ListClustersResponse is the result of
  1245. // ListClustersRequest.
  1246. type ListClustersResponse struct {
  1247. // Clusters: A list of clusters in the project in the specified zone,
  1248. // or
  1249. // across all ones.
  1250. Clusters []*Cluster `json:"clusters,omitempty"`
  1251. // MissingZones: If any zones are listed here, the list of clusters
  1252. // returned
  1253. // may be missing those zones.
  1254. MissingZones []string `json:"missingZones,omitempty"`
  1255. // ServerResponse contains the HTTP response code and headers from the
  1256. // server.
  1257. googleapi.ServerResponse `json:"-"`
  1258. // ForceSendFields is a list of field names (e.g. "Clusters") to
  1259. // unconditionally include in API requests. By default, fields with
  1260. // empty values are omitted from API requests. However, any non-pointer,
  1261. // non-interface field appearing in ForceSendFields will be sent to the
  1262. // server regardless of whether the field is empty or not. This may be
  1263. // used to include empty fields in Patch requests.
  1264. ForceSendFields []string `json:"-"`
  1265. // NullFields is a list of field names (e.g. "Clusters") to include in
  1266. // API requests with the JSON null value. By default, fields with empty
  1267. // values are omitted from API requests. However, any field with an
  1268. // empty value appearing in NullFields will be sent to the server as
  1269. // null. It is an error if a field in this list has a non-empty value.
  1270. // This may be used to include null fields in Patch requests.
  1271. NullFields []string `json:"-"`
  1272. }
  1273. func (s *ListClustersResponse) MarshalJSON() ([]byte, error) {
  1274. type NoMethod ListClustersResponse
  1275. raw := NoMethod(*s)
  1276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1277. }
  1278. // ListLocationsResponse: ListLocationsResponse returns the list of all
  1279. // GKE locations and their
  1280. // recommendation state.
  1281. type ListLocationsResponse struct {
  1282. // Locations: A full list of GKE locations.
  1283. Locations []*Location `json:"locations,omitempty"`
  1284. // NextPageToken: Only return ListLocationsResponse that occur after the
  1285. // page_token. This
  1286. // value should be populated from the
  1287. // ListLocationsResponse.next_page_token if
  1288. // that response token was set (which happens when listing more
  1289. // Locations than
  1290. // fit in a single ListLocationsResponse).
  1291. NextPageToken string `json:"nextPageToken,omitempty"`
  1292. // ServerResponse contains the HTTP response code and headers from the
  1293. // server.
  1294. googleapi.ServerResponse `json:"-"`
  1295. // ForceSendFields is a list of field names (e.g. "Locations") to
  1296. // unconditionally include in API requests. By default, fields with
  1297. // empty values are omitted from API requests. However, any non-pointer,
  1298. // non-interface field appearing in ForceSendFields will be sent to the
  1299. // server regardless of whether the field is empty or not. This may be
  1300. // used to include empty fields in Patch requests.
  1301. ForceSendFields []string `json:"-"`
  1302. // NullFields is a list of field names (e.g. "Locations") to include in
  1303. // API requests with the JSON null value. By default, fields with empty
  1304. // values are omitted from API requests. However, any field with an
  1305. // empty value appearing in NullFields will be sent to the server as
  1306. // null. It is an error if a field in this list has a non-empty value.
  1307. // This may be used to include null fields in Patch requests.
  1308. NullFields []string `json:"-"`
  1309. }
  1310. func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
  1311. type NoMethod ListLocationsResponse
  1312. raw := NoMethod(*s)
  1313. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1314. }
  1315. // ListNodePoolsResponse: ListNodePoolsResponse is the result of
  1316. // ListNodePoolsRequest.
  1317. type ListNodePoolsResponse struct {
  1318. // NodePools: A list of node pools for a cluster.
  1319. NodePools []*NodePool `json:"nodePools,omitempty"`
  1320. // ServerResponse contains the HTTP response code and headers from the
  1321. // server.
  1322. googleapi.ServerResponse `json:"-"`
  1323. // ForceSendFields is a list of field names (e.g. "NodePools") to
  1324. // unconditionally include in API requests. By default, fields with
  1325. // empty values are omitted from API requests. However, any non-pointer,
  1326. // non-interface field appearing in ForceSendFields will be sent to the
  1327. // server regardless of whether the field is empty or not. This may be
  1328. // used to include empty fields in Patch requests.
  1329. ForceSendFields []string `json:"-"`
  1330. // NullFields is a list of field names (e.g. "NodePools") to include in
  1331. // API requests with the JSON null value. By default, fields with empty
  1332. // values are omitted from API requests. However, any field with an
  1333. // empty value appearing in NullFields will be sent to the server as
  1334. // null. It is an error if a field in this list has a non-empty value.
  1335. // This may be used to include null fields in Patch requests.
  1336. NullFields []string `json:"-"`
  1337. }
  1338. func (s *ListNodePoolsResponse) MarshalJSON() ([]byte, error) {
  1339. type NoMethod ListNodePoolsResponse
  1340. raw := NoMethod(*s)
  1341. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1342. }
  1343. // ListOperationsResponse: ListOperationsResponse is the result of
  1344. // ListOperationsRequest.
  1345. type ListOperationsResponse struct {
  1346. // MissingZones: If any zones are listed here, the list of operations
  1347. // returned
  1348. // may be missing the operations from those zones.
  1349. MissingZones []string `json:"missingZones,omitempty"`
  1350. // Operations: A list of operations in the project in the specified
  1351. // zone.
  1352. Operations []*Operation `json:"operations,omitempty"`
  1353. // ServerResponse contains the HTTP response code and headers from the
  1354. // server.
  1355. googleapi.ServerResponse `json:"-"`
  1356. // ForceSendFields is a list of field names (e.g. "MissingZones") to
  1357. // unconditionally include in API requests. By default, fields with
  1358. // empty values are omitted from API requests. However, any non-pointer,
  1359. // non-interface field appearing in ForceSendFields will be sent to the
  1360. // server regardless of whether the field is empty or not. This may be
  1361. // used to include empty fields in Patch requests.
  1362. ForceSendFields []string `json:"-"`
  1363. // NullFields is a list of field names (e.g. "MissingZones") to include
  1364. // in API requests with the JSON null value. By default, fields with
  1365. // empty values are omitted from API requests. However, any field with
  1366. // an empty value appearing in NullFields will be sent to the server as
  1367. // null. It is an error if a field in this list has a non-empty value.
  1368. // This may be used to include null fields in Patch requests.
  1369. NullFields []string `json:"-"`
  1370. }
  1371. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  1372. type NoMethod ListOperationsResponse
  1373. raw := NoMethod(*s)
  1374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1375. }
  1376. // ListUsableSubnetworksResponse: ListUsableSubnetworksResponse is the
  1377. // response of
  1378. // ListUsableSubnetworksRequest.
  1379. type ListUsableSubnetworksResponse struct {
  1380. // NextPageToken: This token allows you to get the next page of results
  1381. // for list requests.
  1382. // If the number of results is larger than `page_size`, use
  1383. // the
  1384. // `next_page_token` as a value for the query parameter `page_token` in
  1385. // the
  1386. // next request. The value will become empty when there are no more
  1387. // pages.
  1388. NextPageToken string `json:"nextPageToken,omitempty"`
  1389. // Subnetworks: A list of usable subnetworks in the specified network
  1390. // project.
  1391. Subnetworks []*UsableSubnetwork `json:"subnetworks,omitempty"`
  1392. // ServerResponse contains the HTTP response code and headers from the
  1393. // server.
  1394. googleapi.ServerResponse `json:"-"`
  1395. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1396. // unconditionally include in API requests. By default, fields with
  1397. // empty values are omitted from API requests. However, any non-pointer,
  1398. // non-interface field appearing in ForceSendFields will be sent to the
  1399. // server regardless of whether the field is empty or not. This may be
  1400. // used to include empty fields in Patch requests.
  1401. ForceSendFields []string `json:"-"`
  1402. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1403. // in API requests with the JSON null value. By default, fields with
  1404. // empty values are omitted from API requests. However, any field with
  1405. // an empty value appearing in NullFields will be sent to the server as
  1406. // null. It is an error if a field in this list has a non-empty value.
  1407. // This may be used to include null fields in Patch requests.
  1408. NullFields []string `json:"-"`
  1409. }
  1410. func (s *ListUsableSubnetworksResponse) MarshalJSON() ([]byte, error) {
  1411. type NoMethod ListUsableSubnetworksResponse
  1412. raw := NoMethod(*s)
  1413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1414. }
  1415. // Location: Location returns the location name, and if the location is
  1416. // recommended
  1417. // for GKE cluster scheduling.
  1418. type Location struct {
  1419. // Name: Contains the name of the resource requested.
  1420. // Specific in the format 'projects/*/locations/*'.
  1421. Name string `json:"name,omitempty"`
  1422. // Recommended: Recommended is a bool combining the drain state of the
  1423. // location (ie- has
  1424. // the region been drained manually?), and the stockout status of any
  1425. // zone
  1426. // according to Zone Advisor. This will be internal only for use by
  1427. // pantheon.
  1428. Recommended bool `json:"recommended,omitempty"`
  1429. // Type: Contains the type of location this Location is for.
  1430. // Regional or Zonal.
  1431. //
  1432. // Possible values:
  1433. // "LOCATION_TYPE_UNSPECIFIED" - LOCATION_TYPE_UNSPECIFIED means the
  1434. // location type was not determined.
  1435. // "ZONE" - A GKE Location where Zonal clusters can be created.
  1436. // "REGION" - A GKE Location where Regional clusters can be created.
  1437. Type string `json:"type,omitempty"`
  1438. // ForceSendFields is a list of field names (e.g. "Name") to
  1439. // unconditionally include in API requests. By default, fields with
  1440. // empty values are omitted from API requests. However, any non-pointer,
  1441. // non-interface field appearing in ForceSendFields will be sent to the
  1442. // server regardless of whether the field is empty or not. This may be
  1443. // used to include empty fields in Patch requests.
  1444. ForceSendFields []string `json:"-"`
  1445. // NullFields is a list of field names (e.g. "Name") to include in API
  1446. // requests with the JSON null value. By default, fields with empty
  1447. // values are omitted from API requests. However, any field with an
  1448. // empty value appearing in NullFields will be sent to the server as
  1449. // null. It is an error if a field in this list has a non-empty value.
  1450. // This may be used to include null fields in Patch requests.
  1451. NullFields []string `json:"-"`
  1452. }
  1453. func (s *Location) MarshalJSON() ([]byte, error) {
  1454. type NoMethod Location
  1455. raw := NoMethod(*s)
  1456. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1457. }
  1458. // MaintenancePolicy: MaintenancePolicy defines the maintenance policy
  1459. // to be used for the cluster.
  1460. type MaintenancePolicy struct {
  1461. // Window: Specifies the maintenance window in which maintenance may be
  1462. // performed.
  1463. Window *MaintenanceWindow `json:"window,omitempty"`
  1464. // ForceSendFields is a list of field names (e.g. "Window") to
  1465. // unconditionally include in API requests. By default, fields with
  1466. // empty values are omitted from API requests. However, any non-pointer,
  1467. // non-interface field appearing in ForceSendFields will be sent to the
  1468. // server regardless of whether the field is empty or not. This may be
  1469. // used to include empty fields in Patch requests.
  1470. ForceSendFields []string `json:"-"`
  1471. // NullFields is a list of field names (e.g. "Window") to include in API
  1472. // requests with the JSON null value. By default, fields with empty
  1473. // values are omitted from API requests. However, any field with an
  1474. // empty value appearing in NullFields will be sent to the server as
  1475. // null. It is an error if a field in this list has a non-empty value.
  1476. // This may be used to include null fields in Patch requests.
  1477. NullFields []string `json:"-"`
  1478. }
  1479. func (s *MaintenancePolicy) MarshalJSON() ([]byte, error) {
  1480. type NoMethod MaintenancePolicy
  1481. raw := NoMethod(*s)
  1482. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1483. }
  1484. // MaintenanceWindow: MaintenanceWindow defines the maintenance window
  1485. // to be used for the cluster.
  1486. type MaintenanceWindow struct {
  1487. // DailyMaintenanceWindow: DailyMaintenanceWindow specifies a daily
  1488. // maintenance operation window.
  1489. DailyMaintenanceWindow *DailyMaintenanceWindow `json:"dailyMaintenanceWindow,omitempty"`
  1490. // ForceSendFields is a list of field names (e.g.
  1491. // "DailyMaintenanceWindow") to unconditionally include in API requests.
  1492. // By default, fields with empty values are omitted from API requests.
  1493. // However, any non-pointer, non-interface field appearing in
  1494. // ForceSendFields will be sent to the server regardless of whether the
  1495. // field is empty or not. This may be used to include empty fields in
  1496. // Patch requests.
  1497. ForceSendFields []string `json:"-"`
  1498. // NullFields is a list of field names (e.g. "DailyMaintenanceWindow")
  1499. // to include in API requests with the JSON null value. By default,
  1500. // fields with empty values are omitted from API requests. However, any
  1501. // field with an empty value appearing in NullFields will be sent to the
  1502. // server as null. It is an error if a field in this list has a
  1503. // non-empty value. This may be used to include null fields in Patch
  1504. // requests.
  1505. NullFields []string `json:"-"`
  1506. }
  1507. func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) {
  1508. type NoMethod MaintenanceWindow
  1509. raw := NoMethod(*s)
  1510. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1511. }
  1512. // MasterAuth: The authentication information for accessing the master
  1513. // endpoint.
  1514. // Authentication can be done using HTTP basic auth or using
  1515. // client
  1516. // certificates.
  1517. type MasterAuth struct {
  1518. // ClientCertificate: [Output only] Base64-encoded public certificate
  1519. // used by clients to
  1520. // authenticate to the cluster endpoint.
  1521. ClientCertificate string `json:"clientCertificate,omitempty"`
  1522. // ClientCertificateConfig: Configuration for client certificate
  1523. // authentication on the cluster. If no
  1524. // configuration is specified, a client certificate is issued.
  1525. ClientCertificateConfig *ClientCertificateConfig `json:"clientCertificateConfig,omitempty"`
  1526. // ClientKey: [Output only] Base64-encoded private key used by clients
  1527. // to authenticate
  1528. // to the cluster endpoint.
  1529. ClientKey string `json:"clientKey,omitempty"`
  1530. // ClusterCaCertificate: [Output only] Base64-encoded public certificate
  1531. // that is the root of
  1532. // trust for the cluster.
  1533. ClusterCaCertificate string `json:"clusterCaCertificate,omitempty"`
  1534. // Password: The password to use for HTTP basic authentication to the
  1535. // master endpoint.
  1536. // Because the master endpoint is open to the Internet, you should
  1537. // create a
  1538. // strong password. If a password is provided for cluster creation,
  1539. // username
  1540. // must be non-empty.
  1541. Password string `json:"password,omitempty"`
  1542. // Username: The username to use for HTTP basic authentication to the
  1543. // master endpoint.
  1544. // For clusters v1.6.0 and later, you can disable basic authentication
  1545. // by
  1546. // providing an empty username.
  1547. Username string `json:"username,omitempty"`
  1548. // ForceSendFields is a list of field names (e.g. "ClientCertificate")
  1549. // to unconditionally include in API requests. By default, fields with
  1550. // empty values are omitted from API requests. However, any non-pointer,
  1551. // non-interface field appearing in ForceSendFields will be sent to the
  1552. // server regardless of whether the field is empty or not. This may be
  1553. // used to include empty fields in Patch requests.
  1554. ForceSendFields []string `json:"-"`
  1555. // NullFields is a list of field names (e.g. "ClientCertificate") to
  1556. // include in API requests with the JSON null value. By default, fields
  1557. // with empty values are omitted from API requests. However, any field
  1558. // with an empty value appearing in NullFields will be sent to the
  1559. // server as null. It is an error if a field in this list has a
  1560. // non-empty value. This may be used to include null fields in Patch
  1561. // requests.
  1562. NullFields []string `json:"-"`
  1563. }
  1564. func (s *MasterAuth) MarshalJSON() ([]byte, error) {
  1565. type NoMethod MasterAuth
  1566. raw := NoMethod(*s)
  1567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1568. }
  1569. // MasterAuthorizedNetworksConfig: Configuration options for the master
  1570. // authorized networks feature. Enabled
  1571. // master authorized networks will disallow all external traffic to
  1572. // access
  1573. // Kubernetes master through HTTPS except traffic from the given CIDR
  1574. // blocks,
  1575. // Google Compute Engine Public IPs and Google Prod IPs.
  1576. type MasterAuthorizedNetworksConfig struct {
  1577. // CidrBlocks: cidr_blocks define up to 10 external networks that could
  1578. // access
  1579. // Kubernetes master through HTTPS.
  1580. CidrBlocks []*CidrBlock `json:"cidrBlocks,omitempty"`
  1581. // Enabled: Whether or not master authorized networks is enabled.
  1582. Enabled bool `json:"enabled,omitempty"`
  1583. // ForceSendFields is a list of field names (e.g. "CidrBlocks") to
  1584. // unconditionally include in API requests. By default, fields with
  1585. // empty values are omitted from API requests. However, any non-pointer,
  1586. // non-interface field appearing in ForceSendFields will be sent to the
  1587. // server regardless of whether the field is empty or not. This may be
  1588. // used to include empty fields in Patch requests.
  1589. ForceSendFields []string `json:"-"`
  1590. // NullFields is a list of field names (e.g. "CidrBlocks") to include in
  1591. // API requests with the JSON null value. By default, fields with empty
  1592. // values are omitted from API requests. However, any field with an
  1593. // empty value appearing in NullFields will be sent to the server as
  1594. // null. It is an error if a field in this list has a non-empty value.
  1595. // This may be used to include null fields in Patch requests.
  1596. NullFields []string `json:"-"`
  1597. }
  1598. func (s *MasterAuthorizedNetworksConfig) MarshalJSON() ([]byte, error) {
  1599. type NoMethod MasterAuthorizedNetworksConfig
  1600. raw := NoMethod(*s)
  1601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1602. }
  1603. // Metric: Progress metric is (string, int|float|string) pair.
  1604. type Metric struct {
  1605. // DoubleValue: For metrics with floating point value.
  1606. DoubleValue float64 `json:"doubleValue,omitempty"`
  1607. // IntValue: For metrics with integer value.
  1608. IntValue int64 `json:"intValue,omitempty,string"`
  1609. // Name: Metric name, required.
  1610. // e.g., "nodes total", "percent done"
  1611. Name string `json:"name,omitempty"`
  1612. // StringValue: For metrics with custom values (ratios, visual progress,
  1613. // etc.).
  1614. StringValue string `json:"stringValue,omitempty"`
  1615. // ForceSendFields is a list of field names (e.g. "DoubleValue") to
  1616. // unconditionally include in API requests. By default, fields with
  1617. // empty values are omitted from API requests. However, any non-pointer,
  1618. // non-interface field appearing in ForceSendFields will be sent to the
  1619. // server regardless of whether the field is empty or not. This may be
  1620. // used to include empty fields in Patch requests.
  1621. ForceSendFields []string `json:"-"`
  1622. // NullFields is a list of field names (e.g. "DoubleValue") to include
  1623. // in API requests with the JSON null value. By default, fields with
  1624. // empty values are omitted from API requests. However, any field with
  1625. // an empty value appearing in NullFields will be sent to the server as
  1626. // null. It is an error if a field in this list has a non-empty value.
  1627. // This may be used to include null fields in Patch requests.
  1628. NullFields []string `json:"-"`
  1629. }
  1630. func (s *Metric) MarshalJSON() ([]byte, error) {
  1631. type NoMethod Metric
  1632. raw := NoMethod(*s)
  1633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1634. }
  1635. func (s *Metric) UnmarshalJSON(data []byte) error {
  1636. type NoMethod Metric
  1637. var s1 struct {
  1638. DoubleValue gensupport.JSONFloat64 `json:"doubleValue"`
  1639. *NoMethod
  1640. }
  1641. s1.NoMethod = (*NoMethod)(s)
  1642. if err := json.Unmarshal(data, &s1); err != nil {
  1643. return err
  1644. }
  1645. s.DoubleValue = float64(s1.DoubleValue)
  1646. return nil
  1647. }
  1648. // NetworkConfig: NetworkConfig reports the relative names of network &
  1649. // subnetwork.
  1650. type NetworkConfig struct {
  1651. // Network: Output only. The name of the Google Compute
  1652. // Engine
  1653. // network(/compute/docs/networks-and-firewalls#networks).
  1654. // Example
  1655. // : projects/my-project/global/networks/my-network
  1656. Network string `json:"network,omitempty"`
  1657. // Subnetwork: Output only. The name of the Google Compute
  1658. // Engine
  1659. // [subnetwork](/compute/docs/vpc).
  1660. // Example:
  1661. // projects/my-project/regions/us-central1/subnetworks/my-subnet
  1662. Subnetwork string `json:"subnetwork,omitempty"`
  1663. // ForceSendFields is a list of field names (e.g. "Network") to
  1664. // unconditionally include in API requests. By default, fields with
  1665. // empty values are omitted from API requests. However, any non-pointer,
  1666. // non-interface field appearing in ForceSendFields will be sent to the
  1667. // server regardless of whether the field is empty or not. This may be
  1668. // used to include empty fields in Patch requests.
  1669. ForceSendFields []string `json:"-"`
  1670. // NullFields is a list of field names (e.g. "Network") to include in
  1671. // API requests with the JSON null value. By default, fields with empty
  1672. // values are omitted from API requests. However, any field with an
  1673. // empty value appearing in NullFields will be sent to the server as
  1674. // null. It is an error if a field in this list has a non-empty value.
  1675. // This may be used to include null fields in Patch requests.
  1676. NullFields []string `json:"-"`
  1677. }
  1678. func (s *NetworkConfig) MarshalJSON() ([]byte, error) {
  1679. type NoMethod NetworkConfig
  1680. raw := NoMethod(*s)
  1681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1682. }
  1683. // NetworkPolicy: Configuration options for the NetworkPolicy
  1684. // feature.
  1685. // https://kubernetes.io/docs/concepts/services-networking/netwo
  1686. // rkpolicies/
  1687. type NetworkPolicy struct {
  1688. // Enabled: Whether network policy is enabled on the cluster.
  1689. Enabled bool `json:"enabled,omitempty"`
  1690. // Provider: The selected network policy provider.
  1691. //
  1692. // Possible values:
  1693. // "PROVIDER_UNSPECIFIED" - Not set
  1694. // "CALICO" - Tigera (Calico Felix).
  1695. Provider string `json:"provider,omitempty"`
  1696. // ForceSendFields is a list of field names (e.g. "Enabled") to
  1697. // unconditionally include in API requests. By default, fields with
  1698. // empty values are omitted from API requests. However, any non-pointer,
  1699. // non-interface field appearing in ForceSendFields will be sent to the
  1700. // server regardless of whether the field is empty or not. This may be
  1701. // used to include empty fields in Patch requests.
  1702. ForceSendFields []string `json:"-"`
  1703. // NullFields is a list of field names (e.g. "Enabled") to include in
  1704. // API requests with the JSON null value. By default, fields with empty
  1705. // values are omitted from API requests. However, any field with an
  1706. // empty value appearing in NullFields will be sent to the server as
  1707. // null. It is an error if a field in this list has a non-empty value.
  1708. // This may be used to include null fields in Patch requests.
  1709. NullFields []string `json:"-"`
  1710. }
  1711. func (s *NetworkPolicy) MarshalJSON() ([]byte, error) {
  1712. type NoMethod NetworkPolicy
  1713. raw := NoMethod(*s)
  1714. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1715. }
  1716. // NetworkPolicyConfig: Configuration for NetworkPolicy. This only
  1717. // tracks whether the addon
  1718. // is enabled or not on the Master, it does not track whether network
  1719. // policy
  1720. // is enabled for the nodes.
  1721. type NetworkPolicyConfig struct {
  1722. // Disabled: Whether NetworkPolicy is enabled for this cluster.
  1723. Disabled bool `json:"disabled,omitempty"`
  1724. // ForceSendFields is a list of field names (e.g. "Disabled") to
  1725. // unconditionally include in API requests. By default, fields with
  1726. // empty values are omitted from API requests. However, any non-pointer,
  1727. // non-interface field appearing in ForceSendFields will be sent to the
  1728. // server regardless of whether the field is empty or not. This may be
  1729. // used to include empty fields in Patch requests.
  1730. ForceSendFields []string `json:"-"`
  1731. // NullFields is a list of field names (e.g. "Disabled") to include in
  1732. // API requests with the JSON null value. By default, fields with empty
  1733. // values are omitted from API requests. However, any field with an
  1734. // empty value appearing in NullFields will be sent to the server as
  1735. // null. It is an error if a field in this list has a non-empty value.
  1736. // This may be used to include null fields in Patch requests.
  1737. NullFields []string `json:"-"`
  1738. }
  1739. func (s *NetworkPolicyConfig) MarshalJSON() ([]byte, error) {
  1740. type NoMethod NetworkPolicyConfig
  1741. raw := NoMethod(*s)
  1742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1743. }
  1744. // NodeConfig: Parameters that describe the nodes in a cluster.
  1745. type NodeConfig struct {
  1746. // Accelerators: A list of hardware accelerators to be attached to each
  1747. // node.
  1748. // See https://cloud.google.com/compute/docs/gpus for more information
  1749. // about
  1750. // support for GPUs.
  1751. Accelerators []*AcceleratorConfig `json:"accelerators,omitempty"`
  1752. // DiskSizeGb: Size of the disk attached to each node, specified in
  1753. // GB.
  1754. // The smallest allowed disk size is 10GB.
  1755. //
  1756. // If unspecified, the default disk size is 100GB.
  1757. DiskSizeGb int64 `json:"diskSizeGb,omitempty"`
  1758. // DiskType: Type of the disk attached to each node (e.g. 'pd-standard'
  1759. // or 'pd-ssd')
  1760. //
  1761. // If unspecified, the default disk type is 'pd-standard'
  1762. DiskType string `json:"diskType,omitempty"`
  1763. // ImageType: The image type to use for this node. Note that for a given
  1764. // image type,
  1765. // the latest version of it will be used.
  1766. ImageType string `json:"imageType,omitempty"`
  1767. // Labels: The map of Kubernetes labels (key/value pairs) to be applied
  1768. // to each node.
  1769. // These will added in addition to any default label(s) that
  1770. // Kubernetes may apply to the node.
  1771. // In case of conflict in label keys, the applied set may differ
  1772. // depending on
  1773. // the Kubernetes version -- it's best to assume the behavior is
  1774. // undefined
  1775. // and conflicts should be avoided.
  1776. // For more information, including usage and the valid values,
  1777. // see:
  1778. // https://kubernetes.io/docs/concepts/overview/working-with-objects
  1779. // /labels/
  1780. Labels map[string]string `json:"labels,omitempty"`
  1781. // LocalSsdCount: The number of local SSD disks to be attached to the
  1782. // node.
  1783. //
  1784. // The limit for this value is dependant upon the maximum number
  1785. // of
  1786. // disks available on a machine per zone.
  1787. // See:
  1788. // https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_l
  1789. // imits
  1790. // for more information.
  1791. LocalSsdCount int64 `json:"localSsdCount,omitempty"`
  1792. // MachineType: The name of a Google Compute Engine
  1793. // [machine
  1794. // type](/compute/docs/machine-types) (e.g.
  1795. // `n1-standard-1`).
  1796. //
  1797. // If unspecified, the default machine type is
  1798. // `n1-standard-1`.
  1799. MachineType string `json:"machineType,omitempty"`
  1800. // Metadata: The metadata key/value pairs assigned to instances in the
  1801. // cluster.
  1802. //
  1803. // Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128
  1804. // bytes
  1805. // in length. These are reflected as part of a URL in the metadata
  1806. // server.
  1807. // Additionally, to avoid ambiguity, keys must not conflict with any
  1808. // other
  1809. // metadata keys for the project or be one of the reserved keys:
  1810. // "cluster-location"
  1811. // "cluster-name"
  1812. // "cluster-uid"
  1813. // "configure-sh"
  1814. // "gci-update-strategy"
  1815. // "gci-ensure-gke-docker"
  1816. // "instance-template"
  1817. // "kube-env"
  1818. // "startup-script"
  1819. // "user-data"
  1820. //
  1821. // Values are free-form strings, and only have meaning as interpreted
  1822. // by
  1823. // the image running in the instance. The only restriction placed on
  1824. // them is
  1825. // that each value's size must be less than or equal to 32 KB.
  1826. //
  1827. // The total size of all keys and values must be less than 512 KB.
  1828. Metadata map[string]string `json:"metadata,omitempty"`
  1829. // MinCpuPlatform: Minimum CPU platform to be used by this instance. The
  1830. // instance may be
  1831. // scheduled on the specified or newer CPU platform. Applicable values
  1832. // are the
  1833. // friendly names of CPU platforms, such as
  1834. // <code>minCpuPlatform: &quot;Intel Haswell&quot;</code>
  1835. // or
  1836. // <code>minCpuPlatform: &quot;Intel Sandy Bridge&quot;</code>. For
  1837. // more
  1838. // information, read [how to specify min
  1839. // CPU
  1840. // platform](https://cloud.google.com/compute/docs/instances/specify-
  1841. // min-cpu-platform)
  1842. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  1843. // OauthScopes: The set of Google API scopes to be made available on all
  1844. // of the
  1845. // node VMs under the "default" service account.
  1846. //
  1847. // The following scopes are recommended, but not required, and by
  1848. // default are
  1849. // not included:
  1850. //
  1851. // * `https://www.googleapis.com/auth/compute` is required for
  1852. // mounting
  1853. // persistent storage on your nodes.
  1854. // * `https://www.googleapis.com/auth/devstorage.read_only` is required
  1855. // for
  1856. // communicating with **gcr.io**
  1857. // (the [Google Container Registry](/container-registry/)).
  1858. //
  1859. // If unspecified, no scopes are added, unless Cloud Logging or
  1860. // Cloud
  1861. // Monitoring are enabled, in which case their required scopes will be
  1862. // added.
  1863. OauthScopes []string `json:"oauthScopes,omitempty"`
  1864. // Preemptible: Whether the nodes are created as preemptible VM
  1865. // instances.
  1866. // See:
  1867. // https://cloud.google.com/compute/docs/instances/preemptible for
  1868. // more
  1869. // inforamtion about preemptible VM instances.
  1870. Preemptible bool `json:"preemptible,omitempty"`
  1871. // ServiceAccount: The Google Cloud Platform Service Account to be used
  1872. // by the node VMs. If
  1873. // no Service Account is specified, the "default" service account is
  1874. // used.
  1875. ServiceAccount string `json:"serviceAccount,omitempty"`
  1876. // Tags: The list of instance tags applied to all nodes. Tags are used
  1877. // to identify
  1878. // valid sources or targets for network firewalls and are specified
  1879. // by
  1880. // the client during cluster or node pool creation. Each tag within the
  1881. // list
  1882. // must comply with RFC1035.
  1883. Tags []string `json:"tags,omitempty"`
  1884. // Taints: List of kubernetes taints to be applied to each node.
  1885. //
  1886. // For more information, including usage and the valid values,
  1887. // see:
  1888. // https://kubernetes.io/docs/concepts/configuration/taint-and-toler
  1889. // ation/
  1890. Taints []*NodeTaint `json:"taints,omitempty"`
  1891. // WorkloadMetadataConfig: The workload metadata configuration for this
  1892. // node.
  1893. WorkloadMetadataConfig *WorkloadMetadataConfig `json:"workloadMetadataConfig,omitempty"`
  1894. // ForceSendFields is a list of field names (e.g. "Accelerators") to
  1895. // unconditionally include in API requests. By default, fields with
  1896. // empty values are omitted from API requests. However, any non-pointer,
  1897. // non-interface field appearing in ForceSendFields will be sent to the
  1898. // server regardless of whether the field is empty or not. This may be
  1899. // used to include empty fields in Patch requests.
  1900. ForceSendFields []string `json:"-"`
  1901. // NullFields is a list of field names (e.g. "Accelerators") to include
  1902. // in API requests with the JSON null value. By default, fields with
  1903. // empty values are omitted from API requests. However, any field with
  1904. // an empty value appearing in NullFields will be sent to the server as
  1905. // null. It is an error if a field in this list has a non-empty value.
  1906. // This may be used to include null fields in Patch requests.
  1907. NullFields []string `json:"-"`
  1908. }
  1909. func (s *NodeConfig) MarshalJSON() ([]byte, error) {
  1910. type NoMethod NodeConfig
  1911. raw := NoMethod(*s)
  1912. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1913. }
  1914. // NodeManagement: NodeManagement defines the set of node management
  1915. // services turned on for the
  1916. // node pool.
  1917. type NodeManagement struct {
  1918. // AutoRepair: Whether the nodes will be automatically repaired.
  1919. AutoRepair bool `json:"autoRepair,omitempty"`
  1920. // AutoUpgrade: Whether the nodes will be automatically upgraded.
  1921. AutoUpgrade bool `json:"autoUpgrade,omitempty"`
  1922. // UpgradeOptions: Specifies the Auto Upgrade knobs for the node pool.
  1923. UpgradeOptions *AutoUpgradeOptions `json:"upgradeOptions,omitempty"`
  1924. // ForceSendFields is a list of field names (e.g. "AutoRepair") to
  1925. // unconditionally include in API requests. By default, fields with
  1926. // empty values are omitted from API requests. However, any non-pointer,
  1927. // non-interface field appearing in ForceSendFields will be sent to the
  1928. // server regardless of whether the field is empty or not. This may be
  1929. // used to include empty fields in Patch requests.
  1930. ForceSendFields []string `json:"-"`
  1931. // NullFields is a list of field names (e.g. "AutoRepair") to include in
  1932. // API requests with the JSON null value. By default, fields with empty
  1933. // values are omitted from API requests. However, any field with an
  1934. // empty value appearing in NullFields will be sent to the server as
  1935. // null. It is an error if a field in this list has a non-empty value.
  1936. // This may be used to include null fields in Patch requests.
  1937. NullFields []string `json:"-"`
  1938. }
  1939. func (s *NodeManagement) MarshalJSON() ([]byte, error) {
  1940. type NoMethod NodeManagement
  1941. raw := NoMethod(*s)
  1942. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1943. }
  1944. // NodePool: NodePool contains the name and configuration for a
  1945. // cluster's node pool.
  1946. // Node pools are a set of nodes (i.e. VM's), with a common
  1947. // configuration and
  1948. // specification, under the control of the cluster master. They may have
  1949. // a set
  1950. // of Kubernetes labels applied to them, which may be used to reference
  1951. // them
  1952. // during pod scheduling. They may also be resized up or down, to
  1953. // accommodate
  1954. // the workload.
  1955. type NodePool struct {
  1956. // Autoscaling: Autoscaler configuration for this NodePool. Autoscaler
  1957. // is enabled
  1958. // only if a valid configuration is present.
  1959. Autoscaling *NodePoolAutoscaling `json:"autoscaling,omitempty"`
  1960. // Config: The node configuration of the pool.
  1961. Config *NodeConfig `json:"config,omitempty"`
  1962. // InitialNodeCount: The initial node count for the pool. You must
  1963. // ensure that your
  1964. // Compute Engine <a href="/compute/docs/resource-quotas">resource
  1965. // quota</a>
  1966. // is sufficient for this number of instances. You must also have
  1967. // available
  1968. // firewall and routes quota.
  1969. InitialNodeCount int64 `json:"initialNodeCount,omitempty"`
  1970. // InstanceGroupUrls: [Output only] The resource URLs of the [managed
  1971. // instance
  1972. // groups](/compute/docs/instance-groups/creating-groups-of-mana
  1973. // ged-instances)
  1974. // associated with this node pool.
  1975. InstanceGroupUrls []string `json:"instanceGroupUrls,omitempty"`
  1976. // Management: NodeManagement configuration for this NodePool.
  1977. Management *NodeManagement `json:"management,omitempty"`
  1978. // Name: The name of the node pool.
  1979. Name string `json:"name,omitempty"`
  1980. // SelfLink: [Output only] Server-defined URL for the resource.
  1981. SelfLink string `json:"selfLink,omitempty"`
  1982. // Status: [Output only] The status of the nodes in this pool instance.
  1983. //
  1984. // Possible values:
  1985. // "STATUS_UNSPECIFIED" - Not set.
  1986. // "PROVISIONING" - The PROVISIONING state indicates the node pool is
  1987. // being created.
  1988. // "RUNNING" - The RUNNING state indicates the node pool has been
  1989. // created
  1990. // and is fully usable.
  1991. // "RUNNING_WITH_ERROR" - The RUNNING_WITH_ERROR state indicates the
  1992. // node pool has been created
  1993. // and is partially usable. Some error state has occurred and
  1994. // some
  1995. // functionality may be impaired. Customer may need to reissue a
  1996. // request
  1997. // or trigger a new update.
  1998. // "RECONCILING" - The RECONCILING state indicates that some work is
  1999. // actively being done on
  2000. // the node pool, such as upgrading node software. Details can
  2001. // be found in the `statusMessage` field.
  2002. // "STOPPING" - The STOPPING state indicates the node pool is being
  2003. // deleted.
  2004. // "ERROR" - The ERROR state indicates the node pool may be unusable.
  2005. // Details
  2006. // can be found in the `statusMessage` field.
  2007. Status string `json:"status,omitempty"`
  2008. // StatusMessage: [Output only] Additional information about the current
  2009. // status of this
  2010. // node pool instance, if available.
  2011. StatusMessage string `json:"statusMessage,omitempty"`
  2012. // Version: The version of the Kubernetes of this node.
  2013. Version string `json:"version,omitempty"`
  2014. // ServerResponse contains the HTTP response code and headers from the
  2015. // server.
  2016. googleapi.ServerResponse `json:"-"`
  2017. // ForceSendFields is a list of field names (e.g. "Autoscaling") to
  2018. // unconditionally include in API requests. By default, fields with
  2019. // empty values are omitted from API requests. However, any non-pointer,
  2020. // non-interface field appearing in ForceSendFields will be sent to the
  2021. // server regardless of whether the field is empty or not. This may be
  2022. // used to include empty fields in Patch requests.
  2023. ForceSendFields []string `json:"-"`
  2024. // NullFields is a list of field names (e.g. "Autoscaling") to include
  2025. // in API requests with the JSON null value. By default, fields with
  2026. // empty values are omitted from API requests. However, any field with
  2027. // an empty value appearing in NullFields will be sent to the server as
  2028. // null. It is an error if a field in this list has a non-empty value.
  2029. // This may be used to include null fields in Patch requests.
  2030. NullFields []string `json:"-"`
  2031. }
  2032. func (s *NodePool) MarshalJSON() ([]byte, error) {
  2033. type NoMethod NodePool
  2034. raw := NoMethod(*s)
  2035. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2036. }
  2037. // NodePoolAutoscaling: NodePoolAutoscaling contains information
  2038. // required by cluster autoscaler to
  2039. // adjust the size of the node pool to the current cluster usage.
  2040. type NodePoolAutoscaling struct {
  2041. // Enabled: Is autoscaling enabled for this node pool.
  2042. Enabled bool `json:"enabled,omitempty"`
  2043. // MaxNodeCount: Maximum number of nodes in the NodePool. Must be >=
  2044. // min_node_count. There
  2045. // has to enough quota to scale up the cluster.
  2046. MaxNodeCount int64 `json:"maxNodeCount,omitempty"`
  2047. // MinNodeCount: Minimum number of nodes in the NodePool. Must be >= 1
  2048. // and <=
  2049. // max_node_count.
  2050. MinNodeCount int64 `json:"minNodeCount,omitempty"`
  2051. // ForceSendFields is a list of field names (e.g. "Enabled") to
  2052. // unconditionally include in API requests. By default, fields with
  2053. // empty values are omitted from API requests. However, any non-pointer,
  2054. // non-interface field appearing in ForceSendFields will be sent to the
  2055. // server regardless of whether the field is empty or not. This may be
  2056. // used to include empty fields in Patch requests.
  2057. ForceSendFields []string `json:"-"`
  2058. // NullFields is a list of field names (e.g. "Enabled") to include in
  2059. // API requests with the JSON null value. By default, fields with empty
  2060. // values are omitted from API requests. However, any field with an
  2061. // empty value appearing in NullFields will be sent to the server as
  2062. // null. It is an error if a field in this list has a non-empty value.
  2063. // This may be used to include null fields in Patch requests.
  2064. NullFields []string `json:"-"`
  2065. }
  2066. func (s *NodePoolAutoscaling) MarshalJSON() ([]byte, error) {
  2067. type NoMethod NodePoolAutoscaling
  2068. raw := NoMethod(*s)
  2069. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2070. }
  2071. // NodeTaint: Kubernetes taint is comprised of three fields: key, value,
  2072. // and effect. Effect
  2073. // can only be one of three types: NoSchedule, PreferNoSchedule or
  2074. // NoExecute.
  2075. //
  2076. // For more information, including usage and the valid values,
  2077. // see:
  2078. // https://kubernetes.io/docs/concepts/configuration/taint-and-toler
  2079. // ation/
  2080. type NodeTaint struct {
  2081. // Effect: Effect for taint.
  2082. //
  2083. // Possible values:
  2084. // "EFFECT_UNSPECIFIED" - Not set
  2085. // "NO_SCHEDULE" - NoSchedule
  2086. // "PREFER_NO_SCHEDULE" - PreferNoSchedule
  2087. // "NO_EXECUTE" - NoExecute
  2088. Effect string `json:"effect,omitempty"`
  2089. // Key: Key for taint.
  2090. Key string `json:"key,omitempty"`
  2091. // Value: Value for taint.
  2092. Value string `json:"value,omitempty"`
  2093. // ForceSendFields is a list of field names (e.g. "Effect") to
  2094. // unconditionally include in API requests. By default, fields with
  2095. // empty values are omitted from API requests. However, any non-pointer,
  2096. // non-interface field appearing in ForceSendFields will be sent to the
  2097. // server regardless of whether the field is empty or not. This may be
  2098. // used to include empty fields in Patch requests.
  2099. ForceSendFields []string `json:"-"`
  2100. // NullFields is a list of field names (e.g. "Effect") to include in API
  2101. // requests with the JSON null value. By default, fields with empty
  2102. // values are omitted from API requests. However, any field with an
  2103. // empty value appearing in NullFields will be sent to the server as
  2104. // null. It is an error if a field in this list has a non-empty value.
  2105. // This may be used to include null fields in Patch requests.
  2106. NullFields []string `json:"-"`
  2107. }
  2108. func (s *NodeTaint) MarshalJSON() ([]byte, error) {
  2109. type NoMethod NodeTaint
  2110. raw := NoMethod(*s)
  2111. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2112. }
  2113. // Operation: This operation resource represents operations that may
  2114. // have happened or are
  2115. // happening on the cluster. All fields are output only.
  2116. type Operation struct {
  2117. // Detail: Detailed operation progress, if available.
  2118. Detail string `json:"detail,omitempty"`
  2119. // EndTime: [Output only] The time the operation completed,
  2120. // in
  2121. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  2122. EndTime string `json:"endTime,omitempty"`
  2123. // Location: [Output only] The name of the Google Compute
  2124. // Engine
  2125. // [zone](/compute/docs/regions-zones/regions-zones#available)
  2126. // or
  2127. // [region](/compute/docs/regions-zones/regions-zones#available) in
  2128. // which
  2129. // the cluster resides.
  2130. Location string `json:"location,omitempty"`
  2131. // Name: The server-assigned ID for the operation.
  2132. Name string `json:"name,omitempty"`
  2133. // OperationType: The operation type.
  2134. //
  2135. // Possible values:
  2136. // "TYPE_UNSPECIFIED" - Not set.
  2137. // "CREATE_CLUSTER" - Cluster create.
  2138. // "DELETE_CLUSTER" - Cluster delete.
  2139. // "UPGRADE_MASTER" - A master upgrade.
  2140. // "UPGRADE_NODES" - A node upgrade.
  2141. // "REPAIR_CLUSTER" - Cluster repair.
  2142. // "UPDATE_CLUSTER" - Cluster update.
  2143. // "CREATE_NODE_POOL" - Node pool create.
  2144. // "DELETE_NODE_POOL" - Node pool delete.
  2145. // "SET_NODE_POOL_MANAGEMENT" - Set node pool management.
  2146. // "AUTO_REPAIR_NODES" - Automatic node pool repair.
  2147. // "AUTO_UPGRADE_NODES" - Automatic node upgrade.
  2148. // "SET_LABELS" - Set labels.
  2149. // "SET_MASTER_AUTH" - Set/generate master auth materials
  2150. // "SET_NODE_POOL_SIZE" - Set node pool size.
  2151. // "SET_NETWORK_POLICY" - Updates network policy for a cluster.
  2152. // "SET_MAINTENANCE_POLICY" - Set the maintenance policy.
  2153. OperationType string `json:"operationType,omitempty"`
  2154. // Progress: [Output only] Progress information for an operation.
  2155. Progress *OperationProgress `json:"progress,omitempty"`
  2156. // SelfLink: Server-defined URL for the resource.
  2157. SelfLink string `json:"selfLink,omitempty"`
  2158. // StartTime: [Output only] The time the operation started,
  2159. // in
  2160. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  2161. StartTime string `json:"startTime,omitempty"`
  2162. // Status: The current status of the operation.
  2163. //
  2164. // Possible values:
  2165. // "STATUS_UNSPECIFIED" - Not set.
  2166. // "PENDING" - The operation has been created.
  2167. // "RUNNING" - The operation is currently running.
  2168. // "DONE" - The operation is done, either cancelled or completed.
  2169. // "ABORTING" - The operation is aborting.
  2170. Status string `json:"status,omitempty"`
  2171. // StatusMessage: If an error has occurred, a textual description of the
  2172. // error.
  2173. StatusMessage string `json:"statusMessage,omitempty"`
  2174. // TargetLink: Server-defined URL for the target of the operation.
  2175. TargetLink string `json:"targetLink,omitempty"`
  2176. // Zone: The name of the Google Compute
  2177. // Engine
  2178. // [zone](/compute/docs/zones#available) in which the operation
  2179. // is taking place.
  2180. // This field is deprecated, use location instead.
  2181. Zone string `json:"zone,omitempty"`
  2182. // ServerResponse contains the HTTP response code and headers from the
  2183. // server.
  2184. googleapi.ServerResponse `json:"-"`
  2185. // ForceSendFields is a list of field names (e.g. "Detail") to
  2186. // unconditionally include in API requests. By default, fields with
  2187. // empty values are omitted from API requests. However, any non-pointer,
  2188. // non-interface field appearing in ForceSendFields will be sent to the
  2189. // server regardless of whether the field is empty or not. This may be
  2190. // used to include empty fields in Patch requests.
  2191. ForceSendFields []string `json:"-"`
  2192. // NullFields is a list of field names (e.g. "Detail") to include in API
  2193. // requests with the JSON null value. By default, fields with empty
  2194. // values are omitted from API requests. However, any field with an
  2195. // empty value appearing in NullFields will be sent to the server as
  2196. // null. It is an error if a field in this list has a non-empty value.
  2197. // This may be used to include null fields in Patch requests.
  2198. NullFields []string `json:"-"`
  2199. }
  2200. func (s *Operation) MarshalJSON() ([]byte, error) {
  2201. type NoMethod Operation
  2202. raw := NoMethod(*s)
  2203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2204. }
  2205. // OperationProgress: Information about operation (or operation stage)
  2206. // progress.
  2207. type OperationProgress struct {
  2208. // Metrics: Progress metric bundle, for example:
  2209. // metrics: [{name: "nodes done", int_value: 15},
  2210. // {name: "nodes total", int_value: 32}]
  2211. // or
  2212. // metrics: [{name: "progress", double_value: 0.56},
  2213. // {name: "progress scale", double_value: 1.0}]
  2214. Metrics []*Metric `json:"metrics,omitempty"`
  2215. // Name: A non-parameterized string describing an operation stage.
  2216. // Unset for single-stage operations.
  2217. Name string `json:"name,omitempty"`
  2218. // Stages: Substages of an operation or a stage.
  2219. Stages []*OperationProgress `json:"stages,omitempty"`
  2220. // Status: Status of an operation stage.
  2221. // Unset for single-stage operations.
  2222. //
  2223. // Possible values:
  2224. // "STATUS_UNSPECIFIED" - Not set.
  2225. // "PENDING" - The operation has been created.
  2226. // "RUNNING" - The operation is currently running.
  2227. // "DONE" - The operation is done, either cancelled or completed.
  2228. // "ABORTING" - The operation is aborting.
  2229. Status string `json:"status,omitempty"`
  2230. // ForceSendFields is a list of field names (e.g. "Metrics") to
  2231. // unconditionally include in API requests. By default, fields with
  2232. // empty values are omitted from API requests. However, any non-pointer,
  2233. // non-interface field appearing in ForceSendFields will be sent to the
  2234. // server regardless of whether the field is empty or not. This may be
  2235. // used to include empty fields in Patch requests.
  2236. ForceSendFields []string `json:"-"`
  2237. // NullFields is a list of field names (e.g. "Metrics") to include in
  2238. // API requests with the JSON null value. By default, fields with empty
  2239. // values are omitted from API requests. However, any field with an
  2240. // empty value appearing in NullFields will be sent to the server as
  2241. // null. It is an error if a field in this list has a non-empty value.
  2242. // This may be used to include null fields in Patch requests.
  2243. NullFields []string `json:"-"`
  2244. }
  2245. func (s *OperationProgress) MarshalJSON() ([]byte, error) {
  2246. type NoMethod OperationProgress
  2247. raw := NoMethod(*s)
  2248. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2249. }
  2250. // PodSecurityPolicyConfig: Configuration for the PodSecurityPolicy
  2251. // feature.
  2252. type PodSecurityPolicyConfig struct {
  2253. // Enabled: Enable the PodSecurityPolicy controller for this cluster. If
  2254. // enabled, pods
  2255. // must be valid under a PodSecurityPolicy to be created.
  2256. Enabled bool `json:"enabled,omitempty"`
  2257. // ForceSendFields is a list of field names (e.g. "Enabled") to
  2258. // unconditionally include in API requests. By default, fields with
  2259. // empty values are omitted from API requests. However, any non-pointer,
  2260. // non-interface field appearing in ForceSendFields will be sent to the
  2261. // server regardless of whether the field is empty or not. This may be
  2262. // used to include empty fields in Patch requests.
  2263. ForceSendFields []string `json:"-"`
  2264. // NullFields is a list of field names (e.g. "Enabled") to include in
  2265. // API requests with the JSON null value. By default, fields with empty
  2266. // values are omitted from API requests. However, any field with an
  2267. // empty value appearing in NullFields will be sent to the server as
  2268. // null. It is an error if a field in this list has a non-empty value.
  2269. // This may be used to include null fields in Patch requests.
  2270. NullFields []string `json:"-"`
  2271. }
  2272. func (s *PodSecurityPolicyConfig) MarshalJSON() ([]byte, error) {
  2273. type NoMethod PodSecurityPolicyConfig
  2274. raw := NoMethod(*s)
  2275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2276. }
  2277. // RollbackNodePoolUpgradeRequest: RollbackNodePoolUpgradeRequest
  2278. // rollbacks the previously Aborted or Failed
  2279. // NodePool upgrade. This will be an no-op if the last upgrade
  2280. // successfully
  2281. // completed.
  2282. type RollbackNodePoolUpgradeRequest struct {
  2283. // ClusterId: Deprecated. The name of the cluster to rollback.
  2284. // This field has been deprecated and replaced by the name field.
  2285. ClusterId string `json:"clusterId,omitempty"`
  2286. // Name: The name (project, location, cluster, node pool id) of the node
  2287. // poll to
  2288. // rollback upgrade.
  2289. // Specified in the format
  2290. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2291. Name string `json:"name,omitempty"`
  2292. // NodePoolId: Deprecated. The name of the node pool to rollback.
  2293. // This field has been deprecated and replaced by the name field.
  2294. NodePoolId string `json:"nodePoolId,omitempty"`
  2295. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2296. // project
  2297. // number](https://support.google.com/cloud/answer/6158840).
  2298. // This
  2299. // field has been deprecated and replaced by the name field.
  2300. ProjectId string `json:"projectId,omitempty"`
  2301. // Zone: Deprecated. The name of the Google Compute
  2302. // Engine
  2303. // [zone](/compute/docs/zones#available) in which the
  2304. // cluster
  2305. // resides.
  2306. // This field has been deprecated and replaced by the name field.
  2307. Zone string `json:"zone,omitempty"`
  2308. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2309. // unconditionally include in API requests. By default, fields with
  2310. // empty values are omitted from API requests. However, any non-pointer,
  2311. // non-interface field appearing in ForceSendFields will be sent to the
  2312. // server regardless of whether the field is empty or not. This may be
  2313. // used to include empty fields in Patch requests.
  2314. ForceSendFields []string `json:"-"`
  2315. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2316. // API requests with the JSON null value. By default, fields with empty
  2317. // values are omitted from API requests. However, any field with an
  2318. // empty value appearing in NullFields will be sent to the server as
  2319. // null. It is an error if a field in this list has a non-empty value.
  2320. // This may be used to include null fields in Patch requests.
  2321. NullFields []string `json:"-"`
  2322. }
  2323. func (s *RollbackNodePoolUpgradeRequest) MarshalJSON() ([]byte, error) {
  2324. type NoMethod RollbackNodePoolUpgradeRequest
  2325. raw := NoMethod(*s)
  2326. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2327. }
  2328. // ServerConfig: Kubernetes Engine service configuration.
  2329. type ServerConfig struct {
  2330. // DefaultClusterVersion: Version of Kubernetes the service deploys by
  2331. // default.
  2332. DefaultClusterVersion string `json:"defaultClusterVersion,omitempty"`
  2333. // DefaultImageType: Default image type.
  2334. DefaultImageType string `json:"defaultImageType,omitempty"`
  2335. // ValidImageTypes: List of valid image types.
  2336. ValidImageTypes []string `json:"validImageTypes,omitempty"`
  2337. // ValidMasterVersions: List of valid master versions.
  2338. ValidMasterVersions []string `json:"validMasterVersions,omitempty"`
  2339. // ValidNodeVersions: List of valid node upgrade target versions.
  2340. ValidNodeVersions []string `json:"validNodeVersions,omitempty"`
  2341. // ServerResponse contains the HTTP response code and headers from the
  2342. // server.
  2343. googleapi.ServerResponse `json:"-"`
  2344. // ForceSendFields is a list of field names (e.g.
  2345. // "DefaultClusterVersion") to unconditionally include in API requests.
  2346. // By default, fields with empty values are omitted from API requests.
  2347. // However, any non-pointer, non-interface field appearing in
  2348. // ForceSendFields will be sent to the server regardless of whether the
  2349. // field is empty or not. This may be used to include empty fields in
  2350. // Patch requests.
  2351. ForceSendFields []string `json:"-"`
  2352. // NullFields is a list of field names (e.g. "DefaultClusterVersion") to
  2353. // include in API requests with the JSON null value. By default, fields
  2354. // with empty values are omitted from API requests. However, any field
  2355. // with an empty value appearing in NullFields will be sent to the
  2356. // server as null. It is an error if a field in this list has a
  2357. // non-empty value. This may be used to include null fields in Patch
  2358. // requests.
  2359. NullFields []string `json:"-"`
  2360. }
  2361. func (s *ServerConfig) MarshalJSON() ([]byte, error) {
  2362. type NoMethod ServerConfig
  2363. raw := NoMethod(*s)
  2364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2365. }
  2366. // SetAddonsConfigRequest: SetAddonsRequest sets the addons associated
  2367. // with the cluster.
  2368. type SetAddonsConfigRequest struct {
  2369. // AddonsConfig: The desired configurations for the various addons
  2370. // available to run in the
  2371. // cluster.
  2372. AddonsConfig *AddonsConfig `json:"addonsConfig,omitempty"`
  2373. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2374. // This field has been deprecated and replaced by the name field.
  2375. ClusterId string `json:"clusterId,omitempty"`
  2376. // Name: The name (project, location, cluster) of the cluster to set
  2377. // addons.
  2378. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2379. Name string `json:"name,omitempty"`
  2380. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2381. // project
  2382. // number](https://support.google.com/cloud/answer/6158840).
  2383. // This
  2384. // 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. "AddonsConfig") 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. "AddonsConfig") to include
  2401. // in API requests with the JSON null value. By default, fields with
  2402. // empty values are omitted from API requests. However, any field with
  2403. // an 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 *SetAddonsConfigRequest) MarshalJSON() ([]byte, error) {
  2409. type NoMethod SetAddonsConfigRequest
  2410. raw := NoMethod(*s)
  2411. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2412. }
  2413. // SetLabelsRequest: SetLabelsRequest sets the Google Cloud Platform
  2414. // labels on a Google Container
  2415. // Engine cluster, which will in turn set them for Google Compute
  2416. // Engine
  2417. // resources used by that cluster
  2418. type SetLabelsRequest struct {
  2419. // ClusterId: Deprecated. The name of the cluster.
  2420. // This field has been deprecated and replaced by the name field.
  2421. ClusterId string `json:"clusterId,omitempty"`
  2422. // LabelFingerprint: The fingerprint of the previous set of labels for
  2423. // this resource,
  2424. // used to detect conflicts. The fingerprint is initially generated
  2425. // by
  2426. // Kubernetes Engine and changes after every request to modify or
  2427. // update
  2428. // labels. You must always provide an up-to-date fingerprint hash
  2429. // when
  2430. // updating or changing labels. Make a <code>get()</code> request to
  2431. // the
  2432. // resource to get the latest fingerprint.
  2433. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  2434. // Name: The name (project, location, cluster id) of the cluster to set
  2435. // labels.
  2436. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2437. Name string `json:"name,omitempty"`
  2438. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2439. // project
  2440. // number](https://developers.google.com/console/help/new/#projec
  2441. // tnumber).
  2442. // This field has been deprecated and replaced by the name field.
  2443. ProjectId string `json:"projectId,omitempty"`
  2444. // ResourceLabels: The labels to set for that cluster.
  2445. ResourceLabels map[string]string `json:"resourceLabels,omitempty"`
  2446. // Zone: Deprecated. The name of the Google Compute
  2447. // Engine
  2448. // [zone](/compute/docs/zones#available) in which the
  2449. // cluster
  2450. // resides.
  2451. // This field has been deprecated and replaced by the name field.
  2452. Zone string `json:"zone,omitempty"`
  2453. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2454. // unconditionally include in API requests. By default, fields with
  2455. // empty values are omitted from API requests. However, any non-pointer,
  2456. // non-interface field appearing in ForceSendFields will be sent to the
  2457. // server regardless of whether the field is empty or not. This may be
  2458. // used to include empty fields in Patch requests.
  2459. ForceSendFields []string `json:"-"`
  2460. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2461. // API requests with the JSON null value. By default, fields with empty
  2462. // values are omitted from API requests. However, any field with an
  2463. // empty value appearing in NullFields will be sent to the server as
  2464. // null. It is an error if a field in this list has a non-empty value.
  2465. // This may be used to include null fields in Patch requests.
  2466. NullFields []string `json:"-"`
  2467. }
  2468. func (s *SetLabelsRequest) MarshalJSON() ([]byte, error) {
  2469. type NoMethod SetLabelsRequest
  2470. raw := NoMethod(*s)
  2471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2472. }
  2473. // SetLegacyAbacRequest: SetLegacyAbacRequest enables or disables the
  2474. // ABAC authorization mechanism for
  2475. // a cluster.
  2476. type SetLegacyAbacRequest struct {
  2477. // ClusterId: Deprecated. The name of the cluster to update.
  2478. // This field has been deprecated and replaced by the name field.
  2479. ClusterId string `json:"clusterId,omitempty"`
  2480. // Enabled: Whether ABAC authorization will be enabled in the cluster.
  2481. Enabled bool `json:"enabled,omitempty"`
  2482. // Name: The name (project, location, cluster id) of the cluster to set
  2483. // legacy abac.
  2484. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2485. Name string `json:"name,omitempty"`
  2486. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2487. // project
  2488. // number](https://support.google.com/cloud/answer/6158840).
  2489. // This
  2490. // field has been deprecated and replaced by the name field.
  2491. ProjectId string `json:"projectId,omitempty"`
  2492. // Zone: Deprecated. The name of the Google Compute
  2493. // Engine
  2494. // [zone](/compute/docs/zones#available) in which the
  2495. // cluster
  2496. // resides.
  2497. // This field has been deprecated and replaced by the name field.
  2498. Zone string `json:"zone,omitempty"`
  2499. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2500. // unconditionally include in API requests. By default, fields with
  2501. // empty values are omitted from API requests. However, any non-pointer,
  2502. // non-interface field appearing in ForceSendFields will be sent to the
  2503. // server regardless of whether the field is empty or not. This may be
  2504. // used to include empty fields in Patch requests.
  2505. ForceSendFields []string `json:"-"`
  2506. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2507. // API requests with the JSON null value. By default, fields with empty
  2508. // values are omitted from API requests. However, any field with an
  2509. // empty value appearing in NullFields will be sent to the server as
  2510. // null. It is an error if a field in this list has a non-empty value.
  2511. // This may be used to include null fields in Patch requests.
  2512. NullFields []string `json:"-"`
  2513. }
  2514. func (s *SetLegacyAbacRequest) MarshalJSON() ([]byte, error) {
  2515. type NoMethod SetLegacyAbacRequest
  2516. raw := NoMethod(*s)
  2517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2518. }
  2519. // SetLocationsRequest: SetLocationsRequest sets the locations of the
  2520. // cluster.
  2521. type SetLocationsRequest struct {
  2522. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2523. // This field has been deprecated and replaced by the name field.
  2524. ClusterId string `json:"clusterId,omitempty"`
  2525. // Locations: The desired list of Google Compute
  2526. // Engine
  2527. // [locations](/compute/docs/zones#available) in which the cluster's
  2528. // nodes
  2529. // should be located. Changing the locations a cluster is in will
  2530. // result
  2531. // in nodes being either created or removed from the cluster, depending
  2532. // on
  2533. // whether locations are being added or removed.
  2534. //
  2535. // This list must always include the cluster's primary zone.
  2536. Locations []string `json:"locations,omitempty"`
  2537. // Name: The name (project, location, cluster) of the cluster to set
  2538. // locations.
  2539. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2540. Name string `json:"name,omitempty"`
  2541. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2542. // project
  2543. // number](https://support.google.com/cloud/answer/6158840).
  2544. // This
  2545. // field has been deprecated and replaced by the name field.
  2546. ProjectId string `json:"projectId,omitempty"`
  2547. // Zone: Deprecated. The name of the Google Compute
  2548. // Engine
  2549. // [zone](/compute/docs/zones#available) in which the
  2550. // cluster
  2551. // resides.
  2552. // This field has been deprecated and replaced by the name field.
  2553. Zone string `json:"zone,omitempty"`
  2554. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2555. // unconditionally include in API requests. By default, fields with
  2556. // empty values are omitted from API requests. However, any non-pointer,
  2557. // non-interface field appearing in ForceSendFields will be sent to the
  2558. // server regardless of whether the field is empty or not. This may be
  2559. // used to include empty fields in Patch requests.
  2560. ForceSendFields []string `json:"-"`
  2561. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2562. // API requests with the JSON null value. By default, fields with empty
  2563. // values are omitted from API requests. However, any field with an
  2564. // empty value appearing in NullFields will be sent to the server as
  2565. // null. It is an error if a field in this list has a non-empty value.
  2566. // This may be used to include null fields in Patch requests.
  2567. NullFields []string `json:"-"`
  2568. }
  2569. func (s *SetLocationsRequest) MarshalJSON() ([]byte, error) {
  2570. type NoMethod SetLocationsRequest
  2571. raw := NoMethod(*s)
  2572. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2573. }
  2574. // SetLoggingServiceRequest: SetLoggingServiceRequest sets the logging
  2575. // service of a cluster.
  2576. type SetLoggingServiceRequest struct {
  2577. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2578. // This field has been deprecated and replaced by the name field.
  2579. ClusterId string `json:"clusterId,omitempty"`
  2580. // LoggingService: The logging service the cluster should use to write
  2581. // metrics.
  2582. // Currently available options:
  2583. //
  2584. // * "logging.googleapis.com" - the Google Cloud Logging service
  2585. // * "none" - no metrics will be exported from the cluster
  2586. LoggingService string `json:"loggingService,omitempty"`
  2587. // Name: The name (project, location, cluster) of the cluster to set
  2588. // logging.
  2589. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2590. Name string `json:"name,omitempty"`
  2591. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2592. // project
  2593. // number](https://support.google.com/cloud/answer/6158840).
  2594. // This
  2595. // field has been deprecated and replaced by the name field.
  2596. ProjectId string `json:"projectId,omitempty"`
  2597. // Zone: Deprecated. The name of the Google Compute
  2598. // Engine
  2599. // [zone](/compute/docs/zones#available) in which the
  2600. // cluster
  2601. // resides.
  2602. // This field has been deprecated and replaced by the name field.
  2603. Zone string `json:"zone,omitempty"`
  2604. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2605. // unconditionally include in API requests. By default, fields with
  2606. // empty values are omitted from API requests. However, any non-pointer,
  2607. // non-interface field appearing in ForceSendFields will be sent to the
  2608. // server regardless of whether the field is empty or not. This may be
  2609. // used to include empty fields in Patch requests.
  2610. ForceSendFields []string `json:"-"`
  2611. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2612. // API requests with the JSON null value. By default, fields with empty
  2613. // values are omitted from API requests. However, any field with an
  2614. // empty value appearing in NullFields will be sent to the server as
  2615. // null. It is an error if a field in this list has a non-empty value.
  2616. // This may be used to include null fields in Patch requests.
  2617. NullFields []string `json:"-"`
  2618. }
  2619. func (s *SetLoggingServiceRequest) MarshalJSON() ([]byte, error) {
  2620. type NoMethod SetLoggingServiceRequest
  2621. raw := NoMethod(*s)
  2622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2623. }
  2624. // SetMaintenancePolicyRequest: SetMaintenancePolicyRequest sets the
  2625. // maintenance policy for a cluster.
  2626. type SetMaintenancePolicyRequest struct {
  2627. // ClusterId: The name of the cluster to update.
  2628. ClusterId string `json:"clusterId,omitempty"`
  2629. // MaintenancePolicy: The maintenance policy to be set for the cluster.
  2630. // An empty field
  2631. // clears the existing maintenance policy.
  2632. MaintenancePolicy *MaintenancePolicy `json:"maintenancePolicy,omitempty"`
  2633. // Name: The name (project, location, cluster id) of the cluster to set
  2634. // maintenance
  2635. // policy.
  2636. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2637. Name string `json:"name,omitempty"`
  2638. // ProjectId: The Google Developers Console [project ID or
  2639. // project
  2640. // number](https://support.google.com/cloud/answer/6158840).
  2641. ProjectId string `json:"projectId,omitempty"`
  2642. // Zone: The name of the Google Compute
  2643. // Engine
  2644. // [zone](/compute/docs/zones#available) in which the cluster
  2645. // resides.
  2646. Zone string `json:"zone,omitempty"`
  2647. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2648. // unconditionally include in API requests. By default, fields with
  2649. // empty values are omitted from API requests. However, any non-pointer,
  2650. // non-interface field appearing in ForceSendFields will be sent to the
  2651. // server regardless of whether the field is empty or not. This may be
  2652. // used to include empty fields in Patch requests.
  2653. ForceSendFields []string `json:"-"`
  2654. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2655. // API requests with the JSON null value. By default, fields with empty
  2656. // values are omitted from API requests. However, any field with an
  2657. // empty value appearing in NullFields will be sent to the server as
  2658. // null. It is an error if a field in this list has a non-empty value.
  2659. // This may be used to include null fields in Patch requests.
  2660. NullFields []string `json:"-"`
  2661. }
  2662. func (s *SetMaintenancePolicyRequest) MarshalJSON() ([]byte, error) {
  2663. type NoMethod SetMaintenancePolicyRequest
  2664. raw := NoMethod(*s)
  2665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2666. }
  2667. // SetMasterAuthRequest: SetMasterAuthRequest updates the admin password
  2668. // of a cluster.
  2669. type SetMasterAuthRequest struct {
  2670. // Action: The exact form of action to be taken on the master auth.
  2671. //
  2672. // Possible values:
  2673. // "UNKNOWN" - Operation is unknown and will error out.
  2674. // "SET_PASSWORD" - Set the password to a user generated value.
  2675. // "GENERATE_PASSWORD" - Generate a new password and set it to that.
  2676. // "SET_USERNAME" - Set the username. If an empty username is
  2677. // provided, basic authentication
  2678. // is disabled for the cluster. If a non-empty username is provided,
  2679. // basic
  2680. // authentication is enabled, with either a provided password or a
  2681. // generated
  2682. // one.
  2683. Action string `json:"action,omitempty"`
  2684. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2685. // This field has been deprecated and replaced by the name field.
  2686. ClusterId string `json:"clusterId,omitempty"`
  2687. // Name: The name (project, location, cluster) of the cluster to set
  2688. // auth.
  2689. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2690. Name string `json:"name,omitempty"`
  2691. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2692. // project
  2693. // number](https://support.google.com/cloud/answer/6158840).
  2694. // This
  2695. // field has been deprecated and replaced by the name field.
  2696. ProjectId string `json:"projectId,omitempty"`
  2697. // Update: A description of the update.
  2698. Update *MasterAuth `json:"update,omitempty"`
  2699. // Zone: Deprecated. The name of the Google Compute
  2700. // Engine
  2701. // [zone](/compute/docs/zones#available) in which the
  2702. // cluster
  2703. // resides.
  2704. // This field has been deprecated and replaced by the name field.
  2705. Zone string `json:"zone,omitempty"`
  2706. // ForceSendFields is a list of field names (e.g. "Action") to
  2707. // unconditionally include in API requests. By default, fields with
  2708. // empty values are omitted from API requests. However, any non-pointer,
  2709. // non-interface field appearing in ForceSendFields will be sent to the
  2710. // server regardless of whether the field is empty or not. This may be
  2711. // used to include empty fields in Patch requests.
  2712. ForceSendFields []string `json:"-"`
  2713. // NullFields is a list of field names (e.g. "Action") to include in API
  2714. // requests with the JSON null value. By default, fields with empty
  2715. // values are omitted from API requests. However, any field with an
  2716. // empty value appearing in NullFields will be sent to the server as
  2717. // null. It is an error if a field in this list has a non-empty value.
  2718. // This may be used to include null fields in Patch requests.
  2719. NullFields []string `json:"-"`
  2720. }
  2721. func (s *SetMasterAuthRequest) MarshalJSON() ([]byte, error) {
  2722. type NoMethod SetMasterAuthRequest
  2723. raw := NoMethod(*s)
  2724. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2725. }
  2726. // SetMonitoringServiceRequest: SetMonitoringServiceRequest sets the
  2727. // monitoring service of a cluster.
  2728. type SetMonitoringServiceRequest struct {
  2729. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2730. // This field has been deprecated and replaced by the name field.
  2731. ClusterId string `json:"clusterId,omitempty"`
  2732. // MonitoringService: The monitoring service the cluster should use to
  2733. // write metrics.
  2734. // Currently available options:
  2735. //
  2736. // * "monitoring.googleapis.com" - the Google Cloud Monitoring service
  2737. // * "none" - no metrics will be exported from the cluster
  2738. MonitoringService string `json:"monitoringService,omitempty"`
  2739. // Name: The name (project, location, cluster) of the cluster to set
  2740. // monitoring.
  2741. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2742. Name string `json:"name,omitempty"`
  2743. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2744. // project
  2745. // number](https://support.google.com/cloud/answer/6158840).
  2746. // This
  2747. // field has been deprecated and replaced by the name field.
  2748. ProjectId string `json:"projectId,omitempty"`
  2749. // Zone: Deprecated. The name of the Google Compute
  2750. // Engine
  2751. // [zone](/compute/docs/zones#available) in which the
  2752. // cluster
  2753. // resides.
  2754. // This field has been deprecated and replaced by the name field.
  2755. Zone string `json:"zone,omitempty"`
  2756. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2757. // unconditionally include in API requests. By default, fields with
  2758. // empty values are omitted from API requests. However, any non-pointer,
  2759. // non-interface field appearing in ForceSendFields will be sent to the
  2760. // server regardless of whether the field is empty or not. This may be
  2761. // used to include empty fields in Patch requests.
  2762. ForceSendFields []string `json:"-"`
  2763. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2764. // API requests with the JSON null value. By default, fields with empty
  2765. // values are omitted from API requests. However, any field with an
  2766. // empty value appearing in NullFields will be sent to the server as
  2767. // null. It is an error if a field in this list has a non-empty value.
  2768. // This may be used to include null fields in Patch requests.
  2769. NullFields []string `json:"-"`
  2770. }
  2771. func (s *SetMonitoringServiceRequest) MarshalJSON() ([]byte, error) {
  2772. type NoMethod SetMonitoringServiceRequest
  2773. raw := NoMethod(*s)
  2774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2775. }
  2776. // SetNetworkPolicyRequest: SetNetworkPolicyRequest enables/disables
  2777. // network policy for a cluster.
  2778. type SetNetworkPolicyRequest struct {
  2779. // ClusterId: Deprecated. The name of the cluster.
  2780. // This field has been deprecated and replaced by the name field.
  2781. ClusterId string `json:"clusterId,omitempty"`
  2782. // Name: The name (project, location, cluster id) of the cluster to set
  2783. // networking
  2784. // policy. Specified in the format 'projects/*/locations/*/clusters/*'.
  2785. Name string `json:"name,omitempty"`
  2786. // NetworkPolicy: Configuration options for the NetworkPolicy feature.
  2787. NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"`
  2788. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2789. // project
  2790. // number](https://developers.google.com/console/help/new/#projec
  2791. // tnumber).
  2792. // This field has been deprecated and replaced by the name field.
  2793. ProjectId string `json:"projectId,omitempty"`
  2794. // Zone: Deprecated. The name of the Google Compute
  2795. // Engine
  2796. // [zone](/compute/docs/zones#available) in which the
  2797. // cluster
  2798. // resides.
  2799. // This field has been deprecated and replaced by the name field.
  2800. Zone string `json:"zone,omitempty"`
  2801. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2802. // unconditionally include in API requests. By default, fields with
  2803. // empty values are omitted from API requests. However, any non-pointer,
  2804. // non-interface field appearing in ForceSendFields will be sent to the
  2805. // server regardless of whether the field is empty or not. This may be
  2806. // used to include empty fields in Patch requests.
  2807. ForceSendFields []string `json:"-"`
  2808. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2809. // API requests with the JSON null value. By default, fields with empty
  2810. // values are omitted from API requests. However, any field with an
  2811. // empty value appearing in NullFields will be sent to the server as
  2812. // null. It is an error if a field in this list has a non-empty value.
  2813. // This may be used to include null fields in Patch requests.
  2814. NullFields []string `json:"-"`
  2815. }
  2816. func (s *SetNetworkPolicyRequest) MarshalJSON() ([]byte, error) {
  2817. type NoMethod SetNetworkPolicyRequest
  2818. raw := NoMethod(*s)
  2819. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2820. }
  2821. // SetNodePoolAutoscalingRequest: SetNodePoolAutoscalingRequest sets the
  2822. // autoscaler settings of a node pool.
  2823. type SetNodePoolAutoscalingRequest struct {
  2824. // Autoscaling: Autoscaling configuration for the node pool.
  2825. Autoscaling *NodePoolAutoscaling `json:"autoscaling,omitempty"`
  2826. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2827. // This field has been deprecated and replaced by the name field.
  2828. ClusterId string `json:"clusterId,omitempty"`
  2829. // Name: The name (project, location, cluster, node pool) of the node
  2830. // pool to set
  2831. // autoscaler settings. Specified in the
  2832. // format
  2833. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2834. Name string `json:"name,omitempty"`
  2835. // NodePoolId: Deprecated. The name of the node pool to upgrade.
  2836. // This field has been deprecated and replaced by the name field.
  2837. NodePoolId string `json:"nodePoolId,omitempty"`
  2838. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2839. // project
  2840. // number](https://support.google.com/cloud/answer/6158840).
  2841. // This
  2842. // field has been deprecated and replaced by the name field.
  2843. ProjectId string `json:"projectId,omitempty"`
  2844. // Zone: Deprecated. The name of the Google Compute
  2845. // Engine
  2846. // [zone](/compute/docs/zones#available) in which the
  2847. // cluster
  2848. // resides.
  2849. // This field has been deprecated and replaced by the name field.
  2850. Zone string `json:"zone,omitempty"`
  2851. // ForceSendFields is a list of field names (e.g. "Autoscaling") to
  2852. // unconditionally include in API requests. By default, fields with
  2853. // empty values are omitted from API requests. However, any non-pointer,
  2854. // non-interface field appearing in ForceSendFields will be sent to the
  2855. // server regardless of whether the field is empty or not. This may be
  2856. // used to include empty fields in Patch requests.
  2857. ForceSendFields []string `json:"-"`
  2858. // NullFields is a list of field names (e.g. "Autoscaling") to include
  2859. // in API requests with the JSON null value. By default, fields with
  2860. // empty values are omitted from API requests. However, any field with
  2861. // an empty value appearing in NullFields will be sent to the server as
  2862. // null. It is an error if a field in this list has a non-empty value.
  2863. // This may be used to include null fields in Patch requests.
  2864. NullFields []string `json:"-"`
  2865. }
  2866. func (s *SetNodePoolAutoscalingRequest) MarshalJSON() ([]byte, error) {
  2867. type NoMethod SetNodePoolAutoscalingRequest
  2868. raw := NoMethod(*s)
  2869. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2870. }
  2871. // SetNodePoolManagementRequest: SetNodePoolManagementRequest sets the
  2872. // node management properties of a node
  2873. // pool.
  2874. type SetNodePoolManagementRequest struct {
  2875. // ClusterId: Deprecated. The name of the cluster to update.
  2876. // This field has been deprecated and replaced by the name field.
  2877. ClusterId string `json:"clusterId,omitempty"`
  2878. // Management: NodeManagement configuration for the node pool.
  2879. Management *NodeManagement `json:"management,omitempty"`
  2880. // Name: The name (project, location, cluster, node pool id) of the node
  2881. // pool to set
  2882. // management properties. Specified in the
  2883. // format
  2884. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2885. Name string `json:"name,omitempty"`
  2886. // NodePoolId: Deprecated. The name of the node pool to update.
  2887. // This field has been deprecated and replaced by the name field.
  2888. NodePoolId string `json:"nodePoolId,omitempty"`
  2889. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2890. // project
  2891. // number](https://support.google.com/cloud/answer/6158840).
  2892. // This
  2893. // field has been deprecated and replaced by the name field.
  2894. ProjectId string `json:"projectId,omitempty"`
  2895. // Zone: Deprecated. The name of the Google Compute
  2896. // Engine
  2897. // [zone](/compute/docs/zones#available) in which the
  2898. // cluster
  2899. // resides.
  2900. // This field has been deprecated and replaced by the name field.
  2901. Zone string `json:"zone,omitempty"`
  2902. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2903. // unconditionally include in API requests. By default, fields with
  2904. // empty values are omitted from API requests. However, any non-pointer,
  2905. // non-interface field appearing in ForceSendFields will be sent to the
  2906. // server regardless of whether the field is empty or not. This may be
  2907. // used to include empty fields in Patch requests.
  2908. ForceSendFields []string `json:"-"`
  2909. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2910. // API requests with the JSON null value. By default, fields with empty
  2911. // values are omitted from API requests. However, any field with an
  2912. // empty value appearing in NullFields will be sent to the server as
  2913. // null. It is an error if a field in this list has a non-empty value.
  2914. // This may be used to include null fields in Patch requests.
  2915. NullFields []string `json:"-"`
  2916. }
  2917. func (s *SetNodePoolManagementRequest) MarshalJSON() ([]byte, error) {
  2918. type NoMethod SetNodePoolManagementRequest
  2919. raw := NoMethod(*s)
  2920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2921. }
  2922. // SetNodePoolSizeRequest: SetNodePoolSizeRequest sets the size a
  2923. // node
  2924. // pool.
  2925. type SetNodePoolSizeRequest struct {
  2926. // ClusterId: Deprecated. The name of the cluster to update.
  2927. // This field has been deprecated and replaced by the name field.
  2928. ClusterId string `json:"clusterId,omitempty"`
  2929. // Name: The name (project, location, cluster, node pool id) of the node
  2930. // pool to set
  2931. // size.
  2932. // Specified in the format
  2933. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2934. Name string `json:"name,omitempty"`
  2935. // NodeCount: The desired node count for the pool.
  2936. NodeCount int64 `json:"nodeCount,omitempty"`
  2937. // NodePoolId: Deprecated. The name of the node pool to update.
  2938. // This field has been deprecated and replaced by the name field.
  2939. NodePoolId string `json:"nodePoolId,omitempty"`
  2940. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2941. // project
  2942. // number](https://support.google.com/cloud/answer/6158840).
  2943. // This
  2944. // field has been deprecated and replaced by the name field.
  2945. ProjectId string `json:"projectId,omitempty"`
  2946. // Zone: Deprecated. The name of the Google Compute
  2947. // Engine
  2948. // [zone](/compute/docs/zones#available) in which the
  2949. // cluster
  2950. // resides.
  2951. // This field has been deprecated and replaced by the name field.
  2952. Zone string `json:"zone,omitempty"`
  2953. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2954. // unconditionally include in API requests. By default, fields with
  2955. // empty values are omitted from API requests. However, any non-pointer,
  2956. // non-interface field appearing in ForceSendFields will be sent to the
  2957. // server regardless of whether the field is empty or not. This may be
  2958. // used to include empty fields in Patch requests.
  2959. ForceSendFields []string `json:"-"`
  2960. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2961. // API requests with the JSON null value. By default, fields with empty
  2962. // values are omitted from API requests. However, any field with an
  2963. // empty value appearing in NullFields will be sent to the server as
  2964. // null. It is an error if a field in this list has a non-empty value.
  2965. // This may be used to include null fields in Patch requests.
  2966. NullFields []string `json:"-"`
  2967. }
  2968. func (s *SetNodePoolSizeRequest) MarshalJSON() ([]byte, error) {
  2969. type NoMethod SetNodePoolSizeRequest
  2970. raw := NoMethod(*s)
  2971. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2972. }
  2973. // StartIPRotationRequest: StartIPRotationRequest creates a new IP for
  2974. // the cluster and then performs
  2975. // a node upgrade on each node pool to point to the new IP.
  2976. type StartIPRotationRequest struct {
  2977. // ClusterId: Deprecated. The name of the cluster.
  2978. // This field has been deprecated and replaced by the name field.
  2979. ClusterId string `json:"clusterId,omitempty"`
  2980. // Name: The name (project, location, cluster id) of the cluster to
  2981. // start IP
  2982. // rotation. Specified in the format
  2983. // 'projects/*/locations/*/clusters/*'.
  2984. Name string `json:"name,omitempty"`
  2985. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2986. // project
  2987. // number](https://developers.google.com/console/help/new/#projec
  2988. // tnumber).
  2989. // This field has been deprecated and replaced by the name field.
  2990. ProjectId string `json:"projectId,omitempty"`
  2991. // RotateCredentials: Whether to rotate credentials during IP rotation.
  2992. RotateCredentials bool `json:"rotateCredentials,omitempty"`
  2993. // Zone: Deprecated. The name of the Google Compute
  2994. // Engine
  2995. // [zone](/compute/docs/zones#available) in which the
  2996. // cluster
  2997. // resides.
  2998. // This field has been deprecated and replaced by the name field.
  2999. Zone string `json:"zone,omitempty"`
  3000. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3001. // unconditionally include in API requests. By default, fields with
  3002. // empty values are omitted from API requests. However, any non-pointer,
  3003. // non-interface field appearing in ForceSendFields will be sent to the
  3004. // server regardless of whether the field is empty or not. This may be
  3005. // used to include empty fields in Patch requests.
  3006. ForceSendFields []string `json:"-"`
  3007. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3008. // API requests with the JSON null value. By default, fields with empty
  3009. // values are omitted from API requests. However, any field with an
  3010. // empty value appearing in NullFields will be sent to the server as
  3011. // null. It is an error if a field in this list has a non-empty value.
  3012. // This may be used to include null fields in Patch requests.
  3013. NullFields []string `json:"-"`
  3014. }
  3015. func (s *StartIPRotationRequest) MarshalJSON() ([]byte, error) {
  3016. type NoMethod StartIPRotationRequest
  3017. raw := NoMethod(*s)
  3018. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3019. }
  3020. // UpdateClusterRequest: UpdateClusterRequest updates the settings of a
  3021. // cluster.
  3022. type UpdateClusterRequest struct {
  3023. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3024. // This field has been deprecated and replaced by the name field.
  3025. ClusterId string `json:"clusterId,omitempty"`
  3026. // Name: The name (project, location, cluster) of the cluster to
  3027. // update.
  3028. // Specified in the format 'projects/*/locations/*/clusters/*'.
  3029. Name string `json:"name,omitempty"`
  3030. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3031. // project
  3032. // number](https://support.google.com/cloud/answer/6158840).
  3033. // This
  3034. // field has been deprecated and replaced by the name field.
  3035. ProjectId string `json:"projectId,omitempty"`
  3036. // Update: A description of the update.
  3037. Update *ClusterUpdate `json:"update,omitempty"`
  3038. // Zone: Deprecated. The name of the Google Compute
  3039. // Engine
  3040. // [zone](/compute/docs/zones#available) in which the
  3041. // cluster
  3042. // resides.
  3043. // This field has been deprecated and replaced by the name field.
  3044. Zone string `json:"zone,omitempty"`
  3045. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3046. // unconditionally include in API requests. By default, fields with
  3047. // empty values are omitted from API requests. However, any non-pointer,
  3048. // non-interface field appearing in ForceSendFields will be sent to the
  3049. // server regardless of whether the field is empty or not. This may be
  3050. // used to include empty fields in Patch requests.
  3051. ForceSendFields []string `json:"-"`
  3052. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3053. // API requests with the JSON null value. By default, fields with empty
  3054. // values are omitted from API requests. However, any field with an
  3055. // empty value appearing in NullFields will be sent to the server as
  3056. // null. It is an error if a field in this list has a non-empty value.
  3057. // This may be used to include null fields in Patch requests.
  3058. NullFields []string `json:"-"`
  3059. }
  3060. func (s *UpdateClusterRequest) MarshalJSON() ([]byte, error) {
  3061. type NoMethod UpdateClusterRequest
  3062. raw := NoMethod(*s)
  3063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3064. }
  3065. // UpdateMasterRequest: UpdateMasterRequest updates the master of the
  3066. // cluster.
  3067. type UpdateMasterRequest struct {
  3068. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3069. // This field has been deprecated and replaced by the name field.
  3070. ClusterId string `json:"clusterId,omitempty"`
  3071. // MasterVersion: The Kubernetes version to change the master to.
  3072. //
  3073. // Users may specify either explicit versions offered by
  3074. // Kubernetes Engine or version aliases, which have the following
  3075. // behavior:
  3076. //
  3077. // - "latest": picks the highest valid Kubernetes version
  3078. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  3079. // version
  3080. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  3081. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  3082. // - "-": picks the default Kubernetes version
  3083. MasterVersion string `json:"masterVersion,omitempty"`
  3084. // Name: The name (project, location, cluster) of the cluster to
  3085. // update.
  3086. // Specified in the format 'projects/*/locations/*/clusters/*'.
  3087. Name string `json:"name,omitempty"`
  3088. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3089. // project
  3090. // number](https://support.google.com/cloud/answer/6158840).
  3091. // This
  3092. // field has been deprecated and replaced by the name field.
  3093. ProjectId string `json:"projectId,omitempty"`
  3094. // Zone: Deprecated. The name of the Google Compute
  3095. // Engine
  3096. // [zone](/compute/docs/zones#available) in which the
  3097. // cluster
  3098. // resides.
  3099. // This field has been deprecated and replaced by the name field.
  3100. Zone string `json:"zone,omitempty"`
  3101. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3102. // unconditionally include in API requests. By default, fields with
  3103. // empty values are omitted from API requests. However, any non-pointer,
  3104. // non-interface field appearing in ForceSendFields will be sent to the
  3105. // server regardless of whether the field is empty or not. This may be
  3106. // used to include empty fields in Patch requests.
  3107. ForceSendFields []string `json:"-"`
  3108. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3109. // API requests with the JSON null value. By default, fields with empty
  3110. // values are omitted from API requests. However, any field with an
  3111. // empty value appearing in NullFields will be sent to the server as
  3112. // null. It is an error if a field in this list has a non-empty value.
  3113. // This may be used to include null fields in Patch requests.
  3114. NullFields []string `json:"-"`
  3115. }
  3116. func (s *UpdateMasterRequest) MarshalJSON() ([]byte, error) {
  3117. type NoMethod UpdateMasterRequest
  3118. raw := NoMethod(*s)
  3119. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3120. }
  3121. // UpdateNodePoolRequest: SetNodePoolVersionRequest updates the version
  3122. // of a node pool.
  3123. type UpdateNodePoolRequest struct {
  3124. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3125. // This field has been deprecated and replaced by the name field.
  3126. ClusterId string `json:"clusterId,omitempty"`
  3127. // ImageType: The desired image type for the node pool.
  3128. ImageType string `json:"imageType,omitempty"`
  3129. // Name: The name (project, location, cluster, node pool) of the node
  3130. // pool to
  3131. // update. Specified in the
  3132. // format
  3133. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  3134. Name string `json:"name,omitempty"`
  3135. // NodePoolId: Deprecated. The name of the node pool to upgrade.
  3136. // This field has been deprecated and replaced by the name field.
  3137. NodePoolId string `json:"nodePoolId,omitempty"`
  3138. // NodeVersion: The Kubernetes version to change the nodes to (typically
  3139. // an
  3140. // upgrade).
  3141. //
  3142. // Users may specify either explicit versions offered by Kubernetes
  3143. // Engine or
  3144. // version aliases, which have the following behavior:
  3145. //
  3146. // - "latest": picks the highest valid Kubernetes version
  3147. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  3148. // version
  3149. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  3150. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  3151. // - "-": picks the Kubernetes master version
  3152. NodeVersion string `json:"nodeVersion,omitempty"`
  3153. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3154. // project
  3155. // number](https://support.google.com/cloud/answer/6158840).
  3156. // This
  3157. // field has been deprecated and replaced by the name field.
  3158. ProjectId string `json:"projectId,omitempty"`
  3159. // Zone: Deprecated. The name of the Google Compute
  3160. // Engine
  3161. // [zone](/compute/docs/zones#available) in which the
  3162. // cluster
  3163. // resides.
  3164. // This field has been deprecated and replaced by the name field.
  3165. Zone string `json:"zone,omitempty"`
  3166. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3167. // unconditionally include in API requests. By default, fields with
  3168. // empty values are omitted from API requests. However, any non-pointer,
  3169. // non-interface field appearing in ForceSendFields will be sent to the
  3170. // server regardless of whether the field is empty or not. This may be
  3171. // used to include empty fields in Patch requests.
  3172. ForceSendFields []string `json:"-"`
  3173. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3174. // API requests with the JSON null value. By default, fields with empty
  3175. // values are omitted from API requests. However, any field with an
  3176. // empty value appearing in NullFields will be sent to the server as
  3177. // null. It is an error if a field in this list has a non-empty value.
  3178. // This may be used to include null fields in Patch requests.
  3179. NullFields []string `json:"-"`
  3180. }
  3181. func (s *UpdateNodePoolRequest) MarshalJSON() ([]byte, error) {
  3182. type NoMethod UpdateNodePoolRequest
  3183. raw := NoMethod(*s)
  3184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3185. }
  3186. // UsableSubnetwork: UsableSubnetwork resource returns the subnetwork
  3187. // name, its associated network
  3188. // and the primary CIDR range.
  3189. type UsableSubnetwork struct {
  3190. // IpCidrRange: The range of internal addresses that are owned by this
  3191. // subnetwork.
  3192. IpCidrRange string `json:"ipCidrRange,omitempty"`
  3193. // Network: Network Name.
  3194. // Example: projects/my-project/global/networks/my-network
  3195. Network string `json:"network,omitempty"`
  3196. // Subnetwork: Subnetwork Name.
  3197. // Example:
  3198. // projects/my-project/regions/us-central1/subnetworks/my-subnet
  3199. Subnetwork string `json:"subnetwork,omitempty"`
  3200. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  3201. // unconditionally include in API requests. By default, fields with
  3202. // empty values are omitted from API requests. However, any non-pointer,
  3203. // non-interface field appearing in ForceSendFields will be sent to the
  3204. // server regardless of whether the field is empty or not. This may be
  3205. // used to include empty fields in Patch requests.
  3206. ForceSendFields []string `json:"-"`
  3207. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  3208. // in API requests with the JSON null value. By default, fields with
  3209. // empty values are omitted from API requests. However, any field with
  3210. // an empty value appearing in NullFields will be sent to the server as
  3211. // null. It is an error if a field in this list has a non-empty value.
  3212. // This may be used to include null fields in Patch requests.
  3213. NullFields []string `json:"-"`
  3214. }
  3215. func (s *UsableSubnetwork) MarshalJSON() ([]byte, error) {
  3216. type NoMethod UsableSubnetwork
  3217. raw := NoMethod(*s)
  3218. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3219. }
  3220. // WorkloadMetadataConfig: WorkloadMetadataConfig defines the metadata
  3221. // configuration to expose to
  3222. // workloads on the node pool.
  3223. type WorkloadMetadataConfig struct {
  3224. // NodeMetadata: NodeMetadata is the configuration for how to expose the
  3225. // node metadata to
  3226. // the workload running on the node.
  3227. //
  3228. // Possible values:
  3229. // "UNSPECIFIED" - Not set.
  3230. // "SECURE" - Prevent workloads not in hostNetwork from accessing
  3231. // certain VM metadata,
  3232. // specifically kube-env, which contains Kubelet credentials, and
  3233. // the
  3234. // instance identity token.
  3235. //
  3236. // Metadata concealment is a temporary security solution available while
  3237. // the
  3238. // bootstrapping process for cluster nodes is being redesigned
  3239. // with
  3240. // significant security improvements. This feature is scheduled to
  3241. // be
  3242. // deprecated in the future and later removed.
  3243. // "EXPOSE" - Expose all VM metadata to pods.
  3244. NodeMetadata string `json:"nodeMetadata,omitempty"`
  3245. // ForceSendFields is a list of field names (e.g. "NodeMetadata") to
  3246. // unconditionally include in API requests. By default, fields with
  3247. // empty values are omitted from API requests. However, any non-pointer,
  3248. // non-interface field appearing in ForceSendFields will be sent to the
  3249. // server regardless of whether the field is empty or not. This may be
  3250. // used to include empty fields in Patch requests.
  3251. ForceSendFields []string `json:"-"`
  3252. // NullFields is a list of field names (e.g. "NodeMetadata") to include
  3253. // in API requests with the JSON null value. By default, fields with
  3254. // empty values are omitted from API requests. However, any field with
  3255. // an empty value appearing in NullFields will be sent to the server as
  3256. // null. It is an error if a field in this list has a non-empty value.
  3257. // This may be used to include null fields in Patch requests.
  3258. NullFields []string `json:"-"`
  3259. }
  3260. func (s *WorkloadMetadataConfig) MarshalJSON() ([]byte, error) {
  3261. type NoMethod WorkloadMetadataConfig
  3262. raw := NoMethod(*s)
  3263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3264. }
  3265. // method id "container.projects.aggregated.usableSubnetworks.list":
  3266. type ProjectsAggregatedUsableSubnetworksListCall struct {
  3267. s *Service
  3268. parent string
  3269. urlParams_ gensupport.URLParams
  3270. ifNoneMatch_ string
  3271. ctx_ context.Context
  3272. header_ http.Header
  3273. }
  3274. // List: Lists subnetworks that are usable for creating clusters in a
  3275. // project.
  3276. func (r *ProjectsAggregatedUsableSubnetworksService) List(parent string) *ProjectsAggregatedUsableSubnetworksListCall {
  3277. c := &ProjectsAggregatedUsableSubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3278. c.parent = parent
  3279. return c
  3280. }
  3281. // Filter sets the optional parameter "filter": Filtering currently only
  3282. // supports equality on the networkProjectId and must
  3283. // be in the form: "networkProjectId=[PROJECTID]", where
  3284. // `networkProjectId`
  3285. // is the project which owns the listed subnetworks. This defaults to
  3286. // the
  3287. // parent project ID.
  3288. func (c *ProjectsAggregatedUsableSubnetworksListCall) Filter(filter string) *ProjectsAggregatedUsableSubnetworksListCall {
  3289. c.urlParams_.Set("filter", filter)
  3290. return c
  3291. }
  3292. // PageSize sets the optional parameter "pageSize": The max number of
  3293. // results per page that should be returned. If the number
  3294. // of available results is larger than `page_size`, a `next_page_token`
  3295. // is
  3296. // returned which can be used to get the next page of results in
  3297. // subsequent
  3298. // requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
  3299. func (c *ProjectsAggregatedUsableSubnetworksListCall) PageSize(pageSize int64) *ProjectsAggregatedUsableSubnetworksListCall {
  3300. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3301. return c
  3302. }
  3303. // PageToken sets the optional parameter "pageToken": Specifies a page
  3304. // token to use. Set this to the nextPageToken returned by
  3305. // previous list requests to get the next page of results.
  3306. func (c *ProjectsAggregatedUsableSubnetworksListCall) PageToken(pageToken string) *ProjectsAggregatedUsableSubnetworksListCall {
  3307. c.urlParams_.Set("pageToken", pageToken)
  3308. return c
  3309. }
  3310. // Fields allows partial responses to be retrieved. See
  3311. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3312. // for more information.
  3313. func (c *ProjectsAggregatedUsableSubnetworksListCall) Fields(s ...googleapi.Field) *ProjectsAggregatedUsableSubnetworksListCall {
  3314. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3315. return c
  3316. }
  3317. // IfNoneMatch sets the optional parameter which makes the operation
  3318. // fail if the object's ETag matches the given value. This is useful for
  3319. // getting updates only after the object has changed since the last
  3320. // request. Use googleapi.IsNotModified to check whether the response
  3321. // error from Do is the result of In-None-Match.
  3322. func (c *ProjectsAggregatedUsableSubnetworksListCall) IfNoneMatch(entityTag string) *ProjectsAggregatedUsableSubnetworksListCall {
  3323. c.ifNoneMatch_ = entityTag
  3324. return c
  3325. }
  3326. // Context sets the context to be used in this call's Do method. Any
  3327. // pending HTTP request will be aborted if the provided context is
  3328. // canceled.
  3329. func (c *ProjectsAggregatedUsableSubnetworksListCall) Context(ctx context.Context) *ProjectsAggregatedUsableSubnetworksListCall {
  3330. c.ctx_ = ctx
  3331. return c
  3332. }
  3333. // Header returns an http.Header that can be modified by the caller to
  3334. // add HTTP headers to the request.
  3335. func (c *ProjectsAggregatedUsableSubnetworksListCall) Header() http.Header {
  3336. if c.header_ == nil {
  3337. c.header_ = make(http.Header)
  3338. }
  3339. return c.header_
  3340. }
  3341. func (c *ProjectsAggregatedUsableSubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  3342. reqHeaders := make(http.Header)
  3343. for k, v := range c.header_ {
  3344. reqHeaders[k] = v
  3345. }
  3346. reqHeaders.Set("User-Agent", c.s.userAgent())
  3347. if c.ifNoneMatch_ != "" {
  3348. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3349. }
  3350. var body io.Reader = nil
  3351. c.urlParams_.Set("alt", alt)
  3352. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/aggregated/usableSubnetworks")
  3353. urls += "?" + c.urlParams_.Encode()
  3354. req, _ := http.NewRequest("GET", urls, body)
  3355. req.Header = reqHeaders
  3356. googleapi.Expand(req.URL, map[string]string{
  3357. "parent": c.parent,
  3358. })
  3359. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3360. }
  3361. // Do executes the "container.projects.aggregated.usableSubnetworks.list" call.
  3362. // Exactly one of *ListUsableSubnetworksResponse or error will be
  3363. // non-nil. Any non-2xx status code is an error. Response headers are in
  3364. // either *ListUsableSubnetworksResponse.ServerResponse.Header or (if a
  3365. // response was returned at all) in error.(*googleapi.Error).Header. Use
  3366. // googleapi.IsNotModified to check whether the returned error was
  3367. // because http.StatusNotModified was returned.
  3368. func (c *ProjectsAggregatedUsableSubnetworksListCall) Do(opts ...googleapi.CallOption) (*ListUsableSubnetworksResponse, error) {
  3369. gensupport.SetOptions(c.urlParams_, opts...)
  3370. res, err := c.doRequest("json")
  3371. if res != nil && res.StatusCode == http.StatusNotModified {
  3372. if res.Body != nil {
  3373. res.Body.Close()
  3374. }
  3375. return nil, &googleapi.Error{
  3376. Code: res.StatusCode,
  3377. Header: res.Header,
  3378. }
  3379. }
  3380. if err != nil {
  3381. return nil, err
  3382. }
  3383. defer googleapi.CloseBody(res)
  3384. if err := googleapi.CheckResponse(res); err != nil {
  3385. return nil, err
  3386. }
  3387. ret := &ListUsableSubnetworksResponse{
  3388. ServerResponse: googleapi.ServerResponse{
  3389. Header: res.Header,
  3390. HTTPStatusCode: res.StatusCode,
  3391. },
  3392. }
  3393. target := &ret
  3394. if err := gensupport.DecodeResponse(target, res); err != nil {
  3395. return nil, err
  3396. }
  3397. return ret, nil
  3398. // {
  3399. // "description": "Lists subnetworks that are usable for creating clusters in a project.",
  3400. // "flatPath": "v1beta1/projects/{projectsId}/aggregated/usableSubnetworks",
  3401. // "httpMethod": "GET",
  3402. // "id": "container.projects.aggregated.usableSubnetworks.list",
  3403. // "parameterOrder": [
  3404. // "parent"
  3405. // ],
  3406. // "parameters": {
  3407. // "filter": {
  3408. // "description": "Filtering currently only supports equality on the networkProjectId and must\nbe in the form: \"networkProjectId=[PROJECTID]\", where `networkProjectId`\nis the project which owns the listed subnetworks. This defaults to the\nparent project ID.",
  3409. // "location": "query",
  3410. // "type": "string"
  3411. // },
  3412. // "pageSize": {
  3413. // "description": "The max number of results per page that should be returned. If the number\nof available results is larger than `page_size`, a `next_page_token` is\nreturned which can be used to get the next page of results in subsequent\nrequests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  3414. // "format": "int32",
  3415. // "location": "query",
  3416. // "type": "integer"
  3417. // },
  3418. // "pageToken": {
  3419. // "description": "Specifies a page token to use. Set this to the nextPageToken returned by\nprevious list requests to get the next page of results.",
  3420. // "location": "query",
  3421. // "type": "string"
  3422. // },
  3423. // "parent": {
  3424. // "description": "The parent project where subnetworks are usable.\nSpecified in the format 'projects/*'.",
  3425. // "location": "path",
  3426. // "pattern": "^projects/[^/]+$",
  3427. // "required": true,
  3428. // "type": "string"
  3429. // }
  3430. // },
  3431. // "path": "v1beta1/{+parent}/aggregated/usableSubnetworks",
  3432. // "response": {
  3433. // "$ref": "ListUsableSubnetworksResponse"
  3434. // },
  3435. // "scopes": [
  3436. // "https://www.googleapis.com/auth/cloud-platform"
  3437. // ]
  3438. // }
  3439. }
  3440. // Pages invokes f for each page of results.
  3441. // A non-nil error returned from f will halt the iteration.
  3442. // The provided context supersedes any context provided to the Context method.
  3443. func (c *ProjectsAggregatedUsableSubnetworksListCall) Pages(ctx context.Context, f func(*ListUsableSubnetworksResponse) error) error {
  3444. c.ctx_ = ctx
  3445. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3446. for {
  3447. x, err := c.Do()
  3448. if err != nil {
  3449. return err
  3450. }
  3451. if err := f(x); err != nil {
  3452. return err
  3453. }
  3454. if x.NextPageToken == "" {
  3455. return nil
  3456. }
  3457. c.PageToken(x.NextPageToken)
  3458. }
  3459. }
  3460. // method id "container.projects.locations.getServerConfig":
  3461. type ProjectsLocationsGetServerConfigCall struct {
  3462. s *Service
  3463. name string
  3464. urlParams_ gensupport.URLParams
  3465. ifNoneMatch_ string
  3466. ctx_ context.Context
  3467. header_ http.Header
  3468. }
  3469. // GetServerConfig: Returns configuration info about the Kubernetes
  3470. // Engine service.
  3471. func (r *ProjectsLocationsService) GetServerConfig(name string) *ProjectsLocationsGetServerConfigCall {
  3472. c := &ProjectsLocationsGetServerConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3473. c.name = name
  3474. return c
  3475. }
  3476. // ProjectId sets the optional parameter "projectId": Deprecated. The
  3477. // Google Developers Console [project ID or
  3478. // project
  3479. // number](https://support.google.com/cloud/answer/6158840).
  3480. // This
  3481. // field has been deprecated and replaced by the name field.
  3482. func (c *ProjectsLocationsGetServerConfigCall) ProjectId(projectId string) *ProjectsLocationsGetServerConfigCall {
  3483. c.urlParams_.Set("projectId", projectId)
  3484. return c
  3485. }
  3486. // Zone sets the optional parameter "zone": Deprecated. The name of the
  3487. // Google Compute Engine
  3488. // [zone](/compute/docs/zones#available) to return operations for.
  3489. // This field has been deprecated and replaced by the name field.
  3490. func (c *ProjectsLocationsGetServerConfigCall) Zone(zone string) *ProjectsLocationsGetServerConfigCall {
  3491. c.urlParams_.Set("zone", zone)
  3492. return c
  3493. }
  3494. // Fields allows partial responses to be retrieved. See
  3495. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3496. // for more information.
  3497. func (c *ProjectsLocationsGetServerConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetServerConfigCall {
  3498. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3499. return c
  3500. }
  3501. // IfNoneMatch sets the optional parameter which makes the operation
  3502. // fail if the object's ETag matches the given value. This is useful for
  3503. // getting updates only after the object has changed since the last
  3504. // request. Use googleapi.IsNotModified to check whether the response
  3505. // error from Do is the result of In-None-Match.
  3506. func (c *ProjectsLocationsGetServerConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetServerConfigCall {
  3507. c.ifNoneMatch_ = entityTag
  3508. return c
  3509. }
  3510. // Context sets the context to be used in this call's Do method. Any
  3511. // pending HTTP request will be aborted if the provided context is
  3512. // canceled.
  3513. func (c *ProjectsLocationsGetServerConfigCall) Context(ctx context.Context) *ProjectsLocationsGetServerConfigCall {
  3514. c.ctx_ = ctx
  3515. return c
  3516. }
  3517. // Header returns an http.Header that can be modified by the caller to
  3518. // add HTTP headers to the request.
  3519. func (c *ProjectsLocationsGetServerConfigCall) Header() http.Header {
  3520. if c.header_ == nil {
  3521. c.header_ = make(http.Header)
  3522. }
  3523. return c.header_
  3524. }
  3525. func (c *ProjectsLocationsGetServerConfigCall) doRequest(alt string) (*http.Response, error) {
  3526. reqHeaders := make(http.Header)
  3527. for k, v := range c.header_ {
  3528. reqHeaders[k] = v
  3529. }
  3530. reqHeaders.Set("User-Agent", c.s.userAgent())
  3531. if c.ifNoneMatch_ != "" {
  3532. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3533. }
  3534. var body io.Reader = nil
  3535. c.urlParams_.Set("alt", alt)
  3536. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/serverConfig")
  3537. urls += "?" + c.urlParams_.Encode()
  3538. req, _ := http.NewRequest("GET", urls, body)
  3539. req.Header = reqHeaders
  3540. googleapi.Expand(req.URL, map[string]string{
  3541. "name": c.name,
  3542. })
  3543. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3544. }
  3545. // Do executes the "container.projects.locations.getServerConfig" call.
  3546. // Exactly one of *ServerConfig or error will be non-nil. Any non-2xx
  3547. // status code is an error. Response headers are in either
  3548. // *ServerConfig.ServerResponse.Header or (if a response was returned at
  3549. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3550. // to check whether the returned error was because
  3551. // http.StatusNotModified was returned.
  3552. func (c *ProjectsLocationsGetServerConfigCall) Do(opts ...googleapi.CallOption) (*ServerConfig, error) {
  3553. gensupport.SetOptions(c.urlParams_, opts...)
  3554. res, err := c.doRequest("json")
  3555. if res != nil && res.StatusCode == http.StatusNotModified {
  3556. if res.Body != nil {
  3557. res.Body.Close()
  3558. }
  3559. return nil, &googleapi.Error{
  3560. Code: res.StatusCode,
  3561. Header: res.Header,
  3562. }
  3563. }
  3564. if err != nil {
  3565. return nil, err
  3566. }
  3567. defer googleapi.CloseBody(res)
  3568. if err := googleapi.CheckResponse(res); err != nil {
  3569. return nil, err
  3570. }
  3571. ret := &ServerConfig{
  3572. ServerResponse: googleapi.ServerResponse{
  3573. Header: res.Header,
  3574. HTTPStatusCode: res.StatusCode,
  3575. },
  3576. }
  3577. target := &ret
  3578. if err := gensupport.DecodeResponse(target, res); err != nil {
  3579. return nil, err
  3580. }
  3581. return ret, nil
  3582. // {
  3583. // "description": "Returns configuration info about the Kubernetes Engine service.",
  3584. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/serverConfig",
  3585. // "httpMethod": "GET",
  3586. // "id": "container.projects.locations.getServerConfig",
  3587. // "parameterOrder": [
  3588. // "name"
  3589. // ],
  3590. // "parameters": {
  3591. // "name": {
  3592. // "description": "The name (project and location) of the server config to get\nSpecified in the format 'projects/*/locations/*'.",
  3593. // "location": "path",
  3594. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  3595. // "required": true,
  3596. // "type": "string"
  3597. // },
  3598. // "projectId": {
  3599. // "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.",
  3600. // "location": "query",
  3601. // "type": "string"
  3602. // },
  3603. // "zone": {
  3604. // "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.",
  3605. // "location": "query",
  3606. // "type": "string"
  3607. // }
  3608. // },
  3609. // "path": "v1beta1/{+name}/serverConfig",
  3610. // "response": {
  3611. // "$ref": "ServerConfig"
  3612. // },
  3613. // "scopes": [
  3614. // "https://www.googleapis.com/auth/cloud-platform"
  3615. // ]
  3616. // }
  3617. }
  3618. // method id "container.projects.locations.list":
  3619. type ProjectsLocationsListCall struct {
  3620. s *Service
  3621. parent string
  3622. urlParams_ gensupport.URLParams
  3623. ifNoneMatch_ string
  3624. ctx_ context.Context
  3625. header_ http.Header
  3626. }
  3627. // List:
  3628. func (r *ProjectsLocationsService) List(parent string) *ProjectsLocationsListCall {
  3629. c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3630. c.parent = parent
  3631. return c
  3632. }
  3633. // Fields allows partial responses to be retrieved. See
  3634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3635. // for more information.
  3636. func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
  3637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3638. return c
  3639. }
  3640. // IfNoneMatch sets the optional parameter which makes the operation
  3641. // fail if the object's ETag matches the given value. This is useful for
  3642. // getting updates only after the object has changed since the last
  3643. // request. Use googleapi.IsNotModified to check whether the response
  3644. // error from Do is the result of In-None-Match.
  3645. func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  3646. c.ifNoneMatch_ = entityTag
  3647. return c
  3648. }
  3649. // Context sets the context to be used in this call's Do method. Any
  3650. // pending HTTP request will be aborted if the provided context is
  3651. // canceled.
  3652. func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  3653. c.ctx_ = ctx
  3654. return c
  3655. }
  3656. // Header returns an http.Header that can be modified by the caller to
  3657. // add HTTP headers to the request.
  3658. func (c *ProjectsLocationsListCall) Header() http.Header {
  3659. if c.header_ == nil {
  3660. c.header_ = make(http.Header)
  3661. }
  3662. return c.header_
  3663. }
  3664. func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  3665. reqHeaders := make(http.Header)
  3666. for k, v := range c.header_ {
  3667. reqHeaders[k] = v
  3668. }
  3669. reqHeaders.Set("User-Agent", c.s.userAgent())
  3670. if c.ifNoneMatch_ != "" {
  3671. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3672. }
  3673. var body io.Reader = nil
  3674. c.urlParams_.Set("alt", alt)
  3675. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/locations")
  3676. urls += "?" + c.urlParams_.Encode()
  3677. req, _ := http.NewRequest("GET", urls, body)
  3678. req.Header = reqHeaders
  3679. googleapi.Expand(req.URL, map[string]string{
  3680. "parent": c.parent,
  3681. })
  3682. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3683. }
  3684. // Do executes the "container.projects.locations.list" call.
  3685. // Exactly one of *ListLocationsResponse or error will be non-nil. Any
  3686. // non-2xx status code is an error. Response headers are in either
  3687. // *ListLocationsResponse.ServerResponse.Header or (if a response was
  3688. // returned at all) in error.(*googleapi.Error).Header. Use
  3689. // googleapi.IsNotModified to check whether the returned error was
  3690. // because http.StatusNotModified was returned.
  3691. func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  3692. gensupport.SetOptions(c.urlParams_, opts...)
  3693. res, err := c.doRequest("json")
  3694. if res != nil && res.StatusCode == http.StatusNotModified {
  3695. if res.Body != nil {
  3696. res.Body.Close()
  3697. }
  3698. return nil, &googleapi.Error{
  3699. Code: res.StatusCode,
  3700. Header: res.Header,
  3701. }
  3702. }
  3703. if err != nil {
  3704. return nil, err
  3705. }
  3706. defer googleapi.CloseBody(res)
  3707. if err := googleapi.CheckResponse(res); err != nil {
  3708. return nil, err
  3709. }
  3710. ret := &ListLocationsResponse{
  3711. ServerResponse: googleapi.ServerResponse{
  3712. Header: res.Header,
  3713. HTTPStatusCode: res.StatusCode,
  3714. },
  3715. }
  3716. target := &ret
  3717. if err := gensupport.DecodeResponse(target, res); err != nil {
  3718. return nil, err
  3719. }
  3720. return ret, nil
  3721. // {
  3722. // "description": "",
  3723. // "flatPath": "v1beta1/projects/{projectsId}/locations",
  3724. // "httpMethod": "GET",
  3725. // "id": "container.projects.locations.list",
  3726. // "parameterOrder": [
  3727. // "parent"
  3728. // ],
  3729. // "parameters": {
  3730. // "parent": {
  3731. // "description": "Contains the name of the resource requested.\nSpecific in the format 'projects/*/locations'.",
  3732. // "location": "path",
  3733. // "pattern": "^projects/[^/]+$",
  3734. // "required": true,
  3735. // "type": "string"
  3736. // }
  3737. // },
  3738. // "path": "v1beta1/{+parent}/locations",
  3739. // "response": {
  3740. // "$ref": "ListLocationsResponse"
  3741. // },
  3742. // "scopes": [
  3743. // "https://www.googleapis.com/auth/cloud-platform"
  3744. // ]
  3745. // }
  3746. }
  3747. // method id "container.projects.locations.clusters.completeIpRotation":
  3748. type ProjectsLocationsClustersCompleteIpRotationCall struct {
  3749. s *Service
  3750. name string
  3751. completeiprotationrequest *CompleteIPRotationRequest
  3752. urlParams_ gensupport.URLParams
  3753. ctx_ context.Context
  3754. header_ http.Header
  3755. }
  3756. // CompleteIpRotation: Completes master IP rotation.
  3757. func (r *ProjectsLocationsClustersService) CompleteIpRotation(name string, completeiprotationrequest *CompleteIPRotationRequest) *ProjectsLocationsClustersCompleteIpRotationCall {
  3758. c := &ProjectsLocationsClustersCompleteIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3759. c.name = name
  3760. c.completeiprotationrequest = completeiprotationrequest
  3761. return c
  3762. }
  3763. // Fields allows partial responses to be retrieved. See
  3764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3765. // for more information.
  3766. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersCompleteIpRotationCall {
  3767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3768. return c
  3769. }
  3770. // Context sets the context to be used in this call's Do method. Any
  3771. // pending HTTP request will be aborted if the provided context is
  3772. // canceled.
  3773. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Context(ctx context.Context) *ProjectsLocationsClustersCompleteIpRotationCall {
  3774. c.ctx_ = ctx
  3775. return c
  3776. }
  3777. // Header returns an http.Header that can be modified by the caller to
  3778. // add HTTP headers to the request.
  3779. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Header() http.Header {
  3780. if c.header_ == nil {
  3781. c.header_ = make(http.Header)
  3782. }
  3783. return c.header_
  3784. }
  3785. func (c *ProjectsLocationsClustersCompleteIpRotationCall) doRequest(alt string) (*http.Response, error) {
  3786. reqHeaders := make(http.Header)
  3787. for k, v := range c.header_ {
  3788. reqHeaders[k] = v
  3789. }
  3790. reqHeaders.Set("User-Agent", c.s.userAgent())
  3791. var body io.Reader = nil
  3792. body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeiprotationrequest)
  3793. if err != nil {
  3794. return nil, err
  3795. }
  3796. reqHeaders.Set("Content-Type", "application/json")
  3797. c.urlParams_.Set("alt", alt)
  3798. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:completeIpRotation")
  3799. urls += "?" + c.urlParams_.Encode()
  3800. req, _ := http.NewRequest("POST", urls, body)
  3801. req.Header = reqHeaders
  3802. googleapi.Expand(req.URL, map[string]string{
  3803. "name": c.name,
  3804. })
  3805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3806. }
  3807. // Do executes the "container.projects.locations.clusters.completeIpRotation" call.
  3808. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3809. // status code is an error. Response headers are in either
  3810. // *Operation.ServerResponse.Header or (if a response was returned at
  3811. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3812. // to check whether the returned error was because
  3813. // http.StatusNotModified was returned.
  3814. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3815. gensupport.SetOptions(c.urlParams_, opts...)
  3816. res, err := c.doRequest("json")
  3817. if res != nil && res.StatusCode == http.StatusNotModified {
  3818. if res.Body != nil {
  3819. res.Body.Close()
  3820. }
  3821. return nil, &googleapi.Error{
  3822. Code: res.StatusCode,
  3823. Header: res.Header,
  3824. }
  3825. }
  3826. if err != nil {
  3827. return nil, err
  3828. }
  3829. defer googleapi.CloseBody(res)
  3830. if err := googleapi.CheckResponse(res); err != nil {
  3831. return nil, err
  3832. }
  3833. ret := &Operation{
  3834. ServerResponse: googleapi.ServerResponse{
  3835. Header: res.Header,
  3836. HTTPStatusCode: res.StatusCode,
  3837. },
  3838. }
  3839. target := &ret
  3840. if err := gensupport.DecodeResponse(target, res); err != nil {
  3841. return nil, err
  3842. }
  3843. return ret, nil
  3844. // {
  3845. // "description": "Completes master IP rotation.",
  3846. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:completeIpRotation",
  3847. // "httpMethod": "POST",
  3848. // "id": "container.projects.locations.clusters.completeIpRotation",
  3849. // "parameterOrder": [
  3850. // "name"
  3851. // ],
  3852. // "parameters": {
  3853. // "name": {
  3854. // "description": "The name (project, location, cluster id) of the cluster to complete IP\nrotation. Specified in the format 'projects/*/locations/*/clusters/*'.",
  3855. // "location": "path",
  3856. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  3857. // "required": true,
  3858. // "type": "string"
  3859. // }
  3860. // },
  3861. // "path": "v1beta1/{+name}:completeIpRotation",
  3862. // "request": {
  3863. // "$ref": "CompleteIPRotationRequest"
  3864. // },
  3865. // "response": {
  3866. // "$ref": "Operation"
  3867. // },
  3868. // "scopes": [
  3869. // "https://www.googleapis.com/auth/cloud-platform"
  3870. // ]
  3871. // }
  3872. }
  3873. // method id "container.projects.locations.clusters.create":
  3874. type ProjectsLocationsClustersCreateCall struct {
  3875. s *Service
  3876. parent string
  3877. createclusterrequest *CreateClusterRequest
  3878. urlParams_ gensupport.URLParams
  3879. ctx_ context.Context
  3880. header_ http.Header
  3881. }
  3882. // Create: Creates a cluster, consisting of the specified number and
  3883. // type of Google
  3884. // Compute Engine instances.
  3885. //
  3886. // By default, the cluster is created in the project's
  3887. // [default
  3888. // network](/compute/docs/networks-and-firewalls#networks).
  3889. //
  3890. // One firewall is added for the cluster. After cluster creation,
  3891. // the cluster creates routes for each node to allow the containers
  3892. // on that node to communicate with all other instances in
  3893. // the
  3894. // cluster.
  3895. //
  3896. // Finally, an entry is added to the project's global metadata
  3897. // indicating
  3898. // which CIDR range is being used by the cluster.
  3899. func (r *ProjectsLocationsClustersService) Create(parent string, createclusterrequest *CreateClusterRequest) *ProjectsLocationsClustersCreateCall {
  3900. c := &ProjectsLocationsClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3901. c.parent = parent
  3902. c.createclusterrequest = createclusterrequest
  3903. return c
  3904. }
  3905. // Fields allows partial responses to be retrieved. See
  3906. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3907. // for more information.
  3908. func (c *ProjectsLocationsClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersCreateCall {
  3909. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3910. return c
  3911. }
  3912. // Context sets the context to be used in this call's Do method. Any
  3913. // pending HTTP request will be aborted if the provided context is
  3914. // canceled.
  3915. func (c *ProjectsLocationsClustersCreateCall) Context(ctx context.Context) *ProjectsLocationsClustersCreateCall {
  3916. c.ctx_ = ctx
  3917. return c
  3918. }
  3919. // Header returns an http.Header that can be modified by the caller to
  3920. // add HTTP headers to the request.
  3921. func (c *ProjectsLocationsClustersCreateCall) Header() http.Header {
  3922. if c.header_ == nil {
  3923. c.header_ = make(http.Header)
  3924. }
  3925. return c.header_
  3926. }
  3927. func (c *ProjectsLocationsClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  3928. reqHeaders := make(http.Header)
  3929. for k, v := range c.header_ {
  3930. reqHeaders[k] = v
  3931. }
  3932. reqHeaders.Set("User-Agent", c.s.userAgent())
  3933. var body io.Reader = nil
  3934. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest)
  3935. if err != nil {
  3936. return nil, err
  3937. }
  3938. reqHeaders.Set("Content-Type", "application/json")
  3939. c.urlParams_.Set("alt", alt)
  3940. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/clusters")
  3941. urls += "?" + c.urlParams_.Encode()
  3942. req, _ := http.NewRequest("POST", urls, body)
  3943. req.Header = reqHeaders
  3944. googleapi.Expand(req.URL, map[string]string{
  3945. "parent": c.parent,
  3946. })
  3947. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3948. }
  3949. // Do executes the "container.projects.locations.clusters.create" call.
  3950. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3951. // status code is an error. Response headers are in either
  3952. // *Operation.ServerResponse.Header or (if a response was returned at
  3953. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3954. // to check whether the returned error was because
  3955. // http.StatusNotModified was returned.
  3956. func (c *ProjectsLocationsClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3957. gensupport.SetOptions(c.urlParams_, opts...)
  3958. res, err := c.doRequest("json")
  3959. if res != nil && res.StatusCode == http.StatusNotModified {
  3960. if res.Body != nil {
  3961. res.Body.Close()
  3962. }
  3963. return nil, &googleapi.Error{
  3964. Code: res.StatusCode,
  3965. Header: res.Header,
  3966. }
  3967. }
  3968. if err != nil {
  3969. return nil, err
  3970. }
  3971. defer googleapi.CloseBody(res)
  3972. if err := googleapi.CheckResponse(res); err != nil {
  3973. return nil, err
  3974. }
  3975. ret := &Operation{
  3976. ServerResponse: googleapi.ServerResponse{
  3977. Header: res.Header,
  3978. HTTPStatusCode: res.StatusCode,
  3979. },
  3980. }
  3981. target := &ret
  3982. if err := gensupport.DecodeResponse(target, res); err != nil {
  3983. return nil, err
  3984. }
  3985. return ret, nil
  3986. // {
  3987. // "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.",
  3988. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters",
  3989. // "httpMethod": "POST",
  3990. // "id": "container.projects.locations.clusters.create",
  3991. // "parameterOrder": [
  3992. // "parent"
  3993. // ],
  3994. // "parameters": {
  3995. // "parent": {
  3996. // "description": "The parent (project and location) where the cluster will be created.\nSpecified in the format 'projects/*/locations/*'.",
  3997. // "location": "path",
  3998. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  3999. // "required": true,
  4000. // "type": "string"
  4001. // }
  4002. // },
  4003. // "path": "v1beta1/{+parent}/clusters",
  4004. // "request": {
  4005. // "$ref": "CreateClusterRequest"
  4006. // },
  4007. // "response": {
  4008. // "$ref": "Operation"
  4009. // },
  4010. // "scopes": [
  4011. // "https://www.googleapis.com/auth/cloud-platform"
  4012. // ]
  4013. // }
  4014. }
  4015. // method id "container.projects.locations.clusters.delete":
  4016. type ProjectsLocationsClustersDeleteCall struct {
  4017. s *Service
  4018. name string
  4019. urlParams_ gensupport.URLParams
  4020. ctx_ context.Context
  4021. header_ http.Header
  4022. }
  4023. // Delete: Deletes the cluster, including the Kubernetes endpoint and
  4024. // all worker
  4025. // nodes.
  4026. //
  4027. // Firewalls and routes that were configured during cluster creation
  4028. // are also deleted.
  4029. //
  4030. // Other Google Compute Engine resources that might be in use by the
  4031. // cluster
  4032. // (e.g. load balancer resources) will not be deleted if they weren't
  4033. // present
  4034. // at the initial create time.
  4035. func (r *ProjectsLocationsClustersService) Delete(name string) *ProjectsLocationsClustersDeleteCall {
  4036. c := &ProjectsLocationsClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4037. c.name = name
  4038. return c
  4039. }
  4040. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  4041. // name of the cluster to delete.
  4042. // This field has been deprecated and replaced by the name field.
  4043. func (c *ProjectsLocationsClustersDeleteCall) ClusterId(clusterId string) *ProjectsLocationsClustersDeleteCall {
  4044. c.urlParams_.Set("clusterId", clusterId)
  4045. return c
  4046. }
  4047. // ProjectId sets the optional parameter "projectId": Deprecated. The
  4048. // Google Developers Console [project ID or
  4049. // project
  4050. // number](https://support.google.com/cloud/answer/6158840).
  4051. // This
  4052. // field has been deprecated and replaced by the name field.
  4053. func (c *ProjectsLocationsClustersDeleteCall) ProjectId(projectId string) *ProjectsLocationsClustersDeleteCall {
  4054. c.urlParams_.Set("projectId", projectId)
  4055. return c
  4056. }
  4057. // Zone sets the optional parameter "zone": Deprecated. The name of the
  4058. // Google Compute Engine
  4059. // [zone](/compute/docs/zones#available) in which the
  4060. // cluster
  4061. // resides.
  4062. // This field has been deprecated and replaced by the name field.
  4063. func (c *ProjectsLocationsClustersDeleteCall) Zone(zone string) *ProjectsLocationsClustersDeleteCall {
  4064. c.urlParams_.Set("zone", zone)
  4065. return c
  4066. }
  4067. // Fields allows partial responses to be retrieved. See
  4068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4069. // for more information.
  4070. func (c *ProjectsLocationsClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersDeleteCall {
  4071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4072. return c
  4073. }
  4074. // Context sets the context to be used in this call's Do method. Any
  4075. // pending HTTP request will be aborted if the provided context is
  4076. // canceled.
  4077. func (c *ProjectsLocationsClustersDeleteCall) Context(ctx context.Context) *ProjectsLocationsClustersDeleteCall {
  4078. c.ctx_ = ctx
  4079. return c
  4080. }
  4081. // Header returns an http.Header that can be modified by the caller to
  4082. // add HTTP headers to the request.
  4083. func (c *ProjectsLocationsClustersDeleteCall) Header() http.Header {
  4084. if c.header_ == nil {
  4085. c.header_ = make(http.Header)
  4086. }
  4087. return c.header_
  4088. }
  4089. func (c *ProjectsLocationsClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  4090. reqHeaders := make(http.Header)
  4091. for k, v := range c.header_ {
  4092. reqHeaders[k] = v
  4093. }
  4094. reqHeaders.Set("User-Agent", c.s.userAgent())
  4095. var body io.Reader = nil
  4096. c.urlParams_.Set("alt", alt)
  4097. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  4098. urls += "?" + c.urlParams_.Encode()
  4099. req, _ := http.NewRequest("DELETE", urls, body)
  4100. req.Header = reqHeaders
  4101. googleapi.Expand(req.URL, map[string]string{
  4102. "name": c.name,
  4103. })
  4104. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4105. }
  4106. // Do executes the "container.projects.locations.clusters.delete" call.
  4107. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4108. // status code is an error. Response headers are in either
  4109. // *Operation.ServerResponse.Header or (if a response was returned at
  4110. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4111. // to check whether the returned error was because
  4112. // http.StatusNotModified was returned.
  4113. func (c *ProjectsLocationsClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4114. gensupport.SetOptions(c.urlParams_, opts...)
  4115. res, err := c.doRequest("json")
  4116. if res != nil && res.StatusCode == http.StatusNotModified {
  4117. if res.Body != nil {
  4118. res.Body.Close()
  4119. }
  4120. return nil, &googleapi.Error{
  4121. Code: res.StatusCode,
  4122. Header: res.Header,
  4123. }
  4124. }
  4125. if err != nil {
  4126. return nil, err
  4127. }
  4128. defer googleapi.CloseBody(res)
  4129. if err := googleapi.CheckResponse(res); err != nil {
  4130. return nil, err
  4131. }
  4132. ret := &Operation{
  4133. ServerResponse: googleapi.ServerResponse{
  4134. Header: res.Header,
  4135. HTTPStatusCode: res.StatusCode,
  4136. },
  4137. }
  4138. target := &ret
  4139. if err := gensupport.DecodeResponse(target, res); err != nil {
  4140. return nil, err
  4141. }
  4142. return ret, nil
  4143. // {
  4144. // "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.",
  4145. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
  4146. // "httpMethod": "DELETE",
  4147. // "id": "container.projects.locations.clusters.delete",
  4148. // "parameterOrder": [
  4149. // "name"
  4150. // ],
  4151. // "parameters": {
  4152. // "clusterId": {
  4153. // "description": "Deprecated. The name of the cluster to delete.\nThis field has been deprecated and replaced by the name field.",
  4154. // "location": "query",
  4155. // "type": "string"
  4156. // },
  4157. // "name": {
  4158. // "description": "The name (project, location, cluster) of the cluster to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4159. // "location": "path",
  4160. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4161. // "required": true,
  4162. // "type": "string"
  4163. // },
  4164. // "projectId": {
  4165. // "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.",
  4166. // "location": "query",
  4167. // "type": "string"
  4168. // },
  4169. // "zone": {
  4170. // "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.",
  4171. // "location": "query",
  4172. // "type": "string"
  4173. // }
  4174. // },
  4175. // "path": "v1beta1/{+name}",
  4176. // "response": {
  4177. // "$ref": "Operation"
  4178. // },
  4179. // "scopes": [
  4180. // "https://www.googleapis.com/auth/cloud-platform"
  4181. // ]
  4182. // }
  4183. }
  4184. // method id "container.projects.locations.clusters.get":
  4185. type ProjectsLocationsClustersGetCall struct {
  4186. s *Service
  4187. name string
  4188. urlParams_ gensupport.URLParams
  4189. ifNoneMatch_ string
  4190. ctx_ context.Context
  4191. header_ http.Header
  4192. }
  4193. // Get: Gets the details for a specific cluster.
  4194. func (r *ProjectsLocationsClustersService) Get(name string) *ProjectsLocationsClustersGetCall {
  4195. c := &ProjectsLocationsClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4196. c.name = name
  4197. return c
  4198. }
  4199. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  4200. // name of the cluster to retrieve.
  4201. // This field has been deprecated and replaced by the name field.
  4202. func (c *ProjectsLocationsClustersGetCall) ClusterId(clusterId string) *ProjectsLocationsClustersGetCall {
  4203. c.urlParams_.Set("clusterId", clusterId)
  4204. return c
  4205. }
  4206. // ProjectId sets the optional parameter "projectId": Deprecated. The
  4207. // Google Developers Console [project ID or
  4208. // project
  4209. // number](https://support.google.com/cloud/answer/6158840).
  4210. // This
  4211. // field has been deprecated and replaced by the name field.
  4212. func (c *ProjectsLocationsClustersGetCall) ProjectId(projectId string) *ProjectsLocationsClustersGetCall {
  4213. c.urlParams_.Set("projectId", projectId)
  4214. return c
  4215. }
  4216. // Zone sets the optional parameter "zone": Deprecated. The name of the
  4217. // Google Compute Engine
  4218. // [zone](/compute/docs/zones#available) in which the
  4219. // cluster
  4220. // resides.
  4221. // This field has been deprecated and replaced by the name field.
  4222. func (c *ProjectsLocationsClustersGetCall) Zone(zone string) *ProjectsLocationsClustersGetCall {
  4223. c.urlParams_.Set("zone", zone)
  4224. return c
  4225. }
  4226. // Fields allows partial responses to be retrieved. See
  4227. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4228. // for more information.
  4229. func (c *ProjectsLocationsClustersGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersGetCall {
  4230. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4231. return c
  4232. }
  4233. // IfNoneMatch sets the optional parameter which makes the operation
  4234. // fail if the object's ETag matches the given value. This is useful for
  4235. // getting updates only after the object has changed since the last
  4236. // request. Use googleapi.IsNotModified to check whether the response
  4237. // error from Do is the result of In-None-Match.
  4238. func (c *ProjectsLocationsClustersGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersGetCall {
  4239. c.ifNoneMatch_ = entityTag
  4240. return c
  4241. }
  4242. // Context sets the context to be used in this call's Do method. Any
  4243. // pending HTTP request will be aborted if the provided context is
  4244. // canceled.
  4245. func (c *ProjectsLocationsClustersGetCall) Context(ctx context.Context) *ProjectsLocationsClustersGetCall {
  4246. c.ctx_ = ctx
  4247. return c
  4248. }
  4249. // Header returns an http.Header that can be modified by the caller to
  4250. // add HTTP headers to the request.
  4251. func (c *ProjectsLocationsClustersGetCall) Header() http.Header {
  4252. if c.header_ == nil {
  4253. c.header_ = make(http.Header)
  4254. }
  4255. return c.header_
  4256. }
  4257. func (c *ProjectsLocationsClustersGetCall) doRequest(alt string) (*http.Response, error) {
  4258. reqHeaders := make(http.Header)
  4259. for k, v := range c.header_ {
  4260. reqHeaders[k] = v
  4261. }
  4262. reqHeaders.Set("User-Agent", c.s.userAgent())
  4263. if c.ifNoneMatch_ != "" {
  4264. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4265. }
  4266. var body io.Reader = nil
  4267. c.urlParams_.Set("alt", alt)
  4268. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  4269. urls += "?" + c.urlParams_.Encode()
  4270. req, _ := http.NewRequest("GET", urls, body)
  4271. req.Header = reqHeaders
  4272. googleapi.Expand(req.URL, map[string]string{
  4273. "name": c.name,
  4274. })
  4275. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4276. }
  4277. // Do executes the "container.projects.locations.clusters.get" call.
  4278. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  4279. // code is an error. Response headers are in either
  4280. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  4281. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4282. // check whether the returned error was because http.StatusNotModified
  4283. // was returned.
  4284. func (c *ProjectsLocationsClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  4285. gensupport.SetOptions(c.urlParams_, opts...)
  4286. res, err := c.doRequest("json")
  4287. if res != nil && res.StatusCode == http.StatusNotModified {
  4288. if res.Body != nil {
  4289. res.Body.Close()
  4290. }
  4291. return nil, &googleapi.Error{
  4292. Code: res.StatusCode,
  4293. Header: res.Header,
  4294. }
  4295. }
  4296. if err != nil {
  4297. return nil, err
  4298. }
  4299. defer googleapi.CloseBody(res)
  4300. if err := googleapi.CheckResponse(res); err != nil {
  4301. return nil, err
  4302. }
  4303. ret := &Cluster{
  4304. ServerResponse: googleapi.ServerResponse{
  4305. Header: res.Header,
  4306. HTTPStatusCode: res.StatusCode,
  4307. },
  4308. }
  4309. target := &ret
  4310. if err := gensupport.DecodeResponse(target, res); err != nil {
  4311. return nil, err
  4312. }
  4313. return ret, nil
  4314. // {
  4315. // "description": "Gets the details for a specific cluster.",
  4316. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
  4317. // "httpMethod": "GET",
  4318. // "id": "container.projects.locations.clusters.get",
  4319. // "parameterOrder": [
  4320. // "name"
  4321. // ],
  4322. // "parameters": {
  4323. // "clusterId": {
  4324. // "description": "Deprecated. The name of the cluster to retrieve.\nThis field has been deprecated and replaced by the name field.",
  4325. // "location": "query",
  4326. // "type": "string"
  4327. // },
  4328. // "name": {
  4329. // "description": "The name (project, location, cluster) of the cluster to retrieve.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4330. // "location": "path",
  4331. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4332. // "required": true,
  4333. // "type": "string"
  4334. // },
  4335. // "projectId": {
  4336. // "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.",
  4337. // "location": "query",
  4338. // "type": "string"
  4339. // },
  4340. // "zone": {
  4341. // "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.",
  4342. // "location": "query",
  4343. // "type": "string"
  4344. // }
  4345. // },
  4346. // "path": "v1beta1/{+name}",
  4347. // "response": {
  4348. // "$ref": "Cluster"
  4349. // },
  4350. // "scopes": [
  4351. // "https://www.googleapis.com/auth/cloud-platform"
  4352. // ]
  4353. // }
  4354. }
  4355. // method id "container.projects.locations.clusters.list":
  4356. type ProjectsLocationsClustersListCall struct {
  4357. s *Service
  4358. parent string
  4359. urlParams_ gensupport.URLParams
  4360. ifNoneMatch_ string
  4361. ctx_ context.Context
  4362. header_ http.Header
  4363. }
  4364. // List: Lists all clusters owned by a project in either the specified
  4365. // zone or all
  4366. // zones.
  4367. func (r *ProjectsLocationsClustersService) List(parent string) *ProjectsLocationsClustersListCall {
  4368. c := &ProjectsLocationsClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4369. c.parent = parent
  4370. return c
  4371. }
  4372. // ProjectId sets the optional parameter "projectId": Deprecated. The
  4373. // Google Developers Console [project ID or
  4374. // project
  4375. // number](https://support.google.com/cloud/answer/6158840).
  4376. // This
  4377. // field has been deprecated and replaced by the parent field.
  4378. func (c *ProjectsLocationsClustersListCall) ProjectId(projectId string) *ProjectsLocationsClustersListCall {
  4379. c.urlParams_.Set("projectId", projectId)
  4380. return c
  4381. }
  4382. // Zone sets the optional parameter "zone": Deprecated. The name of the
  4383. // Google Compute Engine
  4384. // [zone](/compute/docs/zones#available) in which the cluster
  4385. // resides, or "-" for all zones.
  4386. // This field has been deprecated and replaced by the parent field.
  4387. func (c *ProjectsLocationsClustersListCall) Zone(zone string) *ProjectsLocationsClustersListCall {
  4388. c.urlParams_.Set("zone", zone)
  4389. return c
  4390. }
  4391. // Fields allows partial responses to be retrieved. See
  4392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4393. // for more information.
  4394. func (c *ProjectsLocationsClustersListCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersListCall {
  4395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4396. return c
  4397. }
  4398. // IfNoneMatch sets the optional parameter which makes the operation
  4399. // fail if the object's ETag matches the given value. This is useful for
  4400. // getting updates only after the object has changed since the last
  4401. // request. Use googleapi.IsNotModified to check whether the response
  4402. // error from Do is the result of In-None-Match.
  4403. func (c *ProjectsLocationsClustersListCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersListCall {
  4404. c.ifNoneMatch_ = entityTag
  4405. return c
  4406. }
  4407. // Context sets the context to be used in this call's Do method. Any
  4408. // pending HTTP request will be aborted if the provided context is
  4409. // canceled.
  4410. func (c *ProjectsLocationsClustersListCall) Context(ctx context.Context) *ProjectsLocationsClustersListCall {
  4411. c.ctx_ = ctx
  4412. return c
  4413. }
  4414. // Header returns an http.Header that can be modified by the caller to
  4415. // add HTTP headers to the request.
  4416. func (c *ProjectsLocationsClustersListCall) Header() http.Header {
  4417. if c.header_ == nil {
  4418. c.header_ = make(http.Header)
  4419. }
  4420. return c.header_
  4421. }
  4422. func (c *ProjectsLocationsClustersListCall) doRequest(alt string) (*http.Response, error) {
  4423. reqHeaders := make(http.Header)
  4424. for k, v := range c.header_ {
  4425. reqHeaders[k] = v
  4426. }
  4427. reqHeaders.Set("User-Agent", c.s.userAgent())
  4428. if c.ifNoneMatch_ != "" {
  4429. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4430. }
  4431. var body io.Reader = nil
  4432. c.urlParams_.Set("alt", alt)
  4433. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/clusters")
  4434. urls += "?" + c.urlParams_.Encode()
  4435. req, _ := http.NewRequest("GET", urls, body)
  4436. req.Header = reqHeaders
  4437. googleapi.Expand(req.URL, map[string]string{
  4438. "parent": c.parent,
  4439. })
  4440. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4441. }
  4442. // Do executes the "container.projects.locations.clusters.list" call.
  4443. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  4444. // non-2xx status code is an error. Response headers are in either
  4445. // *ListClustersResponse.ServerResponse.Header or (if a response was
  4446. // returned at all) in error.(*googleapi.Error).Header. Use
  4447. // googleapi.IsNotModified to check whether the returned error was
  4448. // because http.StatusNotModified was returned.
  4449. func (c *ProjectsLocationsClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  4450. gensupport.SetOptions(c.urlParams_, opts...)
  4451. res, err := c.doRequest("json")
  4452. if res != nil && res.StatusCode == http.StatusNotModified {
  4453. if res.Body != nil {
  4454. res.Body.Close()
  4455. }
  4456. return nil, &googleapi.Error{
  4457. Code: res.StatusCode,
  4458. Header: res.Header,
  4459. }
  4460. }
  4461. if err != nil {
  4462. return nil, err
  4463. }
  4464. defer googleapi.CloseBody(res)
  4465. if err := googleapi.CheckResponse(res); err != nil {
  4466. return nil, err
  4467. }
  4468. ret := &ListClustersResponse{
  4469. ServerResponse: googleapi.ServerResponse{
  4470. Header: res.Header,
  4471. HTTPStatusCode: res.StatusCode,
  4472. },
  4473. }
  4474. target := &ret
  4475. if err := gensupport.DecodeResponse(target, res); err != nil {
  4476. return nil, err
  4477. }
  4478. return ret, nil
  4479. // {
  4480. // "description": "Lists all clusters owned by a project in either the specified zone or all\nzones.",
  4481. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters",
  4482. // "httpMethod": "GET",
  4483. // "id": "container.projects.locations.clusters.list",
  4484. // "parameterOrder": [
  4485. // "parent"
  4486. // ],
  4487. // "parameters": {
  4488. // "parent": {
  4489. // "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.",
  4490. // "location": "path",
  4491. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  4492. // "required": true,
  4493. // "type": "string"
  4494. // },
  4495. // "projectId": {
  4496. // "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.",
  4497. // "location": "query",
  4498. // "type": "string"
  4499. // },
  4500. // "zone": {
  4501. // "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.",
  4502. // "location": "query",
  4503. // "type": "string"
  4504. // }
  4505. // },
  4506. // "path": "v1beta1/{+parent}/clusters",
  4507. // "response": {
  4508. // "$ref": "ListClustersResponse"
  4509. // },
  4510. // "scopes": [
  4511. // "https://www.googleapis.com/auth/cloud-platform"
  4512. // ]
  4513. // }
  4514. }
  4515. // method id "container.projects.locations.clusters.setAddons":
  4516. type ProjectsLocationsClustersSetAddonsCall struct {
  4517. s *Service
  4518. name string
  4519. setaddonsconfigrequest *SetAddonsConfigRequest
  4520. urlParams_ gensupport.URLParams
  4521. ctx_ context.Context
  4522. header_ http.Header
  4523. }
  4524. // SetAddons: Sets the addons for a specific cluster.
  4525. func (r *ProjectsLocationsClustersService) SetAddons(name string, setaddonsconfigrequest *SetAddonsConfigRequest) *ProjectsLocationsClustersSetAddonsCall {
  4526. c := &ProjectsLocationsClustersSetAddonsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4527. c.name = name
  4528. c.setaddonsconfigrequest = setaddonsconfigrequest
  4529. return c
  4530. }
  4531. // Fields allows partial responses to be retrieved. See
  4532. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4533. // for more information.
  4534. func (c *ProjectsLocationsClustersSetAddonsCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetAddonsCall {
  4535. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4536. return c
  4537. }
  4538. // Context sets the context to be used in this call's Do method. Any
  4539. // pending HTTP request will be aborted if the provided context is
  4540. // canceled.
  4541. func (c *ProjectsLocationsClustersSetAddonsCall) Context(ctx context.Context) *ProjectsLocationsClustersSetAddonsCall {
  4542. c.ctx_ = ctx
  4543. return c
  4544. }
  4545. // Header returns an http.Header that can be modified by the caller to
  4546. // add HTTP headers to the request.
  4547. func (c *ProjectsLocationsClustersSetAddonsCall) Header() http.Header {
  4548. if c.header_ == nil {
  4549. c.header_ = make(http.Header)
  4550. }
  4551. return c.header_
  4552. }
  4553. func (c *ProjectsLocationsClustersSetAddonsCall) doRequest(alt string) (*http.Response, error) {
  4554. reqHeaders := make(http.Header)
  4555. for k, v := range c.header_ {
  4556. reqHeaders[k] = v
  4557. }
  4558. reqHeaders.Set("User-Agent", c.s.userAgent())
  4559. var body io.Reader = nil
  4560. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setaddonsconfigrequest)
  4561. if err != nil {
  4562. return nil, err
  4563. }
  4564. reqHeaders.Set("Content-Type", "application/json")
  4565. c.urlParams_.Set("alt", alt)
  4566. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setAddons")
  4567. urls += "?" + c.urlParams_.Encode()
  4568. req, _ := http.NewRequest("POST", urls, body)
  4569. req.Header = reqHeaders
  4570. googleapi.Expand(req.URL, map[string]string{
  4571. "name": c.name,
  4572. })
  4573. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4574. }
  4575. // Do executes the "container.projects.locations.clusters.setAddons" call.
  4576. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4577. // status code is an error. Response headers are in either
  4578. // *Operation.ServerResponse.Header or (if a response was returned at
  4579. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4580. // to check whether the returned error was because
  4581. // http.StatusNotModified was returned.
  4582. func (c *ProjectsLocationsClustersSetAddonsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4583. gensupport.SetOptions(c.urlParams_, opts...)
  4584. res, err := c.doRequest("json")
  4585. if res != nil && res.StatusCode == http.StatusNotModified {
  4586. if res.Body != nil {
  4587. res.Body.Close()
  4588. }
  4589. return nil, &googleapi.Error{
  4590. Code: res.StatusCode,
  4591. Header: res.Header,
  4592. }
  4593. }
  4594. if err != nil {
  4595. return nil, err
  4596. }
  4597. defer googleapi.CloseBody(res)
  4598. if err := googleapi.CheckResponse(res); err != nil {
  4599. return nil, err
  4600. }
  4601. ret := &Operation{
  4602. ServerResponse: googleapi.ServerResponse{
  4603. Header: res.Header,
  4604. HTTPStatusCode: res.StatusCode,
  4605. },
  4606. }
  4607. target := &ret
  4608. if err := gensupport.DecodeResponse(target, res); err != nil {
  4609. return nil, err
  4610. }
  4611. return ret, nil
  4612. // {
  4613. // "description": "Sets the addons for a specific cluster.",
  4614. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setAddons",
  4615. // "httpMethod": "POST",
  4616. // "id": "container.projects.locations.clusters.setAddons",
  4617. // "parameterOrder": [
  4618. // "name"
  4619. // ],
  4620. // "parameters": {
  4621. // "name": {
  4622. // "description": "The name (project, location, cluster) of the cluster to set addons.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4623. // "location": "path",
  4624. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4625. // "required": true,
  4626. // "type": "string"
  4627. // }
  4628. // },
  4629. // "path": "v1beta1/{+name}:setAddons",
  4630. // "request": {
  4631. // "$ref": "SetAddonsConfigRequest"
  4632. // },
  4633. // "response": {
  4634. // "$ref": "Operation"
  4635. // },
  4636. // "scopes": [
  4637. // "https://www.googleapis.com/auth/cloud-platform"
  4638. // ]
  4639. // }
  4640. }
  4641. // method id "container.projects.locations.clusters.setLegacyAbac":
  4642. type ProjectsLocationsClustersSetLegacyAbacCall struct {
  4643. s *Service
  4644. name string
  4645. setlegacyabacrequest *SetLegacyAbacRequest
  4646. urlParams_ gensupport.URLParams
  4647. ctx_ context.Context
  4648. header_ http.Header
  4649. }
  4650. // SetLegacyAbac: Enables or disables the ABAC authorization mechanism
  4651. // on a cluster.
  4652. func (r *ProjectsLocationsClustersService) SetLegacyAbac(name string, setlegacyabacrequest *SetLegacyAbacRequest) *ProjectsLocationsClustersSetLegacyAbacCall {
  4653. c := &ProjectsLocationsClustersSetLegacyAbacCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4654. c.name = name
  4655. c.setlegacyabacrequest = setlegacyabacrequest
  4656. return c
  4657. }
  4658. // Fields allows partial responses to be retrieved. See
  4659. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4660. // for more information.
  4661. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetLegacyAbacCall {
  4662. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4663. return c
  4664. }
  4665. // Context sets the context to be used in this call's Do method. Any
  4666. // pending HTTP request will be aborted if the provided context is
  4667. // canceled.
  4668. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Context(ctx context.Context) *ProjectsLocationsClustersSetLegacyAbacCall {
  4669. c.ctx_ = ctx
  4670. return c
  4671. }
  4672. // Header returns an http.Header that can be modified by the caller to
  4673. // add HTTP headers to the request.
  4674. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Header() http.Header {
  4675. if c.header_ == nil {
  4676. c.header_ = make(http.Header)
  4677. }
  4678. return c.header_
  4679. }
  4680. func (c *ProjectsLocationsClustersSetLegacyAbacCall) doRequest(alt string) (*http.Response, error) {
  4681. reqHeaders := make(http.Header)
  4682. for k, v := range c.header_ {
  4683. reqHeaders[k] = v
  4684. }
  4685. reqHeaders.Set("User-Agent", c.s.userAgent())
  4686. var body io.Reader = nil
  4687. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlegacyabacrequest)
  4688. if err != nil {
  4689. return nil, err
  4690. }
  4691. reqHeaders.Set("Content-Type", "application/json")
  4692. c.urlParams_.Set("alt", alt)
  4693. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setLegacyAbac")
  4694. urls += "?" + c.urlParams_.Encode()
  4695. req, _ := http.NewRequest("POST", urls, body)
  4696. req.Header = reqHeaders
  4697. googleapi.Expand(req.URL, map[string]string{
  4698. "name": c.name,
  4699. })
  4700. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4701. }
  4702. // Do executes the "container.projects.locations.clusters.setLegacyAbac" call.
  4703. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4704. // status code is an error. Response headers are in either
  4705. // *Operation.ServerResponse.Header or (if a response was returned at
  4706. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4707. // to check whether the returned error was because
  4708. // http.StatusNotModified was returned.
  4709. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4710. gensupport.SetOptions(c.urlParams_, opts...)
  4711. res, err := c.doRequest("json")
  4712. if res != nil && res.StatusCode == http.StatusNotModified {
  4713. if res.Body != nil {
  4714. res.Body.Close()
  4715. }
  4716. return nil, &googleapi.Error{
  4717. Code: res.StatusCode,
  4718. Header: res.Header,
  4719. }
  4720. }
  4721. if err != nil {
  4722. return nil, err
  4723. }
  4724. defer googleapi.CloseBody(res)
  4725. if err := googleapi.CheckResponse(res); err != nil {
  4726. return nil, err
  4727. }
  4728. ret := &Operation{
  4729. ServerResponse: googleapi.ServerResponse{
  4730. Header: res.Header,
  4731. HTTPStatusCode: res.StatusCode,
  4732. },
  4733. }
  4734. target := &ret
  4735. if err := gensupport.DecodeResponse(target, res); err != nil {
  4736. return nil, err
  4737. }
  4738. return ret, nil
  4739. // {
  4740. // "description": "Enables or disables the ABAC authorization mechanism on a cluster.",
  4741. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLegacyAbac",
  4742. // "httpMethod": "POST",
  4743. // "id": "container.projects.locations.clusters.setLegacyAbac",
  4744. // "parameterOrder": [
  4745. // "name"
  4746. // ],
  4747. // "parameters": {
  4748. // "name": {
  4749. // "description": "The name (project, location, cluster id) of the cluster to set legacy abac.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4750. // "location": "path",
  4751. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4752. // "required": true,
  4753. // "type": "string"
  4754. // }
  4755. // },
  4756. // "path": "v1beta1/{+name}:setLegacyAbac",
  4757. // "request": {
  4758. // "$ref": "SetLegacyAbacRequest"
  4759. // },
  4760. // "response": {
  4761. // "$ref": "Operation"
  4762. // },
  4763. // "scopes": [
  4764. // "https://www.googleapis.com/auth/cloud-platform"
  4765. // ]
  4766. // }
  4767. }
  4768. // method id "container.projects.locations.clusters.setLocations":
  4769. type ProjectsLocationsClustersSetLocationsCall struct {
  4770. s *Service
  4771. name string
  4772. setlocationsrequest *SetLocationsRequest
  4773. urlParams_ gensupport.URLParams
  4774. ctx_ context.Context
  4775. header_ http.Header
  4776. }
  4777. // SetLocations: Sets the locations for a specific cluster.
  4778. func (r *ProjectsLocationsClustersService) SetLocations(name string, setlocationsrequest *SetLocationsRequest) *ProjectsLocationsClustersSetLocationsCall {
  4779. c := &ProjectsLocationsClustersSetLocationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4780. c.name = name
  4781. c.setlocationsrequest = setlocationsrequest
  4782. return c
  4783. }
  4784. // Fields allows partial responses to be retrieved. See
  4785. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4786. // for more information.
  4787. func (c *ProjectsLocationsClustersSetLocationsCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetLocationsCall {
  4788. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4789. return c
  4790. }
  4791. // Context sets the context to be used in this call's Do method. Any
  4792. // pending HTTP request will be aborted if the provided context is
  4793. // canceled.
  4794. func (c *ProjectsLocationsClustersSetLocationsCall) Context(ctx context.Context) *ProjectsLocationsClustersSetLocationsCall {
  4795. c.ctx_ = ctx
  4796. return c
  4797. }
  4798. // Header returns an http.Header that can be modified by the caller to
  4799. // add HTTP headers to the request.
  4800. func (c *ProjectsLocationsClustersSetLocationsCall) Header() http.Header {
  4801. if c.header_ == nil {
  4802. c.header_ = make(http.Header)
  4803. }
  4804. return c.header_
  4805. }
  4806. func (c *ProjectsLocationsClustersSetLocationsCall) doRequest(alt string) (*http.Response, error) {
  4807. reqHeaders := make(http.Header)
  4808. for k, v := range c.header_ {
  4809. reqHeaders[k] = v
  4810. }
  4811. reqHeaders.Set("User-Agent", c.s.userAgent())
  4812. var body io.Reader = nil
  4813. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlocationsrequest)
  4814. if err != nil {
  4815. return nil, err
  4816. }
  4817. reqHeaders.Set("Content-Type", "application/json")
  4818. c.urlParams_.Set("alt", alt)
  4819. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setLocations")
  4820. urls += "?" + c.urlParams_.Encode()
  4821. req, _ := http.NewRequest("POST", urls, body)
  4822. req.Header = reqHeaders
  4823. googleapi.Expand(req.URL, map[string]string{
  4824. "name": c.name,
  4825. })
  4826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4827. }
  4828. // Do executes the "container.projects.locations.clusters.setLocations" call.
  4829. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4830. // status code is an error. Response headers are in either
  4831. // *Operation.ServerResponse.Header or (if a response was returned at
  4832. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4833. // to check whether the returned error was because
  4834. // http.StatusNotModified was returned.
  4835. func (c *ProjectsLocationsClustersSetLocationsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4836. gensupport.SetOptions(c.urlParams_, opts...)
  4837. res, err := c.doRequest("json")
  4838. if res != nil && res.StatusCode == http.StatusNotModified {
  4839. if res.Body != nil {
  4840. res.Body.Close()
  4841. }
  4842. return nil, &googleapi.Error{
  4843. Code: res.StatusCode,
  4844. Header: res.Header,
  4845. }
  4846. }
  4847. if err != nil {
  4848. return nil, err
  4849. }
  4850. defer googleapi.CloseBody(res)
  4851. if err := googleapi.CheckResponse(res); err != nil {
  4852. return nil, err
  4853. }
  4854. ret := &Operation{
  4855. ServerResponse: googleapi.ServerResponse{
  4856. Header: res.Header,
  4857. HTTPStatusCode: res.StatusCode,
  4858. },
  4859. }
  4860. target := &ret
  4861. if err := gensupport.DecodeResponse(target, res); err != nil {
  4862. return nil, err
  4863. }
  4864. return ret, nil
  4865. // {
  4866. // "description": "Sets the locations for a specific cluster.",
  4867. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLocations",
  4868. // "httpMethod": "POST",
  4869. // "id": "container.projects.locations.clusters.setLocations",
  4870. // "parameterOrder": [
  4871. // "name"
  4872. // ],
  4873. // "parameters": {
  4874. // "name": {
  4875. // "description": "The name (project, location, cluster) of the cluster to set locations.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4876. // "location": "path",
  4877. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4878. // "required": true,
  4879. // "type": "string"
  4880. // }
  4881. // },
  4882. // "path": "v1beta1/{+name}:setLocations",
  4883. // "request": {
  4884. // "$ref": "SetLocationsRequest"
  4885. // },
  4886. // "response": {
  4887. // "$ref": "Operation"
  4888. // },
  4889. // "scopes": [
  4890. // "https://www.googleapis.com/auth/cloud-platform"
  4891. // ]
  4892. // }
  4893. }
  4894. // method id "container.projects.locations.clusters.setLogging":
  4895. type ProjectsLocationsClustersSetLoggingCall struct {
  4896. s *Service
  4897. name string
  4898. setloggingservicerequest *SetLoggingServiceRequest
  4899. urlParams_ gensupport.URLParams
  4900. ctx_ context.Context
  4901. header_ http.Header
  4902. }
  4903. // SetLogging: Sets the logging service for a specific cluster.
  4904. func (r *ProjectsLocationsClustersService) SetLogging(name string, setloggingservicerequest *SetLoggingServiceRequest) *ProjectsLocationsClustersSetLoggingCall {
  4905. c := &ProjectsLocationsClustersSetLoggingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4906. c.name = name
  4907. c.setloggingservicerequest = setloggingservicerequest
  4908. return c
  4909. }
  4910. // Fields allows partial responses to be retrieved. See
  4911. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4912. // for more information.
  4913. func (c *ProjectsLocationsClustersSetLoggingCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetLoggingCall {
  4914. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4915. return c
  4916. }
  4917. // Context sets the context to be used in this call's Do method. Any
  4918. // pending HTTP request will be aborted if the provided context is
  4919. // canceled.
  4920. func (c *ProjectsLocationsClustersSetLoggingCall) Context(ctx context.Context) *ProjectsLocationsClustersSetLoggingCall {
  4921. c.ctx_ = ctx
  4922. return c
  4923. }
  4924. // Header returns an http.Header that can be modified by the caller to
  4925. // add HTTP headers to the request.
  4926. func (c *ProjectsLocationsClustersSetLoggingCall) Header() http.Header {
  4927. if c.header_ == nil {
  4928. c.header_ = make(http.Header)
  4929. }
  4930. return c.header_
  4931. }
  4932. func (c *ProjectsLocationsClustersSetLoggingCall) doRequest(alt string) (*http.Response, error) {
  4933. reqHeaders := make(http.Header)
  4934. for k, v := range c.header_ {
  4935. reqHeaders[k] = v
  4936. }
  4937. reqHeaders.Set("User-Agent", c.s.userAgent())
  4938. var body io.Reader = nil
  4939. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setloggingservicerequest)
  4940. if err != nil {
  4941. return nil, err
  4942. }
  4943. reqHeaders.Set("Content-Type", "application/json")
  4944. c.urlParams_.Set("alt", alt)
  4945. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setLogging")
  4946. urls += "?" + c.urlParams_.Encode()
  4947. req, _ := http.NewRequest("POST", urls, body)
  4948. req.Header = reqHeaders
  4949. googleapi.Expand(req.URL, map[string]string{
  4950. "name": c.name,
  4951. })
  4952. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4953. }
  4954. // Do executes the "container.projects.locations.clusters.setLogging" call.
  4955. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4956. // status code is an error. Response headers are in either
  4957. // *Operation.ServerResponse.Header or (if a response was returned at
  4958. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4959. // to check whether the returned error was because
  4960. // http.StatusNotModified was returned.
  4961. func (c *ProjectsLocationsClustersSetLoggingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4962. gensupport.SetOptions(c.urlParams_, opts...)
  4963. res, err := c.doRequest("json")
  4964. if res != nil && res.StatusCode == http.StatusNotModified {
  4965. if res.Body != nil {
  4966. res.Body.Close()
  4967. }
  4968. return nil, &googleapi.Error{
  4969. Code: res.StatusCode,
  4970. Header: res.Header,
  4971. }
  4972. }
  4973. if err != nil {
  4974. return nil, err
  4975. }
  4976. defer googleapi.CloseBody(res)
  4977. if err := googleapi.CheckResponse(res); err != nil {
  4978. return nil, err
  4979. }
  4980. ret := &Operation{
  4981. ServerResponse: googleapi.ServerResponse{
  4982. Header: res.Header,
  4983. HTTPStatusCode: res.StatusCode,
  4984. },
  4985. }
  4986. target := &ret
  4987. if err := gensupport.DecodeResponse(target, res); err != nil {
  4988. return nil, err
  4989. }
  4990. return ret, nil
  4991. // {
  4992. // "description": "Sets the logging service for a specific cluster.",
  4993. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLogging",
  4994. // "httpMethod": "POST",
  4995. // "id": "container.projects.locations.clusters.setLogging",
  4996. // "parameterOrder": [
  4997. // "name"
  4998. // ],
  4999. // "parameters": {
  5000. // "name": {
  5001. // "description": "The name (project, location, cluster) of the cluster to set logging.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5002. // "location": "path",
  5003. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5004. // "required": true,
  5005. // "type": "string"
  5006. // }
  5007. // },
  5008. // "path": "v1beta1/{+name}:setLogging",
  5009. // "request": {
  5010. // "$ref": "SetLoggingServiceRequest"
  5011. // },
  5012. // "response": {
  5013. // "$ref": "Operation"
  5014. // },
  5015. // "scopes": [
  5016. // "https://www.googleapis.com/auth/cloud-platform"
  5017. // ]
  5018. // }
  5019. }
  5020. // method id "container.projects.locations.clusters.setMaintenancePolicy":
  5021. type ProjectsLocationsClustersSetMaintenancePolicyCall struct {
  5022. s *Service
  5023. name string
  5024. setmaintenancepolicyrequest *SetMaintenancePolicyRequest
  5025. urlParams_ gensupport.URLParams
  5026. ctx_ context.Context
  5027. header_ http.Header
  5028. }
  5029. // SetMaintenancePolicy: Sets the maintenance policy for a cluster.
  5030. func (r *ProjectsLocationsClustersService) SetMaintenancePolicy(name string, setmaintenancepolicyrequest *SetMaintenancePolicyRequest) *ProjectsLocationsClustersSetMaintenancePolicyCall {
  5031. c := &ProjectsLocationsClustersSetMaintenancePolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5032. c.name = name
  5033. c.setmaintenancepolicyrequest = setmaintenancepolicyrequest
  5034. return c
  5035. }
  5036. // Fields allows partial responses to be retrieved. See
  5037. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5038. // for more information.
  5039. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetMaintenancePolicyCall {
  5040. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5041. return c
  5042. }
  5043. // Context sets the context to be used in this call's Do method. Any
  5044. // pending HTTP request will be aborted if the provided context is
  5045. // canceled.
  5046. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Context(ctx context.Context) *ProjectsLocationsClustersSetMaintenancePolicyCall {
  5047. c.ctx_ = ctx
  5048. return c
  5049. }
  5050. // Header returns an http.Header that can be modified by the caller to
  5051. // add HTTP headers to the request.
  5052. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Header() http.Header {
  5053. if c.header_ == nil {
  5054. c.header_ = make(http.Header)
  5055. }
  5056. return c.header_
  5057. }
  5058. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) doRequest(alt string) (*http.Response, error) {
  5059. reqHeaders := make(http.Header)
  5060. for k, v := range c.header_ {
  5061. reqHeaders[k] = v
  5062. }
  5063. reqHeaders.Set("User-Agent", c.s.userAgent())
  5064. var body io.Reader = nil
  5065. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmaintenancepolicyrequest)
  5066. if err != nil {
  5067. return nil, err
  5068. }
  5069. reqHeaders.Set("Content-Type", "application/json")
  5070. c.urlParams_.Set("alt", alt)
  5071. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setMaintenancePolicy")
  5072. urls += "?" + c.urlParams_.Encode()
  5073. req, _ := http.NewRequest("POST", urls, body)
  5074. req.Header = reqHeaders
  5075. googleapi.Expand(req.URL, map[string]string{
  5076. "name": c.name,
  5077. })
  5078. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5079. }
  5080. // Do executes the "container.projects.locations.clusters.setMaintenancePolicy" call.
  5081. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5082. // status code is an error. Response headers are in either
  5083. // *Operation.ServerResponse.Header or (if a response was returned at
  5084. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5085. // to check whether the returned error was because
  5086. // http.StatusNotModified was returned.
  5087. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5088. gensupport.SetOptions(c.urlParams_, opts...)
  5089. res, err := c.doRequest("json")
  5090. if res != nil && res.StatusCode == http.StatusNotModified {
  5091. if res.Body != nil {
  5092. res.Body.Close()
  5093. }
  5094. return nil, &googleapi.Error{
  5095. Code: res.StatusCode,
  5096. Header: res.Header,
  5097. }
  5098. }
  5099. if err != nil {
  5100. return nil, err
  5101. }
  5102. defer googleapi.CloseBody(res)
  5103. if err := googleapi.CheckResponse(res); err != nil {
  5104. return nil, err
  5105. }
  5106. ret := &Operation{
  5107. ServerResponse: googleapi.ServerResponse{
  5108. Header: res.Header,
  5109. HTTPStatusCode: res.StatusCode,
  5110. },
  5111. }
  5112. target := &ret
  5113. if err := gensupport.DecodeResponse(target, res); err != nil {
  5114. return nil, err
  5115. }
  5116. return ret, nil
  5117. // {
  5118. // "description": "Sets the maintenance policy for a cluster.",
  5119. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMaintenancePolicy",
  5120. // "httpMethod": "POST",
  5121. // "id": "container.projects.locations.clusters.setMaintenancePolicy",
  5122. // "parameterOrder": [
  5123. // "name"
  5124. // ],
  5125. // "parameters": {
  5126. // "name": {
  5127. // "description": "The name (project, location, cluster id) of the cluster to set maintenance\npolicy.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5128. // "location": "path",
  5129. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5130. // "required": true,
  5131. // "type": "string"
  5132. // }
  5133. // },
  5134. // "path": "v1beta1/{+name}:setMaintenancePolicy",
  5135. // "request": {
  5136. // "$ref": "SetMaintenancePolicyRequest"
  5137. // },
  5138. // "response": {
  5139. // "$ref": "Operation"
  5140. // },
  5141. // "scopes": [
  5142. // "https://www.googleapis.com/auth/cloud-platform"
  5143. // ]
  5144. // }
  5145. }
  5146. // method id "container.projects.locations.clusters.setMasterAuth":
  5147. type ProjectsLocationsClustersSetMasterAuthCall struct {
  5148. s *Service
  5149. name string
  5150. setmasterauthrequest *SetMasterAuthRequest
  5151. urlParams_ gensupport.URLParams
  5152. ctx_ context.Context
  5153. header_ http.Header
  5154. }
  5155. // SetMasterAuth: Used to set master auth materials. Currently supports
  5156. // :-
  5157. // Changing the admin password for a specific cluster.
  5158. // This can be either via password generation or explicitly set.
  5159. // Modify basic_auth.csv and reset the K8S API server.
  5160. func (r *ProjectsLocationsClustersService) SetMasterAuth(name string, setmasterauthrequest *SetMasterAuthRequest) *ProjectsLocationsClustersSetMasterAuthCall {
  5161. c := &ProjectsLocationsClustersSetMasterAuthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5162. c.name = name
  5163. c.setmasterauthrequest = setmasterauthrequest
  5164. return c
  5165. }
  5166. // Fields allows partial responses to be retrieved. See
  5167. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5168. // for more information.
  5169. func (c *ProjectsLocationsClustersSetMasterAuthCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetMasterAuthCall {
  5170. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5171. return c
  5172. }
  5173. // Context sets the context to be used in this call's Do method. Any
  5174. // pending HTTP request will be aborted if the provided context is
  5175. // canceled.
  5176. func (c *ProjectsLocationsClustersSetMasterAuthCall) Context(ctx context.Context) *ProjectsLocationsClustersSetMasterAuthCall {
  5177. c.ctx_ = ctx
  5178. return c
  5179. }
  5180. // Header returns an http.Header that can be modified by the caller to
  5181. // add HTTP headers to the request.
  5182. func (c *ProjectsLocationsClustersSetMasterAuthCall) Header() http.Header {
  5183. if c.header_ == nil {
  5184. c.header_ = make(http.Header)
  5185. }
  5186. return c.header_
  5187. }
  5188. func (c *ProjectsLocationsClustersSetMasterAuthCall) doRequest(alt string) (*http.Response, error) {
  5189. reqHeaders := make(http.Header)
  5190. for k, v := range c.header_ {
  5191. reqHeaders[k] = v
  5192. }
  5193. reqHeaders.Set("User-Agent", c.s.userAgent())
  5194. var body io.Reader = nil
  5195. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmasterauthrequest)
  5196. if err != nil {
  5197. return nil, err
  5198. }
  5199. reqHeaders.Set("Content-Type", "application/json")
  5200. c.urlParams_.Set("alt", alt)
  5201. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setMasterAuth")
  5202. urls += "?" + c.urlParams_.Encode()
  5203. req, _ := http.NewRequest("POST", urls, body)
  5204. req.Header = reqHeaders
  5205. googleapi.Expand(req.URL, map[string]string{
  5206. "name": c.name,
  5207. })
  5208. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5209. }
  5210. // Do executes the "container.projects.locations.clusters.setMasterAuth" call.
  5211. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5212. // status code is an error. Response headers are in either
  5213. // *Operation.ServerResponse.Header or (if a response was returned at
  5214. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5215. // to check whether the returned error was because
  5216. // http.StatusNotModified was returned.
  5217. func (c *ProjectsLocationsClustersSetMasterAuthCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5218. gensupport.SetOptions(c.urlParams_, opts...)
  5219. res, err := c.doRequest("json")
  5220. if res != nil && res.StatusCode == http.StatusNotModified {
  5221. if res.Body != nil {
  5222. res.Body.Close()
  5223. }
  5224. return nil, &googleapi.Error{
  5225. Code: res.StatusCode,
  5226. Header: res.Header,
  5227. }
  5228. }
  5229. if err != nil {
  5230. return nil, err
  5231. }
  5232. defer googleapi.CloseBody(res)
  5233. if err := googleapi.CheckResponse(res); err != nil {
  5234. return nil, err
  5235. }
  5236. ret := &Operation{
  5237. ServerResponse: googleapi.ServerResponse{
  5238. Header: res.Header,
  5239. HTTPStatusCode: res.StatusCode,
  5240. },
  5241. }
  5242. target := &ret
  5243. if err := gensupport.DecodeResponse(target, res); err != nil {
  5244. return nil, err
  5245. }
  5246. return ret, nil
  5247. // {
  5248. // "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.\nModify basic_auth.csv and reset the K8S API server.",
  5249. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMasterAuth",
  5250. // "httpMethod": "POST",
  5251. // "id": "container.projects.locations.clusters.setMasterAuth",
  5252. // "parameterOrder": [
  5253. // "name"
  5254. // ],
  5255. // "parameters": {
  5256. // "name": {
  5257. // "description": "The name (project, location, cluster) of the cluster to set auth.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5258. // "location": "path",
  5259. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5260. // "required": true,
  5261. // "type": "string"
  5262. // }
  5263. // },
  5264. // "path": "v1beta1/{+name}:setMasterAuth",
  5265. // "request": {
  5266. // "$ref": "SetMasterAuthRequest"
  5267. // },
  5268. // "response": {
  5269. // "$ref": "Operation"
  5270. // },
  5271. // "scopes": [
  5272. // "https://www.googleapis.com/auth/cloud-platform"
  5273. // ]
  5274. // }
  5275. }
  5276. // method id "container.projects.locations.clusters.setMonitoring":
  5277. type ProjectsLocationsClustersSetMonitoringCall struct {
  5278. s *Service
  5279. name string
  5280. setmonitoringservicerequest *SetMonitoringServiceRequest
  5281. urlParams_ gensupport.URLParams
  5282. ctx_ context.Context
  5283. header_ http.Header
  5284. }
  5285. // SetMonitoring: Sets the monitoring service for a specific cluster.
  5286. func (r *ProjectsLocationsClustersService) SetMonitoring(name string, setmonitoringservicerequest *SetMonitoringServiceRequest) *ProjectsLocationsClustersSetMonitoringCall {
  5287. c := &ProjectsLocationsClustersSetMonitoringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5288. c.name = name
  5289. c.setmonitoringservicerequest = setmonitoringservicerequest
  5290. return c
  5291. }
  5292. // Fields allows partial responses to be retrieved. See
  5293. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5294. // for more information.
  5295. func (c *ProjectsLocationsClustersSetMonitoringCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetMonitoringCall {
  5296. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5297. return c
  5298. }
  5299. // Context sets the context to be used in this call's Do method. Any
  5300. // pending HTTP request will be aborted if the provided context is
  5301. // canceled.
  5302. func (c *ProjectsLocationsClustersSetMonitoringCall) Context(ctx context.Context) *ProjectsLocationsClustersSetMonitoringCall {
  5303. c.ctx_ = ctx
  5304. return c
  5305. }
  5306. // Header returns an http.Header that can be modified by the caller to
  5307. // add HTTP headers to the request.
  5308. func (c *ProjectsLocationsClustersSetMonitoringCall) Header() http.Header {
  5309. if c.header_ == nil {
  5310. c.header_ = make(http.Header)
  5311. }
  5312. return c.header_
  5313. }
  5314. func (c *ProjectsLocationsClustersSetMonitoringCall) doRequest(alt string) (*http.Response, error) {
  5315. reqHeaders := make(http.Header)
  5316. for k, v := range c.header_ {
  5317. reqHeaders[k] = v
  5318. }
  5319. reqHeaders.Set("User-Agent", c.s.userAgent())
  5320. var body io.Reader = nil
  5321. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmonitoringservicerequest)
  5322. if err != nil {
  5323. return nil, err
  5324. }
  5325. reqHeaders.Set("Content-Type", "application/json")
  5326. c.urlParams_.Set("alt", alt)
  5327. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setMonitoring")
  5328. urls += "?" + c.urlParams_.Encode()
  5329. req, _ := http.NewRequest("POST", urls, body)
  5330. req.Header = reqHeaders
  5331. googleapi.Expand(req.URL, map[string]string{
  5332. "name": c.name,
  5333. })
  5334. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5335. }
  5336. // Do executes the "container.projects.locations.clusters.setMonitoring" call.
  5337. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5338. // status code is an error. Response headers are in either
  5339. // *Operation.ServerResponse.Header or (if a response was returned at
  5340. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5341. // to check whether the returned error was because
  5342. // http.StatusNotModified was returned.
  5343. func (c *ProjectsLocationsClustersSetMonitoringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5344. gensupport.SetOptions(c.urlParams_, opts...)
  5345. res, err := c.doRequest("json")
  5346. if res != nil && res.StatusCode == http.StatusNotModified {
  5347. if res.Body != nil {
  5348. res.Body.Close()
  5349. }
  5350. return nil, &googleapi.Error{
  5351. Code: res.StatusCode,
  5352. Header: res.Header,
  5353. }
  5354. }
  5355. if err != nil {
  5356. return nil, err
  5357. }
  5358. defer googleapi.CloseBody(res)
  5359. if err := googleapi.CheckResponse(res); err != nil {
  5360. return nil, err
  5361. }
  5362. ret := &Operation{
  5363. ServerResponse: googleapi.ServerResponse{
  5364. Header: res.Header,
  5365. HTTPStatusCode: res.StatusCode,
  5366. },
  5367. }
  5368. target := &ret
  5369. if err := gensupport.DecodeResponse(target, res); err != nil {
  5370. return nil, err
  5371. }
  5372. return ret, nil
  5373. // {
  5374. // "description": "Sets the monitoring service for a specific cluster.",
  5375. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMonitoring",
  5376. // "httpMethod": "POST",
  5377. // "id": "container.projects.locations.clusters.setMonitoring",
  5378. // "parameterOrder": [
  5379. // "name"
  5380. // ],
  5381. // "parameters": {
  5382. // "name": {
  5383. // "description": "The name (project, location, cluster) of the cluster to set monitoring.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5384. // "location": "path",
  5385. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5386. // "required": true,
  5387. // "type": "string"
  5388. // }
  5389. // },
  5390. // "path": "v1beta1/{+name}:setMonitoring",
  5391. // "request": {
  5392. // "$ref": "SetMonitoringServiceRequest"
  5393. // },
  5394. // "response": {
  5395. // "$ref": "Operation"
  5396. // },
  5397. // "scopes": [
  5398. // "https://www.googleapis.com/auth/cloud-platform"
  5399. // ]
  5400. // }
  5401. }
  5402. // method id "container.projects.locations.clusters.setNetworkPolicy":
  5403. type ProjectsLocationsClustersSetNetworkPolicyCall struct {
  5404. s *Service
  5405. name string
  5406. setnetworkpolicyrequest *SetNetworkPolicyRequest
  5407. urlParams_ gensupport.URLParams
  5408. ctx_ context.Context
  5409. header_ http.Header
  5410. }
  5411. // SetNetworkPolicy: Enables/Disables Network Policy for a cluster.
  5412. func (r *ProjectsLocationsClustersService) SetNetworkPolicy(name string, setnetworkpolicyrequest *SetNetworkPolicyRequest) *ProjectsLocationsClustersSetNetworkPolicyCall {
  5413. c := &ProjectsLocationsClustersSetNetworkPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5414. c.name = name
  5415. c.setnetworkpolicyrequest = setnetworkpolicyrequest
  5416. return c
  5417. }
  5418. // Fields allows partial responses to be retrieved. See
  5419. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5420. // for more information.
  5421. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetNetworkPolicyCall {
  5422. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5423. return c
  5424. }
  5425. // Context sets the context to be used in this call's Do method. Any
  5426. // pending HTTP request will be aborted if the provided context is
  5427. // canceled.
  5428. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Context(ctx context.Context) *ProjectsLocationsClustersSetNetworkPolicyCall {
  5429. c.ctx_ = ctx
  5430. return c
  5431. }
  5432. // Header returns an http.Header that can be modified by the caller to
  5433. // add HTTP headers to the request.
  5434. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Header() http.Header {
  5435. if c.header_ == nil {
  5436. c.header_ = make(http.Header)
  5437. }
  5438. return c.header_
  5439. }
  5440. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) doRequest(alt string) (*http.Response, error) {
  5441. reqHeaders := make(http.Header)
  5442. for k, v := range c.header_ {
  5443. reqHeaders[k] = v
  5444. }
  5445. reqHeaders.Set("User-Agent", c.s.userAgent())
  5446. var body io.Reader = nil
  5447. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnetworkpolicyrequest)
  5448. if err != nil {
  5449. return nil, err
  5450. }
  5451. reqHeaders.Set("Content-Type", "application/json")
  5452. c.urlParams_.Set("alt", alt)
  5453. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setNetworkPolicy")
  5454. urls += "?" + c.urlParams_.Encode()
  5455. req, _ := http.NewRequest("POST", urls, body)
  5456. req.Header = reqHeaders
  5457. googleapi.Expand(req.URL, map[string]string{
  5458. "name": c.name,
  5459. })
  5460. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5461. }
  5462. // Do executes the "container.projects.locations.clusters.setNetworkPolicy" call.
  5463. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5464. // status code is an error. Response headers are in either
  5465. // *Operation.ServerResponse.Header or (if a response was returned at
  5466. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5467. // to check whether the returned error was because
  5468. // http.StatusNotModified was returned.
  5469. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5470. gensupport.SetOptions(c.urlParams_, opts...)
  5471. res, err := c.doRequest("json")
  5472. if res != nil && res.StatusCode == http.StatusNotModified {
  5473. if res.Body != nil {
  5474. res.Body.Close()
  5475. }
  5476. return nil, &googleapi.Error{
  5477. Code: res.StatusCode,
  5478. Header: res.Header,
  5479. }
  5480. }
  5481. if err != nil {
  5482. return nil, err
  5483. }
  5484. defer googleapi.CloseBody(res)
  5485. if err := googleapi.CheckResponse(res); err != nil {
  5486. return nil, err
  5487. }
  5488. ret := &Operation{
  5489. ServerResponse: googleapi.ServerResponse{
  5490. Header: res.Header,
  5491. HTTPStatusCode: res.StatusCode,
  5492. },
  5493. }
  5494. target := &ret
  5495. if err := gensupport.DecodeResponse(target, res); err != nil {
  5496. return nil, err
  5497. }
  5498. return ret, nil
  5499. // {
  5500. // "description": "Enables/Disables Network Policy for a cluster.",
  5501. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setNetworkPolicy",
  5502. // "httpMethod": "POST",
  5503. // "id": "container.projects.locations.clusters.setNetworkPolicy",
  5504. // "parameterOrder": [
  5505. // "name"
  5506. // ],
  5507. // "parameters": {
  5508. // "name": {
  5509. // "description": "The name (project, location, cluster id) of the cluster to set networking\npolicy. Specified in the format 'projects/*/locations/*/clusters/*'.",
  5510. // "location": "path",
  5511. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5512. // "required": true,
  5513. // "type": "string"
  5514. // }
  5515. // },
  5516. // "path": "v1beta1/{+name}:setNetworkPolicy",
  5517. // "request": {
  5518. // "$ref": "SetNetworkPolicyRequest"
  5519. // },
  5520. // "response": {
  5521. // "$ref": "Operation"
  5522. // },
  5523. // "scopes": [
  5524. // "https://www.googleapis.com/auth/cloud-platform"
  5525. // ]
  5526. // }
  5527. }
  5528. // method id "container.projects.locations.clusters.setResourceLabels":
  5529. type ProjectsLocationsClustersSetResourceLabelsCall struct {
  5530. s *Service
  5531. name string
  5532. setlabelsrequest *SetLabelsRequest
  5533. urlParams_ gensupport.URLParams
  5534. ctx_ context.Context
  5535. header_ http.Header
  5536. }
  5537. // SetResourceLabels: Sets labels on a cluster.
  5538. func (r *ProjectsLocationsClustersService) SetResourceLabels(name string, setlabelsrequest *SetLabelsRequest) *ProjectsLocationsClustersSetResourceLabelsCall {
  5539. c := &ProjectsLocationsClustersSetResourceLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5540. c.name = name
  5541. c.setlabelsrequest = setlabelsrequest
  5542. return c
  5543. }
  5544. // Fields allows partial responses to be retrieved. See
  5545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5546. // for more information.
  5547. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetResourceLabelsCall {
  5548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5549. return c
  5550. }
  5551. // Context sets the context to be used in this call's Do method. Any
  5552. // pending HTTP request will be aborted if the provided context is
  5553. // canceled.
  5554. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Context(ctx context.Context) *ProjectsLocationsClustersSetResourceLabelsCall {
  5555. c.ctx_ = ctx
  5556. return c
  5557. }
  5558. // Header returns an http.Header that can be modified by the caller to
  5559. // add HTTP headers to the request.
  5560. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Header() http.Header {
  5561. if c.header_ == nil {
  5562. c.header_ = make(http.Header)
  5563. }
  5564. return c.header_
  5565. }
  5566. func (c *ProjectsLocationsClustersSetResourceLabelsCall) doRequest(alt string) (*http.Response, error) {
  5567. reqHeaders := make(http.Header)
  5568. for k, v := range c.header_ {
  5569. reqHeaders[k] = v
  5570. }
  5571. reqHeaders.Set("User-Agent", c.s.userAgent())
  5572. var body io.Reader = nil
  5573. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlabelsrequest)
  5574. if err != nil {
  5575. return nil, err
  5576. }
  5577. reqHeaders.Set("Content-Type", "application/json")
  5578. c.urlParams_.Set("alt", alt)
  5579. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setResourceLabels")
  5580. urls += "?" + c.urlParams_.Encode()
  5581. req, _ := http.NewRequest("POST", urls, body)
  5582. req.Header = reqHeaders
  5583. googleapi.Expand(req.URL, map[string]string{
  5584. "name": c.name,
  5585. })
  5586. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5587. }
  5588. // Do executes the "container.projects.locations.clusters.setResourceLabels" call.
  5589. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5590. // status code is an error. Response headers are in either
  5591. // *Operation.ServerResponse.Header or (if a response was returned at
  5592. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5593. // to check whether the returned error was because
  5594. // http.StatusNotModified was returned.
  5595. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5596. gensupport.SetOptions(c.urlParams_, opts...)
  5597. res, err := c.doRequest("json")
  5598. if res != nil && res.StatusCode == http.StatusNotModified {
  5599. if res.Body != nil {
  5600. res.Body.Close()
  5601. }
  5602. return nil, &googleapi.Error{
  5603. Code: res.StatusCode,
  5604. Header: res.Header,
  5605. }
  5606. }
  5607. if err != nil {
  5608. return nil, err
  5609. }
  5610. defer googleapi.CloseBody(res)
  5611. if err := googleapi.CheckResponse(res); err != nil {
  5612. return nil, err
  5613. }
  5614. ret := &Operation{
  5615. ServerResponse: googleapi.ServerResponse{
  5616. Header: res.Header,
  5617. HTTPStatusCode: res.StatusCode,
  5618. },
  5619. }
  5620. target := &ret
  5621. if err := gensupport.DecodeResponse(target, res); err != nil {
  5622. return nil, err
  5623. }
  5624. return ret, nil
  5625. // {
  5626. // "description": "Sets labels on a cluster.",
  5627. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setResourceLabels",
  5628. // "httpMethod": "POST",
  5629. // "id": "container.projects.locations.clusters.setResourceLabels",
  5630. // "parameterOrder": [
  5631. // "name"
  5632. // ],
  5633. // "parameters": {
  5634. // "name": {
  5635. // "description": "The name (project, location, cluster id) of the cluster to set labels.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5636. // "location": "path",
  5637. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5638. // "required": true,
  5639. // "type": "string"
  5640. // }
  5641. // },
  5642. // "path": "v1beta1/{+name}:setResourceLabels",
  5643. // "request": {
  5644. // "$ref": "SetLabelsRequest"
  5645. // },
  5646. // "response": {
  5647. // "$ref": "Operation"
  5648. // },
  5649. // "scopes": [
  5650. // "https://www.googleapis.com/auth/cloud-platform"
  5651. // ]
  5652. // }
  5653. }
  5654. // method id "container.projects.locations.clusters.startIpRotation":
  5655. type ProjectsLocationsClustersStartIpRotationCall struct {
  5656. s *Service
  5657. name string
  5658. startiprotationrequest *StartIPRotationRequest
  5659. urlParams_ gensupport.URLParams
  5660. ctx_ context.Context
  5661. header_ http.Header
  5662. }
  5663. // StartIpRotation: Start master IP rotation.
  5664. func (r *ProjectsLocationsClustersService) StartIpRotation(name string, startiprotationrequest *StartIPRotationRequest) *ProjectsLocationsClustersStartIpRotationCall {
  5665. c := &ProjectsLocationsClustersStartIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5666. c.name = name
  5667. c.startiprotationrequest = startiprotationrequest
  5668. return c
  5669. }
  5670. // Fields allows partial responses to be retrieved. See
  5671. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5672. // for more information.
  5673. func (c *ProjectsLocationsClustersStartIpRotationCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersStartIpRotationCall {
  5674. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5675. return c
  5676. }
  5677. // Context sets the context to be used in this call's Do method. Any
  5678. // pending HTTP request will be aborted if the provided context is
  5679. // canceled.
  5680. func (c *ProjectsLocationsClustersStartIpRotationCall) Context(ctx context.Context) *ProjectsLocationsClustersStartIpRotationCall {
  5681. c.ctx_ = ctx
  5682. return c
  5683. }
  5684. // Header returns an http.Header that can be modified by the caller to
  5685. // add HTTP headers to the request.
  5686. func (c *ProjectsLocationsClustersStartIpRotationCall) Header() http.Header {
  5687. if c.header_ == nil {
  5688. c.header_ = make(http.Header)
  5689. }
  5690. return c.header_
  5691. }
  5692. func (c *ProjectsLocationsClustersStartIpRotationCall) doRequest(alt string) (*http.Response, error) {
  5693. reqHeaders := make(http.Header)
  5694. for k, v := range c.header_ {
  5695. reqHeaders[k] = v
  5696. }
  5697. reqHeaders.Set("User-Agent", c.s.userAgent())
  5698. var body io.Reader = nil
  5699. body, err := googleapi.WithoutDataWrapper.JSONReader(c.startiprotationrequest)
  5700. if err != nil {
  5701. return nil, err
  5702. }
  5703. reqHeaders.Set("Content-Type", "application/json")
  5704. c.urlParams_.Set("alt", alt)
  5705. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:startIpRotation")
  5706. urls += "?" + c.urlParams_.Encode()
  5707. req, _ := http.NewRequest("POST", urls, body)
  5708. req.Header = reqHeaders
  5709. googleapi.Expand(req.URL, map[string]string{
  5710. "name": c.name,
  5711. })
  5712. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5713. }
  5714. // Do executes the "container.projects.locations.clusters.startIpRotation" call.
  5715. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5716. // status code is an error. Response headers are in either
  5717. // *Operation.ServerResponse.Header or (if a response was returned at
  5718. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5719. // to check whether the returned error was because
  5720. // http.StatusNotModified was returned.
  5721. func (c *ProjectsLocationsClustersStartIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5722. gensupport.SetOptions(c.urlParams_, opts...)
  5723. res, err := c.doRequest("json")
  5724. if res != nil && res.StatusCode == http.StatusNotModified {
  5725. if res.Body != nil {
  5726. res.Body.Close()
  5727. }
  5728. return nil, &googleapi.Error{
  5729. Code: res.StatusCode,
  5730. Header: res.Header,
  5731. }
  5732. }
  5733. if err != nil {
  5734. return nil, err
  5735. }
  5736. defer googleapi.CloseBody(res)
  5737. if err := googleapi.CheckResponse(res); err != nil {
  5738. return nil, err
  5739. }
  5740. ret := &Operation{
  5741. ServerResponse: googleapi.ServerResponse{
  5742. Header: res.Header,
  5743. HTTPStatusCode: res.StatusCode,
  5744. },
  5745. }
  5746. target := &ret
  5747. if err := gensupport.DecodeResponse(target, res); err != nil {
  5748. return nil, err
  5749. }
  5750. return ret, nil
  5751. // {
  5752. // "description": "Start master IP rotation.",
  5753. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:startIpRotation",
  5754. // "httpMethod": "POST",
  5755. // "id": "container.projects.locations.clusters.startIpRotation",
  5756. // "parameterOrder": [
  5757. // "name"
  5758. // ],
  5759. // "parameters": {
  5760. // "name": {
  5761. // "description": "The name (project, location, cluster id) of the cluster to start IP\nrotation. Specified in the format 'projects/*/locations/*/clusters/*'.",
  5762. // "location": "path",
  5763. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5764. // "required": true,
  5765. // "type": "string"
  5766. // }
  5767. // },
  5768. // "path": "v1beta1/{+name}:startIpRotation",
  5769. // "request": {
  5770. // "$ref": "StartIPRotationRequest"
  5771. // },
  5772. // "response": {
  5773. // "$ref": "Operation"
  5774. // },
  5775. // "scopes": [
  5776. // "https://www.googleapis.com/auth/cloud-platform"
  5777. // ]
  5778. // }
  5779. }
  5780. // method id "container.projects.locations.clusters.update":
  5781. type ProjectsLocationsClustersUpdateCall struct {
  5782. s *Service
  5783. name string
  5784. updateclusterrequest *UpdateClusterRequest
  5785. urlParams_ gensupport.URLParams
  5786. ctx_ context.Context
  5787. header_ http.Header
  5788. }
  5789. // Update: Updates the settings for a specific cluster.
  5790. func (r *ProjectsLocationsClustersService) Update(name string, updateclusterrequest *UpdateClusterRequest) *ProjectsLocationsClustersUpdateCall {
  5791. c := &ProjectsLocationsClustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5792. c.name = name
  5793. c.updateclusterrequest = updateclusterrequest
  5794. return c
  5795. }
  5796. // Fields allows partial responses to be retrieved. See
  5797. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5798. // for more information.
  5799. func (c *ProjectsLocationsClustersUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersUpdateCall {
  5800. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5801. return c
  5802. }
  5803. // Context sets the context to be used in this call's Do method. Any
  5804. // pending HTTP request will be aborted if the provided context is
  5805. // canceled.
  5806. func (c *ProjectsLocationsClustersUpdateCall) Context(ctx context.Context) *ProjectsLocationsClustersUpdateCall {
  5807. c.ctx_ = ctx
  5808. return c
  5809. }
  5810. // Header returns an http.Header that can be modified by the caller to
  5811. // add HTTP headers to the request.
  5812. func (c *ProjectsLocationsClustersUpdateCall) Header() http.Header {
  5813. if c.header_ == nil {
  5814. c.header_ = make(http.Header)
  5815. }
  5816. return c.header_
  5817. }
  5818. func (c *ProjectsLocationsClustersUpdateCall) doRequest(alt string) (*http.Response, error) {
  5819. reqHeaders := make(http.Header)
  5820. for k, v := range c.header_ {
  5821. reqHeaders[k] = v
  5822. }
  5823. reqHeaders.Set("User-Agent", c.s.userAgent())
  5824. var body io.Reader = nil
  5825. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest)
  5826. if err != nil {
  5827. return nil, err
  5828. }
  5829. reqHeaders.Set("Content-Type", "application/json")
  5830. c.urlParams_.Set("alt", alt)
  5831. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  5832. urls += "?" + c.urlParams_.Encode()
  5833. req, _ := http.NewRequest("PUT", urls, body)
  5834. req.Header = reqHeaders
  5835. googleapi.Expand(req.URL, map[string]string{
  5836. "name": c.name,
  5837. })
  5838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5839. }
  5840. // Do executes the "container.projects.locations.clusters.update" call.
  5841. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5842. // status code is an error. Response headers are in either
  5843. // *Operation.ServerResponse.Header or (if a response was returned at
  5844. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5845. // to check whether the returned error was because
  5846. // http.StatusNotModified was returned.
  5847. func (c *ProjectsLocationsClustersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5848. gensupport.SetOptions(c.urlParams_, opts...)
  5849. res, err := c.doRequest("json")
  5850. if res != nil && res.StatusCode == http.StatusNotModified {
  5851. if res.Body != nil {
  5852. res.Body.Close()
  5853. }
  5854. return nil, &googleapi.Error{
  5855. Code: res.StatusCode,
  5856. Header: res.Header,
  5857. }
  5858. }
  5859. if err != nil {
  5860. return nil, err
  5861. }
  5862. defer googleapi.CloseBody(res)
  5863. if err := googleapi.CheckResponse(res); err != nil {
  5864. return nil, err
  5865. }
  5866. ret := &Operation{
  5867. ServerResponse: googleapi.ServerResponse{
  5868. Header: res.Header,
  5869. HTTPStatusCode: res.StatusCode,
  5870. },
  5871. }
  5872. target := &ret
  5873. if err := gensupport.DecodeResponse(target, res); err != nil {
  5874. return nil, err
  5875. }
  5876. return ret, nil
  5877. // {
  5878. // "description": "Updates the settings for a specific cluster.",
  5879. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
  5880. // "httpMethod": "PUT",
  5881. // "id": "container.projects.locations.clusters.update",
  5882. // "parameterOrder": [
  5883. // "name"
  5884. // ],
  5885. // "parameters": {
  5886. // "name": {
  5887. // "description": "The name (project, location, cluster) of the cluster to update.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5888. // "location": "path",
  5889. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5890. // "required": true,
  5891. // "type": "string"
  5892. // }
  5893. // },
  5894. // "path": "v1beta1/{+name}",
  5895. // "request": {
  5896. // "$ref": "UpdateClusterRequest"
  5897. // },
  5898. // "response": {
  5899. // "$ref": "Operation"
  5900. // },
  5901. // "scopes": [
  5902. // "https://www.googleapis.com/auth/cloud-platform"
  5903. // ]
  5904. // }
  5905. }
  5906. // method id "container.projects.locations.clusters.updateMaster":
  5907. type ProjectsLocationsClustersUpdateMasterCall struct {
  5908. s *Service
  5909. name string
  5910. updatemasterrequest *UpdateMasterRequest
  5911. urlParams_ gensupport.URLParams
  5912. ctx_ context.Context
  5913. header_ http.Header
  5914. }
  5915. // UpdateMaster: Updates the master for a specific cluster.
  5916. func (r *ProjectsLocationsClustersService) UpdateMaster(name string, updatemasterrequest *UpdateMasterRequest) *ProjectsLocationsClustersUpdateMasterCall {
  5917. c := &ProjectsLocationsClustersUpdateMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5918. c.name = name
  5919. c.updatemasterrequest = updatemasterrequest
  5920. return c
  5921. }
  5922. // Fields allows partial responses to be retrieved. See
  5923. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5924. // for more information.
  5925. func (c *ProjectsLocationsClustersUpdateMasterCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersUpdateMasterCall {
  5926. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5927. return c
  5928. }
  5929. // Context sets the context to be used in this call's Do method. Any
  5930. // pending HTTP request will be aborted if the provided context is
  5931. // canceled.
  5932. func (c *ProjectsLocationsClustersUpdateMasterCall) Context(ctx context.Context) *ProjectsLocationsClustersUpdateMasterCall {
  5933. c.ctx_ = ctx
  5934. return c
  5935. }
  5936. // Header returns an http.Header that can be modified by the caller to
  5937. // add HTTP headers to the request.
  5938. func (c *ProjectsLocationsClustersUpdateMasterCall) Header() http.Header {
  5939. if c.header_ == nil {
  5940. c.header_ = make(http.Header)
  5941. }
  5942. return c.header_
  5943. }
  5944. func (c *ProjectsLocationsClustersUpdateMasterCall) doRequest(alt string) (*http.Response, error) {
  5945. reqHeaders := make(http.Header)
  5946. for k, v := range c.header_ {
  5947. reqHeaders[k] = v
  5948. }
  5949. reqHeaders.Set("User-Agent", c.s.userAgent())
  5950. var body io.Reader = nil
  5951. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatemasterrequest)
  5952. if err != nil {
  5953. return nil, err
  5954. }
  5955. reqHeaders.Set("Content-Type", "application/json")
  5956. c.urlParams_.Set("alt", alt)
  5957. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:updateMaster")
  5958. urls += "?" + c.urlParams_.Encode()
  5959. req, _ := http.NewRequest("POST", urls, body)
  5960. req.Header = reqHeaders
  5961. googleapi.Expand(req.URL, map[string]string{
  5962. "name": c.name,
  5963. })
  5964. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5965. }
  5966. // Do executes the "container.projects.locations.clusters.updateMaster" call.
  5967. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5968. // status code is an error. Response headers are in either
  5969. // *Operation.ServerResponse.Header or (if a response was returned at
  5970. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5971. // to check whether the returned error was because
  5972. // http.StatusNotModified was returned.
  5973. func (c *ProjectsLocationsClustersUpdateMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5974. gensupport.SetOptions(c.urlParams_, opts...)
  5975. res, err := c.doRequest("json")
  5976. if res != nil && res.StatusCode == http.StatusNotModified {
  5977. if res.Body != nil {
  5978. res.Body.Close()
  5979. }
  5980. return nil, &googleapi.Error{
  5981. Code: res.StatusCode,
  5982. Header: res.Header,
  5983. }
  5984. }
  5985. if err != nil {
  5986. return nil, err
  5987. }
  5988. defer googleapi.CloseBody(res)
  5989. if err := googleapi.CheckResponse(res); err != nil {
  5990. return nil, err
  5991. }
  5992. ret := &Operation{
  5993. ServerResponse: googleapi.ServerResponse{
  5994. Header: res.Header,
  5995. HTTPStatusCode: res.StatusCode,
  5996. },
  5997. }
  5998. target := &ret
  5999. if err := gensupport.DecodeResponse(target, res); err != nil {
  6000. return nil, err
  6001. }
  6002. return ret, nil
  6003. // {
  6004. // "description": "Updates the master for a specific cluster.",
  6005. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:updateMaster",
  6006. // "httpMethod": "POST",
  6007. // "id": "container.projects.locations.clusters.updateMaster",
  6008. // "parameterOrder": [
  6009. // "name"
  6010. // ],
  6011. // "parameters": {
  6012. // "name": {
  6013. // "description": "The name (project, location, cluster) of the cluster to update.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  6014. // "location": "path",
  6015. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6016. // "required": true,
  6017. // "type": "string"
  6018. // }
  6019. // },
  6020. // "path": "v1beta1/{+name}:updateMaster",
  6021. // "request": {
  6022. // "$ref": "UpdateMasterRequest"
  6023. // },
  6024. // "response": {
  6025. // "$ref": "Operation"
  6026. // },
  6027. // "scopes": [
  6028. // "https://www.googleapis.com/auth/cloud-platform"
  6029. // ]
  6030. // }
  6031. }
  6032. // method id "container.projects.locations.clusters.nodePools.create":
  6033. type ProjectsLocationsClustersNodePoolsCreateCall struct {
  6034. s *Service
  6035. parent string
  6036. createnodepoolrequest *CreateNodePoolRequest
  6037. urlParams_ gensupport.URLParams
  6038. ctx_ context.Context
  6039. header_ http.Header
  6040. }
  6041. // Create: Creates a node pool for a cluster.
  6042. func (r *ProjectsLocationsClustersNodePoolsService) Create(parent string, createnodepoolrequest *CreateNodePoolRequest) *ProjectsLocationsClustersNodePoolsCreateCall {
  6043. c := &ProjectsLocationsClustersNodePoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6044. c.parent = parent
  6045. c.createnodepoolrequest = createnodepoolrequest
  6046. return c
  6047. }
  6048. // Fields allows partial responses to be retrieved. See
  6049. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6050. // for more information.
  6051. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsCreateCall {
  6052. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6053. return c
  6054. }
  6055. // Context sets the context to be used in this call's Do method. Any
  6056. // pending HTTP request will be aborted if the provided context is
  6057. // canceled.
  6058. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsCreateCall {
  6059. c.ctx_ = ctx
  6060. return c
  6061. }
  6062. // Header returns an http.Header that can be modified by the caller to
  6063. // add HTTP headers to the request.
  6064. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Header() http.Header {
  6065. if c.header_ == nil {
  6066. c.header_ = make(http.Header)
  6067. }
  6068. return c.header_
  6069. }
  6070. func (c *ProjectsLocationsClustersNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) {
  6071. reqHeaders := make(http.Header)
  6072. for k, v := range c.header_ {
  6073. reqHeaders[k] = v
  6074. }
  6075. reqHeaders.Set("User-Agent", c.s.userAgent())
  6076. var body io.Reader = nil
  6077. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createnodepoolrequest)
  6078. if err != nil {
  6079. return nil, err
  6080. }
  6081. reqHeaders.Set("Content-Type", "application/json")
  6082. c.urlParams_.Set("alt", alt)
  6083. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/nodePools")
  6084. urls += "?" + c.urlParams_.Encode()
  6085. req, _ := http.NewRequest("POST", urls, body)
  6086. req.Header = reqHeaders
  6087. googleapi.Expand(req.URL, map[string]string{
  6088. "parent": c.parent,
  6089. })
  6090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6091. }
  6092. // Do executes the "container.projects.locations.clusters.nodePools.create" call.
  6093. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6094. // status code is an error. Response headers are in either
  6095. // *Operation.ServerResponse.Header or (if a response was returned at
  6096. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6097. // to check whether the returned error was because
  6098. // http.StatusNotModified was returned.
  6099. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6100. gensupport.SetOptions(c.urlParams_, opts...)
  6101. res, err := c.doRequest("json")
  6102. if res != nil && res.StatusCode == http.StatusNotModified {
  6103. if res.Body != nil {
  6104. res.Body.Close()
  6105. }
  6106. return nil, &googleapi.Error{
  6107. Code: res.StatusCode,
  6108. Header: res.Header,
  6109. }
  6110. }
  6111. if err != nil {
  6112. return nil, err
  6113. }
  6114. defer googleapi.CloseBody(res)
  6115. if err := googleapi.CheckResponse(res); err != nil {
  6116. return nil, err
  6117. }
  6118. ret := &Operation{
  6119. ServerResponse: googleapi.ServerResponse{
  6120. Header: res.Header,
  6121. HTTPStatusCode: res.StatusCode,
  6122. },
  6123. }
  6124. target := &ret
  6125. if err := gensupport.DecodeResponse(target, res); err != nil {
  6126. return nil, err
  6127. }
  6128. return ret, nil
  6129. // {
  6130. // "description": "Creates a node pool for a cluster.",
  6131. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools",
  6132. // "httpMethod": "POST",
  6133. // "id": "container.projects.locations.clusters.nodePools.create",
  6134. // "parameterOrder": [
  6135. // "parent"
  6136. // ],
  6137. // "parameters": {
  6138. // "parent": {
  6139. // "description": "The parent (project, location, cluster id) where the node pool will be\ncreated. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  6140. // "location": "path",
  6141. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6142. // "required": true,
  6143. // "type": "string"
  6144. // }
  6145. // },
  6146. // "path": "v1beta1/{+parent}/nodePools",
  6147. // "request": {
  6148. // "$ref": "CreateNodePoolRequest"
  6149. // },
  6150. // "response": {
  6151. // "$ref": "Operation"
  6152. // },
  6153. // "scopes": [
  6154. // "https://www.googleapis.com/auth/cloud-platform"
  6155. // ]
  6156. // }
  6157. }
  6158. // method id "container.projects.locations.clusters.nodePools.delete":
  6159. type ProjectsLocationsClustersNodePoolsDeleteCall struct {
  6160. s *Service
  6161. name string
  6162. urlParams_ gensupport.URLParams
  6163. ctx_ context.Context
  6164. header_ http.Header
  6165. }
  6166. // Delete: Deletes a node pool from a cluster.
  6167. func (r *ProjectsLocationsClustersNodePoolsService) Delete(name string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  6168. c := &ProjectsLocationsClustersNodePoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6169. c.name = name
  6170. return c
  6171. }
  6172. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  6173. // name of the cluster.
  6174. // This field has been deprecated and replaced by the name field.
  6175. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) ClusterId(clusterId string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  6176. c.urlParams_.Set("clusterId", clusterId)
  6177. return c
  6178. }
  6179. // NodePoolId sets the optional parameter "nodePoolId": Deprecated. The
  6180. // name of the node pool to delete.
  6181. // This field has been deprecated and replaced by the name field.
  6182. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) NodePoolId(nodePoolId string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  6183. c.urlParams_.Set("nodePoolId", nodePoolId)
  6184. return c
  6185. }
  6186. // ProjectId sets the optional parameter "projectId": Deprecated. The
  6187. // Google Developers Console [project ID or
  6188. // project
  6189. // number](https://developers.google.com/console/help/new/#projec
  6190. // tnumber).
  6191. // This field has been deprecated and replaced by the name field.
  6192. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) ProjectId(projectId string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  6193. c.urlParams_.Set("projectId", projectId)
  6194. return c
  6195. }
  6196. // Zone sets the optional parameter "zone": Deprecated. The name of the
  6197. // Google Compute Engine
  6198. // [zone](/compute/docs/zones#available) in which the
  6199. // cluster
  6200. // resides.
  6201. // This field has been deprecated and replaced by the name field.
  6202. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Zone(zone string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  6203. c.urlParams_.Set("zone", zone)
  6204. return c
  6205. }
  6206. // Fields allows partial responses to be retrieved. See
  6207. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6208. // for more information.
  6209. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsDeleteCall {
  6210. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6211. return c
  6212. }
  6213. // Context sets the context to be used in this call's Do method. Any
  6214. // pending HTTP request will be aborted if the provided context is
  6215. // canceled.
  6216. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsDeleteCall {
  6217. c.ctx_ = ctx
  6218. return c
  6219. }
  6220. // Header returns an http.Header that can be modified by the caller to
  6221. // add HTTP headers to the request.
  6222. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Header() http.Header {
  6223. if c.header_ == nil {
  6224. c.header_ = make(http.Header)
  6225. }
  6226. return c.header_
  6227. }
  6228. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6229. reqHeaders := make(http.Header)
  6230. for k, v := range c.header_ {
  6231. reqHeaders[k] = v
  6232. }
  6233. reqHeaders.Set("User-Agent", c.s.userAgent())
  6234. var body io.Reader = nil
  6235. c.urlParams_.Set("alt", alt)
  6236. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  6237. urls += "?" + c.urlParams_.Encode()
  6238. req, _ := http.NewRequest("DELETE", urls, body)
  6239. req.Header = reqHeaders
  6240. googleapi.Expand(req.URL, map[string]string{
  6241. "name": c.name,
  6242. })
  6243. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6244. }
  6245. // Do executes the "container.projects.locations.clusters.nodePools.delete" call.
  6246. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6247. // status code is an error. Response headers are in either
  6248. // *Operation.ServerResponse.Header or (if a response was returned at
  6249. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6250. // to check whether the returned error was because
  6251. // http.StatusNotModified was returned.
  6252. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6253. gensupport.SetOptions(c.urlParams_, opts...)
  6254. res, err := c.doRequest("json")
  6255. if res != nil && res.StatusCode == http.StatusNotModified {
  6256. if res.Body != nil {
  6257. res.Body.Close()
  6258. }
  6259. return nil, &googleapi.Error{
  6260. Code: res.StatusCode,
  6261. Header: res.Header,
  6262. }
  6263. }
  6264. if err != nil {
  6265. return nil, err
  6266. }
  6267. defer googleapi.CloseBody(res)
  6268. if err := googleapi.CheckResponse(res); err != nil {
  6269. return nil, err
  6270. }
  6271. ret := &Operation{
  6272. ServerResponse: googleapi.ServerResponse{
  6273. Header: res.Header,
  6274. HTTPStatusCode: res.StatusCode,
  6275. },
  6276. }
  6277. target := &ret
  6278. if err := gensupport.DecodeResponse(target, res); err != nil {
  6279. return nil, err
  6280. }
  6281. return ret, nil
  6282. // {
  6283. // "description": "Deletes a node pool from a cluster.",
  6284. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
  6285. // "httpMethod": "DELETE",
  6286. // "id": "container.projects.locations.clusters.nodePools.delete",
  6287. // "parameterOrder": [
  6288. // "name"
  6289. // ],
  6290. // "parameters": {
  6291. // "clusterId": {
  6292. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  6293. // "location": "query",
  6294. // "type": "string"
  6295. // },
  6296. // "name": {
  6297. // "description": "The name (project, location, cluster, node pool id) of the node pool to\ndelete. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  6298. // "location": "path",
  6299. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6300. // "required": true,
  6301. // "type": "string"
  6302. // },
  6303. // "nodePoolId": {
  6304. // "description": "Deprecated. The name of the node pool to delete.\nThis field has been deprecated and replaced by the name field.",
  6305. // "location": "query",
  6306. // "type": "string"
  6307. // },
  6308. // "projectId": {
  6309. // "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.",
  6310. // "location": "query",
  6311. // "type": "string"
  6312. // },
  6313. // "zone": {
  6314. // "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.",
  6315. // "location": "query",
  6316. // "type": "string"
  6317. // }
  6318. // },
  6319. // "path": "v1beta1/{+name}",
  6320. // "response": {
  6321. // "$ref": "Operation"
  6322. // },
  6323. // "scopes": [
  6324. // "https://www.googleapis.com/auth/cloud-platform"
  6325. // ]
  6326. // }
  6327. }
  6328. // method id "container.projects.locations.clusters.nodePools.get":
  6329. type ProjectsLocationsClustersNodePoolsGetCall struct {
  6330. s *Service
  6331. name string
  6332. urlParams_ gensupport.URLParams
  6333. ifNoneMatch_ string
  6334. ctx_ context.Context
  6335. header_ http.Header
  6336. }
  6337. // Get: Retrieves the node pool requested.
  6338. func (r *ProjectsLocationsClustersNodePoolsService) Get(name string) *ProjectsLocationsClustersNodePoolsGetCall {
  6339. c := &ProjectsLocationsClustersNodePoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6340. c.name = name
  6341. return c
  6342. }
  6343. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  6344. // name of the cluster.
  6345. // This field has been deprecated and replaced by the name field.
  6346. func (c *ProjectsLocationsClustersNodePoolsGetCall) ClusterId(clusterId string) *ProjectsLocationsClustersNodePoolsGetCall {
  6347. c.urlParams_.Set("clusterId", clusterId)
  6348. return c
  6349. }
  6350. // NodePoolId sets the optional parameter "nodePoolId": Deprecated. The
  6351. // name of the node pool.
  6352. // This field has been deprecated and replaced by the name field.
  6353. func (c *ProjectsLocationsClustersNodePoolsGetCall) NodePoolId(nodePoolId string) *ProjectsLocationsClustersNodePoolsGetCall {
  6354. c.urlParams_.Set("nodePoolId", nodePoolId)
  6355. return c
  6356. }
  6357. // ProjectId sets the optional parameter "projectId": Deprecated. The
  6358. // Google Developers Console [project ID or
  6359. // project
  6360. // number](https://developers.google.com/console/help/new/#projec
  6361. // tnumber).
  6362. // This field has been deprecated and replaced by the name field.
  6363. func (c *ProjectsLocationsClustersNodePoolsGetCall) ProjectId(projectId string) *ProjectsLocationsClustersNodePoolsGetCall {
  6364. c.urlParams_.Set("projectId", projectId)
  6365. return c
  6366. }
  6367. // Zone sets the optional parameter "zone": Deprecated. The name of the
  6368. // Google Compute Engine
  6369. // [zone](/compute/docs/zones#available) in which the
  6370. // cluster
  6371. // resides.
  6372. // This field has been deprecated and replaced by the name field.
  6373. func (c *ProjectsLocationsClustersNodePoolsGetCall) Zone(zone string) *ProjectsLocationsClustersNodePoolsGetCall {
  6374. c.urlParams_.Set("zone", zone)
  6375. return c
  6376. }
  6377. // Fields allows partial responses to be retrieved. See
  6378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6379. // for more information.
  6380. func (c *ProjectsLocationsClustersNodePoolsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsGetCall {
  6381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6382. return c
  6383. }
  6384. // IfNoneMatch sets the optional parameter which makes the operation
  6385. // fail if the object's ETag matches the given value. This is useful for
  6386. // getting updates only after the object has changed since the last
  6387. // request. Use googleapi.IsNotModified to check whether the response
  6388. // error from Do is the result of In-None-Match.
  6389. func (c *ProjectsLocationsClustersNodePoolsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersNodePoolsGetCall {
  6390. c.ifNoneMatch_ = entityTag
  6391. return c
  6392. }
  6393. // Context sets the context to be used in this call's Do method. Any
  6394. // pending HTTP request will be aborted if the provided context is
  6395. // canceled.
  6396. func (c *ProjectsLocationsClustersNodePoolsGetCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsGetCall {
  6397. c.ctx_ = ctx
  6398. return c
  6399. }
  6400. // Header returns an http.Header that can be modified by the caller to
  6401. // add HTTP headers to the request.
  6402. func (c *ProjectsLocationsClustersNodePoolsGetCall) Header() http.Header {
  6403. if c.header_ == nil {
  6404. c.header_ = make(http.Header)
  6405. }
  6406. return c.header_
  6407. }
  6408. func (c *ProjectsLocationsClustersNodePoolsGetCall) doRequest(alt string) (*http.Response, error) {
  6409. reqHeaders := make(http.Header)
  6410. for k, v := range c.header_ {
  6411. reqHeaders[k] = v
  6412. }
  6413. reqHeaders.Set("User-Agent", c.s.userAgent())
  6414. if c.ifNoneMatch_ != "" {
  6415. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6416. }
  6417. var body io.Reader = nil
  6418. c.urlParams_.Set("alt", alt)
  6419. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  6420. urls += "?" + c.urlParams_.Encode()
  6421. req, _ := http.NewRequest("GET", urls, body)
  6422. req.Header = reqHeaders
  6423. googleapi.Expand(req.URL, map[string]string{
  6424. "name": c.name,
  6425. })
  6426. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6427. }
  6428. // Do executes the "container.projects.locations.clusters.nodePools.get" call.
  6429. // Exactly one of *NodePool or error will be non-nil. Any non-2xx status
  6430. // code is an error. Response headers are in either
  6431. // *NodePool.ServerResponse.Header or (if a response was returned at
  6432. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6433. // to check whether the returned error was because
  6434. // http.StatusNotModified was returned.
  6435. func (c *ProjectsLocationsClustersNodePoolsGetCall) Do(opts ...googleapi.CallOption) (*NodePool, error) {
  6436. gensupport.SetOptions(c.urlParams_, opts...)
  6437. res, err := c.doRequest("json")
  6438. if res != nil && res.StatusCode == http.StatusNotModified {
  6439. if res.Body != nil {
  6440. res.Body.Close()
  6441. }
  6442. return nil, &googleapi.Error{
  6443. Code: res.StatusCode,
  6444. Header: res.Header,
  6445. }
  6446. }
  6447. if err != nil {
  6448. return nil, err
  6449. }
  6450. defer googleapi.CloseBody(res)
  6451. if err := googleapi.CheckResponse(res); err != nil {
  6452. return nil, err
  6453. }
  6454. ret := &NodePool{
  6455. ServerResponse: googleapi.ServerResponse{
  6456. Header: res.Header,
  6457. HTTPStatusCode: res.StatusCode,
  6458. },
  6459. }
  6460. target := &ret
  6461. if err := gensupport.DecodeResponse(target, res); err != nil {
  6462. return nil, err
  6463. }
  6464. return ret, nil
  6465. // {
  6466. // "description": "Retrieves the node pool requested.",
  6467. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
  6468. // "httpMethod": "GET",
  6469. // "id": "container.projects.locations.clusters.nodePools.get",
  6470. // "parameterOrder": [
  6471. // "name"
  6472. // ],
  6473. // "parameters": {
  6474. // "clusterId": {
  6475. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  6476. // "location": "query",
  6477. // "type": "string"
  6478. // },
  6479. // "name": {
  6480. // "description": "The name (project, location, cluster, node pool id) of the node pool to\nget. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  6481. // "location": "path",
  6482. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6483. // "required": true,
  6484. // "type": "string"
  6485. // },
  6486. // "nodePoolId": {
  6487. // "description": "Deprecated. The name of the node pool.\nThis field has been deprecated and replaced by the name field.",
  6488. // "location": "query",
  6489. // "type": "string"
  6490. // },
  6491. // "projectId": {
  6492. // "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.",
  6493. // "location": "query",
  6494. // "type": "string"
  6495. // },
  6496. // "zone": {
  6497. // "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.",
  6498. // "location": "query",
  6499. // "type": "string"
  6500. // }
  6501. // },
  6502. // "path": "v1beta1/{+name}",
  6503. // "response": {
  6504. // "$ref": "NodePool"
  6505. // },
  6506. // "scopes": [
  6507. // "https://www.googleapis.com/auth/cloud-platform"
  6508. // ]
  6509. // }
  6510. }
  6511. // method id "container.projects.locations.clusters.nodePools.list":
  6512. type ProjectsLocationsClustersNodePoolsListCall struct {
  6513. s *Service
  6514. parent string
  6515. urlParams_ gensupport.URLParams
  6516. ifNoneMatch_ string
  6517. ctx_ context.Context
  6518. header_ http.Header
  6519. }
  6520. // List: Lists the node pools for a cluster.
  6521. func (r *ProjectsLocationsClustersNodePoolsService) List(parent string) *ProjectsLocationsClustersNodePoolsListCall {
  6522. c := &ProjectsLocationsClustersNodePoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6523. c.parent = parent
  6524. return c
  6525. }
  6526. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  6527. // name of the cluster.
  6528. // This field has been deprecated and replaced by the parent field.
  6529. func (c *ProjectsLocationsClustersNodePoolsListCall) ClusterId(clusterId string) *ProjectsLocationsClustersNodePoolsListCall {
  6530. c.urlParams_.Set("clusterId", clusterId)
  6531. return c
  6532. }
  6533. // ProjectId sets the optional parameter "projectId": Deprecated. The
  6534. // Google Developers Console [project ID or
  6535. // project
  6536. // number](https://developers.google.com/console/help/new/#projec
  6537. // tnumber).
  6538. // This field has been deprecated and replaced by the parent field.
  6539. func (c *ProjectsLocationsClustersNodePoolsListCall) ProjectId(projectId string) *ProjectsLocationsClustersNodePoolsListCall {
  6540. c.urlParams_.Set("projectId", projectId)
  6541. return c
  6542. }
  6543. // Zone sets the optional parameter "zone": Deprecated. The name of the
  6544. // Google Compute Engine
  6545. // [zone](/compute/docs/zones#available) in which the
  6546. // cluster
  6547. // resides.
  6548. // This field has been deprecated and replaced by the parent field.
  6549. func (c *ProjectsLocationsClustersNodePoolsListCall) Zone(zone string) *ProjectsLocationsClustersNodePoolsListCall {
  6550. c.urlParams_.Set("zone", zone)
  6551. return c
  6552. }
  6553. // Fields allows partial responses to be retrieved. See
  6554. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6555. // for more information.
  6556. func (c *ProjectsLocationsClustersNodePoolsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsListCall {
  6557. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6558. return c
  6559. }
  6560. // IfNoneMatch sets the optional parameter which makes the operation
  6561. // fail if the object's ETag matches the given value. This is useful for
  6562. // getting updates only after the object has changed since the last
  6563. // request. Use googleapi.IsNotModified to check whether the response
  6564. // error from Do is the result of In-None-Match.
  6565. func (c *ProjectsLocationsClustersNodePoolsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersNodePoolsListCall {
  6566. c.ifNoneMatch_ = entityTag
  6567. return c
  6568. }
  6569. // Context sets the context to be used in this call's Do method. Any
  6570. // pending HTTP request will be aborted if the provided context is
  6571. // canceled.
  6572. func (c *ProjectsLocationsClustersNodePoolsListCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsListCall {
  6573. c.ctx_ = ctx
  6574. return c
  6575. }
  6576. // Header returns an http.Header that can be modified by the caller to
  6577. // add HTTP headers to the request.
  6578. func (c *ProjectsLocationsClustersNodePoolsListCall) Header() http.Header {
  6579. if c.header_ == nil {
  6580. c.header_ = make(http.Header)
  6581. }
  6582. return c.header_
  6583. }
  6584. func (c *ProjectsLocationsClustersNodePoolsListCall) doRequest(alt string) (*http.Response, error) {
  6585. reqHeaders := make(http.Header)
  6586. for k, v := range c.header_ {
  6587. reqHeaders[k] = v
  6588. }
  6589. reqHeaders.Set("User-Agent", c.s.userAgent())
  6590. if c.ifNoneMatch_ != "" {
  6591. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6592. }
  6593. var body io.Reader = nil
  6594. c.urlParams_.Set("alt", alt)
  6595. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/nodePools")
  6596. urls += "?" + c.urlParams_.Encode()
  6597. req, _ := http.NewRequest("GET", urls, body)
  6598. req.Header = reqHeaders
  6599. googleapi.Expand(req.URL, map[string]string{
  6600. "parent": c.parent,
  6601. })
  6602. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6603. }
  6604. // Do executes the "container.projects.locations.clusters.nodePools.list" call.
  6605. // Exactly one of *ListNodePoolsResponse or error will be non-nil. Any
  6606. // non-2xx status code is an error. Response headers are in either
  6607. // *ListNodePoolsResponse.ServerResponse.Header or (if a response was
  6608. // returned at all) in error.(*googleapi.Error).Header. Use
  6609. // googleapi.IsNotModified to check whether the returned error was
  6610. // because http.StatusNotModified was returned.
  6611. func (c *ProjectsLocationsClustersNodePoolsListCall) Do(opts ...googleapi.CallOption) (*ListNodePoolsResponse, error) {
  6612. gensupport.SetOptions(c.urlParams_, opts...)
  6613. res, err := c.doRequest("json")
  6614. if res != nil && res.StatusCode == http.StatusNotModified {
  6615. if res.Body != nil {
  6616. res.Body.Close()
  6617. }
  6618. return nil, &googleapi.Error{
  6619. Code: res.StatusCode,
  6620. Header: res.Header,
  6621. }
  6622. }
  6623. if err != nil {
  6624. return nil, err
  6625. }
  6626. defer googleapi.CloseBody(res)
  6627. if err := googleapi.CheckResponse(res); err != nil {
  6628. return nil, err
  6629. }
  6630. ret := &ListNodePoolsResponse{
  6631. ServerResponse: googleapi.ServerResponse{
  6632. Header: res.Header,
  6633. HTTPStatusCode: res.StatusCode,
  6634. },
  6635. }
  6636. target := &ret
  6637. if err := gensupport.DecodeResponse(target, res); err != nil {
  6638. return nil, err
  6639. }
  6640. return ret, nil
  6641. // {
  6642. // "description": "Lists the node pools for a cluster.",
  6643. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools",
  6644. // "httpMethod": "GET",
  6645. // "id": "container.projects.locations.clusters.nodePools.list",
  6646. // "parameterOrder": [
  6647. // "parent"
  6648. // ],
  6649. // "parameters": {
  6650. // "clusterId": {
  6651. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the parent field.",
  6652. // "location": "query",
  6653. // "type": "string"
  6654. // },
  6655. // "parent": {
  6656. // "description": "The parent (project, location, cluster id) where the node pools will be\nlisted. Specified in the format 'projects/*/locations/*/clusters/*'.",
  6657. // "location": "path",
  6658. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6659. // "required": true,
  6660. // "type": "string"
  6661. // },
  6662. // "projectId": {
  6663. // "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.",
  6664. // "location": "query",
  6665. // "type": "string"
  6666. // },
  6667. // "zone": {
  6668. // "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.",
  6669. // "location": "query",
  6670. // "type": "string"
  6671. // }
  6672. // },
  6673. // "path": "v1beta1/{+parent}/nodePools",
  6674. // "response": {
  6675. // "$ref": "ListNodePoolsResponse"
  6676. // },
  6677. // "scopes": [
  6678. // "https://www.googleapis.com/auth/cloud-platform"
  6679. // ]
  6680. // }
  6681. }
  6682. // method id "container.projects.locations.clusters.nodePools.rollback":
  6683. type ProjectsLocationsClustersNodePoolsRollbackCall struct {
  6684. s *Service
  6685. name string
  6686. rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest
  6687. urlParams_ gensupport.URLParams
  6688. ctx_ context.Context
  6689. header_ http.Header
  6690. }
  6691. // Rollback: Roll back the previously Aborted or Failed NodePool
  6692. // upgrade.
  6693. // This will be an no-op if the last upgrade successfully completed.
  6694. func (r *ProjectsLocationsClustersNodePoolsService) Rollback(name string, rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest) *ProjectsLocationsClustersNodePoolsRollbackCall {
  6695. c := &ProjectsLocationsClustersNodePoolsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6696. c.name = name
  6697. c.rollbacknodepoolupgraderequest = rollbacknodepoolupgraderequest
  6698. return c
  6699. }
  6700. // Fields allows partial responses to be retrieved. See
  6701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6702. // for more information.
  6703. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsRollbackCall {
  6704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6705. return c
  6706. }
  6707. // Context sets the context to be used in this call's Do method. Any
  6708. // pending HTTP request will be aborted if the provided context is
  6709. // canceled.
  6710. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsRollbackCall {
  6711. c.ctx_ = ctx
  6712. return c
  6713. }
  6714. // Header returns an http.Header that can be modified by the caller to
  6715. // add HTTP headers to the request.
  6716. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Header() http.Header {
  6717. if c.header_ == nil {
  6718. c.header_ = make(http.Header)
  6719. }
  6720. return c.header_
  6721. }
  6722. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) doRequest(alt string) (*http.Response, error) {
  6723. reqHeaders := make(http.Header)
  6724. for k, v := range c.header_ {
  6725. reqHeaders[k] = v
  6726. }
  6727. reqHeaders.Set("User-Agent", c.s.userAgent())
  6728. var body io.Reader = nil
  6729. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbacknodepoolupgraderequest)
  6730. if err != nil {
  6731. return nil, err
  6732. }
  6733. reqHeaders.Set("Content-Type", "application/json")
  6734. c.urlParams_.Set("alt", alt)
  6735. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:rollback")
  6736. urls += "?" + c.urlParams_.Encode()
  6737. req, _ := http.NewRequest("POST", urls, body)
  6738. req.Header = reqHeaders
  6739. googleapi.Expand(req.URL, map[string]string{
  6740. "name": c.name,
  6741. })
  6742. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6743. }
  6744. // Do executes the "container.projects.locations.clusters.nodePools.rollback" call.
  6745. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6746. // status code is an error. Response headers are in either
  6747. // *Operation.ServerResponse.Header or (if a response was returned at
  6748. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6749. // to check whether the returned error was because
  6750. // http.StatusNotModified was returned.
  6751. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6752. gensupport.SetOptions(c.urlParams_, opts...)
  6753. res, err := c.doRequest("json")
  6754. if res != nil && res.StatusCode == http.StatusNotModified {
  6755. if res.Body != nil {
  6756. res.Body.Close()
  6757. }
  6758. return nil, &googleapi.Error{
  6759. Code: res.StatusCode,
  6760. Header: res.Header,
  6761. }
  6762. }
  6763. if err != nil {
  6764. return nil, err
  6765. }
  6766. defer googleapi.CloseBody(res)
  6767. if err := googleapi.CheckResponse(res); err != nil {
  6768. return nil, err
  6769. }
  6770. ret := &Operation{
  6771. ServerResponse: googleapi.ServerResponse{
  6772. Header: res.Header,
  6773. HTTPStatusCode: res.StatusCode,
  6774. },
  6775. }
  6776. target := &ret
  6777. if err := gensupport.DecodeResponse(target, res); err != nil {
  6778. return nil, err
  6779. }
  6780. return ret, nil
  6781. // {
  6782. // "description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed.",
  6783. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:rollback",
  6784. // "httpMethod": "POST",
  6785. // "id": "container.projects.locations.clusters.nodePools.rollback",
  6786. // "parameterOrder": [
  6787. // "name"
  6788. // ],
  6789. // "parameters": {
  6790. // "name": {
  6791. // "description": "The name (project, location, cluster, node pool id) of the node poll to\nrollback upgrade.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.",
  6792. // "location": "path",
  6793. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6794. // "required": true,
  6795. // "type": "string"
  6796. // }
  6797. // },
  6798. // "path": "v1beta1/{+name}:rollback",
  6799. // "request": {
  6800. // "$ref": "RollbackNodePoolUpgradeRequest"
  6801. // },
  6802. // "response": {
  6803. // "$ref": "Operation"
  6804. // },
  6805. // "scopes": [
  6806. // "https://www.googleapis.com/auth/cloud-platform"
  6807. // ]
  6808. // }
  6809. }
  6810. // method id "container.projects.locations.clusters.nodePools.setAutoscaling":
  6811. type ProjectsLocationsClustersNodePoolsSetAutoscalingCall struct {
  6812. s *Service
  6813. name string
  6814. setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest
  6815. urlParams_ gensupport.URLParams
  6816. ctx_ context.Context
  6817. header_ http.Header
  6818. }
  6819. // SetAutoscaling: Sets the autoscaling settings of a specific node
  6820. // pool.
  6821. func (r *ProjectsLocationsClustersNodePoolsService) SetAutoscaling(name string, setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest) *ProjectsLocationsClustersNodePoolsSetAutoscalingCall {
  6822. c := &ProjectsLocationsClustersNodePoolsSetAutoscalingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6823. c.name = name
  6824. c.setnodepoolautoscalingrequest = setnodepoolautoscalingrequest
  6825. return c
  6826. }
  6827. // Fields allows partial responses to be retrieved. See
  6828. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6829. // for more information.
  6830. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsSetAutoscalingCall {
  6831. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6832. return c
  6833. }
  6834. // Context sets the context to be used in this call's Do method. Any
  6835. // pending HTTP request will be aborted if the provided context is
  6836. // canceled.
  6837. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsSetAutoscalingCall {
  6838. c.ctx_ = ctx
  6839. return c
  6840. }
  6841. // Header returns an http.Header that can be modified by the caller to
  6842. // add HTTP headers to the request.
  6843. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Header() http.Header {
  6844. if c.header_ == nil {
  6845. c.header_ = make(http.Header)
  6846. }
  6847. return c.header_
  6848. }
  6849. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) doRequest(alt string) (*http.Response, error) {
  6850. reqHeaders := make(http.Header)
  6851. for k, v := range c.header_ {
  6852. reqHeaders[k] = v
  6853. }
  6854. reqHeaders.Set("User-Agent", c.s.userAgent())
  6855. var body io.Reader = nil
  6856. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolautoscalingrequest)
  6857. if err != nil {
  6858. return nil, err
  6859. }
  6860. reqHeaders.Set("Content-Type", "application/json")
  6861. c.urlParams_.Set("alt", alt)
  6862. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setAutoscaling")
  6863. urls += "?" + c.urlParams_.Encode()
  6864. req, _ := http.NewRequest("POST", urls, body)
  6865. req.Header = reqHeaders
  6866. googleapi.Expand(req.URL, map[string]string{
  6867. "name": c.name,
  6868. })
  6869. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6870. }
  6871. // Do executes the "container.projects.locations.clusters.nodePools.setAutoscaling" call.
  6872. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6873. // status code is an error. Response headers are in either
  6874. // *Operation.ServerResponse.Header or (if a response was returned at
  6875. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6876. // to check whether the returned error was because
  6877. // http.StatusNotModified was returned.
  6878. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6879. gensupport.SetOptions(c.urlParams_, opts...)
  6880. res, err := c.doRequest("json")
  6881. if res != nil && res.StatusCode == http.StatusNotModified {
  6882. if res.Body != nil {
  6883. res.Body.Close()
  6884. }
  6885. return nil, &googleapi.Error{
  6886. Code: res.StatusCode,
  6887. Header: res.Header,
  6888. }
  6889. }
  6890. if err != nil {
  6891. return nil, err
  6892. }
  6893. defer googleapi.CloseBody(res)
  6894. if err := googleapi.CheckResponse(res); err != nil {
  6895. return nil, err
  6896. }
  6897. ret := &Operation{
  6898. ServerResponse: googleapi.ServerResponse{
  6899. Header: res.Header,
  6900. HTTPStatusCode: res.StatusCode,
  6901. },
  6902. }
  6903. target := &ret
  6904. if err := gensupport.DecodeResponse(target, res); err != nil {
  6905. return nil, err
  6906. }
  6907. return ret, nil
  6908. // {
  6909. // "description": "Sets the autoscaling settings of a specific node pool.",
  6910. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setAutoscaling",
  6911. // "httpMethod": "POST",
  6912. // "id": "container.projects.locations.clusters.nodePools.setAutoscaling",
  6913. // "parameterOrder": [
  6914. // "name"
  6915. // ],
  6916. // "parameters": {
  6917. // "name": {
  6918. // "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/*'.",
  6919. // "location": "path",
  6920. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6921. // "required": true,
  6922. // "type": "string"
  6923. // }
  6924. // },
  6925. // "path": "v1beta1/{+name}:setAutoscaling",
  6926. // "request": {
  6927. // "$ref": "SetNodePoolAutoscalingRequest"
  6928. // },
  6929. // "response": {
  6930. // "$ref": "Operation"
  6931. // },
  6932. // "scopes": [
  6933. // "https://www.googleapis.com/auth/cloud-platform"
  6934. // ]
  6935. // }
  6936. }
  6937. // method id "container.projects.locations.clusters.nodePools.setManagement":
  6938. type ProjectsLocationsClustersNodePoolsSetManagementCall struct {
  6939. s *Service
  6940. name string
  6941. setnodepoolmanagementrequest *SetNodePoolManagementRequest
  6942. urlParams_ gensupport.URLParams
  6943. ctx_ context.Context
  6944. header_ http.Header
  6945. }
  6946. // SetManagement: Sets the NodeManagement options for a node pool.
  6947. func (r *ProjectsLocationsClustersNodePoolsService) SetManagement(name string, setnodepoolmanagementrequest *SetNodePoolManagementRequest) *ProjectsLocationsClustersNodePoolsSetManagementCall {
  6948. c := &ProjectsLocationsClustersNodePoolsSetManagementCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6949. c.name = name
  6950. c.setnodepoolmanagementrequest = setnodepoolmanagementrequest
  6951. return c
  6952. }
  6953. // Fields allows partial responses to be retrieved. See
  6954. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6955. // for more information.
  6956. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsSetManagementCall {
  6957. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6958. return c
  6959. }
  6960. // Context sets the context to be used in this call's Do method. Any
  6961. // pending HTTP request will be aborted if the provided context is
  6962. // canceled.
  6963. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsSetManagementCall {
  6964. c.ctx_ = ctx
  6965. return c
  6966. }
  6967. // Header returns an http.Header that can be modified by the caller to
  6968. // add HTTP headers to the request.
  6969. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Header() http.Header {
  6970. if c.header_ == nil {
  6971. c.header_ = make(http.Header)
  6972. }
  6973. return c.header_
  6974. }
  6975. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) doRequest(alt string) (*http.Response, error) {
  6976. reqHeaders := make(http.Header)
  6977. for k, v := range c.header_ {
  6978. reqHeaders[k] = v
  6979. }
  6980. reqHeaders.Set("User-Agent", c.s.userAgent())
  6981. var body io.Reader = nil
  6982. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolmanagementrequest)
  6983. if err != nil {
  6984. return nil, err
  6985. }
  6986. reqHeaders.Set("Content-Type", "application/json")
  6987. c.urlParams_.Set("alt", alt)
  6988. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setManagement")
  6989. urls += "?" + c.urlParams_.Encode()
  6990. req, _ := http.NewRequest("POST", urls, body)
  6991. req.Header = reqHeaders
  6992. googleapi.Expand(req.URL, map[string]string{
  6993. "name": c.name,
  6994. })
  6995. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6996. }
  6997. // Do executes the "container.projects.locations.clusters.nodePools.setManagement" call.
  6998. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6999. // status code is an error. Response headers are in either
  7000. // *Operation.ServerResponse.Header or (if a response was returned at
  7001. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7002. // to check whether the returned error was because
  7003. // http.StatusNotModified was returned.
  7004. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7005. gensupport.SetOptions(c.urlParams_, opts...)
  7006. res, err := c.doRequest("json")
  7007. if res != nil && res.StatusCode == http.StatusNotModified {
  7008. if res.Body != nil {
  7009. res.Body.Close()
  7010. }
  7011. return nil, &googleapi.Error{
  7012. Code: res.StatusCode,
  7013. Header: res.Header,
  7014. }
  7015. }
  7016. if err != nil {
  7017. return nil, err
  7018. }
  7019. defer googleapi.CloseBody(res)
  7020. if err := googleapi.CheckResponse(res); err != nil {
  7021. return nil, err
  7022. }
  7023. ret := &Operation{
  7024. ServerResponse: googleapi.ServerResponse{
  7025. Header: res.Header,
  7026. HTTPStatusCode: res.StatusCode,
  7027. },
  7028. }
  7029. target := &ret
  7030. if err := gensupport.DecodeResponse(target, res); err != nil {
  7031. return nil, err
  7032. }
  7033. return ret, nil
  7034. // {
  7035. // "description": "Sets the NodeManagement options for a node pool.",
  7036. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setManagement",
  7037. // "httpMethod": "POST",
  7038. // "id": "container.projects.locations.clusters.nodePools.setManagement",
  7039. // "parameterOrder": [
  7040. // "name"
  7041. // ],
  7042. // "parameters": {
  7043. // "name": {
  7044. // "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/*'.",
  7045. // "location": "path",
  7046. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  7047. // "required": true,
  7048. // "type": "string"
  7049. // }
  7050. // },
  7051. // "path": "v1beta1/{+name}:setManagement",
  7052. // "request": {
  7053. // "$ref": "SetNodePoolManagementRequest"
  7054. // },
  7055. // "response": {
  7056. // "$ref": "Operation"
  7057. // },
  7058. // "scopes": [
  7059. // "https://www.googleapis.com/auth/cloud-platform"
  7060. // ]
  7061. // }
  7062. }
  7063. // method id "container.projects.locations.clusters.nodePools.setSize":
  7064. type ProjectsLocationsClustersNodePoolsSetSizeCall struct {
  7065. s *Service
  7066. name string
  7067. setnodepoolsizerequest *SetNodePoolSizeRequest
  7068. urlParams_ gensupport.URLParams
  7069. ctx_ context.Context
  7070. header_ http.Header
  7071. }
  7072. // SetSize: Sets the size for a specific node pool.
  7073. func (r *ProjectsLocationsClustersNodePoolsService) SetSize(name string, setnodepoolsizerequest *SetNodePoolSizeRequest) *ProjectsLocationsClustersNodePoolsSetSizeCall {
  7074. c := &ProjectsLocationsClustersNodePoolsSetSizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7075. c.name = name
  7076. c.setnodepoolsizerequest = setnodepoolsizerequest
  7077. return c
  7078. }
  7079. // Fields allows partial responses to be retrieved. See
  7080. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7081. // for more information.
  7082. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsSetSizeCall {
  7083. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7084. return c
  7085. }
  7086. // Context sets the context to be used in this call's Do method. Any
  7087. // pending HTTP request will be aborted if the provided context is
  7088. // canceled.
  7089. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsSetSizeCall {
  7090. c.ctx_ = ctx
  7091. return c
  7092. }
  7093. // Header returns an http.Header that can be modified by the caller to
  7094. // add HTTP headers to the request.
  7095. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Header() http.Header {
  7096. if c.header_ == nil {
  7097. c.header_ = make(http.Header)
  7098. }
  7099. return c.header_
  7100. }
  7101. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) doRequest(alt string) (*http.Response, error) {
  7102. reqHeaders := make(http.Header)
  7103. for k, v := range c.header_ {
  7104. reqHeaders[k] = v
  7105. }
  7106. reqHeaders.Set("User-Agent", c.s.userAgent())
  7107. var body io.Reader = nil
  7108. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolsizerequest)
  7109. if err != nil {
  7110. return nil, err
  7111. }
  7112. reqHeaders.Set("Content-Type", "application/json")
  7113. c.urlParams_.Set("alt", alt)
  7114. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setSize")
  7115. urls += "?" + c.urlParams_.Encode()
  7116. req, _ := http.NewRequest("POST", urls, body)
  7117. req.Header = reqHeaders
  7118. googleapi.Expand(req.URL, map[string]string{
  7119. "name": c.name,
  7120. })
  7121. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7122. }
  7123. // Do executes the "container.projects.locations.clusters.nodePools.setSize" call.
  7124. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7125. // status code is an error. Response headers are in either
  7126. // *Operation.ServerResponse.Header or (if a response was returned at
  7127. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7128. // to check whether the returned error was because
  7129. // http.StatusNotModified was returned.
  7130. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7131. gensupport.SetOptions(c.urlParams_, opts...)
  7132. res, err := c.doRequest("json")
  7133. if res != nil && res.StatusCode == http.StatusNotModified {
  7134. if res.Body != nil {
  7135. res.Body.Close()
  7136. }
  7137. return nil, &googleapi.Error{
  7138. Code: res.StatusCode,
  7139. Header: res.Header,
  7140. }
  7141. }
  7142. if err != nil {
  7143. return nil, err
  7144. }
  7145. defer googleapi.CloseBody(res)
  7146. if err := googleapi.CheckResponse(res); err != nil {
  7147. return nil, err
  7148. }
  7149. ret := &Operation{
  7150. ServerResponse: googleapi.ServerResponse{
  7151. Header: res.Header,
  7152. HTTPStatusCode: res.StatusCode,
  7153. },
  7154. }
  7155. target := &ret
  7156. if err := gensupport.DecodeResponse(target, res); err != nil {
  7157. return nil, err
  7158. }
  7159. return ret, nil
  7160. // {
  7161. // "description": "Sets the size for a specific node pool.",
  7162. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setSize",
  7163. // "httpMethod": "POST",
  7164. // "id": "container.projects.locations.clusters.nodePools.setSize",
  7165. // "parameterOrder": [
  7166. // "name"
  7167. // ],
  7168. // "parameters": {
  7169. // "name": {
  7170. // "description": "The name (project, location, cluster, node pool id) of the node pool to set\nsize.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.",
  7171. // "location": "path",
  7172. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  7173. // "required": true,
  7174. // "type": "string"
  7175. // }
  7176. // },
  7177. // "path": "v1beta1/{+name}:setSize",
  7178. // "request": {
  7179. // "$ref": "SetNodePoolSizeRequest"
  7180. // },
  7181. // "response": {
  7182. // "$ref": "Operation"
  7183. // },
  7184. // "scopes": [
  7185. // "https://www.googleapis.com/auth/cloud-platform"
  7186. // ]
  7187. // }
  7188. }
  7189. // method id "container.projects.locations.clusters.nodePools.update":
  7190. type ProjectsLocationsClustersNodePoolsUpdateCall struct {
  7191. s *Service
  7192. name string
  7193. updatenodepoolrequest *UpdateNodePoolRequest
  7194. urlParams_ gensupport.URLParams
  7195. ctx_ context.Context
  7196. header_ http.Header
  7197. }
  7198. // Update: Updates the version and/or image type of a specific node
  7199. // pool.
  7200. func (r *ProjectsLocationsClustersNodePoolsService) Update(name string, updatenodepoolrequest *UpdateNodePoolRequest) *ProjectsLocationsClustersNodePoolsUpdateCall {
  7201. c := &ProjectsLocationsClustersNodePoolsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7202. c.name = name
  7203. c.updatenodepoolrequest = updatenodepoolrequest
  7204. return c
  7205. }
  7206. // Fields allows partial responses to be retrieved. See
  7207. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7208. // for more information.
  7209. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsUpdateCall {
  7210. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7211. return c
  7212. }
  7213. // Context sets the context to be used in this call's Do method. Any
  7214. // pending HTTP request will be aborted if the provided context is
  7215. // canceled.
  7216. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsUpdateCall {
  7217. c.ctx_ = ctx
  7218. return c
  7219. }
  7220. // Header returns an http.Header that can be modified by the caller to
  7221. // add HTTP headers to the request.
  7222. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Header() http.Header {
  7223. if c.header_ == nil {
  7224. c.header_ = make(http.Header)
  7225. }
  7226. return c.header_
  7227. }
  7228. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7229. reqHeaders := make(http.Header)
  7230. for k, v := range c.header_ {
  7231. reqHeaders[k] = v
  7232. }
  7233. reqHeaders.Set("User-Agent", c.s.userAgent())
  7234. var body io.Reader = nil
  7235. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatenodepoolrequest)
  7236. if err != nil {
  7237. return nil, err
  7238. }
  7239. reqHeaders.Set("Content-Type", "application/json")
  7240. c.urlParams_.Set("alt", alt)
  7241. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  7242. urls += "?" + c.urlParams_.Encode()
  7243. req, _ := http.NewRequest("PUT", urls, body)
  7244. req.Header = reqHeaders
  7245. googleapi.Expand(req.URL, map[string]string{
  7246. "name": c.name,
  7247. })
  7248. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7249. }
  7250. // Do executes the "container.projects.locations.clusters.nodePools.update" call.
  7251. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7252. // status code is an error. Response headers are in either
  7253. // *Operation.ServerResponse.Header or (if a response was returned at
  7254. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7255. // to check whether the returned error was because
  7256. // http.StatusNotModified was returned.
  7257. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7258. gensupport.SetOptions(c.urlParams_, opts...)
  7259. res, err := c.doRequest("json")
  7260. if res != nil && res.StatusCode == http.StatusNotModified {
  7261. if res.Body != nil {
  7262. res.Body.Close()
  7263. }
  7264. return nil, &googleapi.Error{
  7265. Code: res.StatusCode,
  7266. Header: res.Header,
  7267. }
  7268. }
  7269. if err != nil {
  7270. return nil, err
  7271. }
  7272. defer googleapi.CloseBody(res)
  7273. if err := googleapi.CheckResponse(res); err != nil {
  7274. return nil, err
  7275. }
  7276. ret := &Operation{
  7277. ServerResponse: googleapi.ServerResponse{
  7278. Header: res.Header,
  7279. HTTPStatusCode: res.StatusCode,
  7280. },
  7281. }
  7282. target := &ret
  7283. if err := gensupport.DecodeResponse(target, res); err != nil {
  7284. return nil, err
  7285. }
  7286. return ret, nil
  7287. // {
  7288. // "description": "Updates the version and/or image type of a specific node pool.",
  7289. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
  7290. // "httpMethod": "PUT",
  7291. // "id": "container.projects.locations.clusters.nodePools.update",
  7292. // "parameterOrder": [
  7293. // "name"
  7294. // ],
  7295. // "parameters": {
  7296. // "name": {
  7297. // "description": "The name (project, location, cluster, node pool) of the node pool to\nupdate. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  7298. // "location": "path",
  7299. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  7300. // "required": true,
  7301. // "type": "string"
  7302. // }
  7303. // },
  7304. // "path": "v1beta1/{+name}",
  7305. // "request": {
  7306. // "$ref": "UpdateNodePoolRequest"
  7307. // },
  7308. // "response": {
  7309. // "$ref": "Operation"
  7310. // },
  7311. // "scopes": [
  7312. // "https://www.googleapis.com/auth/cloud-platform"
  7313. // ]
  7314. // }
  7315. }
  7316. // method id "container.projects.locations.operations.cancel":
  7317. type ProjectsLocationsOperationsCancelCall struct {
  7318. s *Service
  7319. name string
  7320. canceloperationrequest *CancelOperationRequest
  7321. urlParams_ gensupport.URLParams
  7322. ctx_ context.Context
  7323. header_ http.Header
  7324. }
  7325. // Cancel: Cancels the specified operation.
  7326. func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
  7327. c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7328. c.name = name
  7329. c.canceloperationrequest = canceloperationrequest
  7330. return c
  7331. }
  7332. // Fields allows partial responses to be retrieved. See
  7333. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7334. // for more information.
  7335. func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
  7336. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7337. return c
  7338. }
  7339. // Context sets the context to be used in this call's Do method. Any
  7340. // pending HTTP request will be aborted if the provided context is
  7341. // canceled.
  7342. func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
  7343. c.ctx_ = ctx
  7344. return c
  7345. }
  7346. // Header returns an http.Header that can be modified by the caller to
  7347. // add HTTP headers to the request.
  7348. func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
  7349. if c.header_ == nil {
  7350. c.header_ = make(http.Header)
  7351. }
  7352. return c.header_
  7353. }
  7354. func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  7355. reqHeaders := make(http.Header)
  7356. for k, v := range c.header_ {
  7357. reqHeaders[k] = v
  7358. }
  7359. reqHeaders.Set("User-Agent", c.s.userAgent())
  7360. var body io.Reader = nil
  7361. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  7362. if err != nil {
  7363. return nil, err
  7364. }
  7365. reqHeaders.Set("Content-Type", "application/json")
  7366. c.urlParams_.Set("alt", alt)
  7367. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel")
  7368. urls += "?" + c.urlParams_.Encode()
  7369. req, _ := http.NewRequest("POST", urls, body)
  7370. req.Header = reqHeaders
  7371. googleapi.Expand(req.URL, map[string]string{
  7372. "name": c.name,
  7373. })
  7374. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7375. }
  7376. // Do executes the "container.projects.locations.operations.cancel" call.
  7377. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  7378. // code is an error. Response headers are in either
  7379. // *Empty.ServerResponse.Header or (if a response was returned at all)
  7380. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7381. // check whether the returned error was because http.StatusNotModified
  7382. // was returned.
  7383. func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  7384. gensupport.SetOptions(c.urlParams_, opts...)
  7385. res, err := c.doRequest("json")
  7386. if res != nil && res.StatusCode == http.StatusNotModified {
  7387. if res.Body != nil {
  7388. res.Body.Close()
  7389. }
  7390. return nil, &googleapi.Error{
  7391. Code: res.StatusCode,
  7392. Header: res.Header,
  7393. }
  7394. }
  7395. if err != nil {
  7396. return nil, err
  7397. }
  7398. defer googleapi.CloseBody(res)
  7399. if err := googleapi.CheckResponse(res); err != nil {
  7400. return nil, err
  7401. }
  7402. ret := &Empty{
  7403. ServerResponse: googleapi.ServerResponse{
  7404. Header: res.Header,
  7405. HTTPStatusCode: res.StatusCode,
  7406. },
  7407. }
  7408. target := &ret
  7409. if err := gensupport.DecodeResponse(target, res); err != nil {
  7410. return nil, err
  7411. }
  7412. return ret, nil
  7413. // {
  7414. // "description": "Cancels the specified operation.",
  7415. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel",
  7416. // "httpMethod": "POST",
  7417. // "id": "container.projects.locations.operations.cancel",
  7418. // "parameterOrder": [
  7419. // "name"
  7420. // ],
  7421. // "parameters": {
  7422. // "name": {
  7423. // "description": "The name (project, location, operation id) of the operation to cancel.\nSpecified in the format 'projects/*/locations/*/operations/*'.",
  7424. // "location": "path",
  7425. // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  7426. // "required": true,
  7427. // "type": "string"
  7428. // }
  7429. // },
  7430. // "path": "v1beta1/{+name}:cancel",
  7431. // "request": {
  7432. // "$ref": "CancelOperationRequest"
  7433. // },
  7434. // "response": {
  7435. // "$ref": "Empty"
  7436. // },
  7437. // "scopes": [
  7438. // "https://www.googleapis.com/auth/cloud-platform"
  7439. // ]
  7440. // }
  7441. }
  7442. // method id "container.projects.locations.operations.get":
  7443. type ProjectsLocationsOperationsGetCall struct {
  7444. s *Service
  7445. name string
  7446. urlParams_ gensupport.URLParams
  7447. ifNoneMatch_ string
  7448. ctx_ context.Context
  7449. header_ http.Header
  7450. }
  7451. // Get: Gets the specified operation.
  7452. func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  7453. c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7454. c.name = name
  7455. return c
  7456. }
  7457. // OperationId sets the optional parameter "operationId": Deprecated.
  7458. // The server-assigned `name` of the operation.
  7459. // This field has been deprecated and replaced by the name field.
  7460. func (c *ProjectsLocationsOperationsGetCall) OperationId(operationId string) *ProjectsLocationsOperationsGetCall {
  7461. c.urlParams_.Set("operationId", operationId)
  7462. return c
  7463. }
  7464. // ProjectId sets the optional parameter "projectId": Deprecated. The
  7465. // Google Developers Console [project ID or
  7466. // project
  7467. // number](https://support.google.com/cloud/answer/6158840).
  7468. // This
  7469. // field has been deprecated and replaced by the name field.
  7470. func (c *ProjectsLocationsOperationsGetCall) ProjectId(projectId string) *ProjectsLocationsOperationsGetCall {
  7471. c.urlParams_.Set("projectId", projectId)
  7472. return c
  7473. }
  7474. // Zone sets the optional parameter "zone": Deprecated. The name of the
  7475. // Google Compute Engine
  7476. // [zone](/compute/docs/zones#available) in which the
  7477. // cluster
  7478. // resides.
  7479. // This field has been deprecated and replaced by the name field.
  7480. func (c *ProjectsLocationsOperationsGetCall) Zone(zone string) *ProjectsLocationsOperationsGetCall {
  7481. c.urlParams_.Set("zone", zone)
  7482. return c
  7483. }
  7484. // Fields allows partial responses to be retrieved. See
  7485. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7486. // for more information.
  7487. func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  7488. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7489. return c
  7490. }
  7491. // IfNoneMatch sets the optional parameter which makes the operation
  7492. // fail if the object's ETag matches the given value. This is useful for
  7493. // getting updates only after the object has changed since the last
  7494. // request. Use googleapi.IsNotModified to check whether the response
  7495. // error from Do is the result of In-None-Match.
  7496. func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  7497. c.ifNoneMatch_ = entityTag
  7498. return c
  7499. }
  7500. // Context sets the context to be used in this call's Do method. Any
  7501. // pending HTTP request will be aborted if the provided context is
  7502. // canceled.
  7503. func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  7504. c.ctx_ = ctx
  7505. return c
  7506. }
  7507. // Header returns an http.Header that can be modified by the caller to
  7508. // add HTTP headers to the request.
  7509. func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  7510. if c.header_ == nil {
  7511. c.header_ = make(http.Header)
  7512. }
  7513. return c.header_
  7514. }
  7515. func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  7516. reqHeaders := make(http.Header)
  7517. for k, v := range c.header_ {
  7518. reqHeaders[k] = v
  7519. }
  7520. reqHeaders.Set("User-Agent", c.s.userAgent())
  7521. if c.ifNoneMatch_ != "" {
  7522. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7523. }
  7524. var body io.Reader = nil
  7525. c.urlParams_.Set("alt", alt)
  7526. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  7527. urls += "?" + c.urlParams_.Encode()
  7528. req, _ := http.NewRequest("GET", urls, body)
  7529. req.Header = reqHeaders
  7530. googleapi.Expand(req.URL, map[string]string{
  7531. "name": c.name,
  7532. })
  7533. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7534. }
  7535. // Do executes the "container.projects.locations.operations.get" call.
  7536. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7537. // status code is an error. Response headers are in either
  7538. // *Operation.ServerResponse.Header or (if a response was returned at
  7539. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7540. // to check whether the returned error was because
  7541. // http.StatusNotModified was returned.
  7542. func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7543. gensupport.SetOptions(c.urlParams_, opts...)
  7544. res, err := c.doRequest("json")
  7545. if res != nil && res.StatusCode == http.StatusNotModified {
  7546. if res.Body != nil {
  7547. res.Body.Close()
  7548. }
  7549. return nil, &googleapi.Error{
  7550. Code: res.StatusCode,
  7551. Header: res.Header,
  7552. }
  7553. }
  7554. if err != nil {
  7555. return nil, err
  7556. }
  7557. defer googleapi.CloseBody(res)
  7558. if err := googleapi.CheckResponse(res); err != nil {
  7559. return nil, err
  7560. }
  7561. ret := &Operation{
  7562. ServerResponse: googleapi.ServerResponse{
  7563. Header: res.Header,
  7564. HTTPStatusCode: res.StatusCode,
  7565. },
  7566. }
  7567. target := &ret
  7568. if err := gensupport.DecodeResponse(target, res); err != nil {
  7569. return nil, err
  7570. }
  7571. return ret, nil
  7572. // {
  7573. // "description": "Gets the specified operation.",
  7574. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
  7575. // "httpMethod": "GET",
  7576. // "id": "container.projects.locations.operations.get",
  7577. // "parameterOrder": [
  7578. // "name"
  7579. // ],
  7580. // "parameters": {
  7581. // "name": {
  7582. // "description": "The name (project, location, operation id) of the operation to get.\nSpecified in the format 'projects/*/locations/*/operations/*'.",
  7583. // "location": "path",
  7584. // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  7585. // "required": true,
  7586. // "type": "string"
  7587. // },
  7588. // "operationId": {
  7589. // "description": "Deprecated. The server-assigned `name` of the operation.\nThis field has been deprecated and replaced by the name field.",
  7590. // "location": "query",
  7591. // "type": "string"
  7592. // },
  7593. // "projectId": {
  7594. // "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.",
  7595. // "location": "query",
  7596. // "type": "string"
  7597. // },
  7598. // "zone": {
  7599. // "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.",
  7600. // "location": "query",
  7601. // "type": "string"
  7602. // }
  7603. // },
  7604. // "path": "v1beta1/{+name}",
  7605. // "response": {
  7606. // "$ref": "Operation"
  7607. // },
  7608. // "scopes": [
  7609. // "https://www.googleapis.com/auth/cloud-platform"
  7610. // ]
  7611. // }
  7612. }
  7613. // method id "container.projects.locations.operations.list":
  7614. type ProjectsLocationsOperationsListCall struct {
  7615. s *Service
  7616. parent string
  7617. urlParams_ gensupport.URLParams
  7618. ifNoneMatch_ string
  7619. ctx_ context.Context
  7620. header_ http.Header
  7621. }
  7622. // List: Lists all operations in a project in a specific zone or all
  7623. // zones.
  7624. func (r *ProjectsLocationsOperationsService) List(parent string) *ProjectsLocationsOperationsListCall {
  7625. c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7626. c.parent = parent
  7627. return c
  7628. }
  7629. // ProjectId sets the optional parameter "projectId": Deprecated. The
  7630. // Google Developers Console [project ID or
  7631. // project
  7632. // number](https://support.google.com/cloud/answer/6158840).
  7633. // This
  7634. // field has been deprecated and replaced by the parent field.
  7635. func (c *ProjectsLocationsOperationsListCall) ProjectId(projectId string) *ProjectsLocationsOperationsListCall {
  7636. c.urlParams_.Set("projectId", projectId)
  7637. return c
  7638. }
  7639. // Zone sets the optional parameter "zone": Deprecated. The name of the
  7640. // Google Compute Engine
  7641. // [zone](/compute/docs/zones#available) to return operations for, or
  7642. // `-` for
  7643. // all zones. This field has been deprecated and replaced by the parent
  7644. // field.
  7645. func (c *ProjectsLocationsOperationsListCall) Zone(zone string) *ProjectsLocationsOperationsListCall {
  7646. c.urlParams_.Set("zone", zone)
  7647. return c
  7648. }
  7649. // Fields allows partial responses to be retrieved. See
  7650. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7651. // for more information.
  7652. func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  7653. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7654. return c
  7655. }
  7656. // IfNoneMatch sets the optional parameter which makes the operation
  7657. // fail if the object's ETag matches the given value. This is useful for
  7658. // getting updates only after the object has changed since the last
  7659. // request. Use googleapi.IsNotModified to check whether the response
  7660. // error from Do is the result of In-None-Match.
  7661. func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  7662. c.ifNoneMatch_ = entityTag
  7663. return c
  7664. }
  7665. // Context sets the context to be used in this call's Do method. Any
  7666. // pending HTTP request will be aborted if the provided context is
  7667. // canceled.
  7668. func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  7669. c.ctx_ = ctx
  7670. return c
  7671. }
  7672. // Header returns an http.Header that can be modified by the caller to
  7673. // add HTTP headers to the request.
  7674. func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  7675. if c.header_ == nil {
  7676. c.header_ = make(http.Header)
  7677. }
  7678. return c.header_
  7679. }
  7680. func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  7681. reqHeaders := make(http.Header)
  7682. for k, v := range c.header_ {
  7683. reqHeaders[k] = v
  7684. }
  7685. reqHeaders.Set("User-Agent", c.s.userAgent())
  7686. if c.ifNoneMatch_ != "" {
  7687. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7688. }
  7689. var body io.Reader = nil
  7690. c.urlParams_.Set("alt", alt)
  7691. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/operations")
  7692. urls += "?" + c.urlParams_.Encode()
  7693. req, _ := http.NewRequest("GET", urls, body)
  7694. req.Header = reqHeaders
  7695. googleapi.Expand(req.URL, map[string]string{
  7696. "parent": c.parent,
  7697. })
  7698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7699. }
  7700. // Do executes the "container.projects.locations.operations.list" call.
  7701. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  7702. // non-2xx status code is an error. Response headers are in either
  7703. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  7704. // returned at all) in error.(*googleapi.Error).Header. Use
  7705. // googleapi.IsNotModified to check whether the returned error was
  7706. // because http.StatusNotModified was returned.
  7707. func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  7708. gensupport.SetOptions(c.urlParams_, opts...)
  7709. res, err := c.doRequest("json")
  7710. if res != nil && res.StatusCode == http.StatusNotModified {
  7711. if res.Body != nil {
  7712. res.Body.Close()
  7713. }
  7714. return nil, &googleapi.Error{
  7715. Code: res.StatusCode,
  7716. Header: res.Header,
  7717. }
  7718. }
  7719. if err != nil {
  7720. return nil, err
  7721. }
  7722. defer googleapi.CloseBody(res)
  7723. if err := googleapi.CheckResponse(res); err != nil {
  7724. return nil, err
  7725. }
  7726. ret := &ListOperationsResponse{
  7727. ServerResponse: googleapi.ServerResponse{
  7728. Header: res.Header,
  7729. HTTPStatusCode: res.StatusCode,
  7730. },
  7731. }
  7732. target := &ret
  7733. if err := gensupport.DecodeResponse(target, res); err != nil {
  7734. return nil, err
  7735. }
  7736. return ret, nil
  7737. // {
  7738. // "description": "Lists all operations in a project in a specific zone or all zones.",
  7739. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations",
  7740. // "httpMethod": "GET",
  7741. // "id": "container.projects.locations.operations.list",
  7742. // "parameterOrder": [
  7743. // "parent"
  7744. // ],
  7745. // "parameters": {
  7746. // "parent": {
  7747. // "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.",
  7748. // "location": "path",
  7749. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  7750. // "required": true,
  7751. // "type": "string"
  7752. // },
  7753. // "projectId": {
  7754. // "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.",
  7755. // "location": "query",
  7756. // "type": "string"
  7757. // },
  7758. // "zone": {
  7759. // "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.",
  7760. // "location": "query",
  7761. // "type": "string"
  7762. // }
  7763. // },
  7764. // "path": "v1beta1/{+parent}/operations",
  7765. // "response": {
  7766. // "$ref": "ListOperationsResponse"
  7767. // },
  7768. // "scopes": [
  7769. // "https://www.googleapis.com/auth/cloud-platform"
  7770. // ]
  7771. // }
  7772. }
  7773. // method id "container.projects.zones.getServerconfig":
  7774. type ProjectsZonesGetServerconfigCall struct {
  7775. s *Service
  7776. projectId string
  7777. zone string
  7778. urlParams_ gensupport.URLParams
  7779. ifNoneMatch_ string
  7780. ctx_ context.Context
  7781. header_ http.Header
  7782. }
  7783. // GetServerconfig: Returns configuration info about the Kubernetes
  7784. // Engine service.
  7785. func (r *ProjectsZonesService) GetServerconfig(projectId string, zone string) *ProjectsZonesGetServerconfigCall {
  7786. c := &ProjectsZonesGetServerconfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7787. c.projectId = projectId
  7788. c.zone = zone
  7789. return c
  7790. }
  7791. // Name sets the optional parameter "name": The name (project and
  7792. // location) of the server config to get
  7793. // Specified in the format 'projects/*/locations/*'.
  7794. func (c *ProjectsZonesGetServerconfigCall) Name(name string) *ProjectsZonesGetServerconfigCall {
  7795. c.urlParams_.Set("name", name)
  7796. return c
  7797. }
  7798. // Fields allows partial responses to be retrieved. See
  7799. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7800. // for more information.
  7801. func (c *ProjectsZonesGetServerconfigCall) Fields(s ...googleapi.Field) *ProjectsZonesGetServerconfigCall {
  7802. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7803. return c
  7804. }
  7805. // IfNoneMatch sets the optional parameter which makes the operation
  7806. // fail if the object's ETag matches the given value. This is useful for
  7807. // getting updates only after the object has changed since the last
  7808. // request. Use googleapi.IsNotModified to check whether the response
  7809. // error from Do is the result of In-None-Match.
  7810. func (c *ProjectsZonesGetServerconfigCall) IfNoneMatch(entityTag string) *ProjectsZonesGetServerconfigCall {
  7811. c.ifNoneMatch_ = entityTag
  7812. return c
  7813. }
  7814. // Context sets the context to be used in this call's Do method. Any
  7815. // pending HTTP request will be aborted if the provided context is
  7816. // canceled.
  7817. func (c *ProjectsZonesGetServerconfigCall) Context(ctx context.Context) *ProjectsZonesGetServerconfigCall {
  7818. c.ctx_ = ctx
  7819. return c
  7820. }
  7821. // Header returns an http.Header that can be modified by the caller to
  7822. // add HTTP headers to the request.
  7823. func (c *ProjectsZonesGetServerconfigCall) Header() http.Header {
  7824. if c.header_ == nil {
  7825. c.header_ = make(http.Header)
  7826. }
  7827. return c.header_
  7828. }
  7829. func (c *ProjectsZonesGetServerconfigCall) doRequest(alt string) (*http.Response, error) {
  7830. reqHeaders := make(http.Header)
  7831. for k, v := range c.header_ {
  7832. reqHeaders[k] = v
  7833. }
  7834. reqHeaders.Set("User-Agent", c.s.userAgent())
  7835. if c.ifNoneMatch_ != "" {
  7836. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7837. }
  7838. var body io.Reader = nil
  7839. c.urlParams_.Set("alt", alt)
  7840. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/serverconfig")
  7841. urls += "?" + c.urlParams_.Encode()
  7842. req, _ := http.NewRequest("GET", urls, body)
  7843. req.Header = reqHeaders
  7844. googleapi.Expand(req.URL, map[string]string{
  7845. "projectId": c.projectId,
  7846. "zone": c.zone,
  7847. })
  7848. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7849. }
  7850. // Do executes the "container.projects.zones.getServerconfig" call.
  7851. // Exactly one of *ServerConfig or error will be non-nil. Any non-2xx
  7852. // status code is an error. Response headers are in either
  7853. // *ServerConfig.ServerResponse.Header or (if a response was returned at
  7854. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7855. // to check whether the returned error was because
  7856. // http.StatusNotModified was returned.
  7857. func (c *ProjectsZonesGetServerconfigCall) Do(opts ...googleapi.CallOption) (*ServerConfig, error) {
  7858. gensupport.SetOptions(c.urlParams_, opts...)
  7859. res, err := c.doRequest("json")
  7860. if res != nil && res.StatusCode == http.StatusNotModified {
  7861. if res.Body != nil {
  7862. res.Body.Close()
  7863. }
  7864. return nil, &googleapi.Error{
  7865. Code: res.StatusCode,
  7866. Header: res.Header,
  7867. }
  7868. }
  7869. if err != nil {
  7870. return nil, err
  7871. }
  7872. defer googleapi.CloseBody(res)
  7873. if err := googleapi.CheckResponse(res); err != nil {
  7874. return nil, err
  7875. }
  7876. ret := &ServerConfig{
  7877. ServerResponse: googleapi.ServerResponse{
  7878. Header: res.Header,
  7879. HTTPStatusCode: res.StatusCode,
  7880. },
  7881. }
  7882. target := &ret
  7883. if err := gensupport.DecodeResponse(target, res); err != nil {
  7884. return nil, err
  7885. }
  7886. return ret, nil
  7887. // {
  7888. // "description": "Returns configuration info about the Kubernetes Engine service.",
  7889. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/serverconfig",
  7890. // "httpMethod": "GET",
  7891. // "id": "container.projects.zones.getServerconfig",
  7892. // "parameterOrder": [
  7893. // "projectId",
  7894. // "zone"
  7895. // ],
  7896. // "parameters": {
  7897. // "name": {
  7898. // "description": "The name (project and location) of the server config to get\nSpecified in the format 'projects/*/locations/*'.",
  7899. // "location": "query",
  7900. // "type": "string"
  7901. // },
  7902. // "projectId": {
  7903. // "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.",
  7904. // "location": "path",
  7905. // "required": true,
  7906. // "type": "string"
  7907. // },
  7908. // "zone": {
  7909. // "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.",
  7910. // "location": "path",
  7911. // "required": true,
  7912. // "type": "string"
  7913. // }
  7914. // },
  7915. // "path": "v1beta1/projects/{projectId}/zones/{zone}/serverconfig",
  7916. // "response": {
  7917. // "$ref": "ServerConfig"
  7918. // },
  7919. // "scopes": [
  7920. // "https://www.googleapis.com/auth/cloud-platform"
  7921. // ]
  7922. // }
  7923. }
  7924. // method id "container.projects.zones.clusters.addons":
  7925. type ProjectsZonesClustersAddonsCall struct {
  7926. s *Service
  7927. projectId string
  7928. zone string
  7929. clusterId string
  7930. setaddonsconfigrequest *SetAddonsConfigRequest
  7931. urlParams_ gensupport.URLParams
  7932. ctx_ context.Context
  7933. header_ http.Header
  7934. }
  7935. // Addons: Sets the addons for a specific cluster.
  7936. func (r *ProjectsZonesClustersService) Addons(projectId string, zone string, clusterId string, setaddonsconfigrequest *SetAddonsConfigRequest) *ProjectsZonesClustersAddonsCall {
  7937. c := &ProjectsZonesClustersAddonsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7938. c.projectId = projectId
  7939. c.zone = zone
  7940. c.clusterId = clusterId
  7941. c.setaddonsconfigrequest = setaddonsconfigrequest
  7942. return c
  7943. }
  7944. // Fields allows partial responses to be retrieved. See
  7945. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7946. // for more information.
  7947. func (c *ProjectsZonesClustersAddonsCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersAddonsCall {
  7948. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7949. return c
  7950. }
  7951. // Context sets the context to be used in this call's Do method. Any
  7952. // pending HTTP request will be aborted if the provided context is
  7953. // canceled.
  7954. func (c *ProjectsZonesClustersAddonsCall) Context(ctx context.Context) *ProjectsZonesClustersAddonsCall {
  7955. c.ctx_ = ctx
  7956. return c
  7957. }
  7958. // Header returns an http.Header that can be modified by the caller to
  7959. // add HTTP headers to the request.
  7960. func (c *ProjectsZonesClustersAddonsCall) Header() http.Header {
  7961. if c.header_ == nil {
  7962. c.header_ = make(http.Header)
  7963. }
  7964. return c.header_
  7965. }
  7966. func (c *ProjectsZonesClustersAddonsCall) doRequest(alt string) (*http.Response, error) {
  7967. reqHeaders := make(http.Header)
  7968. for k, v := range c.header_ {
  7969. reqHeaders[k] = v
  7970. }
  7971. reqHeaders.Set("User-Agent", c.s.userAgent())
  7972. var body io.Reader = nil
  7973. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setaddonsconfigrequest)
  7974. if err != nil {
  7975. return nil, err
  7976. }
  7977. reqHeaders.Set("Content-Type", "application/json")
  7978. c.urlParams_.Set("alt", alt)
  7979. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons")
  7980. urls += "?" + c.urlParams_.Encode()
  7981. req, _ := http.NewRequest("POST", urls, body)
  7982. req.Header = reqHeaders
  7983. googleapi.Expand(req.URL, map[string]string{
  7984. "projectId": c.projectId,
  7985. "zone": c.zone,
  7986. "clusterId": c.clusterId,
  7987. })
  7988. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7989. }
  7990. // Do executes the "container.projects.zones.clusters.addons" call.
  7991. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7992. // status code is an error. Response headers are in either
  7993. // *Operation.ServerResponse.Header or (if a response was returned at
  7994. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7995. // to check whether the returned error was because
  7996. // http.StatusNotModified was returned.
  7997. func (c *ProjectsZonesClustersAddonsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7998. gensupport.SetOptions(c.urlParams_, opts...)
  7999. res, err := c.doRequest("json")
  8000. if res != nil && res.StatusCode == http.StatusNotModified {
  8001. if res.Body != nil {
  8002. res.Body.Close()
  8003. }
  8004. return nil, &googleapi.Error{
  8005. Code: res.StatusCode,
  8006. Header: res.Header,
  8007. }
  8008. }
  8009. if err != nil {
  8010. return nil, err
  8011. }
  8012. defer googleapi.CloseBody(res)
  8013. if err := googleapi.CheckResponse(res); err != nil {
  8014. return nil, err
  8015. }
  8016. ret := &Operation{
  8017. ServerResponse: googleapi.ServerResponse{
  8018. Header: res.Header,
  8019. HTTPStatusCode: res.StatusCode,
  8020. },
  8021. }
  8022. target := &ret
  8023. if err := gensupport.DecodeResponse(target, res); err != nil {
  8024. return nil, err
  8025. }
  8026. return ret, nil
  8027. // {
  8028. // "description": "Sets the addons for a specific cluster.",
  8029. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons",
  8030. // "httpMethod": "POST",
  8031. // "id": "container.projects.zones.clusters.addons",
  8032. // "parameterOrder": [
  8033. // "projectId",
  8034. // "zone",
  8035. // "clusterId"
  8036. // ],
  8037. // "parameters": {
  8038. // "clusterId": {
  8039. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  8040. // "location": "path",
  8041. // "required": true,
  8042. // "type": "string"
  8043. // },
  8044. // "projectId": {
  8045. // "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.",
  8046. // "location": "path",
  8047. // "required": true,
  8048. // "type": "string"
  8049. // },
  8050. // "zone": {
  8051. // "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.",
  8052. // "location": "path",
  8053. // "required": true,
  8054. // "type": "string"
  8055. // }
  8056. // },
  8057. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons",
  8058. // "request": {
  8059. // "$ref": "SetAddonsConfigRequest"
  8060. // },
  8061. // "response": {
  8062. // "$ref": "Operation"
  8063. // },
  8064. // "scopes": [
  8065. // "https://www.googleapis.com/auth/cloud-platform"
  8066. // ]
  8067. // }
  8068. }
  8069. // method id "container.projects.zones.clusters.completeIpRotation":
  8070. type ProjectsZonesClustersCompleteIpRotationCall struct {
  8071. s *Service
  8072. projectId string
  8073. zone string
  8074. clusterId string
  8075. completeiprotationrequest *CompleteIPRotationRequest
  8076. urlParams_ gensupport.URLParams
  8077. ctx_ context.Context
  8078. header_ http.Header
  8079. }
  8080. // CompleteIpRotation: Completes master IP rotation.
  8081. func (r *ProjectsZonesClustersService) CompleteIpRotation(projectId string, zone string, clusterId string, completeiprotationrequest *CompleteIPRotationRequest) *ProjectsZonesClustersCompleteIpRotationCall {
  8082. c := &ProjectsZonesClustersCompleteIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8083. c.projectId = projectId
  8084. c.zone = zone
  8085. c.clusterId = clusterId
  8086. c.completeiprotationrequest = completeiprotationrequest
  8087. return c
  8088. }
  8089. // Fields allows partial responses to be retrieved. See
  8090. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8091. // for more information.
  8092. func (c *ProjectsZonesClustersCompleteIpRotationCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersCompleteIpRotationCall {
  8093. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8094. return c
  8095. }
  8096. // Context sets the context to be used in this call's Do method. Any
  8097. // pending HTTP request will be aborted if the provided context is
  8098. // canceled.
  8099. func (c *ProjectsZonesClustersCompleteIpRotationCall) Context(ctx context.Context) *ProjectsZonesClustersCompleteIpRotationCall {
  8100. c.ctx_ = ctx
  8101. return c
  8102. }
  8103. // Header returns an http.Header that can be modified by the caller to
  8104. // add HTTP headers to the request.
  8105. func (c *ProjectsZonesClustersCompleteIpRotationCall) Header() http.Header {
  8106. if c.header_ == nil {
  8107. c.header_ = make(http.Header)
  8108. }
  8109. return c.header_
  8110. }
  8111. func (c *ProjectsZonesClustersCompleteIpRotationCall) doRequest(alt string) (*http.Response, error) {
  8112. reqHeaders := make(http.Header)
  8113. for k, v := range c.header_ {
  8114. reqHeaders[k] = v
  8115. }
  8116. reqHeaders.Set("User-Agent", c.s.userAgent())
  8117. var body io.Reader = nil
  8118. body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeiprotationrequest)
  8119. if err != nil {
  8120. return nil, err
  8121. }
  8122. reqHeaders.Set("Content-Type", "application/json")
  8123. c.urlParams_.Set("alt", alt)
  8124. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation")
  8125. urls += "?" + c.urlParams_.Encode()
  8126. req, _ := http.NewRequest("POST", urls, body)
  8127. req.Header = reqHeaders
  8128. googleapi.Expand(req.URL, map[string]string{
  8129. "projectId": c.projectId,
  8130. "zone": c.zone,
  8131. "clusterId": c.clusterId,
  8132. })
  8133. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8134. }
  8135. // Do executes the "container.projects.zones.clusters.completeIpRotation" call.
  8136. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8137. // status code is an error. Response headers are in either
  8138. // *Operation.ServerResponse.Header or (if a response was returned at
  8139. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8140. // to check whether the returned error was because
  8141. // http.StatusNotModified was returned.
  8142. func (c *ProjectsZonesClustersCompleteIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8143. gensupport.SetOptions(c.urlParams_, opts...)
  8144. res, err := c.doRequest("json")
  8145. if res != nil && res.StatusCode == http.StatusNotModified {
  8146. if res.Body != nil {
  8147. res.Body.Close()
  8148. }
  8149. return nil, &googleapi.Error{
  8150. Code: res.StatusCode,
  8151. Header: res.Header,
  8152. }
  8153. }
  8154. if err != nil {
  8155. return nil, err
  8156. }
  8157. defer googleapi.CloseBody(res)
  8158. if err := googleapi.CheckResponse(res); err != nil {
  8159. return nil, err
  8160. }
  8161. ret := &Operation{
  8162. ServerResponse: googleapi.ServerResponse{
  8163. Header: res.Header,
  8164. HTTPStatusCode: res.StatusCode,
  8165. },
  8166. }
  8167. target := &ret
  8168. if err := gensupport.DecodeResponse(target, res); err != nil {
  8169. return nil, err
  8170. }
  8171. return ret, nil
  8172. // {
  8173. // "description": "Completes master IP rotation.",
  8174. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation",
  8175. // "httpMethod": "POST",
  8176. // "id": "container.projects.zones.clusters.completeIpRotation",
  8177. // "parameterOrder": [
  8178. // "projectId",
  8179. // "zone",
  8180. // "clusterId"
  8181. // ],
  8182. // "parameters": {
  8183. // "clusterId": {
  8184. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  8185. // "location": "path",
  8186. // "required": true,
  8187. // "type": "string"
  8188. // },
  8189. // "projectId": {
  8190. // "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.",
  8191. // "location": "path",
  8192. // "required": true,
  8193. // "type": "string"
  8194. // },
  8195. // "zone": {
  8196. // "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.",
  8197. // "location": "path",
  8198. // "required": true,
  8199. // "type": "string"
  8200. // }
  8201. // },
  8202. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation",
  8203. // "request": {
  8204. // "$ref": "CompleteIPRotationRequest"
  8205. // },
  8206. // "response": {
  8207. // "$ref": "Operation"
  8208. // },
  8209. // "scopes": [
  8210. // "https://www.googleapis.com/auth/cloud-platform"
  8211. // ]
  8212. // }
  8213. }
  8214. // method id "container.projects.zones.clusters.create":
  8215. type ProjectsZonesClustersCreateCall struct {
  8216. s *Service
  8217. projectId string
  8218. zone string
  8219. createclusterrequest *CreateClusterRequest
  8220. urlParams_ gensupport.URLParams
  8221. ctx_ context.Context
  8222. header_ http.Header
  8223. }
  8224. // Create: Creates a cluster, consisting of the specified number and
  8225. // type of Google
  8226. // Compute Engine instances.
  8227. //
  8228. // By default, the cluster is created in the project's
  8229. // [default
  8230. // network](/compute/docs/networks-and-firewalls#networks).
  8231. //
  8232. // One firewall is added for the cluster. After cluster creation,
  8233. // the cluster creates routes for each node to allow the containers
  8234. // on that node to communicate with all other instances in
  8235. // the
  8236. // cluster.
  8237. //
  8238. // Finally, an entry is added to the project's global metadata
  8239. // indicating
  8240. // which CIDR range is being used by the cluster.
  8241. func (r *ProjectsZonesClustersService) Create(projectId string, zone string, createclusterrequest *CreateClusterRequest) *ProjectsZonesClustersCreateCall {
  8242. c := &ProjectsZonesClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8243. c.projectId = projectId
  8244. c.zone = zone
  8245. c.createclusterrequest = createclusterrequest
  8246. return c
  8247. }
  8248. // Fields allows partial responses to be retrieved. See
  8249. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8250. // for more information.
  8251. func (c *ProjectsZonesClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersCreateCall {
  8252. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8253. return c
  8254. }
  8255. // Context sets the context to be used in this call's Do method. Any
  8256. // pending HTTP request will be aborted if the provided context is
  8257. // canceled.
  8258. func (c *ProjectsZonesClustersCreateCall) Context(ctx context.Context) *ProjectsZonesClustersCreateCall {
  8259. c.ctx_ = ctx
  8260. return c
  8261. }
  8262. // Header returns an http.Header that can be modified by the caller to
  8263. // add HTTP headers to the request.
  8264. func (c *ProjectsZonesClustersCreateCall) Header() http.Header {
  8265. if c.header_ == nil {
  8266. c.header_ = make(http.Header)
  8267. }
  8268. return c.header_
  8269. }
  8270. func (c *ProjectsZonesClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  8271. reqHeaders := make(http.Header)
  8272. for k, v := range c.header_ {
  8273. reqHeaders[k] = v
  8274. }
  8275. reqHeaders.Set("User-Agent", c.s.userAgent())
  8276. var body io.Reader = nil
  8277. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest)
  8278. if err != nil {
  8279. return nil, err
  8280. }
  8281. reqHeaders.Set("Content-Type", "application/json")
  8282. c.urlParams_.Set("alt", alt)
  8283. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters")
  8284. urls += "?" + c.urlParams_.Encode()
  8285. req, _ := http.NewRequest("POST", urls, body)
  8286. req.Header = reqHeaders
  8287. googleapi.Expand(req.URL, map[string]string{
  8288. "projectId": c.projectId,
  8289. "zone": c.zone,
  8290. })
  8291. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8292. }
  8293. // Do executes the "container.projects.zones.clusters.create" call.
  8294. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8295. // status code is an error. Response headers are in either
  8296. // *Operation.ServerResponse.Header or (if a response was returned at
  8297. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8298. // to check whether the returned error was because
  8299. // http.StatusNotModified was returned.
  8300. func (c *ProjectsZonesClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8301. gensupport.SetOptions(c.urlParams_, opts...)
  8302. res, err := c.doRequest("json")
  8303. if res != nil && res.StatusCode == http.StatusNotModified {
  8304. if res.Body != nil {
  8305. res.Body.Close()
  8306. }
  8307. return nil, &googleapi.Error{
  8308. Code: res.StatusCode,
  8309. Header: res.Header,
  8310. }
  8311. }
  8312. if err != nil {
  8313. return nil, err
  8314. }
  8315. defer googleapi.CloseBody(res)
  8316. if err := googleapi.CheckResponse(res); err != nil {
  8317. return nil, err
  8318. }
  8319. ret := &Operation{
  8320. ServerResponse: googleapi.ServerResponse{
  8321. Header: res.Header,
  8322. HTTPStatusCode: res.StatusCode,
  8323. },
  8324. }
  8325. target := &ret
  8326. if err := gensupport.DecodeResponse(target, res); err != nil {
  8327. return nil, err
  8328. }
  8329. return ret, nil
  8330. // {
  8331. // "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.",
  8332. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters",
  8333. // "httpMethod": "POST",
  8334. // "id": "container.projects.zones.clusters.create",
  8335. // "parameterOrder": [
  8336. // "projectId",
  8337. // "zone"
  8338. // ],
  8339. // "parameters": {
  8340. // "projectId": {
  8341. // "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.",
  8342. // "location": "path",
  8343. // "required": true,
  8344. // "type": "string"
  8345. // },
  8346. // "zone": {
  8347. // "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.",
  8348. // "location": "path",
  8349. // "required": true,
  8350. // "type": "string"
  8351. // }
  8352. // },
  8353. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters",
  8354. // "request": {
  8355. // "$ref": "CreateClusterRequest"
  8356. // },
  8357. // "response": {
  8358. // "$ref": "Operation"
  8359. // },
  8360. // "scopes": [
  8361. // "https://www.googleapis.com/auth/cloud-platform"
  8362. // ]
  8363. // }
  8364. }
  8365. // method id "container.projects.zones.clusters.delete":
  8366. type ProjectsZonesClustersDeleteCall struct {
  8367. s *Service
  8368. projectId string
  8369. zone string
  8370. clusterId string
  8371. urlParams_ gensupport.URLParams
  8372. ctx_ context.Context
  8373. header_ http.Header
  8374. }
  8375. // Delete: Deletes the cluster, including the Kubernetes endpoint and
  8376. // all worker
  8377. // nodes.
  8378. //
  8379. // Firewalls and routes that were configured during cluster creation
  8380. // are also deleted.
  8381. //
  8382. // Other Google Compute Engine resources that might be in use by the
  8383. // cluster
  8384. // (e.g. load balancer resources) will not be deleted if they weren't
  8385. // present
  8386. // at the initial create time.
  8387. func (r *ProjectsZonesClustersService) Delete(projectId string, zone string, clusterId string) *ProjectsZonesClustersDeleteCall {
  8388. c := &ProjectsZonesClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8389. c.projectId = projectId
  8390. c.zone = zone
  8391. c.clusterId = clusterId
  8392. return c
  8393. }
  8394. // Name sets the optional parameter "name": The name (project, location,
  8395. // cluster) of the cluster to delete.
  8396. // Specified in the format 'projects/*/locations/*/clusters/*'.
  8397. func (c *ProjectsZonesClustersDeleteCall) Name(name string) *ProjectsZonesClustersDeleteCall {
  8398. c.urlParams_.Set("name", name)
  8399. return c
  8400. }
  8401. // Fields allows partial responses to be retrieved. See
  8402. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8403. // for more information.
  8404. func (c *ProjectsZonesClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersDeleteCall {
  8405. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8406. return c
  8407. }
  8408. // Context sets the context to be used in this call's Do method. Any
  8409. // pending HTTP request will be aborted if the provided context is
  8410. // canceled.
  8411. func (c *ProjectsZonesClustersDeleteCall) Context(ctx context.Context) *ProjectsZonesClustersDeleteCall {
  8412. c.ctx_ = ctx
  8413. return c
  8414. }
  8415. // Header returns an http.Header that can be modified by the caller to
  8416. // add HTTP headers to the request.
  8417. func (c *ProjectsZonesClustersDeleteCall) Header() http.Header {
  8418. if c.header_ == nil {
  8419. c.header_ = make(http.Header)
  8420. }
  8421. return c.header_
  8422. }
  8423. func (c *ProjectsZonesClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  8424. reqHeaders := make(http.Header)
  8425. for k, v := range c.header_ {
  8426. reqHeaders[k] = v
  8427. }
  8428. reqHeaders.Set("User-Agent", c.s.userAgent())
  8429. var body io.Reader = nil
  8430. c.urlParams_.Set("alt", alt)
  8431. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  8432. urls += "?" + c.urlParams_.Encode()
  8433. req, _ := http.NewRequest("DELETE", urls, body)
  8434. req.Header = reqHeaders
  8435. googleapi.Expand(req.URL, map[string]string{
  8436. "projectId": c.projectId,
  8437. "zone": c.zone,
  8438. "clusterId": c.clusterId,
  8439. })
  8440. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8441. }
  8442. // Do executes the "container.projects.zones.clusters.delete" call.
  8443. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8444. // status code is an error. Response headers are in either
  8445. // *Operation.ServerResponse.Header or (if a response was returned at
  8446. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8447. // to check whether the returned error was because
  8448. // http.StatusNotModified was returned.
  8449. func (c *ProjectsZonesClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8450. gensupport.SetOptions(c.urlParams_, opts...)
  8451. res, err := c.doRequest("json")
  8452. if res != nil && res.StatusCode == http.StatusNotModified {
  8453. if res.Body != nil {
  8454. res.Body.Close()
  8455. }
  8456. return nil, &googleapi.Error{
  8457. Code: res.StatusCode,
  8458. Header: res.Header,
  8459. }
  8460. }
  8461. if err != nil {
  8462. return nil, err
  8463. }
  8464. defer googleapi.CloseBody(res)
  8465. if err := googleapi.CheckResponse(res); err != nil {
  8466. return nil, err
  8467. }
  8468. ret := &Operation{
  8469. ServerResponse: googleapi.ServerResponse{
  8470. Header: res.Header,
  8471. HTTPStatusCode: res.StatusCode,
  8472. },
  8473. }
  8474. target := &ret
  8475. if err := gensupport.DecodeResponse(target, res); err != nil {
  8476. return nil, err
  8477. }
  8478. return ret, nil
  8479. // {
  8480. // "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.",
  8481. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  8482. // "httpMethod": "DELETE",
  8483. // "id": "container.projects.zones.clusters.delete",
  8484. // "parameterOrder": [
  8485. // "projectId",
  8486. // "zone",
  8487. // "clusterId"
  8488. // ],
  8489. // "parameters": {
  8490. // "clusterId": {
  8491. // "description": "Deprecated. The name of the cluster to delete.\nThis field has been deprecated and replaced by the name field.",
  8492. // "location": "path",
  8493. // "required": true,
  8494. // "type": "string"
  8495. // },
  8496. // "name": {
  8497. // "description": "The name (project, location, cluster) of the cluster to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  8498. // "location": "query",
  8499. // "type": "string"
  8500. // },
  8501. // "projectId": {
  8502. // "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.",
  8503. // "location": "path",
  8504. // "required": true,
  8505. // "type": "string"
  8506. // },
  8507. // "zone": {
  8508. // "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.",
  8509. // "location": "path",
  8510. // "required": true,
  8511. // "type": "string"
  8512. // }
  8513. // },
  8514. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  8515. // "response": {
  8516. // "$ref": "Operation"
  8517. // },
  8518. // "scopes": [
  8519. // "https://www.googleapis.com/auth/cloud-platform"
  8520. // ]
  8521. // }
  8522. }
  8523. // method id "container.projects.zones.clusters.get":
  8524. type ProjectsZonesClustersGetCall struct {
  8525. s *Service
  8526. projectId string
  8527. zone string
  8528. clusterId string
  8529. urlParams_ gensupport.URLParams
  8530. ifNoneMatch_ string
  8531. ctx_ context.Context
  8532. header_ http.Header
  8533. }
  8534. // Get: Gets the details for a specific cluster.
  8535. func (r *ProjectsZonesClustersService) Get(projectId string, zone string, clusterId string) *ProjectsZonesClustersGetCall {
  8536. c := &ProjectsZonesClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8537. c.projectId = projectId
  8538. c.zone = zone
  8539. c.clusterId = clusterId
  8540. return c
  8541. }
  8542. // Name sets the optional parameter "name": The name (project, location,
  8543. // cluster) of the cluster to retrieve.
  8544. // Specified in the format 'projects/*/locations/*/clusters/*'.
  8545. func (c *ProjectsZonesClustersGetCall) Name(name string) *ProjectsZonesClustersGetCall {
  8546. c.urlParams_.Set("name", name)
  8547. return c
  8548. }
  8549. // Fields allows partial responses to be retrieved. See
  8550. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8551. // for more information.
  8552. func (c *ProjectsZonesClustersGetCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersGetCall {
  8553. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8554. return c
  8555. }
  8556. // IfNoneMatch sets the optional parameter which makes the operation
  8557. // fail if the object's ETag matches the given value. This is useful for
  8558. // getting updates only after the object has changed since the last
  8559. // request. Use googleapi.IsNotModified to check whether the response
  8560. // error from Do is the result of In-None-Match.
  8561. func (c *ProjectsZonesClustersGetCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersGetCall {
  8562. c.ifNoneMatch_ = entityTag
  8563. return c
  8564. }
  8565. // Context sets the context to be used in this call's Do method. Any
  8566. // pending HTTP request will be aborted if the provided context is
  8567. // canceled.
  8568. func (c *ProjectsZonesClustersGetCall) Context(ctx context.Context) *ProjectsZonesClustersGetCall {
  8569. c.ctx_ = ctx
  8570. return c
  8571. }
  8572. // Header returns an http.Header that can be modified by the caller to
  8573. // add HTTP headers to the request.
  8574. func (c *ProjectsZonesClustersGetCall) Header() http.Header {
  8575. if c.header_ == nil {
  8576. c.header_ = make(http.Header)
  8577. }
  8578. return c.header_
  8579. }
  8580. func (c *ProjectsZonesClustersGetCall) doRequest(alt string) (*http.Response, error) {
  8581. reqHeaders := make(http.Header)
  8582. for k, v := range c.header_ {
  8583. reqHeaders[k] = v
  8584. }
  8585. reqHeaders.Set("User-Agent", c.s.userAgent())
  8586. if c.ifNoneMatch_ != "" {
  8587. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8588. }
  8589. var body io.Reader = nil
  8590. c.urlParams_.Set("alt", alt)
  8591. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  8592. urls += "?" + c.urlParams_.Encode()
  8593. req, _ := http.NewRequest("GET", urls, body)
  8594. req.Header = reqHeaders
  8595. googleapi.Expand(req.URL, map[string]string{
  8596. "projectId": c.projectId,
  8597. "zone": c.zone,
  8598. "clusterId": c.clusterId,
  8599. })
  8600. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8601. }
  8602. // Do executes the "container.projects.zones.clusters.get" call.
  8603. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  8604. // code is an error. Response headers are in either
  8605. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  8606. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8607. // check whether the returned error was because http.StatusNotModified
  8608. // was returned.
  8609. func (c *ProjectsZonesClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  8610. gensupport.SetOptions(c.urlParams_, opts...)
  8611. res, err := c.doRequest("json")
  8612. if res != nil && res.StatusCode == http.StatusNotModified {
  8613. if res.Body != nil {
  8614. res.Body.Close()
  8615. }
  8616. return nil, &googleapi.Error{
  8617. Code: res.StatusCode,
  8618. Header: res.Header,
  8619. }
  8620. }
  8621. if err != nil {
  8622. return nil, err
  8623. }
  8624. defer googleapi.CloseBody(res)
  8625. if err := googleapi.CheckResponse(res); err != nil {
  8626. return nil, err
  8627. }
  8628. ret := &Cluster{
  8629. ServerResponse: googleapi.ServerResponse{
  8630. Header: res.Header,
  8631. HTTPStatusCode: res.StatusCode,
  8632. },
  8633. }
  8634. target := &ret
  8635. if err := gensupport.DecodeResponse(target, res); err != nil {
  8636. return nil, err
  8637. }
  8638. return ret, nil
  8639. // {
  8640. // "description": "Gets the details for a specific cluster.",
  8641. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  8642. // "httpMethod": "GET",
  8643. // "id": "container.projects.zones.clusters.get",
  8644. // "parameterOrder": [
  8645. // "projectId",
  8646. // "zone",
  8647. // "clusterId"
  8648. // ],
  8649. // "parameters": {
  8650. // "clusterId": {
  8651. // "description": "Deprecated. The name of the cluster to retrieve.\nThis field has been deprecated and replaced by the name field.",
  8652. // "location": "path",
  8653. // "required": true,
  8654. // "type": "string"
  8655. // },
  8656. // "name": {
  8657. // "description": "The name (project, location, cluster) of the cluster to retrieve.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  8658. // "location": "query",
  8659. // "type": "string"
  8660. // },
  8661. // "projectId": {
  8662. // "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.",
  8663. // "location": "path",
  8664. // "required": true,
  8665. // "type": "string"
  8666. // },
  8667. // "zone": {
  8668. // "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.",
  8669. // "location": "path",
  8670. // "required": true,
  8671. // "type": "string"
  8672. // }
  8673. // },
  8674. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  8675. // "response": {
  8676. // "$ref": "Cluster"
  8677. // },
  8678. // "scopes": [
  8679. // "https://www.googleapis.com/auth/cloud-platform"
  8680. // ]
  8681. // }
  8682. }
  8683. // method id "container.projects.zones.clusters.legacyAbac":
  8684. type ProjectsZonesClustersLegacyAbacCall struct {
  8685. s *Service
  8686. projectId string
  8687. zone string
  8688. clusterId string
  8689. setlegacyabacrequest *SetLegacyAbacRequest
  8690. urlParams_ gensupport.URLParams
  8691. ctx_ context.Context
  8692. header_ http.Header
  8693. }
  8694. // LegacyAbac: Enables or disables the ABAC authorization mechanism on a
  8695. // cluster.
  8696. func (r *ProjectsZonesClustersService) LegacyAbac(projectId string, zone string, clusterId string, setlegacyabacrequest *SetLegacyAbacRequest) *ProjectsZonesClustersLegacyAbacCall {
  8697. c := &ProjectsZonesClustersLegacyAbacCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8698. c.projectId = projectId
  8699. c.zone = zone
  8700. c.clusterId = clusterId
  8701. c.setlegacyabacrequest = setlegacyabacrequest
  8702. return c
  8703. }
  8704. // Fields allows partial responses to be retrieved. See
  8705. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8706. // for more information.
  8707. func (c *ProjectsZonesClustersLegacyAbacCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersLegacyAbacCall {
  8708. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8709. return c
  8710. }
  8711. // Context sets the context to be used in this call's Do method. Any
  8712. // pending HTTP request will be aborted if the provided context is
  8713. // canceled.
  8714. func (c *ProjectsZonesClustersLegacyAbacCall) Context(ctx context.Context) *ProjectsZonesClustersLegacyAbacCall {
  8715. c.ctx_ = ctx
  8716. return c
  8717. }
  8718. // Header returns an http.Header that can be modified by the caller to
  8719. // add HTTP headers to the request.
  8720. func (c *ProjectsZonesClustersLegacyAbacCall) Header() http.Header {
  8721. if c.header_ == nil {
  8722. c.header_ = make(http.Header)
  8723. }
  8724. return c.header_
  8725. }
  8726. func (c *ProjectsZonesClustersLegacyAbacCall) doRequest(alt string) (*http.Response, error) {
  8727. reqHeaders := make(http.Header)
  8728. for k, v := range c.header_ {
  8729. reqHeaders[k] = v
  8730. }
  8731. reqHeaders.Set("User-Agent", c.s.userAgent())
  8732. var body io.Reader = nil
  8733. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlegacyabacrequest)
  8734. if err != nil {
  8735. return nil, err
  8736. }
  8737. reqHeaders.Set("Content-Type", "application/json")
  8738. c.urlParams_.Set("alt", alt)
  8739. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac")
  8740. urls += "?" + c.urlParams_.Encode()
  8741. req, _ := http.NewRequest("POST", urls, body)
  8742. req.Header = reqHeaders
  8743. googleapi.Expand(req.URL, map[string]string{
  8744. "projectId": c.projectId,
  8745. "zone": c.zone,
  8746. "clusterId": c.clusterId,
  8747. })
  8748. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8749. }
  8750. // Do executes the "container.projects.zones.clusters.legacyAbac" call.
  8751. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8752. // status code is an error. Response headers are in either
  8753. // *Operation.ServerResponse.Header or (if a response was returned at
  8754. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8755. // to check whether the returned error was because
  8756. // http.StatusNotModified was returned.
  8757. func (c *ProjectsZonesClustersLegacyAbacCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8758. gensupport.SetOptions(c.urlParams_, opts...)
  8759. res, err := c.doRequest("json")
  8760. if res != nil && res.StatusCode == http.StatusNotModified {
  8761. if res.Body != nil {
  8762. res.Body.Close()
  8763. }
  8764. return nil, &googleapi.Error{
  8765. Code: res.StatusCode,
  8766. Header: res.Header,
  8767. }
  8768. }
  8769. if err != nil {
  8770. return nil, err
  8771. }
  8772. defer googleapi.CloseBody(res)
  8773. if err := googleapi.CheckResponse(res); err != nil {
  8774. return nil, err
  8775. }
  8776. ret := &Operation{
  8777. ServerResponse: googleapi.ServerResponse{
  8778. Header: res.Header,
  8779. HTTPStatusCode: res.StatusCode,
  8780. },
  8781. }
  8782. target := &ret
  8783. if err := gensupport.DecodeResponse(target, res); err != nil {
  8784. return nil, err
  8785. }
  8786. return ret, nil
  8787. // {
  8788. // "description": "Enables or disables the ABAC authorization mechanism on a cluster.",
  8789. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac",
  8790. // "httpMethod": "POST",
  8791. // "id": "container.projects.zones.clusters.legacyAbac",
  8792. // "parameterOrder": [
  8793. // "projectId",
  8794. // "zone",
  8795. // "clusterId"
  8796. // ],
  8797. // "parameters": {
  8798. // "clusterId": {
  8799. // "description": "Deprecated. The name of the cluster to update.\nThis field has been deprecated and replaced by the name field.",
  8800. // "location": "path",
  8801. // "required": true,
  8802. // "type": "string"
  8803. // },
  8804. // "projectId": {
  8805. // "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.",
  8806. // "location": "path",
  8807. // "required": true,
  8808. // "type": "string"
  8809. // },
  8810. // "zone": {
  8811. // "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.",
  8812. // "location": "path",
  8813. // "required": true,
  8814. // "type": "string"
  8815. // }
  8816. // },
  8817. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac",
  8818. // "request": {
  8819. // "$ref": "SetLegacyAbacRequest"
  8820. // },
  8821. // "response": {
  8822. // "$ref": "Operation"
  8823. // },
  8824. // "scopes": [
  8825. // "https://www.googleapis.com/auth/cloud-platform"
  8826. // ]
  8827. // }
  8828. }
  8829. // method id "container.projects.zones.clusters.list":
  8830. type ProjectsZonesClustersListCall struct {
  8831. s *Service
  8832. projectId string
  8833. zone string
  8834. urlParams_ gensupport.URLParams
  8835. ifNoneMatch_ string
  8836. ctx_ context.Context
  8837. header_ http.Header
  8838. }
  8839. // List: Lists all clusters owned by a project in either the specified
  8840. // zone or all
  8841. // zones.
  8842. func (r *ProjectsZonesClustersService) List(projectId string, zone string) *ProjectsZonesClustersListCall {
  8843. c := &ProjectsZonesClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8844. c.projectId = projectId
  8845. c.zone = zone
  8846. return c
  8847. }
  8848. // Parent sets the optional parameter "parent": The parent (project and
  8849. // location) where the clusters will be listed.
  8850. // Specified in the format 'projects/*/locations/*'.
  8851. // Location "-" matches all zones and all regions.
  8852. func (c *ProjectsZonesClustersListCall) Parent(parent string) *ProjectsZonesClustersListCall {
  8853. c.urlParams_.Set("parent", parent)
  8854. return c
  8855. }
  8856. // Fields allows partial responses to be retrieved. See
  8857. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8858. // for more information.
  8859. func (c *ProjectsZonesClustersListCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersListCall {
  8860. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8861. return c
  8862. }
  8863. // IfNoneMatch sets the optional parameter which makes the operation
  8864. // fail if the object's ETag matches the given value. This is useful for
  8865. // getting updates only after the object has changed since the last
  8866. // request. Use googleapi.IsNotModified to check whether the response
  8867. // error from Do is the result of In-None-Match.
  8868. func (c *ProjectsZonesClustersListCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersListCall {
  8869. c.ifNoneMatch_ = entityTag
  8870. return c
  8871. }
  8872. // Context sets the context to be used in this call's Do method. Any
  8873. // pending HTTP request will be aborted if the provided context is
  8874. // canceled.
  8875. func (c *ProjectsZonesClustersListCall) Context(ctx context.Context) *ProjectsZonesClustersListCall {
  8876. c.ctx_ = ctx
  8877. return c
  8878. }
  8879. // Header returns an http.Header that can be modified by the caller to
  8880. // add HTTP headers to the request.
  8881. func (c *ProjectsZonesClustersListCall) Header() http.Header {
  8882. if c.header_ == nil {
  8883. c.header_ = make(http.Header)
  8884. }
  8885. return c.header_
  8886. }
  8887. func (c *ProjectsZonesClustersListCall) doRequest(alt string) (*http.Response, error) {
  8888. reqHeaders := make(http.Header)
  8889. for k, v := range c.header_ {
  8890. reqHeaders[k] = v
  8891. }
  8892. reqHeaders.Set("User-Agent", c.s.userAgent())
  8893. if c.ifNoneMatch_ != "" {
  8894. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8895. }
  8896. var body io.Reader = nil
  8897. c.urlParams_.Set("alt", alt)
  8898. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters")
  8899. urls += "?" + c.urlParams_.Encode()
  8900. req, _ := http.NewRequest("GET", urls, body)
  8901. req.Header = reqHeaders
  8902. googleapi.Expand(req.URL, map[string]string{
  8903. "projectId": c.projectId,
  8904. "zone": c.zone,
  8905. })
  8906. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8907. }
  8908. // Do executes the "container.projects.zones.clusters.list" call.
  8909. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  8910. // non-2xx status code is an error. Response headers are in either
  8911. // *ListClustersResponse.ServerResponse.Header or (if a response was
  8912. // returned at all) in error.(*googleapi.Error).Header. Use
  8913. // googleapi.IsNotModified to check whether the returned error was
  8914. // because http.StatusNotModified was returned.
  8915. func (c *ProjectsZonesClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  8916. gensupport.SetOptions(c.urlParams_, opts...)
  8917. res, err := c.doRequest("json")
  8918. if res != nil && res.StatusCode == http.StatusNotModified {
  8919. if res.Body != nil {
  8920. res.Body.Close()
  8921. }
  8922. return nil, &googleapi.Error{
  8923. Code: res.StatusCode,
  8924. Header: res.Header,
  8925. }
  8926. }
  8927. if err != nil {
  8928. return nil, err
  8929. }
  8930. defer googleapi.CloseBody(res)
  8931. if err := googleapi.CheckResponse(res); err != nil {
  8932. return nil, err
  8933. }
  8934. ret := &ListClustersResponse{
  8935. ServerResponse: googleapi.ServerResponse{
  8936. Header: res.Header,
  8937. HTTPStatusCode: res.StatusCode,
  8938. },
  8939. }
  8940. target := &ret
  8941. if err := gensupport.DecodeResponse(target, res); err != nil {
  8942. return nil, err
  8943. }
  8944. return ret, nil
  8945. // {
  8946. // "description": "Lists all clusters owned by a project in either the specified zone or all\nzones.",
  8947. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters",
  8948. // "httpMethod": "GET",
  8949. // "id": "container.projects.zones.clusters.list",
  8950. // "parameterOrder": [
  8951. // "projectId",
  8952. // "zone"
  8953. // ],
  8954. // "parameters": {
  8955. // "parent": {
  8956. // "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.",
  8957. // "location": "query",
  8958. // "type": "string"
  8959. // },
  8960. // "projectId": {
  8961. // "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.",
  8962. // "location": "path",
  8963. // "required": true,
  8964. // "type": "string"
  8965. // },
  8966. // "zone": {
  8967. // "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.",
  8968. // "location": "path",
  8969. // "required": true,
  8970. // "type": "string"
  8971. // }
  8972. // },
  8973. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters",
  8974. // "response": {
  8975. // "$ref": "ListClustersResponse"
  8976. // },
  8977. // "scopes": [
  8978. // "https://www.googleapis.com/auth/cloud-platform"
  8979. // ]
  8980. // }
  8981. }
  8982. // method id "container.projects.zones.clusters.locations":
  8983. type ProjectsZonesClustersLocationsCall struct {
  8984. s *Service
  8985. projectId string
  8986. zone string
  8987. clusterId string
  8988. setlocationsrequest *SetLocationsRequest
  8989. urlParams_ gensupport.URLParams
  8990. ctx_ context.Context
  8991. header_ http.Header
  8992. }
  8993. // Locations: Sets the locations for a specific cluster.
  8994. func (r *ProjectsZonesClustersService) Locations(projectId string, zone string, clusterId string, setlocationsrequest *SetLocationsRequest) *ProjectsZonesClustersLocationsCall {
  8995. c := &ProjectsZonesClustersLocationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8996. c.projectId = projectId
  8997. c.zone = zone
  8998. c.clusterId = clusterId
  8999. c.setlocationsrequest = setlocationsrequest
  9000. return c
  9001. }
  9002. // Fields allows partial responses to be retrieved. See
  9003. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9004. // for more information.
  9005. func (c *ProjectsZonesClustersLocationsCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersLocationsCall {
  9006. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9007. return c
  9008. }
  9009. // Context sets the context to be used in this call's Do method. Any
  9010. // pending HTTP request will be aborted if the provided context is
  9011. // canceled.
  9012. func (c *ProjectsZonesClustersLocationsCall) Context(ctx context.Context) *ProjectsZonesClustersLocationsCall {
  9013. c.ctx_ = ctx
  9014. return c
  9015. }
  9016. // Header returns an http.Header that can be modified by the caller to
  9017. // add HTTP headers to the request.
  9018. func (c *ProjectsZonesClustersLocationsCall) Header() http.Header {
  9019. if c.header_ == nil {
  9020. c.header_ = make(http.Header)
  9021. }
  9022. return c.header_
  9023. }
  9024. func (c *ProjectsZonesClustersLocationsCall) doRequest(alt string) (*http.Response, error) {
  9025. reqHeaders := make(http.Header)
  9026. for k, v := range c.header_ {
  9027. reqHeaders[k] = v
  9028. }
  9029. reqHeaders.Set("User-Agent", c.s.userAgent())
  9030. var body io.Reader = nil
  9031. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlocationsrequest)
  9032. if err != nil {
  9033. return nil, err
  9034. }
  9035. reqHeaders.Set("Content-Type", "application/json")
  9036. c.urlParams_.Set("alt", alt)
  9037. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations")
  9038. urls += "?" + c.urlParams_.Encode()
  9039. req, _ := http.NewRequest("POST", urls, body)
  9040. req.Header = reqHeaders
  9041. googleapi.Expand(req.URL, map[string]string{
  9042. "projectId": c.projectId,
  9043. "zone": c.zone,
  9044. "clusterId": c.clusterId,
  9045. })
  9046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9047. }
  9048. // Do executes the "container.projects.zones.clusters.locations" call.
  9049. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9050. // status code is an error. Response headers are in either
  9051. // *Operation.ServerResponse.Header or (if a response was returned at
  9052. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9053. // to check whether the returned error was because
  9054. // http.StatusNotModified was returned.
  9055. func (c *ProjectsZonesClustersLocationsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9056. gensupport.SetOptions(c.urlParams_, opts...)
  9057. res, err := c.doRequest("json")
  9058. if res != nil && res.StatusCode == http.StatusNotModified {
  9059. if res.Body != nil {
  9060. res.Body.Close()
  9061. }
  9062. return nil, &googleapi.Error{
  9063. Code: res.StatusCode,
  9064. Header: res.Header,
  9065. }
  9066. }
  9067. if err != nil {
  9068. return nil, err
  9069. }
  9070. defer googleapi.CloseBody(res)
  9071. if err := googleapi.CheckResponse(res); err != nil {
  9072. return nil, err
  9073. }
  9074. ret := &Operation{
  9075. ServerResponse: googleapi.ServerResponse{
  9076. Header: res.Header,
  9077. HTTPStatusCode: res.StatusCode,
  9078. },
  9079. }
  9080. target := &ret
  9081. if err := gensupport.DecodeResponse(target, res); err != nil {
  9082. return nil, err
  9083. }
  9084. return ret, nil
  9085. // {
  9086. // "description": "Sets the locations for a specific cluster.",
  9087. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations",
  9088. // "httpMethod": "POST",
  9089. // "id": "container.projects.zones.clusters.locations",
  9090. // "parameterOrder": [
  9091. // "projectId",
  9092. // "zone",
  9093. // "clusterId"
  9094. // ],
  9095. // "parameters": {
  9096. // "clusterId": {
  9097. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9098. // "location": "path",
  9099. // "required": true,
  9100. // "type": "string"
  9101. // },
  9102. // "projectId": {
  9103. // "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.",
  9104. // "location": "path",
  9105. // "required": true,
  9106. // "type": "string"
  9107. // },
  9108. // "zone": {
  9109. // "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.",
  9110. // "location": "path",
  9111. // "required": true,
  9112. // "type": "string"
  9113. // }
  9114. // },
  9115. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations",
  9116. // "request": {
  9117. // "$ref": "SetLocationsRequest"
  9118. // },
  9119. // "response": {
  9120. // "$ref": "Operation"
  9121. // },
  9122. // "scopes": [
  9123. // "https://www.googleapis.com/auth/cloud-platform"
  9124. // ]
  9125. // }
  9126. }
  9127. // method id "container.projects.zones.clusters.logging":
  9128. type ProjectsZonesClustersLoggingCall struct {
  9129. s *Service
  9130. projectId string
  9131. zone string
  9132. clusterId string
  9133. setloggingservicerequest *SetLoggingServiceRequest
  9134. urlParams_ gensupport.URLParams
  9135. ctx_ context.Context
  9136. header_ http.Header
  9137. }
  9138. // Logging: Sets the logging service for a specific cluster.
  9139. func (r *ProjectsZonesClustersService) Logging(projectId string, zone string, clusterId string, setloggingservicerequest *SetLoggingServiceRequest) *ProjectsZonesClustersLoggingCall {
  9140. c := &ProjectsZonesClustersLoggingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9141. c.projectId = projectId
  9142. c.zone = zone
  9143. c.clusterId = clusterId
  9144. c.setloggingservicerequest = setloggingservicerequest
  9145. return c
  9146. }
  9147. // Fields allows partial responses to be retrieved. See
  9148. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9149. // for more information.
  9150. func (c *ProjectsZonesClustersLoggingCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersLoggingCall {
  9151. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9152. return c
  9153. }
  9154. // Context sets the context to be used in this call's Do method. Any
  9155. // pending HTTP request will be aborted if the provided context is
  9156. // canceled.
  9157. func (c *ProjectsZonesClustersLoggingCall) Context(ctx context.Context) *ProjectsZonesClustersLoggingCall {
  9158. c.ctx_ = ctx
  9159. return c
  9160. }
  9161. // Header returns an http.Header that can be modified by the caller to
  9162. // add HTTP headers to the request.
  9163. func (c *ProjectsZonesClustersLoggingCall) Header() http.Header {
  9164. if c.header_ == nil {
  9165. c.header_ = make(http.Header)
  9166. }
  9167. return c.header_
  9168. }
  9169. func (c *ProjectsZonesClustersLoggingCall) doRequest(alt string) (*http.Response, error) {
  9170. reqHeaders := make(http.Header)
  9171. for k, v := range c.header_ {
  9172. reqHeaders[k] = v
  9173. }
  9174. reqHeaders.Set("User-Agent", c.s.userAgent())
  9175. var body io.Reader = nil
  9176. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setloggingservicerequest)
  9177. if err != nil {
  9178. return nil, err
  9179. }
  9180. reqHeaders.Set("Content-Type", "application/json")
  9181. c.urlParams_.Set("alt", alt)
  9182. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging")
  9183. urls += "?" + c.urlParams_.Encode()
  9184. req, _ := http.NewRequest("POST", urls, body)
  9185. req.Header = reqHeaders
  9186. googleapi.Expand(req.URL, map[string]string{
  9187. "projectId": c.projectId,
  9188. "zone": c.zone,
  9189. "clusterId": c.clusterId,
  9190. })
  9191. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9192. }
  9193. // Do executes the "container.projects.zones.clusters.logging" call.
  9194. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9195. // status code is an error. Response headers are in either
  9196. // *Operation.ServerResponse.Header or (if a response was returned at
  9197. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9198. // to check whether the returned error was because
  9199. // http.StatusNotModified was returned.
  9200. func (c *ProjectsZonesClustersLoggingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9201. gensupport.SetOptions(c.urlParams_, opts...)
  9202. res, err := c.doRequest("json")
  9203. if res != nil && res.StatusCode == http.StatusNotModified {
  9204. if res.Body != nil {
  9205. res.Body.Close()
  9206. }
  9207. return nil, &googleapi.Error{
  9208. Code: res.StatusCode,
  9209. Header: res.Header,
  9210. }
  9211. }
  9212. if err != nil {
  9213. return nil, err
  9214. }
  9215. defer googleapi.CloseBody(res)
  9216. if err := googleapi.CheckResponse(res); err != nil {
  9217. return nil, err
  9218. }
  9219. ret := &Operation{
  9220. ServerResponse: googleapi.ServerResponse{
  9221. Header: res.Header,
  9222. HTTPStatusCode: res.StatusCode,
  9223. },
  9224. }
  9225. target := &ret
  9226. if err := gensupport.DecodeResponse(target, res); err != nil {
  9227. return nil, err
  9228. }
  9229. return ret, nil
  9230. // {
  9231. // "description": "Sets the logging service for a specific cluster.",
  9232. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging",
  9233. // "httpMethod": "POST",
  9234. // "id": "container.projects.zones.clusters.logging",
  9235. // "parameterOrder": [
  9236. // "projectId",
  9237. // "zone",
  9238. // "clusterId"
  9239. // ],
  9240. // "parameters": {
  9241. // "clusterId": {
  9242. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9243. // "location": "path",
  9244. // "required": true,
  9245. // "type": "string"
  9246. // },
  9247. // "projectId": {
  9248. // "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.",
  9249. // "location": "path",
  9250. // "required": true,
  9251. // "type": "string"
  9252. // },
  9253. // "zone": {
  9254. // "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.",
  9255. // "location": "path",
  9256. // "required": true,
  9257. // "type": "string"
  9258. // }
  9259. // },
  9260. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging",
  9261. // "request": {
  9262. // "$ref": "SetLoggingServiceRequest"
  9263. // },
  9264. // "response": {
  9265. // "$ref": "Operation"
  9266. // },
  9267. // "scopes": [
  9268. // "https://www.googleapis.com/auth/cloud-platform"
  9269. // ]
  9270. // }
  9271. }
  9272. // method id "container.projects.zones.clusters.master":
  9273. type ProjectsZonesClustersMasterCall struct {
  9274. s *Service
  9275. projectId string
  9276. zone string
  9277. clusterId string
  9278. updatemasterrequest *UpdateMasterRequest
  9279. urlParams_ gensupport.URLParams
  9280. ctx_ context.Context
  9281. header_ http.Header
  9282. }
  9283. // Master: Updates the master for a specific cluster.
  9284. func (r *ProjectsZonesClustersService) Master(projectId string, zone string, clusterId string, updatemasterrequest *UpdateMasterRequest) *ProjectsZonesClustersMasterCall {
  9285. c := &ProjectsZonesClustersMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9286. c.projectId = projectId
  9287. c.zone = zone
  9288. c.clusterId = clusterId
  9289. c.updatemasterrequest = updatemasterrequest
  9290. return c
  9291. }
  9292. // Fields allows partial responses to be retrieved. See
  9293. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9294. // for more information.
  9295. func (c *ProjectsZonesClustersMasterCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersMasterCall {
  9296. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9297. return c
  9298. }
  9299. // Context sets the context to be used in this call's Do method. Any
  9300. // pending HTTP request will be aborted if the provided context is
  9301. // canceled.
  9302. func (c *ProjectsZonesClustersMasterCall) Context(ctx context.Context) *ProjectsZonesClustersMasterCall {
  9303. c.ctx_ = ctx
  9304. return c
  9305. }
  9306. // Header returns an http.Header that can be modified by the caller to
  9307. // add HTTP headers to the request.
  9308. func (c *ProjectsZonesClustersMasterCall) Header() http.Header {
  9309. if c.header_ == nil {
  9310. c.header_ = make(http.Header)
  9311. }
  9312. return c.header_
  9313. }
  9314. func (c *ProjectsZonesClustersMasterCall) doRequest(alt string) (*http.Response, error) {
  9315. reqHeaders := make(http.Header)
  9316. for k, v := range c.header_ {
  9317. reqHeaders[k] = v
  9318. }
  9319. reqHeaders.Set("User-Agent", c.s.userAgent())
  9320. var body io.Reader = nil
  9321. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatemasterrequest)
  9322. if err != nil {
  9323. return nil, err
  9324. }
  9325. reqHeaders.Set("Content-Type", "application/json")
  9326. c.urlParams_.Set("alt", alt)
  9327. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master")
  9328. urls += "?" + c.urlParams_.Encode()
  9329. req, _ := http.NewRequest("POST", urls, body)
  9330. req.Header = reqHeaders
  9331. googleapi.Expand(req.URL, map[string]string{
  9332. "projectId": c.projectId,
  9333. "zone": c.zone,
  9334. "clusterId": c.clusterId,
  9335. })
  9336. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9337. }
  9338. // Do executes the "container.projects.zones.clusters.master" call.
  9339. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9340. // status code is an error. Response headers are in either
  9341. // *Operation.ServerResponse.Header or (if a response was returned at
  9342. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9343. // to check whether the returned error was because
  9344. // http.StatusNotModified was returned.
  9345. func (c *ProjectsZonesClustersMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9346. gensupport.SetOptions(c.urlParams_, opts...)
  9347. res, err := c.doRequest("json")
  9348. if res != nil && res.StatusCode == http.StatusNotModified {
  9349. if res.Body != nil {
  9350. res.Body.Close()
  9351. }
  9352. return nil, &googleapi.Error{
  9353. Code: res.StatusCode,
  9354. Header: res.Header,
  9355. }
  9356. }
  9357. if err != nil {
  9358. return nil, err
  9359. }
  9360. defer googleapi.CloseBody(res)
  9361. if err := googleapi.CheckResponse(res); err != nil {
  9362. return nil, err
  9363. }
  9364. ret := &Operation{
  9365. ServerResponse: googleapi.ServerResponse{
  9366. Header: res.Header,
  9367. HTTPStatusCode: res.StatusCode,
  9368. },
  9369. }
  9370. target := &ret
  9371. if err := gensupport.DecodeResponse(target, res); err != nil {
  9372. return nil, err
  9373. }
  9374. return ret, nil
  9375. // {
  9376. // "description": "Updates the master for a specific cluster.",
  9377. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master",
  9378. // "httpMethod": "POST",
  9379. // "id": "container.projects.zones.clusters.master",
  9380. // "parameterOrder": [
  9381. // "projectId",
  9382. // "zone",
  9383. // "clusterId"
  9384. // ],
  9385. // "parameters": {
  9386. // "clusterId": {
  9387. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9388. // "location": "path",
  9389. // "required": true,
  9390. // "type": "string"
  9391. // },
  9392. // "projectId": {
  9393. // "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.",
  9394. // "location": "path",
  9395. // "required": true,
  9396. // "type": "string"
  9397. // },
  9398. // "zone": {
  9399. // "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.",
  9400. // "location": "path",
  9401. // "required": true,
  9402. // "type": "string"
  9403. // }
  9404. // },
  9405. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master",
  9406. // "request": {
  9407. // "$ref": "UpdateMasterRequest"
  9408. // },
  9409. // "response": {
  9410. // "$ref": "Operation"
  9411. // },
  9412. // "scopes": [
  9413. // "https://www.googleapis.com/auth/cloud-platform"
  9414. // ]
  9415. // }
  9416. }
  9417. // method id "container.projects.zones.clusters.monitoring":
  9418. type ProjectsZonesClustersMonitoringCall struct {
  9419. s *Service
  9420. projectId string
  9421. zone string
  9422. clusterId string
  9423. setmonitoringservicerequest *SetMonitoringServiceRequest
  9424. urlParams_ gensupport.URLParams
  9425. ctx_ context.Context
  9426. header_ http.Header
  9427. }
  9428. // Monitoring: Sets the monitoring service for a specific cluster.
  9429. func (r *ProjectsZonesClustersService) Monitoring(projectId string, zone string, clusterId string, setmonitoringservicerequest *SetMonitoringServiceRequest) *ProjectsZonesClustersMonitoringCall {
  9430. c := &ProjectsZonesClustersMonitoringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9431. c.projectId = projectId
  9432. c.zone = zone
  9433. c.clusterId = clusterId
  9434. c.setmonitoringservicerequest = setmonitoringservicerequest
  9435. return c
  9436. }
  9437. // Fields allows partial responses to be retrieved. See
  9438. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9439. // for more information.
  9440. func (c *ProjectsZonesClustersMonitoringCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersMonitoringCall {
  9441. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9442. return c
  9443. }
  9444. // Context sets the context to be used in this call's Do method. Any
  9445. // pending HTTP request will be aborted if the provided context is
  9446. // canceled.
  9447. func (c *ProjectsZonesClustersMonitoringCall) Context(ctx context.Context) *ProjectsZonesClustersMonitoringCall {
  9448. c.ctx_ = ctx
  9449. return c
  9450. }
  9451. // Header returns an http.Header that can be modified by the caller to
  9452. // add HTTP headers to the request.
  9453. func (c *ProjectsZonesClustersMonitoringCall) Header() http.Header {
  9454. if c.header_ == nil {
  9455. c.header_ = make(http.Header)
  9456. }
  9457. return c.header_
  9458. }
  9459. func (c *ProjectsZonesClustersMonitoringCall) doRequest(alt string) (*http.Response, error) {
  9460. reqHeaders := make(http.Header)
  9461. for k, v := range c.header_ {
  9462. reqHeaders[k] = v
  9463. }
  9464. reqHeaders.Set("User-Agent", c.s.userAgent())
  9465. var body io.Reader = nil
  9466. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmonitoringservicerequest)
  9467. if err != nil {
  9468. return nil, err
  9469. }
  9470. reqHeaders.Set("Content-Type", "application/json")
  9471. c.urlParams_.Set("alt", alt)
  9472. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring")
  9473. urls += "?" + c.urlParams_.Encode()
  9474. req, _ := http.NewRequest("POST", urls, body)
  9475. req.Header = reqHeaders
  9476. googleapi.Expand(req.URL, map[string]string{
  9477. "projectId": c.projectId,
  9478. "zone": c.zone,
  9479. "clusterId": c.clusterId,
  9480. })
  9481. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9482. }
  9483. // Do executes the "container.projects.zones.clusters.monitoring" call.
  9484. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9485. // status code is an error. Response headers are in either
  9486. // *Operation.ServerResponse.Header or (if a response was returned at
  9487. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9488. // to check whether the returned error was because
  9489. // http.StatusNotModified was returned.
  9490. func (c *ProjectsZonesClustersMonitoringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9491. gensupport.SetOptions(c.urlParams_, opts...)
  9492. res, err := c.doRequest("json")
  9493. if res != nil && res.StatusCode == http.StatusNotModified {
  9494. if res.Body != nil {
  9495. res.Body.Close()
  9496. }
  9497. return nil, &googleapi.Error{
  9498. Code: res.StatusCode,
  9499. Header: res.Header,
  9500. }
  9501. }
  9502. if err != nil {
  9503. return nil, err
  9504. }
  9505. defer googleapi.CloseBody(res)
  9506. if err := googleapi.CheckResponse(res); err != nil {
  9507. return nil, err
  9508. }
  9509. ret := &Operation{
  9510. ServerResponse: googleapi.ServerResponse{
  9511. Header: res.Header,
  9512. HTTPStatusCode: res.StatusCode,
  9513. },
  9514. }
  9515. target := &ret
  9516. if err := gensupport.DecodeResponse(target, res); err != nil {
  9517. return nil, err
  9518. }
  9519. return ret, nil
  9520. // {
  9521. // "description": "Sets the monitoring service for a specific cluster.",
  9522. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring",
  9523. // "httpMethod": "POST",
  9524. // "id": "container.projects.zones.clusters.monitoring",
  9525. // "parameterOrder": [
  9526. // "projectId",
  9527. // "zone",
  9528. // "clusterId"
  9529. // ],
  9530. // "parameters": {
  9531. // "clusterId": {
  9532. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9533. // "location": "path",
  9534. // "required": true,
  9535. // "type": "string"
  9536. // },
  9537. // "projectId": {
  9538. // "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.",
  9539. // "location": "path",
  9540. // "required": true,
  9541. // "type": "string"
  9542. // },
  9543. // "zone": {
  9544. // "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.",
  9545. // "location": "path",
  9546. // "required": true,
  9547. // "type": "string"
  9548. // }
  9549. // },
  9550. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring",
  9551. // "request": {
  9552. // "$ref": "SetMonitoringServiceRequest"
  9553. // },
  9554. // "response": {
  9555. // "$ref": "Operation"
  9556. // },
  9557. // "scopes": [
  9558. // "https://www.googleapis.com/auth/cloud-platform"
  9559. // ]
  9560. // }
  9561. }
  9562. // method id "container.projects.zones.clusters.resourceLabels":
  9563. type ProjectsZonesClustersResourceLabelsCall struct {
  9564. s *Service
  9565. projectId string
  9566. zone string
  9567. clusterId string
  9568. setlabelsrequest *SetLabelsRequest
  9569. urlParams_ gensupport.URLParams
  9570. ctx_ context.Context
  9571. header_ http.Header
  9572. }
  9573. // ResourceLabels: Sets labels on a cluster.
  9574. func (r *ProjectsZonesClustersService) ResourceLabels(projectId string, zone string, clusterId string, setlabelsrequest *SetLabelsRequest) *ProjectsZonesClustersResourceLabelsCall {
  9575. c := &ProjectsZonesClustersResourceLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9576. c.projectId = projectId
  9577. c.zone = zone
  9578. c.clusterId = clusterId
  9579. c.setlabelsrequest = setlabelsrequest
  9580. return c
  9581. }
  9582. // Fields allows partial responses to be retrieved. See
  9583. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9584. // for more information.
  9585. func (c *ProjectsZonesClustersResourceLabelsCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersResourceLabelsCall {
  9586. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9587. return c
  9588. }
  9589. // Context sets the context to be used in this call's Do method. Any
  9590. // pending HTTP request will be aborted if the provided context is
  9591. // canceled.
  9592. func (c *ProjectsZonesClustersResourceLabelsCall) Context(ctx context.Context) *ProjectsZonesClustersResourceLabelsCall {
  9593. c.ctx_ = ctx
  9594. return c
  9595. }
  9596. // Header returns an http.Header that can be modified by the caller to
  9597. // add HTTP headers to the request.
  9598. func (c *ProjectsZonesClustersResourceLabelsCall) Header() http.Header {
  9599. if c.header_ == nil {
  9600. c.header_ = make(http.Header)
  9601. }
  9602. return c.header_
  9603. }
  9604. func (c *ProjectsZonesClustersResourceLabelsCall) doRequest(alt string) (*http.Response, error) {
  9605. reqHeaders := make(http.Header)
  9606. for k, v := range c.header_ {
  9607. reqHeaders[k] = v
  9608. }
  9609. reqHeaders.Set("User-Agent", c.s.userAgent())
  9610. var body io.Reader = nil
  9611. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlabelsrequest)
  9612. if err != nil {
  9613. return nil, err
  9614. }
  9615. reqHeaders.Set("Content-Type", "application/json")
  9616. c.urlParams_.Set("alt", alt)
  9617. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels")
  9618. urls += "?" + c.urlParams_.Encode()
  9619. req, _ := http.NewRequest("POST", urls, body)
  9620. req.Header = reqHeaders
  9621. googleapi.Expand(req.URL, map[string]string{
  9622. "projectId": c.projectId,
  9623. "zone": c.zone,
  9624. "clusterId": c.clusterId,
  9625. })
  9626. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9627. }
  9628. // Do executes the "container.projects.zones.clusters.resourceLabels" call.
  9629. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9630. // status code is an error. Response headers are in either
  9631. // *Operation.ServerResponse.Header or (if a response was returned at
  9632. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9633. // to check whether the returned error was because
  9634. // http.StatusNotModified was returned.
  9635. func (c *ProjectsZonesClustersResourceLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9636. gensupport.SetOptions(c.urlParams_, opts...)
  9637. res, err := c.doRequest("json")
  9638. if res != nil && res.StatusCode == http.StatusNotModified {
  9639. if res.Body != nil {
  9640. res.Body.Close()
  9641. }
  9642. return nil, &googleapi.Error{
  9643. Code: res.StatusCode,
  9644. Header: res.Header,
  9645. }
  9646. }
  9647. if err != nil {
  9648. return nil, err
  9649. }
  9650. defer googleapi.CloseBody(res)
  9651. if err := googleapi.CheckResponse(res); err != nil {
  9652. return nil, err
  9653. }
  9654. ret := &Operation{
  9655. ServerResponse: googleapi.ServerResponse{
  9656. Header: res.Header,
  9657. HTTPStatusCode: res.StatusCode,
  9658. },
  9659. }
  9660. target := &ret
  9661. if err := gensupport.DecodeResponse(target, res); err != nil {
  9662. return nil, err
  9663. }
  9664. return ret, nil
  9665. // {
  9666. // "description": "Sets labels on a cluster.",
  9667. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels",
  9668. // "httpMethod": "POST",
  9669. // "id": "container.projects.zones.clusters.resourceLabels",
  9670. // "parameterOrder": [
  9671. // "projectId",
  9672. // "zone",
  9673. // "clusterId"
  9674. // ],
  9675. // "parameters": {
  9676. // "clusterId": {
  9677. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  9678. // "location": "path",
  9679. // "required": true,
  9680. // "type": "string"
  9681. // },
  9682. // "projectId": {
  9683. // "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.",
  9684. // "location": "path",
  9685. // "required": true,
  9686. // "type": "string"
  9687. // },
  9688. // "zone": {
  9689. // "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.",
  9690. // "location": "path",
  9691. // "required": true,
  9692. // "type": "string"
  9693. // }
  9694. // },
  9695. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels",
  9696. // "request": {
  9697. // "$ref": "SetLabelsRequest"
  9698. // },
  9699. // "response": {
  9700. // "$ref": "Operation"
  9701. // },
  9702. // "scopes": [
  9703. // "https://www.googleapis.com/auth/cloud-platform"
  9704. // ]
  9705. // }
  9706. }
  9707. // method id "container.projects.zones.clusters.setMaintenancePolicy":
  9708. type ProjectsZonesClustersSetMaintenancePolicyCall struct {
  9709. s *Service
  9710. projectId string
  9711. zone string
  9712. clusterId string
  9713. setmaintenancepolicyrequest *SetMaintenancePolicyRequest
  9714. urlParams_ gensupport.URLParams
  9715. ctx_ context.Context
  9716. header_ http.Header
  9717. }
  9718. // SetMaintenancePolicy: Sets the maintenance policy for a cluster.
  9719. func (r *ProjectsZonesClustersService) SetMaintenancePolicy(projectId string, zone string, clusterId string, setmaintenancepolicyrequest *SetMaintenancePolicyRequest) *ProjectsZonesClustersSetMaintenancePolicyCall {
  9720. c := &ProjectsZonesClustersSetMaintenancePolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9721. c.projectId = projectId
  9722. c.zone = zone
  9723. c.clusterId = clusterId
  9724. c.setmaintenancepolicyrequest = setmaintenancepolicyrequest
  9725. return c
  9726. }
  9727. // Fields allows partial responses to be retrieved. See
  9728. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9729. // for more information.
  9730. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersSetMaintenancePolicyCall {
  9731. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9732. return c
  9733. }
  9734. // Context sets the context to be used in this call's Do method. Any
  9735. // pending HTTP request will be aborted if the provided context is
  9736. // canceled.
  9737. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Context(ctx context.Context) *ProjectsZonesClustersSetMaintenancePolicyCall {
  9738. c.ctx_ = ctx
  9739. return c
  9740. }
  9741. // Header returns an http.Header that can be modified by the caller to
  9742. // add HTTP headers to the request.
  9743. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Header() http.Header {
  9744. if c.header_ == nil {
  9745. c.header_ = make(http.Header)
  9746. }
  9747. return c.header_
  9748. }
  9749. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) doRequest(alt string) (*http.Response, error) {
  9750. reqHeaders := make(http.Header)
  9751. for k, v := range c.header_ {
  9752. reqHeaders[k] = v
  9753. }
  9754. reqHeaders.Set("User-Agent", c.s.userAgent())
  9755. var body io.Reader = nil
  9756. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmaintenancepolicyrequest)
  9757. if err != nil {
  9758. return nil, err
  9759. }
  9760. reqHeaders.Set("Content-Type", "application/json")
  9761. c.urlParams_.Set("alt", alt)
  9762. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy")
  9763. urls += "?" + c.urlParams_.Encode()
  9764. req, _ := http.NewRequest("POST", urls, body)
  9765. req.Header = reqHeaders
  9766. googleapi.Expand(req.URL, map[string]string{
  9767. "projectId": c.projectId,
  9768. "zone": c.zone,
  9769. "clusterId": c.clusterId,
  9770. })
  9771. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9772. }
  9773. // Do executes the "container.projects.zones.clusters.setMaintenancePolicy" call.
  9774. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9775. // status code is an error. Response headers are in either
  9776. // *Operation.ServerResponse.Header or (if a response was returned at
  9777. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9778. // to check whether the returned error was because
  9779. // http.StatusNotModified was returned.
  9780. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9781. gensupport.SetOptions(c.urlParams_, opts...)
  9782. res, err := c.doRequest("json")
  9783. if res != nil && res.StatusCode == http.StatusNotModified {
  9784. if res.Body != nil {
  9785. res.Body.Close()
  9786. }
  9787. return nil, &googleapi.Error{
  9788. Code: res.StatusCode,
  9789. Header: res.Header,
  9790. }
  9791. }
  9792. if err != nil {
  9793. return nil, err
  9794. }
  9795. defer googleapi.CloseBody(res)
  9796. if err := googleapi.CheckResponse(res); err != nil {
  9797. return nil, err
  9798. }
  9799. ret := &Operation{
  9800. ServerResponse: googleapi.ServerResponse{
  9801. Header: res.Header,
  9802. HTTPStatusCode: res.StatusCode,
  9803. },
  9804. }
  9805. target := &ret
  9806. if err := gensupport.DecodeResponse(target, res); err != nil {
  9807. return nil, err
  9808. }
  9809. return ret, nil
  9810. // {
  9811. // "description": "Sets the maintenance policy for a cluster.",
  9812. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy",
  9813. // "httpMethod": "POST",
  9814. // "id": "container.projects.zones.clusters.setMaintenancePolicy",
  9815. // "parameterOrder": [
  9816. // "projectId",
  9817. // "zone",
  9818. // "clusterId"
  9819. // ],
  9820. // "parameters": {
  9821. // "clusterId": {
  9822. // "description": "The name of the cluster to update.",
  9823. // "location": "path",
  9824. // "required": true,
  9825. // "type": "string"
  9826. // },
  9827. // "projectId": {
  9828. // "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).",
  9829. // "location": "path",
  9830. // "required": true,
  9831. // "type": "string"
  9832. // },
  9833. // "zone": {
  9834. // "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.",
  9835. // "location": "path",
  9836. // "required": true,
  9837. // "type": "string"
  9838. // }
  9839. // },
  9840. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy",
  9841. // "request": {
  9842. // "$ref": "SetMaintenancePolicyRequest"
  9843. // },
  9844. // "response": {
  9845. // "$ref": "Operation"
  9846. // },
  9847. // "scopes": [
  9848. // "https://www.googleapis.com/auth/cloud-platform"
  9849. // ]
  9850. // }
  9851. }
  9852. // method id "container.projects.zones.clusters.setMasterAuth":
  9853. type ProjectsZonesClustersSetMasterAuthCall struct {
  9854. s *Service
  9855. projectId string
  9856. zone string
  9857. clusterId string
  9858. setmasterauthrequest *SetMasterAuthRequest
  9859. urlParams_ gensupport.URLParams
  9860. ctx_ context.Context
  9861. header_ http.Header
  9862. }
  9863. // SetMasterAuth: Used to set master auth materials. Currently supports
  9864. // :-
  9865. // Changing the admin password for a specific cluster.
  9866. // This can be either via password generation or explicitly set.
  9867. // Modify basic_auth.csv and reset the K8S API server.
  9868. func (r *ProjectsZonesClustersService) SetMasterAuth(projectId string, zone string, clusterId string, setmasterauthrequest *SetMasterAuthRequest) *ProjectsZonesClustersSetMasterAuthCall {
  9869. c := &ProjectsZonesClustersSetMasterAuthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9870. c.projectId = projectId
  9871. c.zone = zone
  9872. c.clusterId = clusterId
  9873. c.setmasterauthrequest = setmasterauthrequest
  9874. return c
  9875. }
  9876. // Fields allows partial responses to be retrieved. See
  9877. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9878. // for more information.
  9879. func (c *ProjectsZonesClustersSetMasterAuthCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersSetMasterAuthCall {
  9880. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9881. return c
  9882. }
  9883. // Context sets the context to be used in this call's Do method. Any
  9884. // pending HTTP request will be aborted if the provided context is
  9885. // canceled.
  9886. func (c *ProjectsZonesClustersSetMasterAuthCall) Context(ctx context.Context) *ProjectsZonesClustersSetMasterAuthCall {
  9887. c.ctx_ = ctx
  9888. return c
  9889. }
  9890. // Header returns an http.Header that can be modified by the caller to
  9891. // add HTTP headers to the request.
  9892. func (c *ProjectsZonesClustersSetMasterAuthCall) Header() http.Header {
  9893. if c.header_ == nil {
  9894. c.header_ = make(http.Header)
  9895. }
  9896. return c.header_
  9897. }
  9898. func (c *ProjectsZonesClustersSetMasterAuthCall) doRequest(alt string) (*http.Response, error) {
  9899. reqHeaders := make(http.Header)
  9900. for k, v := range c.header_ {
  9901. reqHeaders[k] = v
  9902. }
  9903. reqHeaders.Set("User-Agent", c.s.userAgent())
  9904. var body io.Reader = nil
  9905. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmasterauthrequest)
  9906. if err != nil {
  9907. return nil, err
  9908. }
  9909. reqHeaders.Set("Content-Type", "application/json")
  9910. c.urlParams_.Set("alt", alt)
  9911. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth")
  9912. urls += "?" + c.urlParams_.Encode()
  9913. req, _ := http.NewRequest("POST", urls, body)
  9914. req.Header = reqHeaders
  9915. googleapi.Expand(req.URL, map[string]string{
  9916. "projectId": c.projectId,
  9917. "zone": c.zone,
  9918. "clusterId": c.clusterId,
  9919. })
  9920. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9921. }
  9922. // Do executes the "container.projects.zones.clusters.setMasterAuth" call.
  9923. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9924. // status code is an error. Response headers are in either
  9925. // *Operation.ServerResponse.Header or (if a response was returned at
  9926. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9927. // to check whether the returned error was because
  9928. // http.StatusNotModified was returned.
  9929. func (c *ProjectsZonesClustersSetMasterAuthCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9930. gensupport.SetOptions(c.urlParams_, opts...)
  9931. res, err := c.doRequest("json")
  9932. if res != nil && res.StatusCode == http.StatusNotModified {
  9933. if res.Body != nil {
  9934. res.Body.Close()
  9935. }
  9936. return nil, &googleapi.Error{
  9937. Code: res.StatusCode,
  9938. Header: res.Header,
  9939. }
  9940. }
  9941. if err != nil {
  9942. return nil, err
  9943. }
  9944. defer googleapi.CloseBody(res)
  9945. if err := googleapi.CheckResponse(res); err != nil {
  9946. return nil, err
  9947. }
  9948. ret := &Operation{
  9949. ServerResponse: googleapi.ServerResponse{
  9950. Header: res.Header,
  9951. HTTPStatusCode: res.StatusCode,
  9952. },
  9953. }
  9954. target := &ret
  9955. if err := gensupport.DecodeResponse(target, res); err != nil {
  9956. return nil, err
  9957. }
  9958. return ret, nil
  9959. // {
  9960. // "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.\nModify basic_auth.csv and reset the K8S API server.",
  9961. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth",
  9962. // "httpMethod": "POST",
  9963. // "id": "container.projects.zones.clusters.setMasterAuth",
  9964. // "parameterOrder": [
  9965. // "projectId",
  9966. // "zone",
  9967. // "clusterId"
  9968. // ],
  9969. // "parameters": {
  9970. // "clusterId": {
  9971. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9972. // "location": "path",
  9973. // "required": true,
  9974. // "type": "string"
  9975. // },
  9976. // "projectId": {
  9977. // "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.",
  9978. // "location": "path",
  9979. // "required": true,
  9980. // "type": "string"
  9981. // },
  9982. // "zone": {
  9983. // "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.",
  9984. // "location": "path",
  9985. // "required": true,
  9986. // "type": "string"
  9987. // }
  9988. // },
  9989. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth",
  9990. // "request": {
  9991. // "$ref": "SetMasterAuthRequest"
  9992. // },
  9993. // "response": {
  9994. // "$ref": "Operation"
  9995. // },
  9996. // "scopes": [
  9997. // "https://www.googleapis.com/auth/cloud-platform"
  9998. // ]
  9999. // }
  10000. }
  10001. // method id "container.projects.zones.clusters.setNetworkPolicy":
  10002. type ProjectsZonesClustersSetNetworkPolicyCall struct {
  10003. s *Service
  10004. projectId string
  10005. zone string
  10006. clusterId string
  10007. setnetworkpolicyrequest *SetNetworkPolicyRequest
  10008. urlParams_ gensupport.URLParams
  10009. ctx_ context.Context
  10010. header_ http.Header
  10011. }
  10012. // SetNetworkPolicy: Enables/Disables Network Policy for a cluster.
  10013. func (r *ProjectsZonesClustersService) SetNetworkPolicy(projectId string, zone string, clusterId string, setnetworkpolicyrequest *SetNetworkPolicyRequest) *ProjectsZonesClustersSetNetworkPolicyCall {
  10014. c := &ProjectsZonesClustersSetNetworkPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10015. c.projectId = projectId
  10016. c.zone = zone
  10017. c.clusterId = clusterId
  10018. c.setnetworkpolicyrequest = setnetworkpolicyrequest
  10019. return c
  10020. }
  10021. // Fields allows partial responses to be retrieved. See
  10022. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10023. // for more information.
  10024. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersSetNetworkPolicyCall {
  10025. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10026. return c
  10027. }
  10028. // Context sets the context to be used in this call's Do method. Any
  10029. // pending HTTP request will be aborted if the provided context is
  10030. // canceled.
  10031. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Context(ctx context.Context) *ProjectsZonesClustersSetNetworkPolicyCall {
  10032. c.ctx_ = ctx
  10033. return c
  10034. }
  10035. // Header returns an http.Header that can be modified by the caller to
  10036. // add HTTP headers to the request.
  10037. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Header() http.Header {
  10038. if c.header_ == nil {
  10039. c.header_ = make(http.Header)
  10040. }
  10041. return c.header_
  10042. }
  10043. func (c *ProjectsZonesClustersSetNetworkPolicyCall) doRequest(alt string) (*http.Response, error) {
  10044. reqHeaders := make(http.Header)
  10045. for k, v := range c.header_ {
  10046. reqHeaders[k] = v
  10047. }
  10048. reqHeaders.Set("User-Agent", c.s.userAgent())
  10049. var body io.Reader = nil
  10050. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnetworkpolicyrequest)
  10051. if err != nil {
  10052. return nil, err
  10053. }
  10054. reqHeaders.Set("Content-Type", "application/json")
  10055. c.urlParams_.Set("alt", alt)
  10056. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy")
  10057. urls += "?" + c.urlParams_.Encode()
  10058. req, _ := http.NewRequest("POST", urls, body)
  10059. req.Header = reqHeaders
  10060. googleapi.Expand(req.URL, map[string]string{
  10061. "projectId": c.projectId,
  10062. "zone": c.zone,
  10063. "clusterId": c.clusterId,
  10064. })
  10065. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10066. }
  10067. // Do executes the "container.projects.zones.clusters.setNetworkPolicy" call.
  10068. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10069. // status code is an error. Response headers are in either
  10070. // *Operation.ServerResponse.Header or (if a response was returned at
  10071. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10072. // to check whether the returned error was because
  10073. // http.StatusNotModified was returned.
  10074. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10075. gensupport.SetOptions(c.urlParams_, opts...)
  10076. res, err := c.doRequest("json")
  10077. if res != nil && res.StatusCode == http.StatusNotModified {
  10078. if res.Body != nil {
  10079. res.Body.Close()
  10080. }
  10081. return nil, &googleapi.Error{
  10082. Code: res.StatusCode,
  10083. Header: res.Header,
  10084. }
  10085. }
  10086. if err != nil {
  10087. return nil, err
  10088. }
  10089. defer googleapi.CloseBody(res)
  10090. if err := googleapi.CheckResponse(res); err != nil {
  10091. return nil, err
  10092. }
  10093. ret := &Operation{
  10094. ServerResponse: googleapi.ServerResponse{
  10095. Header: res.Header,
  10096. HTTPStatusCode: res.StatusCode,
  10097. },
  10098. }
  10099. target := &ret
  10100. if err := gensupport.DecodeResponse(target, res); err != nil {
  10101. return nil, err
  10102. }
  10103. return ret, nil
  10104. // {
  10105. // "description": "Enables/Disables Network Policy for a cluster.",
  10106. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy",
  10107. // "httpMethod": "POST",
  10108. // "id": "container.projects.zones.clusters.setNetworkPolicy",
  10109. // "parameterOrder": [
  10110. // "projectId",
  10111. // "zone",
  10112. // "clusterId"
  10113. // ],
  10114. // "parameters": {
  10115. // "clusterId": {
  10116. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  10117. // "location": "path",
  10118. // "required": true,
  10119. // "type": "string"
  10120. // },
  10121. // "projectId": {
  10122. // "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.",
  10123. // "location": "path",
  10124. // "required": true,
  10125. // "type": "string"
  10126. // },
  10127. // "zone": {
  10128. // "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.",
  10129. // "location": "path",
  10130. // "required": true,
  10131. // "type": "string"
  10132. // }
  10133. // },
  10134. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy",
  10135. // "request": {
  10136. // "$ref": "SetNetworkPolicyRequest"
  10137. // },
  10138. // "response": {
  10139. // "$ref": "Operation"
  10140. // },
  10141. // "scopes": [
  10142. // "https://www.googleapis.com/auth/cloud-platform"
  10143. // ]
  10144. // }
  10145. }
  10146. // method id "container.projects.zones.clusters.startIpRotation":
  10147. type ProjectsZonesClustersStartIpRotationCall struct {
  10148. s *Service
  10149. projectId string
  10150. zone string
  10151. clusterId string
  10152. startiprotationrequest *StartIPRotationRequest
  10153. urlParams_ gensupport.URLParams
  10154. ctx_ context.Context
  10155. header_ http.Header
  10156. }
  10157. // StartIpRotation: Start master IP rotation.
  10158. func (r *ProjectsZonesClustersService) StartIpRotation(projectId string, zone string, clusterId string, startiprotationrequest *StartIPRotationRequest) *ProjectsZonesClustersStartIpRotationCall {
  10159. c := &ProjectsZonesClustersStartIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10160. c.projectId = projectId
  10161. c.zone = zone
  10162. c.clusterId = clusterId
  10163. c.startiprotationrequest = startiprotationrequest
  10164. return c
  10165. }
  10166. // Fields allows partial responses to be retrieved. See
  10167. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10168. // for more information.
  10169. func (c *ProjectsZonesClustersStartIpRotationCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersStartIpRotationCall {
  10170. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10171. return c
  10172. }
  10173. // Context sets the context to be used in this call's Do method. Any
  10174. // pending HTTP request will be aborted if the provided context is
  10175. // canceled.
  10176. func (c *ProjectsZonesClustersStartIpRotationCall) Context(ctx context.Context) *ProjectsZonesClustersStartIpRotationCall {
  10177. c.ctx_ = ctx
  10178. return c
  10179. }
  10180. // Header returns an http.Header that can be modified by the caller to
  10181. // add HTTP headers to the request.
  10182. func (c *ProjectsZonesClustersStartIpRotationCall) Header() http.Header {
  10183. if c.header_ == nil {
  10184. c.header_ = make(http.Header)
  10185. }
  10186. return c.header_
  10187. }
  10188. func (c *ProjectsZonesClustersStartIpRotationCall) doRequest(alt string) (*http.Response, error) {
  10189. reqHeaders := make(http.Header)
  10190. for k, v := range c.header_ {
  10191. reqHeaders[k] = v
  10192. }
  10193. reqHeaders.Set("User-Agent", c.s.userAgent())
  10194. var body io.Reader = nil
  10195. body, err := googleapi.WithoutDataWrapper.JSONReader(c.startiprotationrequest)
  10196. if err != nil {
  10197. return nil, err
  10198. }
  10199. reqHeaders.Set("Content-Type", "application/json")
  10200. c.urlParams_.Set("alt", alt)
  10201. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation")
  10202. urls += "?" + c.urlParams_.Encode()
  10203. req, _ := http.NewRequest("POST", urls, body)
  10204. req.Header = reqHeaders
  10205. googleapi.Expand(req.URL, map[string]string{
  10206. "projectId": c.projectId,
  10207. "zone": c.zone,
  10208. "clusterId": c.clusterId,
  10209. })
  10210. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10211. }
  10212. // Do executes the "container.projects.zones.clusters.startIpRotation" call.
  10213. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10214. // status code is an error. Response headers are in either
  10215. // *Operation.ServerResponse.Header or (if a response was returned at
  10216. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10217. // to check whether the returned error was because
  10218. // http.StatusNotModified was returned.
  10219. func (c *ProjectsZonesClustersStartIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10220. gensupport.SetOptions(c.urlParams_, opts...)
  10221. res, err := c.doRequest("json")
  10222. if res != nil && res.StatusCode == http.StatusNotModified {
  10223. if res.Body != nil {
  10224. res.Body.Close()
  10225. }
  10226. return nil, &googleapi.Error{
  10227. Code: res.StatusCode,
  10228. Header: res.Header,
  10229. }
  10230. }
  10231. if err != nil {
  10232. return nil, err
  10233. }
  10234. defer googleapi.CloseBody(res)
  10235. if err := googleapi.CheckResponse(res); err != nil {
  10236. return nil, err
  10237. }
  10238. ret := &Operation{
  10239. ServerResponse: googleapi.ServerResponse{
  10240. Header: res.Header,
  10241. HTTPStatusCode: res.StatusCode,
  10242. },
  10243. }
  10244. target := &ret
  10245. if err := gensupport.DecodeResponse(target, res); err != nil {
  10246. return nil, err
  10247. }
  10248. return ret, nil
  10249. // {
  10250. // "description": "Start master IP rotation.",
  10251. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation",
  10252. // "httpMethod": "POST",
  10253. // "id": "container.projects.zones.clusters.startIpRotation",
  10254. // "parameterOrder": [
  10255. // "projectId",
  10256. // "zone",
  10257. // "clusterId"
  10258. // ],
  10259. // "parameters": {
  10260. // "clusterId": {
  10261. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  10262. // "location": "path",
  10263. // "required": true,
  10264. // "type": "string"
  10265. // },
  10266. // "projectId": {
  10267. // "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.",
  10268. // "location": "path",
  10269. // "required": true,
  10270. // "type": "string"
  10271. // },
  10272. // "zone": {
  10273. // "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.",
  10274. // "location": "path",
  10275. // "required": true,
  10276. // "type": "string"
  10277. // }
  10278. // },
  10279. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation",
  10280. // "request": {
  10281. // "$ref": "StartIPRotationRequest"
  10282. // },
  10283. // "response": {
  10284. // "$ref": "Operation"
  10285. // },
  10286. // "scopes": [
  10287. // "https://www.googleapis.com/auth/cloud-platform"
  10288. // ]
  10289. // }
  10290. }
  10291. // method id "container.projects.zones.clusters.update":
  10292. type ProjectsZonesClustersUpdateCall struct {
  10293. s *Service
  10294. projectId string
  10295. zone string
  10296. clusterId string
  10297. updateclusterrequest *UpdateClusterRequest
  10298. urlParams_ gensupport.URLParams
  10299. ctx_ context.Context
  10300. header_ http.Header
  10301. }
  10302. // Update: Updates the settings for a specific cluster.
  10303. func (r *ProjectsZonesClustersService) Update(projectId string, zone string, clusterId string, updateclusterrequest *UpdateClusterRequest) *ProjectsZonesClustersUpdateCall {
  10304. c := &ProjectsZonesClustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10305. c.projectId = projectId
  10306. c.zone = zone
  10307. c.clusterId = clusterId
  10308. c.updateclusterrequest = updateclusterrequest
  10309. return c
  10310. }
  10311. // Fields allows partial responses to be retrieved. See
  10312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10313. // for more information.
  10314. func (c *ProjectsZonesClustersUpdateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersUpdateCall {
  10315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10316. return c
  10317. }
  10318. // Context sets the context to be used in this call's Do method. Any
  10319. // pending HTTP request will be aborted if the provided context is
  10320. // canceled.
  10321. func (c *ProjectsZonesClustersUpdateCall) Context(ctx context.Context) *ProjectsZonesClustersUpdateCall {
  10322. c.ctx_ = ctx
  10323. return c
  10324. }
  10325. // Header returns an http.Header that can be modified by the caller to
  10326. // add HTTP headers to the request.
  10327. func (c *ProjectsZonesClustersUpdateCall) Header() http.Header {
  10328. if c.header_ == nil {
  10329. c.header_ = make(http.Header)
  10330. }
  10331. return c.header_
  10332. }
  10333. func (c *ProjectsZonesClustersUpdateCall) doRequest(alt string) (*http.Response, error) {
  10334. reqHeaders := make(http.Header)
  10335. for k, v := range c.header_ {
  10336. reqHeaders[k] = v
  10337. }
  10338. reqHeaders.Set("User-Agent", c.s.userAgent())
  10339. var body io.Reader = nil
  10340. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest)
  10341. if err != nil {
  10342. return nil, err
  10343. }
  10344. reqHeaders.Set("Content-Type", "application/json")
  10345. c.urlParams_.Set("alt", alt)
  10346. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  10347. urls += "?" + c.urlParams_.Encode()
  10348. req, _ := http.NewRequest("PUT", urls, body)
  10349. req.Header = reqHeaders
  10350. googleapi.Expand(req.URL, map[string]string{
  10351. "projectId": c.projectId,
  10352. "zone": c.zone,
  10353. "clusterId": c.clusterId,
  10354. })
  10355. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10356. }
  10357. // Do executes the "container.projects.zones.clusters.update" call.
  10358. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10359. // status code is an error. Response headers are in either
  10360. // *Operation.ServerResponse.Header or (if a response was returned at
  10361. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10362. // to check whether the returned error was because
  10363. // http.StatusNotModified was returned.
  10364. func (c *ProjectsZonesClustersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10365. gensupport.SetOptions(c.urlParams_, opts...)
  10366. res, err := c.doRequest("json")
  10367. if res != nil && res.StatusCode == http.StatusNotModified {
  10368. if res.Body != nil {
  10369. res.Body.Close()
  10370. }
  10371. return nil, &googleapi.Error{
  10372. Code: res.StatusCode,
  10373. Header: res.Header,
  10374. }
  10375. }
  10376. if err != nil {
  10377. return nil, err
  10378. }
  10379. defer googleapi.CloseBody(res)
  10380. if err := googleapi.CheckResponse(res); err != nil {
  10381. return nil, err
  10382. }
  10383. ret := &Operation{
  10384. ServerResponse: googleapi.ServerResponse{
  10385. Header: res.Header,
  10386. HTTPStatusCode: res.StatusCode,
  10387. },
  10388. }
  10389. target := &ret
  10390. if err := gensupport.DecodeResponse(target, res); err != nil {
  10391. return nil, err
  10392. }
  10393. return ret, nil
  10394. // {
  10395. // "description": "Updates the settings for a specific cluster.",
  10396. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  10397. // "httpMethod": "PUT",
  10398. // "id": "container.projects.zones.clusters.update",
  10399. // "parameterOrder": [
  10400. // "projectId",
  10401. // "zone",
  10402. // "clusterId"
  10403. // ],
  10404. // "parameters": {
  10405. // "clusterId": {
  10406. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  10407. // "location": "path",
  10408. // "required": true,
  10409. // "type": "string"
  10410. // },
  10411. // "projectId": {
  10412. // "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.",
  10413. // "location": "path",
  10414. // "required": true,
  10415. // "type": "string"
  10416. // },
  10417. // "zone": {
  10418. // "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.",
  10419. // "location": "path",
  10420. // "required": true,
  10421. // "type": "string"
  10422. // }
  10423. // },
  10424. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  10425. // "request": {
  10426. // "$ref": "UpdateClusterRequest"
  10427. // },
  10428. // "response": {
  10429. // "$ref": "Operation"
  10430. // },
  10431. // "scopes": [
  10432. // "https://www.googleapis.com/auth/cloud-platform"
  10433. // ]
  10434. // }
  10435. }
  10436. // method id "container.projects.zones.clusters.nodePools.autoscaling":
  10437. type ProjectsZonesClustersNodePoolsAutoscalingCall struct {
  10438. s *Service
  10439. projectId string
  10440. zone string
  10441. clusterId string
  10442. nodePoolId string
  10443. setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest
  10444. urlParams_ gensupport.URLParams
  10445. ctx_ context.Context
  10446. header_ http.Header
  10447. }
  10448. // Autoscaling: Sets the autoscaling settings of a specific node pool.
  10449. func (r *ProjectsZonesClustersNodePoolsService) Autoscaling(projectId string, zone string, clusterId string, nodePoolId string, setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest) *ProjectsZonesClustersNodePoolsAutoscalingCall {
  10450. c := &ProjectsZonesClustersNodePoolsAutoscalingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10451. c.projectId = projectId
  10452. c.zone = zone
  10453. c.clusterId = clusterId
  10454. c.nodePoolId = nodePoolId
  10455. c.setnodepoolautoscalingrequest = setnodepoolautoscalingrequest
  10456. return c
  10457. }
  10458. // Fields allows partial responses to be retrieved. See
  10459. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10460. // for more information.
  10461. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsAutoscalingCall {
  10462. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10463. return c
  10464. }
  10465. // Context sets the context to be used in this call's Do method. Any
  10466. // pending HTTP request will be aborted if the provided context is
  10467. // canceled.
  10468. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsAutoscalingCall {
  10469. c.ctx_ = ctx
  10470. return c
  10471. }
  10472. // Header returns an http.Header that can be modified by the caller to
  10473. // add HTTP headers to the request.
  10474. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Header() http.Header {
  10475. if c.header_ == nil {
  10476. c.header_ = make(http.Header)
  10477. }
  10478. return c.header_
  10479. }
  10480. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) doRequest(alt string) (*http.Response, error) {
  10481. reqHeaders := make(http.Header)
  10482. for k, v := range c.header_ {
  10483. reqHeaders[k] = v
  10484. }
  10485. reqHeaders.Set("User-Agent", c.s.userAgent())
  10486. var body io.Reader = nil
  10487. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolautoscalingrequest)
  10488. if err != nil {
  10489. return nil, err
  10490. }
  10491. reqHeaders.Set("Content-Type", "application/json")
  10492. c.urlParams_.Set("alt", alt)
  10493. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling")
  10494. urls += "?" + c.urlParams_.Encode()
  10495. req, _ := http.NewRequest("POST", urls, body)
  10496. req.Header = reqHeaders
  10497. googleapi.Expand(req.URL, map[string]string{
  10498. "projectId": c.projectId,
  10499. "zone": c.zone,
  10500. "clusterId": c.clusterId,
  10501. "nodePoolId": c.nodePoolId,
  10502. })
  10503. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10504. }
  10505. // Do executes the "container.projects.zones.clusters.nodePools.autoscaling" call.
  10506. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10507. // status code is an error. Response headers are in either
  10508. // *Operation.ServerResponse.Header or (if a response was returned at
  10509. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10510. // to check whether the returned error was because
  10511. // http.StatusNotModified was returned.
  10512. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10513. gensupport.SetOptions(c.urlParams_, opts...)
  10514. res, err := c.doRequest("json")
  10515. if res != nil && res.StatusCode == http.StatusNotModified {
  10516. if res.Body != nil {
  10517. res.Body.Close()
  10518. }
  10519. return nil, &googleapi.Error{
  10520. Code: res.StatusCode,
  10521. Header: res.Header,
  10522. }
  10523. }
  10524. if err != nil {
  10525. return nil, err
  10526. }
  10527. defer googleapi.CloseBody(res)
  10528. if err := googleapi.CheckResponse(res); err != nil {
  10529. return nil, err
  10530. }
  10531. ret := &Operation{
  10532. ServerResponse: googleapi.ServerResponse{
  10533. Header: res.Header,
  10534. HTTPStatusCode: res.StatusCode,
  10535. },
  10536. }
  10537. target := &ret
  10538. if err := gensupport.DecodeResponse(target, res); err != nil {
  10539. return nil, err
  10540. }
  10541. return ret, nil
  10542. // {
  10543. // "description": "Sets the autoscaling settings of a specific node pool.",
  10544. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling",
  10545. // "httpMethod": "POST",
  10546. // "id": "container.projects.zones.clusters.nodePools.autoscaling",
  10547. // "parameterOrder": [
  10548. // "projectId",
  10549. // "zone",
  10550. // "clusterId",
  10551. // "nodePoolId"
  10552. // ],
  10553. // "parameters": {
  10554. // "clusterId": {
  10555. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  10556. // "location": "path",
  10557. // "required": true,
  10558. // "type": "string"
  10559. // },
  10560. // "nodePoolId": {
  10561. // "description": "Deprecated. The name of the node pool to upgrade.\nThis field has been deprecated and replaced by the name field.",
  10562. // "location": "path",
  10563. // "required": true,
  10564. // "type": "string"
  10565. // },
  10566. // "projectId": {
  10567. // "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.",
  10568. // "location": "path",
  10569. // "required": true,
  10570. // "type": "string"
  10571. // },
  10572. // "zone": {
  10573. // "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.",
  10574. // "location": "path",
  10575. // "required": true,
  10576. // "type": "string"
  10577. // }
  10578. // },
  10579. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling",
  10580. // "request": {
  10581. // "$ref": "SetNodePoolAutoscalingRequest"
  10582. // },
  10583. // "response": {
  10584. // "$ref": "Operation"
  10585. // },
  10586. // "scopes": [
  10587. // "https://www.googleapis.com/auth/cloud-platform"
  10588. // ]
  10589. // }
  10590. }
  10591. // method id "container.projects.zones.clusters.nodePools.create":
  10592. type ProjectsZonesClustersNodePoolsCreateCall struct {
  10593. s *Service
  10594. projectId string
  10595. zone string
  10596. clusterId string
  10597. createnodepoolrequest *CreateNodePoolRequest
  10598. urlParams_ gensupport.URLParams
  10599. ctx_ context.Context
  10600. header_ http.Header
  10601. }
  10602. // Create: Creates a node pool for a cluster.
  10603. func (r *ProjectsZonesClustersNodePoolsService) Create(projectId string, zone string, clusterId string, createnodepoolrequest *CreateNodePoolRequest) *ProjectsZonesClustersNodePoolsCreateCall {
  10604. c := &ProjectsZonesClustersNodePoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10605. c.projectId = projectId
  10606. c.zone = zone
  10607. c.clusterId = clusterId
  10608. c.createnodepoolrequest = createnodepoolrequest
  10609. return c
  10610. }
  10611. // Fields allows partial responses to be retrieved. See
  10612. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10613. // for more information.
  10614. func (c *ProjectsZonesClustersNodePoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsCreateCall {
  10615. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10616. return c
  10617. }
  10618. // Context sets the context to be used in this call's Do method. Any
  10619. // pending HTTP request will be aborted if the provided context is
  10620. // canceled.
  10621. func (c *ProjectsZonesClustersNodePoolsCreateCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsCreateCall {
  10622. c.ctx_ = ctx
  10623. return c
  10624. }
  10625. // Header returns an http.Header that can be modified by the caller to
  10626. // add HTTP headers to the request.
  10627. func (c *ProjectsZonesClustersNodePoolsCreateCall) Header() http.Header {
  10628. if c.header_ == nil {
  10629. c.header_ = make(http.Header)
  10630. }
  10631. return c.header_
  10632. }
  10633. func (c *ProjectsZonesClustersNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) {
  10634. reqHeaders := make(http.Header)
  10635. for k, v := range c.header_ {
  10636. reqHeaders[k] = v
  10637. }
  10638. reqHeaders.Set("User-Agent", c.s.userAgent())
  10639. var body io.Reader = nil
  10640. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createnodepoolrequest)
  10641. if err != nil {
  10642. return nil, err
  10643. }
  10644. reqHeaders.Set("Content-Type", "application/json")
  10645. c.urlParams_.Set("alt", alt)
  10646. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools")
  10647. urls += "?" + c.urlParams_.Encode()
  10648. req, _ := http.NewRequest("POST", urls, body)
  10649. req.Header = reqHeaders
  10650. googleapi.Expand(req.URL, map[string]string{
  10651. "projectId": c.projectId,
  10652. "zone": c.zone,
  10653. "clusterId": c.clusterId,
  10654. })
  10655. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10656. }
  10657. // Do executes the "container.projects.zones.clusters.nodePools.create" call.
  10658. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10659. // status code is an error. Response headers are in either
  10660. // *Operation.ServerResponse.Header or (if a response was returned at
  10661. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10662. // to check whether the returned error was because
  10663. // http.StatusNotModified was returned.
  10664. func (c *ProjectsZonesClustersNodePoolsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10665. gensupport.SetOptions(c.urlParams_, opts...)
  10666. res, err := c.doRequest("json")
  10667. if res != nil && res.StatusCode == http.StatusNotModified {
  10668. if res.Body != nil {
  10669. res.Body.Close()
  10670. }
  10671. return nil, &googleapi.Error{
  10672. Code: res.StatusCode,
  10673. Header: res.Header,
  10674. }
  10675. }
  10676. if err != nil {
  10677. return nil, err
  10678. }
  10679. defer googleapi.CloseBody(res)
  10680. if err := googleapi.CheckResponse(res); err != nil {
  10681. return nil, err
  10682. }
  10683. ret := &Operation{
  10684. ServerResponse: googleapi.ServerResponse{
  10685. Header: res.Header,
  10686. HTTPStatusCode: res.StatusCode,
  10687. },
  10688. }
  10689. target := &ret
  10690. if err := gensupport.DecodeResponse(target, res); err != nil {
  10691. return nil, err
  10692. }
  10693. return ret, nil
  10694. // {
  10695. // "description": "Creates a node pool for a cluster.",
  10696. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  10697. // "httpMethod": "POST",
  10698. // "id": "container.projects.zones.clusters.nodePools.create",
  10699. // "parameterOrder": [
  10700. // "projectId",
  10701. // "zone",
  10702. // "clusterId"
  10703. // ],
  10704. // "parameters": {
  10705. // "clusterId": {
  10706. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the parent field.",
  10707. // "location": "path",
  10708. // "required": true,
  10709. // "type": "string"
  10710. // },
  10711. // "projectId": {
  10712. // "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.",
  10713. // "location": "path",
  10714. // "required": true,
  10715. // "type": "string"
  10716. // },
  10717. // "zone": {
  10718. // "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.",
  10719. // "location": "path",
  10720. // "required": true,
  10721. // "type": "string"
  10722. // }
  10723. // },
  10724. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  10725. // "request": {
  10726. // "$ref": "CreateNodePoolRequest"
  10727. // },
  10728. // "response": {
  10729. // "$ref": "Operation"
  10730. // },
  10731. // "scopes": [
  10732. // "https://www.googleapis.com/auth/cloud-platform"
  10733. // ]
  10734. // }
  10735. }
  10736. // method id "container.projects.zones.clusters.nodePools.delete":
  10737. type ProjectsZonesClustersNodePoolsDeleteCall struct {
  10738. s *Service
  10739. projectId string
  10740. zone string
  10741. clusterId string
  10742. nodePoolId string
  10743. urlParams_ gensupport.URLParams
  10744. ctx_ context.Context
  10745. header_ http.Header
  10746. }
  10747. // Delete: Deletes a node pool from a cluster.
  10748. func (r *ProjectsZonesClustersNodePoolsService) Delete(projectId string, zone string, clusterId string, nodePoolId string) *ProjectsZonesClustersNodePoolsDeleteCall {
  10749. c := &ProjectsZonesClustersNodePoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10750. c.projectId = projectId
  10751. c.zone = zone
  10752. c.clusterId = clusterId
  10753. c.nodePoolId = nodePoolId
  10754. return c
  10755. }
  10756. // Name sets the optional parameter "name": The name (project, location,
  10757. // cluster, node pool id) of the node pool to
  10758. // delete. Specified in the
  10759. // format
  10760. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  10761. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Name(name string) *ProjectsZonesClustersNodePoolsDeleteCall {
  10762. c.urlParams_.Set("name", name)
  10763. return c
  10764. }
  10765. // Fields allows partial responses to be retrieved. See
  10766. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10767. // for more information.
  10768. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsDeleteCall {
  10769. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10770. return c
  10771. }
  10772. // Context sets the context to be used in this call's Do method. Any
  10773. // pending HTTP request will be aborted if the provided context is
  10774. // canceled.
  10775. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsDeleteCall {
  10776. c.ctx_ = ctx
  10777. return c
  10778. }
  10779. // Header returns an http.Header that can be modified by the caller to
  10780. // add HTTP headers to the request.
  10781. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Header() http.Header {
  10782. if c.header_ == nil {
  10783. c.header_ = make(http.Header)
  10784. }
  10785. return c.header_
  10786. }
  10787. func (c *ProjectsZonesClustersNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  10788. reqHeaders := make(http.Header)
  10789. for k, v := range c.header_ {
  10790. reqHeaders[k] = v
  10791. }
  10792. reqHeaders.Set("User-Agent", c.s.userAgent())
  10793. var body io.Reader = nil
  10794. c.urlParams_.Set("alt", alt)
  10795. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}")
  10796. urls += "?" + c.urlParams_.Encode()
  10797. req, _ := http.NewRequest("DELETE", urls, body)
  10798. req.Header = reqHeaders
  10799. googleapi.Expand(req.URL, map[string]string{
  10800. "projectId": c.projectId,
  10801. "zone": c.zone,
  10802. "clusterId": c.clusterId,
  10803. "nodePoolId": c.nodePoolId,
  10804. })
  10805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10806. }
  10807. // Do executes the "container.projects.zones.clusters.nodePools.delete" call.
  10808. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10809. // status code is an error. Response headers are in either
  10810. // *Operation.ServerResponse.Header or (if a response was returned at
  10811. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10812. // to check whether the returned error was because
  10813. // http.StatusNotModified was returned.
  10814. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10815. gensupport.SetOptions(c.urlParams_, opts...)
  10816. res, err := c.doRequest("json")
  10817. if res != nil && res.StatusCode == http.StatusNotModified {
  10818. if res.Body != nil {
  10819. res.Body.Close()
  10820. }
  10821. return nil, &googleapi.Error{
  10822. Code: res.StatusCode,
  10823. Header: res.Header,
  10824. }
  10825. }
  10826. if err != nil {
  10827. return nil, err
  10828. }
  10829. defer googleapi.CloseBody(res)
  10830. if err := googleapi.CheckResponse(res); err != nil {
  10831. return nil, err
  10832. }
  10833. ret := &Operation{
  10834. ServerResponse: googleapi.ServerResponse{
  10835. Header: res.Header,
  10836. HTTPStatusCode: res.StatusCode,
  10837. },
  10838. }
  10839. target := &ret
  10840. if err := gensupport.DecodeResponse(target, res); err != nil {
  10841. return nil, err
  10842. }
  10843. return ret, nil
  10844. // {
  10845. // "description": "Deletes a node pool from a cluster.",
  10846. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  10847. // "httpMethod": "DELETE",
  10848. // "id": "container.projects.zones.clusters.nodePools.delete",
  10849. // "parameterOrder": [
  10850. // "projectId",
  10851. // "zone",
  10852. // "clusterId",
  10853. // "nodePoolId"
  10854. // ],
  10855. // "parameters": {
  10856. // "clusterId": {
  10857. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  10858. // "location": "path",
  10859. // "required": true,
  10860. // "type": "string"
  10861. // },
  10862. // "name": {
  10863. // "description": "The name (project, location, cluster, node pool id) of the node pool to\ndelete. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  10864. // "location": "query",
  10865. // "type": "string"
  10866. // },
  10867. // "nodePoolId": {
  10868. // "description": "Deprecated. The name of the node pool to delete.\nThis field has been deprecated and replaced by the name field.",
  10869. // "location": "path",
  10870. // "required": true,
  10871. // "type": "string"
  10872. // },
  10873. // "projectId": {
  10874. // "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.",
  10875. // "location": "path",
  10876. // "required": true,
  10877. // "type": "string"
  10878. // },
  10879. // "zone": {
  10880. // "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.",
  10881. // "location": "path",
  10882. // "required": true,
  10883. // "type": "string"
  10884. // }
  10885. // },
  10886. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  10887. // "response": {
  10888. // "$ref": "Operation"
  10889. // },
  10890. // "scopes": [
  10891. // "https://www.googleapis.com/auth/cloud-platform"
  10892. // ]
  10893. // }
  10894. }
  10895. // method id "container.projects.zones.clusters.nodePools.get":
  10896. type ProjectsZonesClustersNodePoolsGetCall struct {
  10897. s *Service
  10898. projectId string
  10899. zone string
  10900. clusterId string
  10901. nodePoolId string
  10902. urlParams_ gensupport.URLParams
  10903. ifNoneMatch_ string
  10904. ctx_ context.Context
  10905. header_ http.Header
  10906. }
  10907. // Get: Retrieves the node pool requested.
  10908. func (r *ProjectsZonesClustersNodePoolsService) Get(projectId string, zone string, clusterId string, nodePoolId string) *ProjectsZonesClustersNodePoolsGetCall {
  10909. c := &ProjectsZonesClustersNodePoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10910. c.projectId = projectId
  10911. c.zone = zone
  10912. c.clusterId = clusterId
  10913. c.nodePoolId = nodePoolId
  10914. return c
  10915. }
  10916. // Name sets the optional parameter "name": The name (project, location,
  10917. // cluster, node pool id) of the node pool to
  10918. // get. Specified in the
  10919. // format
  10920. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  10921. func (c *ProjectsZonesClustersNodePoolsGetCall) Name(name string) *ProjectsZonesClustersNodePoolsGetCall {
  10922. c.urlParams_.Set("name", name)
  10923. return c
  10924. }
  10925. // Fields allows partial responses to be retrieved. See
  10926. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10927. // for more information.
  10928. func (c *ProjectsZonesClustersNodePoolsGetCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsGetCall {
  10929. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10930. return c
  10931. }
  10932. // IfNoneMatch sets the optional parameter which makes the operation
  10933. // fail if the object's ETag matches the given value. This is useful for
  10934. // getting updates only after the object has changed since the last
  10935. // request. Use googleapi.IsNotModified to check whether the response
  10936. // error from Do is the result of In-None-Match.
  10937. func (c *ProjectsZonesClustersNodePoolsGetCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersNodePoolsGetCall {
  10938. c.ifNoneMatch_ = entityTag
  10939. return c
  10940. }
  10941. // Context sets the context to be used in this call's Do method. Any
  10942. // pending HTTP request will be aborted if the provided context is
  10943. // canceled.
  10944. func (c *ProjectsZonesClustersNodePoolsGetCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsGetCall {
  10945. c.ctx_ = ctx
  10946. return c
  10947. }
  10948. // Header returns an http.Header that can be modified by the caller to
  10949. // add HTTP headers to the request.
  10950. func (c *ProjectsZonesClustersNodePoolsGetCall) Header() http.Header {
  10951. if c.header_ == nil {
  10952. c.header_ = make(http.Header)
  10953. }
  10954. return c.header_
  10955. }
  10956. func (c *ProjectsZonesClustersNodePoolsGetCall) doRequest(alt string) (*http.Response, error) {
  10957. reqHeaders := make(http.Header)
  10958. for k, v := range c.header_ {
  10959. reqHeaders[k] = v
  10960. }
  10961. reqHeaders.Set("User-Agent", c.s.userAgent())
  10962. if c.ifNoneMatch_ != "" {
  10963. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10964. }
  10965. var body io.Reader = nil
  10966. c.urlParams_.Set("alt", alt)
  10967. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}")
  10968. urls += "?" + c.urlParams_.Encode()
  10969. req, _ := http.NewRequest("GET", urls, body)
  10970. req.Header = reqHeaders
  10971. googleapi.Expand(req.URL, map[string]string{
  10972. "projectId": c.projectId,
  10973. "zone": c.zone,
  10974. "clusterId": c.clusterId,
  10975. "nodePoolId": c.nodePoolId,
  10976. })
  10977. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10978. }
  10979. // Do executes the "container.projects.zones.clusters.nodePools.get" call.
  10980. // Exactly one of *NodePool or error will be non-nil. Any non-2xx status
  10981. // code is an error. Response headers are in either
  10982. // *NodePool.ServerResponse.Header or (if a response was returned at
  10983. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10984. // to check whether the returned error was because
  10985. // http.StatusNotModified was returned.
  10986. func (c *ProjectsZonesClustersNodePoolsGetCall) Do(opts ...googleapi.CallOption) (*NodePool, error) {
  10987. gensupport.SetOptions(c.urlParams_, opts...)
  10988. res, err := c.doRequest("json")
  10989. if res != nil && res.StatusCode == http.StatusNotModified {
  10990. if res.Body != nil {
  10991. res.Body.Close()
  10992. }
  10993. return nil, &googleapi.Error{
  10994. Code: res.StatusCode,
  10995. Header: res.Header,
  10996. }
  10997. }
  10998. if err != nil {
  10999. return nil, err
  11000. }
  11001. defer googleapi.CloseBody(res)
  11002. if err := googleapi.CheckResponse(res); err != nil {
  11003. return nil, err
  11004. }
  11005. ret := &NodePool{
  11006. ServerResponse: googleapi.ServerResponse{
  11007. Header: res.Header,
  11008. HTTPStatusCode: res.StatusCode,
  11009. },
  11010. }
  11011. target := &ret
  11012. if err := gensupport.DecodeResponse(target, res); err != nil {
  11013. return nil, err
  11014. }
  11015. return ret, nil
  11016. // {
  11017. // "description": "Retrieves the node pool requested.",
  11018. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  11019. // "httpMethod": "GET",
  11020. // "id": "container.projects.zones.clusters.nodePools.get",
  11021. // "parameterOrder": [
  11022. // "projectId",
  11023. // "zone",
  11024. // "clusterId",
  11025. // "nodePoolId"
  11026. // ],
  11027. // "parameters": {
  11028. // "clusterId": {
  11029. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  11030. // "location": "path",
  11031. // "required": true,
  11032. // "type": "string"
  11033. // },
  11034. // "name": {
  11035. // "description": "The name (project, location, cluster, node pool id) of the node pool to\nget. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  11036. // "location": "query",
  11037. // "type": "string"
  11038. // },
  11039. // "nodePoolId": {
  11040. // "description": "Deprecated. The name of the node pool.\nThis field has been deprecated and replaced by the name field.",
  11041. // "location": "path",
  11042. // "required": true,
  11043. // "type": "string"
  11044. // },
  11045. // "projectId": {
  11046. // "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.",
  11047. // "location": "path",
  11048. // "required": true,
  11049. // "type": "string"
  11050. // },
  11051. // "zone": {
  11052. // "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.",
  11053. // "location": "path",
  11054. // "required": true,
  11055. // "type": "string"
  11056. // }
  11057. // },
  11058. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  11059. // "response": {
  11060. // "$ref": "NodePool"
  11061. // },
  11062. // "scopes": [
  11063. // "https://www.googleapis.com/auth/cloud-platform"
  11064. // ]
  11065. // }
  11066. }
  11067. // method id "container.projects.zones.clusters.nodePools.list":
  11068. type ProjectsZonesClustersNodePoolsListCall struct {
  11069. s *Service
  11070. projectId string
  11071. zone string
  11072. clusterId string
  11073. urlParams_ gensupport.URLParams
  11074. ifNoneMatch_ string
  11075. ctx_ context.Context
  11076. header_ http.Header
  11077. }
  11078. // List: Lists the node pools for a cluster.
  11079. func (r *ProjectsZonesClustersNodePoolsService) List(projectId string, zone string, clusterId string) *ProjectsZonesClustersNodePoolsListCall {
  11080. c := &ProjectsZonesClustersNodePoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11081. c.projectId = projectId
  11082. c.zone = zone
  11083. c.clusterId = clusterId
  11084. return c
  11085. }
  11086. // Parent sets the optional parameter "parent": The parent (project,
  11087. // location, cluster id) where the node pools will be
  11088. // listed. Specified in the format 'projects/*/locations/*/clusters/*'.
  11089. func (c *ProjectsZonesClustersNodePoolsListCall) Parent(parent string) *ProjectsZonesClustersNodePoolsListCall {
  11090. c.urlParams_.Set("parent", parent)
  11091. return c
  11092. }
  11093. // Fields allows partial responses to be retrieved. See
  11094. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11095. // for more information.
  11096. func (c *ProjectsZonesClustersNodePoolsListCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsListCall {
  11097. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11098. return c
  11099. }
  11100. // IfNoneMatch sets the optional parameter which makes the operation
  11101. // fail if the object's ETag matches the given value. This is useful for
  11102. // getting updates only after the object has changed since the last
  11103. // request. Use googleapi.IsNotModified to check whether the response
  11104. // error from Do is the result of In-None-Match.
  11105. func (c *ProjectsZonesClustersNodePoolsListCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersNodePoolsListCall {
  11106. c.ifNoneMatch_ = entityTag
  11107. return c
  11108. }
  11109. // Context sets the context to be used in this call's Do method. Any
  11110. // pending HTTP request will be aborted if the provided context is
  11111. // canceled.
  11112. func (c *ProjectsZonesClustersNodePoolsListCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsListCall {
  11113. c.ctx_ = ctx
  11114. return c
  11115. }
  11116. // Header returns an http.Header that can be modified by the caller to
  11117. // add HTTP headers to the request.
  11118. func (c *ProjectsZonesClustersNodePoolsListCall) Header() http.Header {
  11119. if c.header_ == nil {
  11120. c.header_ = make(http.Header)
  11121. }
  11122. return c.header_
  11123. }
  11124. func (c *ProjectsZonesClustersNodePoolsListCall) doRequest(alt string) (*http.Response, error) {
  11125. reqHeaders := make(http.Header)
  11126. for k, v := range c.header_ {
  11127. reqHeaders[k] = v
  11128. }
  11129. reqHeaders.Set("User-Agent", c.s.userAgent())
  11130. if c.ifNoneMatch_ != "" {
  11131. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11132. }
  11133. var body io.Reader = nil
  11134. c.urlParams_.Set("alt", alt)
  11135. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools")
  11136. urls += "?" + c.urlParams_.Encode()
  11137. req, _ := http.NewRequest("GET", urls, body)
  11138. req.Header = reqHeaders
  11139. googleapi.Expand(req.URL, map[string]string{
  11140. "projectId": c.projectId,
  11141. "zone": c.zone,
  11142. "clusterId": c.clusterId,
  11143. })
  11144. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11145. }
  11146. // Do executes the "container.projects.zones.clusters.nodePools.list" call.
  11147. // Exactly one of *ListNodePoolsResponse or error will be non-nil. Any
  11148. // non-2xx status code is an error. Response headers are in either
  11149. // *ListNodePoolsResponse.ServerResponse.Header or (if a response was
  11150. // returned at all) in error.(*googleapi.Error).Header. Use
  11151. // googleapi.IsNotModified to check whether the returned error was
  11152. // because http.StatusNotModified was returned.
  11153. func (c *ProjectsZonesClustersNodePoolsListCall) Do(opts ...googleapi.CallOption) (*ListNodePoolsResponse, error) {
  11154. gensupport.SetOptions(c.urlParams_, opts...)
  11155. res, err := c.doRequest("json")
  11156. if res != nil && res.StatusCode == http.StatusNotModified {
  11157. if res.Body != nil {
  11158. res.Body.Close()
  11159. }
  11160. return nil, &googleapi.Error{
  11161. Code: res.StatusCode,
  11162. Header: res.Header,
  11163. }
  11164. }
  11165. if err != nil {
  11166. return nil, err
  11167. }
  11168. defer googleapi.CloseBody(res)
  11169. if err := googleapi.CheckResponse(res); err != nil {
  11170. return nil, err
  11171. }
  11172. ret := &ListNodePoolsResponse{
  11173. ServerResponse: googleapi.ServerResponse{
  11174. Header: res.Header,
  11175. HTTPStatusCode: res.StatusCode,
  11176. },
  11177. }
  11178. target := &ret
  11179. if err := gensupport.DecodeResponse(target, res); err != nil {
  11180. return nil, err
  11181. }
  11182. return ret, nil
  11183. // {
  11184. // "description": "Lists the node pools for a cluster.",
  11185. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  11186. // "httpMethod": "GET",
  11187. // "id": "container.projects.zones.clusters.nodePools.list",
  11188. // "parameterOrder": [
  11189. // "projectId",
  11190. // "zone",
  11191. // "clusterId"
  11192. // ],
  11193. // "parameters": {
  11194. // "clusterId": {
  11195. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the parent field.",
  11196. // "location": "path",
  11197. // "required": true,
  11198. // "type": "string"
  11199. // },
  11200. // "parent": {
  11201. // "description": "The parent (project, location, cluster id) where the node pools will be\nlisted. Specified in the format 'projects/*/locations/*/clusters/*'.",
  11202. // "location": "query",
  11203. // "type": "string"
  11204. // },
  11205. // "projectId": {
  11206. // "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.",
  11207. // "location": "path",
  11208. // "required": true,
  11209. // "type": "string"
  11210. // },
  11211. // "zone": {
  11212. // "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.",
  11213. // "location": "path",
  11214. // "required": true,
  11215. // "type": "string"
  11216. // }
  11217. // },
  11218. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  11219. // "response": {
  11220. // "$ref": "ListNodePoolsResponse"
  11221. // },
  11222. // "scopes": [
  11223. // "https://www.googleapis.com/auth/cloud-platform"
  11224. // ]
  11225. // }
  11226. }
  11227. // method id "container.projects.zones.clusters.nodePools.rollback":
  11228. type ProjectsZonesClustersNodePoolsRollbackCall struct {
  11229. s *Service
  11230. projectId string
  11231. zone string
  11232. clusterId string
  11233. nodePoolId string
  11234. rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest
  11235. urlParams_ gensupport.URLParams
  11236. ctx_ context.Context
  11237. header_ http.Header
  11238. }
  11239. // Rollback: Roll back the previously Aborted or Failed NodePool
  11240. // upgrade.
  11241. // This will be an no-op if the last upgrade successfully completed.
  11242. func (r *ProjectsZonesClustersNodePoolsService) Rollback(projectId string, zone string, clusterId string, nodePoolId string, rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest) *ProjectsZonesClustersNodePoolsRollbackCall {
  11243. c := &ProjectsZonesClustersNodePoolsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11244. c.projectId = projectId
  11245. c.zone = zone
  11246. c.clusterId = clusterId
  11247. c.nodePoolId = nodePoolId
  11248. c.rollbacknodepoolupgraderequest = rollbacknodepoolupgraderequest
  11249. return c
  11250. }
  11251. // Fields allows partial responses to be retrieved. See
  11252. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11253. // for more information.
  11254. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsRollbackCall {
  11255. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11256. return c
  11257. }
  11258. // Context sets the context to be used in this call's Do method. Any
  11259. // pending HTTP request will be aborted if the provided context is
  11260. // canceled.
  11261. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsRollbackCall {
  11262. c.ctx_ = ctx
  11263. return c
  11264. }
  11265. // Header returns an http.Header that can be modified by the caller to
  11266. // add HTTP headers to the request.
  11267. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Header() http.Header {
  11268. if c.header_ == nil {
  11269. c.header_ = make(http.Header)
  11270. }
  11271. return c.header_
  11272. }
  11273. func (c *ProjectsZonesClustersNodePoolsRollbackCall) doRequest(alt string) (*http.Response, error) {
  11274. reqHeaders := make(http.Header)
  11275. for k, v := range c.header_ {
  11276. reqHeaders[k] = v
  11277. }
  11278. reqHeaders.Set("User-Agent", c.s.userAgent())
  11279. var body io.Reader = nil
  11280. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbacknodepoolupgraderequest)
  11281. if err != nil {
  11282. return nil, err
  11283. }
  11284. reqHeaders.Set("Content-Type", "application/json")
  11285. c.urlParams_.Set("alt", alt)
  11286. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback")
  11287. urls += "?" + c.urlParams_.Encode()
  11288. req, _ := http.NewRequest("POST", urls, body)
  11289. req.Header = reqHeaders
  11290. googleapi.Expand(req.URL, map[string]string{
  11291. "projectId": c.projectId,
  11292. "zone": c.zone,
  11293. "clusterId": c.clusterId,
  11294. "nodePoolId": c.nodePoolId,
  11295. })
  11296. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11297. }
  11298. // Do executes the "container.projects.zones.clusters.nodePools.rollback" call.
  11299. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11300. // status code is an error. Response headers are in either
  11301. // *Operation.ServerResponse.Header or (if a response was returned at
  11302. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11303. // to check whether the returned error was because
  11304. // http.StatusNotModified was returned.
  11305. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11306. gensupport.SetOptions(c.urlParams_, opts...)
  11307. res, err := c.doRequest("json")
  11308. if res != nil && res.StatusCode == http.StatusNotModified {
  11309. if res.Body != nil {
  11310. res.Body.Close()
  11311. }
  11312. return nil, &googleapi.Error{
  11313. Code: res.StatusCode,
  11314. Header: res.Header,
  11315. }
  11316. }
  11317. if err != nil {
  11318. return nil, err
  11319. }
  11320. defer googleapi.CloseBody(res)
  11321. if err := googleapi.CheckResponse(res); err != nil {
  11322. return nil, err
  11323. }
  11324. ret := &Operation{
  11325. ServerResponse: googleapi.ServerResponse{
  11326. Header: res.Header,
  11327. HTTPStatusCode: res.StatusCode,
  11328. },
  11329. }
  11330. target := &ret
  11331. if err := gensupport.DecodeResponse(target, res); err != nil {
  11332. return nil, err
  11333. }
  11334. return ret, nil
  11335. // {
  11336. // "description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed.",
  11337. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback",
  11338. // "httpMethod": "POST",
  11339. // "id": "container.projects.zones.clusters.nodePools.rollback",
  11340. // "parameterOrder": [
  11341. // "projectId",
  11342. // "zone",
  11343. // "clusterId",
  11344. // "nodePoolId"
  11345. // ],
  11346. // "parameters": {
  11347. // "clusterId": {
  11348. // "description": "Deprecated. The name of the cluster to rollback.\nThis field has been deprecated and replaced by the name field.",
  11349. // "location": "path",
  11350. // "required": true,
  11351. // "type": "string"
  11352. // },
  11353. // "nodePoolId": {
  11354. // "description": "Deprecated. The name of the node pool to rollback.\nThis field has been deprecated and replaced by the name field.",
  11355. // "location": "path",
  11356. // "required": true,
  11357. // "type": "string"
  11358. // },
  11359. // "projectId": {
  11360. // "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.",
  11361. // "location": "path",
  11362. // "required": true,
  11363. // "type": "string"
  11364. // },
  11365. // "zone": {
  11366. // "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.",
  11367. // "location": "path",
  11368. // "required": true,
  11369. // "type": "string"
  11370. // }
  11371. // },
  11372. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback",
  11373. // "request": {
  11374. // "$ref": "RollbackNodePoolUpgradeRequest"
  11375. // },
  11376. // "response": {
  11377. // "$ref": "Operation"
  11378. // },
  11379. // "scopes": [
  11380. // "https://www.googleapis.com/auth/cloud-platform"
  11381. // ]
  11382. // }
  11383. }
  11384. // method id "container.projects.zones.clusters.nodePools.setManagement":
  11385. type ProjectsZonesClustersNodePoolsSetManagementCall struct {
  11386. s *Service
  11387. projectId string
  11388. zone string
  11389. clusterId string
  11390. nodePoolId string
  11391. setnodepoolmanagementrequest *SetNodePoolManagementRequest
  11392. urlParams_ gensupport.URLParams
  11393. ctx_ context.Context
  11394. header_ http.Header
  11395. }
  11396. // SetManagement: Sets the NodeManagement options for a node pool.
  11397. func (r *ProjectsZonesClustersNodePoolsService) SetManagement(projectId string, zone string, clusterId string, nodePoolId string, setnodepoolmanagementrequest *SetNodePoolManagementRequest) *ProjectsZonesClustersNodePoolsSetManagementCall {
  11398. c := &ProjectsZonesClustersNodePoolsSetManagementCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11399. c.projectId = projectId
  11400. c.zone = zone
  11401. c.clusterId = clusterId
  11402. c.nodePoolId = nodePoolId
  11403. c.setnodepoolmanagementrequest = setnodepoolmanagementrequest
  11404. return c
  11405. }
  11406. // Fields allows partial responses to be retrieved. See
  11407. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11408. // for more information.
  11409. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsSetManagementCall {
  11410. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11411. return c
  11412. }
  11413. // Context sets the context to be used in this call's Do method. Any
  11414. // pending HTTP request will be aborted if the provided context is
  11415. // canceled.
  11416. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsSetManagementCall {
  11417. c.ctx_ = ctx
  11418. return c
  11419. }
  11420. // Header returns an http.Header that can be modified by the caller to
  11421. // add HTTP headers to the request.
  11422. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Header() http.Header {
  11423. if c.header_ == nil {
  11424. c.header_ = make(http.Header)
  11425. }
  11426. return c.header_
  11427. }
  11428. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) doRequest(alt string) (*http.Response, error) {
  11429. reqHeaders := make(http.Header)
  11430. for k, v := range c.header_ {
  11431. reqHeaders[k] = v
  11432. }
  11433. reqHeaders.Set("User-Agent", c.s.userAgent())
  11434. var body io.Reader = nil
  11435. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolmanagementrequest)
  11436. if err != nil {
  11437. return nil, err
  11438. }
  11439. reqHeaders.Set("Content-Type", "application/json")
  11440. c.urlParams_.Set("alt", alt)
  11441. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement")
  11442. urls += "?" + c.urlParams_.Encode()
  11443. req, _ := http.NewRequest("POST", urls, body)
  11444. req.Header = reqHeaders
  11445. googleapi.Expand(req.URL, map[string]string{
  11446. "projectId": c.projectId,
  11447. "zone": c.zone,
  11448. "clusterId": c.clusterId,
  11449. "nodePoolId": c.nodePoolId,
  11450. })
  11451. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11452. }
  11453. // Do executes the "container.projects.zones.clusters.nodePools.setManagement" call.
  11454. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11455. // status code is an error. Response headers are in either
  11456. // *Operation.ServerResponse.Header or (if a response was returned at
  11457. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11458. // to check whether the returned error was because
  11459. // http.StatusNotModified was returned.
  11460. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11461. gensupport.SetOptions(c.urlParams_, opts...)
  11462. res, err := c.doRequest("json")
  11463. if res != nil && res.StatusCode == http.StatusNotModified {
  11464. if res.Body != nil {
  11465. res.Body.Close()
  11466. }
  11467. return nil, &googleapi.Error{
  11468. Code: res.StatusCode,
  11469. Header: res.Header,
  11470. }
  11471. }
  11472. if err != nil {
  11473. return nil, err
  11474. }
  11475. defer googleapi.CloseBody(res)
  11476. if err := googleapi.CheckResponse(res); err != nil {
  11477. return nil, err
  11478. }
  11479. ret := &Operation{
  11480. ServerResponse: googleapi.ServerResponse{
  11481. Header: res.Header,
  11482. HTTPStatusCode: res.StatusCode,
  11483. },
  11484. }
  11485. target := &ret
  11486. if err := gensupport.DecodeResponse(target, res); err != nil {
  11487. return nil, err
  11488. }
  11489. return ret, nil
  11490. // {
  11491. // "description": "Sets the NodeManagement options for a node pool.",
  11492. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement",
  11493. // "httpMethod": "POST",
  11494. // "id": "container.projects.zones.clusters.nodePools.setManagement",
  11495. // "parameterOrder": [
  11496. // "projectId",
  11497. // "zone",
  11498. // "clusterId",
  11499. // "nodePoolId"
  11500. // ],
  11501. // "parameters": {
  11502. // "clusterId": {
  11503. // "description": "Deprecated. The name of the cluster to update.\nThis field has been deprecated and replaced by the name field.",
  11504. // "location": "path",
  11505. // "required": true,
  11506. // "type": "string"
  11507. // },
  11508. // "nodePoolId": {
  11509. // "description": "Deprecated. The name of the node pool to update.\nThis field has been deprecated and replaced by the name field.",
  11510. // "location": "path",
  11511. // "required": true,
  11512. // "type": "string"
  11513. // },
  11514. // "projectId": {
  11515. // "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.",
  11516. // "location": "path",
  11517. // "required": true,
  11518. // "type": "string"
  11519. // },
  11520. // "zone": {
  11521. // "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.",
  11522. // "location": "path",
  11523. // "required": true,
  11524. // "type": "string"
  11525. // }
  11526. // },
  11527. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement",
  11528. // "request": {
  11529. // "$ref": "SetNodePoolManagementRequest"
  11530. // },
  11531. // "response": {
  11532. // "$ref": "Operation"
  11533. // },
  11534. // "scopes": [
  11535. // "https://www.googleapis.com/auth/cloud-platform"
  11536. // ]
  11537. // }
  11538. }
  11539. // method id "container.projects.zones.clusters.nodePools.setSize":
  11540. type ProjectsZonesClustersNodePoolsSetSizeCall struct {
  11541. s *Service
  11542. projectId string
  11543. zone string
  11544. clusterId string
  11545. nodePoolId string
  11546. setnodepoolsizerequest *SetNodePoolSizeRequest
  11547. urlParams_ gensupport.URLParams
  11548. ctx_ context.Context
  11549. header_ http.Header
  11550. }
  11551. // SetSize: Sets the size for a specific node pool.
  11552. func (r *ProjectsZonesClustersNodePoolsService) SetSize(projectId string, zone string, clusterId string, nodePoolId string, setnodepoolsizerequest *SetNodePoolSizeRequest) *ProjectsZonesClustersNodePoolsSetSizeCall {
  11553. c := &ProjectsZonesClustersNodePoolsSetSizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11554. c.projectId = projectId
  11555. c.zone = zone
  11556. c.clusterId = clusterId
  11557. c.nodePoolId = nodePoolId
  11558. c.setnodepoolsizerequest = setnodepoolsizerequest
  11559. return c
  11560. }
  11561. // Fields allows partial responses to be retrieved. See
  11562. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11563. // for more information.
  11564. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsSetSizeCall {
  11565. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11566. return c
  11567. }
  11568. // Context sets the context to be used in this call's Do method. Any
  11569. // pending HTTP request will be aborted if the provided context is
  11570. // canceled.
  11571. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsSetSizeCall {
  11572. c.ctx_ = ctx
  11573. return c
  11574. }
  11575. // Header returns an http.Header that can be modified by the caller to
  11576. // add HTTP headers to the request.
  11577. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Header() http.Header {
  11578. if c.header_ == nil {
  11579. c.header_ = make(http.Header)
  11580. }
  11581. return c.header_
  11582. }
  11583. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) doRequest(alt string) (*http.Response, error) {
  11584. reqHeaders := make(http.Header)
  11585. for k, v := range c.header_ {
  11586. reqHeaders[k] = v
  11587. }
  11588. reqHeaders.Set("User-Agent", c.s.userAgent())
  11589. var body io.Reader = nil
  11590. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolsizerequest)
  11591. if err != nil {
  11592. return nil, err
  11593. }
  11594. reqHeaders.Set("Content-Type", "application/json")
  11595. c.urlParams_.Set("alt", alt)
  11596. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize")
  11597. urls += "?" + c.urlParams_.Encode()
  11598. req, _ := http.NewRequest("POST", urls, body)
  11599. req.Header = reqHeaders
  11600. googleapi.Expand(req.URL, map[string]string{
  11601. "projectId": c.projectId,
  11602. "zone": c.zone,
  11603. "clusterId": c.clusterId,
  11604. "nodePoolId": c.nodePoolId,
  11605. })
  11606. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11607. }
  11608. // Do executes the "container.projects.zones.clusters.nodePools.setSize" call.
  11609. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11610. // status code is an error. Response headers are in either
  11611. // *Operation.ServerResponse.Header or (if a response was returned at
  11612. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11613. // to check whether the returned error was because
  11614. // http.StatusNotModified was returned.
  11615. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11616. gensupport.SetOptions(c.urlParams_, opts...)
  11617. res, err := c.doRequest("json")
  11618. if res != nil && res.StatusCode == http.StatusNotModified {
  11619. if res.Body != nil {
  11620. res.Body.Close()
  11621. }
  11622. return nil, &googleapi.Error{
  11623. Code: res.StatusCode,
  11624. Header: res.Header,
  11625. }
  11626. }
  11627. if err != nil {
  11628. return nil, err
  11629. }
  11630. defer googleapi.CloseBody(res)
  11631. if err := googleapi.CheckResponse(res); err != nil {
  11632. return nil, err
  11633. }
  11634. ret := &Operation{
  11635. ServerResponse: googleapi.ServerResponse{
  11636. Header: res.Header,
  11637. HTTPStatusCode: res.StatusCode,
  11638. },
  11639. }
  11640. target := &ret
  11641. if err := gensupport.DecodeResponse(target, res); err != nil {
  11642. return nil, err
  11643. }
  11644. return ret, nil
  11645. // {
  11646. // "description": "Sets the size for a specific node pool.",
  11647. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize",
  11648. // "httpMethod": "POST",
  11649. // "id": "container.projects.zones.clusters.nodePools.setSize",
  11650. // "parameterOrder": [
  11651. // "projectId",
  11652. // "zone",
  11653. // "clusterId",
  11654. // "nodePoolId"
  11655. // ],
  11656. // "parameters": {
  11657. // "clusterId": {
  11658. // "description": "Deprecated. The name of the cluster to update.\nThis field has been deprecated and replaced by the name field.",
  11659. // "location": "path",
  11660. // "required": true,
  11661. // "type": "string"
  11662. // },
  11663. // "nodePoolId": {
  11664. // "description": "Deprecated. The name of the node pool to update.\nThis field has been deprecated and replaced by the name field.",
  11665. // "location": "path",
  11666. // "required": true,
  11667. // "type": "string"
  11668. // },
  11669. // "projectId": {
  11670. // "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.",
  11671. // "location": "path",
  11672. // "required": true,
  11673. // "type": "string"
  11674. // },
  11675. // "zone": {
  11676. // "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.",
  11677. // "location": "path",
  11678. // "required": true,
  11679. // "type": "string"
  11680. // }
  11681. // },
  11682. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize",
  11683. // "request": {
  11684. // "$ref": "SetNodePoolSizeRequest"
  11685. // },
  11686. // "response": {
  11687. // "$ref": "Operation"
  11688. // },
  11689. // "scopes": [
  11690. // "https://www.googleapis.com/auth/cloud-platform"
  11691. // ]
  11692. // }
  11693. }
  11694. // method id "container.projects.zones.clusters.nodePools.update":
  11695. type ProjectsZonesClustersNodePoolsUpdateCall struct {
  11696. s *Service
  11697. projectId string
  11698. zone string
  11699. clusterId string
  11700. nodePoolId string
  11701. updatenodepoolrequest *UpdateNodePoolRequest
  11702. urlParams_ gensupport.URLParams
  11703. ctx_ context.Context
  11704. header_ http.Header
  11705. }
  11706. // Update: Updates the version and/or image type of a specific node
  11707. // pool.
  11708. func (r *ProjectsZonesClustersNodePoolsService) Update(projectId string, zone string, clusterId string, nodePoolId string, updatenodepoolrequest *UpdateNodePoolRequest) *ProjectsZonesClustersNodePoolsUpdateCall {
  11709. c := &ProjectsZonesClustersNodePoolsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11710. c.projectId = projectId
  11711. c.zone = zone
  11712. c.clusterId = clusterId
  11713. c.nodePoolId = nodePoolId
  11714. c.updatenodepoolrequest = updatenodepoolrequest
  11715. return c
  11716. }
  11717. // Fields allows partial responses to be retrieved. See
  11718. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11719. // for more information.
  11720. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsUpdateCall {
  11721. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11722. return c
  11723. }
  11724. // Context sets the context to be used in this call's Do method. Any
  11725. // pending HTTP request will be aborted if the provided context is
  11726. // canceled.
  11727. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsUpdateCall {
  11728. c.ctx_ = ctx
  11729. return c
  11730. }
  11731. // Header returns an http.Header that can be modified by the caller to
  11732. // add HTTP headers to the request.
  11733. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Header() http.Header {
  11734. if c.header_ == nil {
  11735. c.header_ = make(http.Header)
  11736. }
  11737. return c.header_
  11738. }
  11739. func (c *ProjectsZonesClustersNodePoolsUpdateCall) doRequest(alt string) (*http.Response, error) {
  11740. reqHeaders := make(http.Header)
  11741. for k, v := range c.header_ {
  11742. reqHeaders[k] = v
  11743. }
  11744. reqHeaders.Set("User-Agent", c.s.userAgent())
  11745. var body io.Reader = nil
  11746. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatenodepoolrequest)
  11747. if err != nil {
  11748. return nil, err
  11749. }
  11750. reqHeaders.Set("Content-Type", "application/json")
  11751. c.urlParams_.Set("alt", alt)
  11752. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update")
  11753. urls += "?" + c.urlParams_.Encode()
  11754. req, _ := http.NewRequest("POST", urls, body)
  11755. req.Header = reqHeaders
  11756. googleapi.Expand(req.URL, map[string]string{
  11757. "projectId": c.projectId,
  11758. "zone": c.zone,
  11759. "clusterId": c.clusterId,
  11760. "nodePoolId": c.nodePoolId,
  11761. })
  11762. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11763. }
  11764. // Do executes the "container.projects.zones.clusters.nodePools.update" call.
  11765. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11766. // status code is an error. Response headers are in either
  11767. // *Operation.ServerResponse.Header or (if a response was returned at
  11768. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11769. // to check whether the returned error was because
  11770. // http.StatusNotModified was returned.
  11771. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11772. gensupport.SetOptions(c.urlParams_, opts...)
  11773. res, err := c.doRequest("json")
  11774. if res != nil && res.StatusCode == http.StatusNotModified {
  11775. if res.Body != nil {
  11776. res.Body.Close()
  11777. }
  11778. return nil, &googleapi.Error{
  11779. Code: res.StatusCode,
  11780. Header: res.Header,
  11781. }
  11782. }
  11783. if err != nil {
  11784. return nil, err
  11785. }
  11786. defer googleapi.CloseBody(res)
  11787. if err := googleapi.CheckResponse(res); err != nil {
  11788. return nil, err
  11789. }
  11790. ret := &Operation{
  11791. ServerResponse: googleapi.ServerResponse{
  11792. Header: res.Header,
  11793. HTTPStatusCode: res.StatusCode,
  11794. },
  11795. }
  11796. target := &ret
  11797. if err := gensupport.DecodeResponse(target, res); err != nil {
  11798. return nil, err
  11799. }
  11800. return ret, nil
  11801. // {
  11802. // "description": "Updates the version and/or image type of a specific node pool.",
  11803. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update",
  11804. // "httpMethod": "POST",
  11805. // "id": "container.projects.zones.clusters.nodePools.update",
  11806. // "parameterOrder": [
  11807. // "projectId",
  11808. // "zone",
  11809. // "clusterId",
  11810. // "nodePoolId"
  11811. // ],
  11812. // "parameters": {
  11813. // "clusterId": {
  11814. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  11815. // "location": "path",
  11816. // "required": true,
  11817. // "type": "string"
  11818. // },
  11819. // "nodePoolId": {
  11820. // "description": "Deprecated. The name of the node pool to upgrade.\nThis field has been deprecated and replaced by the name field.",
  11821. // "location": "path",
  11822. // "required": true,
  11823. // "type": "string"
  11824. // },
  11825. // "projectId": {
  11826. // "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.",
  11827. // "location": "path",
  11828. // "required": true,
  11829. // "type": "string"
  11830. // },
  11831. // "zone": {
  11832. // "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.",
  11833. // "location": "path",
  11834. // "required": true,
  11835. // "type": "string"
  11836. // }
  11837. // },
  11838. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update",
  11839. // "request": {
  11840. // "$ref": "UpdateNodePoolRequest"
  11841. // },
  11842. // "response": {
  11843. // "$ref": "Operation"
  11844. // },
  11845. // "scopes": [
  11846. // "https://www.googleapis.com/auth/cloud-platform"
  11847. // ]
  11848. // }
  11849. }
  11850. // method id "container.projects.zones.operations.cancel":
  11851. type ProjectsZonesOperationsCancelCall struct {
  11852. s *Service
  11853. projectId string
  11854. zone string
  11855. operationId string
  11856. canceloperationrequest *CancelOperationRequest
  11857. urlParams_ gensupport.URLParams
  11858. ctx_ context.Context
  11859. header_ http.Header
  11860. }
  11861. // Cancel: Cancels the specified operation.
  11862. func (r *ProjectsZonesOperationsService) Cancel(projectId string, zone string, operationId string, canceloperationrequest *CancelOperationRequest) *ProjectsZonesOperationsCancelCall {
  11863. c := &ProjectsZonesOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11864. c.projectId = projectId
  11865. c.zone = zone
  11866. c.operationId = operationId
  11867. c.canceloperationrequest = canceloperationrequest
  11868. return c
  11869. }
  11870. // Fields allows partial responses to be retrieved. See
  11871. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11872. // for more information.
  11873. func (c *ProjectsZonesOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsCancelCall {
  11874. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11875. return c
  11876. }
  11877. // Context sets the context to be used in this call's Do method. Any
  11878. // pending HTTP request will be aborted if the provided context is
  11879. // canceled.
  11880. func (c *ProjectsZonesOperationsCancelCall) Context(ctx context.Context) *ProjectsZonesOperationsCancelCall {
  11881. c.ctx_ = ctx
  11882. return c
  11883. }
  11884. // Header returns an http.Header that can be modified by the caller to
  11885. // add HTTP headers to the request.
  11886. func (c *ProjectsZonesOperationsCancelCall) Header() http.Header {
  11887. if c.header_ == nil {
  11888. c.header_ = make(http.Header)
  11889. }
  11890. return c.header_
  11891. }
  11892. func (c *ProjectsZonesOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  11893. reqHeaders := make(http.Header)
  11894. for k, v := range c.header_ {
  11895. reqHeaders[k] = v
  11896. }
  11897. reqHeaders.Set("User-Agent", c.s.userAgent())
  11898. var body io.Reader = nil
  11899. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  11900. if err != nil {
  11901. return nil, err
  11902. }
  11903. reqHeaders.Set("Content-Type", "application/json")
  11904. c.urlParams_.Set("alt", alt)
  11905. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel")
  11906. urls += "?" + c.urlParams_.Encode()
  11907. req, _ := http.NewRequest("POST", urls, body)
  11908. req.Header = reqHeaders
  11909. googleapi.Expand(req.URL, map[string]string{
  11910. "projectId": c.projectId,
  11911. "zone": c.zone,
  11912. "operationId": c.operationId,
  11913. })
  11914. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11915. }
  11916. // Do executes the "container.projects.zones.operations.cancel" call.
  11917. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  11918. // code is an error. Response headers are in either
  11919. // *Empty.ServerResponse.Header or (if a response was returned at all)
  11920. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  11921. // check whether the returned error was because http.StatusNotModified
  11922. // was returned.
  11923. func (c *ProjectsZonesOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  11924. gensupport.SetOptions(c.urlParams_, opts...)
  11925. res, err := c.doRequest("json")
  11926. if res != nil && res.StatusCode == http.StatusNotModified {
  11927. if res.Body != nil {
  11928. res.Body.Close()
  11929. }
  11930. return nil, &googleapi.Error{
  11931. Code: res.StatusCode,
  11932. Header: res.Header,
  11933. }
  11934. }
  11935. if err != nil {
  11936. return nil, err
  11937. }
  11938. defer googleapi.CloseBody(res)
  11939. if err := googleapi.CheckResponse(res); err != nil {
  11940. return nil, err
  11941. }
  11942. ret := &Empty{
  11943. ServerResponse: googleapi.ServerResponse{
  11944. Header: res.Header,
  11945. HTTPStatusCode: res.StatusCode,
  11946. },
  11947. }
  11948. target := &ret
  11949. if err := gensupport.DecodeResponse(target, res); err != nil {
  11950. return nil, err
  11951. }
  11952. return ret, nil
  11953. // {
  11954. // "description": "Cancels the specified operation.",
  11955. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel",
  11956. // "httpMethod": "POST",
  11957. // "id": "container.projects.zones.operations.cancel",
  11958. // "parameterOrder": [
  11959. // "projectId",
  11960. // "zone",
  11961. // "operationId"
  11962. // ],
  11963. // "parameters": {
  11964. // "operationId": {
  11965. // "description": "Deprecated. The server-assigned `name` of the operation.\nThis field has been deprecated and replaced by the name field.",
  11966. // "location": "path",
  11967. // "required": true,
  11968. // "type": "string"
  11969. // },
  11970. // "projectId": {
  11971. // "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.",
  11972. // "location": "path",
  11973. // "required": true,
  11974. // "type": "string"
  11975. // },
  11976. // "zone": {
  11977. // "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.",
  11978. // "location": "path",
  11979. // "required": true,
  11980. // "type": "string"
  11981. // }
  11982. // },
  11983. // "path": "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel",
  11984. // "request": {
  11985. // "$ref": "CancelOperationRequest"
  11986. // },
  11987. // "response": {
  11988. // "$ref": "Empty"
  11989. // },
  11990. // "scopes": [
  11991. // "https://www.googleapis.com/auth/cloud-platform"
  11992. // ]
  11993. // }
  11994. }
  11995. // method id "container.projects.zones.operations.get":
  11996. type ProjectsZonesOperationsGetCall struct {
  11997. s *Service
  11998. projectId string
  11999. zone string
  12000. operationId string
  12001. urlParams_ gensupport.URLParams
  12002. ifNoneMatch_ string
  12003. ctx_ context.Context
  12004. header_ http.Header
  12005. }
  12006. // Get: Gets the specified operation.
  12007. func (r *ProjectsZonesOperationsService) Get(projectId string, zone string, operationId string) *ProjectsZonesOperationsGetCall {
  12008. c := &ProjectsZonesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12009. c.projectId = projectId
  12010. c.zone = zone
  12011. c.operationId = operationId
  12012. return c
  12013. }
  12014. // Name sets the optional parameter "name": The name (project, location,
  12015. // operation id) of the operation to get.
  12016. // Specified in the format 'projects/*/locations/*/operations/*'.
  12017. func (c *ProjectsZonesOperationsGetCall) Name(name string) *ProjectsZonesOperationsGetCall {
  12018. c.urlParams_.Set("name", name)
  12019. return c
  12020. }
  12021. // Fields allows partial responses to be retrieved. See
  12022. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12023. // for more information.
  12024. func (c *ProjectsZonesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsGetCall {
  12025. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12026. return c
  12027. }
  12028. // IfNoneMatch sets the optional parameter which makes the operation
  12029. // fail if the object's ETag matches the given value. This is useful for
  12030. // getting updates only after the object has changed since the last
  12031. // request. Use googleapi.IsNotModified to check whether the response
  12032. // error from Do is the result of In-None-Match.
  12033. func (c *ProjectsZonesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsZonesOperationsGetCall {
  12034. c.ifNoneMatch_ = entityTag
  12035. return c
  12036. }
  12037. // Context sets the context to be used in this call's Do method. Any
  12038. // pending HTTP request will be aborted if the provided context is
  12039. // canceled.
  12040. func (c *ProjectsZonesOperationsGetCall) Context(ctx context.Context) *ProjectsZonesOperationsGetCall {
  12041. c.ctx_ = ctx
  12042. return c
  12043. }
  12044. // Header returns an http.Header that can be modified by the caller to
  12045. // add HTTP headers to the request.
  12046. func (c *ProjectsZonesOperationsGetCall) Header() http.Header {
  12047. if c.header_ == nil {
  12048. c.header_ = make(http.Header)
  12049. }
  12050. return c.header_
  12051. }
  12052. func (c *ProjectsZonesOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  12053. reqHeaders := make(http.Header)
  12054. for k, v := range c.header_ {
  12055. reqHeaders[k] = v
  12056. }
  12057. reqHeaders.Set("User-Agent", c.s.userAgent())
  12058. if c.ifNoneMatch_ != "" {
  12059. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12060. }
  12061. var body io.Reader = nil
  12062. c.urlParams_.Set("alt", alt)
  12063. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}")
  12064. urls += "?" + c.urlParams_.Encode()
  12065. req, _ := http.NewRequest("GET", urls, body)
  12066. req.Header = reqHeaders
  12067. googleapi.Expand(req.URL, map[string]string{
  12068. "projectId": c.projectId,
  12069. "zone": c.zone,
  12070. "operationId": c.operationId,
  12071. })
  12072. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12073. }
  12074. // Do executes the "container.projects.zones.operations.get" call.
  12075. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12076. // status code is an error. Response headers are in either
  12077. // *Operation.ServerResponse.Header or (if a response was returned at
  12078. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12079. // to check whether the returned error was because
  12080. // http.StatusNotModified was returned.
  12081. func (c *ProjectsZonesOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12082. gensupport.SetOptions(c.urlParams_, opts...)
  12083. res, err := c.doRequest("json")
  12084. if res != nil && res.StatusCode == http.StatusNotModified {
  12085. if res.Body != nil {
  12086. res.Body.Close()
  12087. }
  12088. return nil, &googleapi.Error{
  12089. Code: res.StatusCode,
  12090. Header: res.Header,
  12091. }
  12092. }
  12093. if err != nil {
  12094. return nil, err
  12095. }
  12096. defer googleapi.CloseBody(res)
  12097. if err := googleapi.CheckResponse(res); err != nil {
  12098. return nil, err
  12099. }
  12100. ret := &Operation{
  12101. ServerResponse: googleapi.ServerResponse{
  12102. Header: res.Header,
  12103. HTTPStatusCode: res.StatusCode,
  12104. },
  12105. }
  12106. target := &ret
  12107. if err := gensupport.DecodeResponse(target, res); err != nil {
  12108. return nil, err
  12109. }
  12110. return ret, nil
  12111. // {
  12112. // "description": "Gets the specified operation.",
  12113. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}",
  12114. // "httpMethod": "GET",
  12115. // "id": "container.projects.zones.operations.get",
  12116. // "parameterOrder": [
  12117. // "projectId",
  12118. // "zone",
  12119. // "operationId"
  12120. // ],
  12121. // "parameters": {
  12122. // "name": {
  12123. // "description": "The name (project, location, operation id) of the operation to get.\nSpecified in the format 'projects/*/locations/*/operations/*'.",
  12124. // "location": "query",
  12125. // "type": "string"
  12126. // },
  12127. // "operationId": {
  12128. // "description": "Deprecated. The server-assigned `name` of the operation.\nThis field has been deprecated and replaced by the name field.",
  12129. // "location": "path",
  12130. // "required": true,
  12131. // "type": "string"
  12132. // },
  12133. // "projectId": {
  12134. // "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.",
  12135. // "location": "path",
  12136. // "required": true,
  12137. // "type": "string"
  12138. // },
  12139. // "zone": {
  12140. // "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.",
  12141. // "location": "path",
  12142. // "required": true,
  12143. // "type": "string"
  12144. // }
  12145. // },
  12146. // "path": "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}",
  12147. // "response": {
  12148. // "$ref": "Operation"
  12149. // },
  12150. // "scopes": [
  12151. // "https://www.googleapis.com/auth/cloud-platform"
  12152. // ]
  12153. // }
  12154. }
  12155. // method id "container.projects.zones.operations.list":
  12156. type ProjectsZonesOperationsListCall struct {
  12157. s *Service
  12158. projectId string
  12159. zone string
  12160. urlParams_ gensupport.URLParams
  12161. ifNoneMatch_ string
  12162. ctx_ context.Context
  12163. header_ http.Header
  12164. }
  12165. // List: Lists all operations in a project in a specific zone or all
  12166. // zones.
  12167. func (r *ProjectsZonesOperationsService) List(projectId string, zone string) *ProjectsZonesOperationsListCall {
  12168. c := &ProjectsZonesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12169. c.projectId = projectId
  12170. c.zone = zone
  12171. return c
  12172. }
  12173. // Parent sets the optional parameter "parent": The parent (project and
  12174. // location) where the operations will be listed.
  12175. // Specified in the format 'projects/*/locations/*'.
  12176. // Location "-" matches all zones and all regions.
  12177. func (c *ProjectsZonesOperationsListCall) Parent(parent string) *ProjectsZonesOperationsListCall {
  12178. c.urlParams_.Set("parent", parent)
  12179. return c
  12180. }
  12181. // Fields allows partial responses to be retrieved. See
  12182. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12183. // for more information.
  12184. func (c *ProjectsZonesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsListCall {
  12185. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12186. return c
  12187. }
  12188. // IfNoneMatch sets the optional parameter which makes the operation
  12189. // fail if the object's ETag matches the given value. This is useful for
  12190. // getting updates only after the object has changed since the last
  12191. // request. Use googleapi.IsNotModified to check whether the response
  12192. // error from Do is the result of In-None-Match.
  12193. func (c *ProjectsZonesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsZonesOperationsListCall {
  12194. c.ifNoneMatch_ = entityTag
  12195. return c
  12196. }
  12197. // Context sets the context to be used in this call's Do method. Any
  12198. // pending HTTP request will be aborted if the provided context is
  12199. // canceled.
  12200. func (c *ProjectsZonesOperationsListCall) Context(ctx context.Context) *ProjectsZonesOperationsListCall {
  12201. c.ctx_ = ctx
  12202. return c
  12203. }
  12204. // Header returns an http.Header that can be modified by the caller to
  12205. // add HTTP headers to the request.
  12206. func (c *ProjectsZonesOperationsListCall) Header() http.Header {
  12207. if c.header_ == nil {
  12208. c.header_ = make(http.Header)
  12209. }
  12210. return c.header_
  12211. }
  12212. func (c *ProjectsZonesOperationsListCall) doRequest(alt string) (*http.Response, error) {
  12213. reqHeaders := make(http.Header)
  12214. for k, v := range c.header_ {
  12215. reqHeaders[k] = v
  12216. }
  12217. reqHeaders.Set("User-Agent", c.s.userAgent())
  12218. if c.ifNoneMatch_ != "" {
  12219. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12220. }
  12221. var body io.Reader = nil
  12222. c.urlParams_.Set("alt", alt)
  12223. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/operations")
  12224. urls += "?" + c.urlParams_.Encode()
  12225. req, _ := http.NewRequest("GET", urls, body)
  12226. req.Header = reqHeaders
  12227. googleapi.Expand(req.URL, map[string]string{
  12228. "projectId": c.projectId,
  12229. "zone": c.zone,
  12230. })
  12231. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12232. }
  12233. // Do executes the "container.projects.zones.operations.list" call.
  12234. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  12235. // non-2xx status code is an error. Response headers are in either
  12236. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  12237. // returned at all) in error.(*googleapi.Error).Header. Use
  12238. // googleapi.IsNotModified to check whether the returned error was
  12239. // because http.StatusNotModified was returned.
  12240. func (c *ProjectsZonesOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  12241. gensupport.SetOptions(c.urlParams_, opts...)
  12242. res, err := c.doRequest("json")
  12243. if res != nil && res.StatusCode == http.StatusNotModified {
  12244. if res.Body != nil {
  12245. res.Body.Close()
  12246. }
  12247. return nil, &googleapi.Error{
  12248. Code: res.StatusCode,
  12249. Header: res.Header,
  12250. }
  12251. }
  12252. if err != nil {
  12253. return nil, err
  12254. }
  12255. defer googleapi.CloseBody(res)
  12256. if err := googleapi.CheckResponse(res); err != nil {
  12257. return nil, err
  12258. }
  12259. ret := &ListOperationsResponse{
  12260. ServerResponse: googleapi.ServerResponse{
  12261. Header: res.Header,
  12262. HTTPStatusCode: res.StatusCode,
  12263. },
  12264. }
  12265. target := &ret
  12266. if err := gensupport.DecodeResponse(target, res); err != nil {
  12267. return nil, err
  12268. }
  12269. return ret, nil
  12270. // {
  12271. // "description": "Lists all operations in a project in a specific zone or all zones.",
  12272. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/operations",
  12273. // "httpMethod": "GET",
  12274. // "id": "container.projects.zones.operations.list",
  12275. // "parameterOrder": [
  12276. // "projectId",
  12277. // "zone"
  12278. // ],
  12279. // "parameters": {
  12280. // "parent": {
  12281. // "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.",
  12282. // "location": "query",
  12283. // "type": "string"
  12284. // },
  12285. // "projectId": {
  12286. // "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.",
  12287. // "location": "path",
  12288. // "required": true,
  12289. // "type": "string"
  12290. // },
  12291. // "zone": {
  12292. // "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.",
  12293. // "location": "path",
  12294. // "required": true,
  12295. // "type": "string"
  12296. // }
  12297. // },
  12298. // "path": "v1beta1/projects/{projectId}/zones/{zone}/operations",
  12299. // "response": {
  12300. // "$ref": "ListOperationsResponse"
  12301. // },
  12302. // "scopes": [
  12303. // "https://www.googleapis.com/auth/cloud-platform"
  12304. // ]
  12305. // }
  12306. }