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.
 
 
 

14801 lines
534 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package container provides access to the Kubernetes Engine API.
  6. //
  7. // For product documentation, see: https://cloud.google.com/container-engine/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/container/v1beta1"
  14. // ...
  15. // ctx := context.Background()
  16. // containerService, err := container.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // containerService, err := container.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // containerService, err := container.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package container // import "google.golang.org/api/container/v1beta1"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "container:v1beta1"
  67. const apiName = "container"
  68. const apiVersion = "v1beta1"
  69. const basePath = "https://container.googleapis.com/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // View and manage your data across Google Cloud Platform services
  73. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  74. )
  75. // NewService creates a new Service.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/cloud-platform",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new Service. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*Service, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &Service{client: client, BasePath: basePath}
  105. s.Projects = NewProjectsService(s)
  106. return s, nil
  107. }
  108. type Service struct {
  109. client *http.Client
  110. BasePath string // API endpoint base URL
  111. UserAgent string // optional additional User-Agent fragment
  112. Projects *ProjectsService
  113. }
  114. func (s *Service) userAgent() string {
  115. if s.UserAgent == "" {
  116. return googleapi.UserAgent
  117. }
  118. return googleapi.UserAgent + " " + s.UserAgent
  119. }
  120. func NewProjectsService(s *Service) *ProjectsService {
  121. rs := &ProjectsService{s: s}
  122. rs.Aggregated = NewProjectsAggregatedService(s)
  123. rs.Locations = NewProjectsLocationsService(s)
  124. rs.Zones = NewProjectsZonesService(s)
  125. return rs
  126. }
  127. type ProjectsService struct {
  128. s *Service
  129. Aggregated *ProjectsAggregatedService
  130. Locations *ProjectsLocationsService
  131. Zones *ProjectsZonesService
  132. }
  133. func NewProjectsAggregatedService(s *Service) *ProjectsAggregatedService {
  134. rs := &ProjectsAggregatedService{s: s}
  135. rs.UsableSubnetworks = NewProjectsAggregatedUsableSubnetworksService(s)
  136. return rs
  137. }
  138. type ProjectsAggregatedService struct {
  139. s *Service
  140. UsableSubnetworks *ProjectsAggregatedUsableSubnetworksService
  141. }
  142. func NewProjectsAggregatedUsableSubnetworksService(s *Service) *ProjectsAggregatedUsableSubnetworksService {
  143. rs := &ProjectsAggregatedUsableSubnetworksService{s: s}
  144. return rs
  145. }
  146. type ProjectsAggregatedUsableSubnetworksService struct {
  147. s *Service
  148. }
  149. func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
  150. rs := &ProjectsLocationsService{s: s}
  151. rs.Clusters = NewProjectsLocationsClustersService(s)
  152. rs.Operations = NewProjectsLocationsOperationsService(s)
  153. return rs
  154. }
  155. type ProjectsLocationsService struct {
  156. s *Service
  157. Clusters *ProjectsLocationsClustersService
  158. Operations *ProjectsLocationsOperationsService
  159. }
  160. func NewProjectsLocationsClustersService(s *Service) *ProjectsLocationsClustersService {
  161. rs := &ProjectsLocationsClustersService{s: s}
  162. rs.NodePools = NewProjectsLocationsClustersNodePoolsService(s)
  163. rs.WellKnown = NewProjectsLocationsClustersWellKnownService(s)
  164. return rs
  165. }
  166. type ProjectsLocationsClustersService struct {
  167. s *Service
  168. NodePools *ProjectsLocationsClustersNodePoolsService
  169. WellKnown *ProjectsLocationsClustersWellKnownService
  170. }
  171. func NewProjectsLocationsClustersNodePoolsService(s *Service) *ProjectsLocationsClustersNodePoolsService {
  172. rs := &ProjectsLocationsClustersNodePoolsService{s: s}
  173. return rs
  174. }
  175. type ProjectsLocationsClustersNodePoolsService struct {
  176. s *Service
  177. }
  178. func NewProjectsLocationsClustersWellKnownService(s *Service) *ProjectsLocationsClustersWellKnownService {
  179. rs := &ProjectsLocationsClustersWellKnownService{s: s}
  180. return rs
  181. }
  182. type ProjectsLocationsClustersWellKnownService struct {
  183. s *Service
  184. }
  185. func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
  186. rs := &ProjectsLocationsOperationsService{s: s}
  187. return rs
  188. }
  189. type ProjectsLocationsOperationsService struct {
  190. s *Service
  191. }
  192. func NewProjectsZonesService(s *Service) *ProjectsZonesService {
  193. rs := &ProjectsZonesService{s: s}
  194. rs.Clusters = NewProjectsZonesClustersService(s)
  195. rs.Operations = NewProjectsZonesOperationsService(s)
  196. return rs
  197. }
  198. type ProjectsZonesService struct {
  199. s *Service
  200. Clusters *ProjectsZonesClustersService
  201. Operations *ProjectsZonesOperationsService
  202. }
  203. func NewProjectsZonesClustersService(s *Service) *ProjectsZonesClustersService {
  204. rs := &ProjectsZonesClustersService{s: s}
  205. rs.NodePools = NewProjectsZonesClustersNodePoolsService(s)
  206. return rs
  207. }
  208. type ProjectsZonesClustersService struct {
  209. s *Service
  210. NodePools *ProjectsZonesClustersNodePoolsService
  211. }
  212. func NewProjectsZonesClustersNodePoolsService(s *Service) *ProjectsZonesClustersNodePoolsService {
  213. rs := &ProjectsZonesClustersNodePoolsService{s: s}
  214. return rs
  215. }
  216. type ProjectsZonesClustersNodePoolsService struct {
  217. s *Service
  218. }
  219. func NewProjectsZonesOperationsService(s *Service) *ProjectsZonesOperationsService {
  220. rs := &ProjectsZonesOperationsService{s: s}
  221. return rs
  222. }
  223. type ProjectsZonesOperationsService struct {
  224. s *Service
  225. }
  226. // AcceleratorConfig: AcceleratorConfig represents a Hardware
  227. // Accelerator request.
  228. type AcceleratorConfig struct {
  229. // AcceleratorCount: The number of the accelerator cards exposed to an
  230. // instance.
  231. AcceleratorCount int64 `json:"acceleratorCount,omitempty,string"`
  232. // AcceleratorType: The accelerator type resource name. List of
  233. // supported accelerators
  234. // [here](/compute/docs/gpus/#Introduction)
  235. AcceleratorType string `json:"acceleratorType,omitempty"`
  236. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  237. // unconditionally include in API requests. By default, fields with
  238. // empty values are omitted from API requests. However, any non-pointer,
  239. // non-interface field appearing in ForceSendFields will be sent to the
  240. // server regardless of whether the field is empty or not. This may be
  241. // used to include empty fields in Patch requests.
  242. ForceSendFields []string `json:"-"`
  243. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  244. // include in API requests with the JSON null value. By default, fields
  245. // with empty values are omitted from API requests. However, any field
  246. // with an empty value appearing in NullFields will be sent to the
  247. // server as null. It is an error if a field in this list has a
  248. // non-empty value. This may be used to include null fields in Patch
  249. // requests.
  250. NullFields []string `json:"-"`
  251. }
  252. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  253. type NoMethod AcceleratorConfig
  254. raw := NoMethod(*s)
  255. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  256. }
  257. // AddonsConfig: Configuration for the addons that can be automatically
  258. // spun up in the
  259. // cluster, enabling additional functionality.
  260. type AddonsConfig struct {
  261. // CloudRunConfig: Configuration for the Cloud Run addon. The
  262. // `IstioConfig` addon must be
  263. // enabled in order to enable Cloud Run addon. This option can only be
  264. // enabled
  265. // at cluster creation time.
  266. CloudRunConfig *CloudRunConfig `json:"cloudRunConfig,omitempty"`
  267. // HorizontalPodAutoscaling: Configuration for the horizontal pod
  268. // autoscaling feature, which
  269. // increases or decreases the number of replica pods a replication
  270. // controller
  271. // has based on the resource usage of the existing pods.
  272. HorizontalPodAutoscaling *HorizontalPodAutoscaling `json:"horizontalPodAutoscaling,omitempty"`
  273. // HttpLoadBalancing: Configuration for the HTTP (L7) load balancing
  274. // controller addon, which
  275. // makes it easy to set up HTTP load balancers for services in a
  276. // cluster.
  277. HttpLoadBalancing *HttpLoadBalancing `json:"httpLoadBalancing,omitempty"`
  278. // IstioConfig: Configuration for Istio, an open platform to connect,
  279. // manage, and secure
  280. // microservices.
  281. IstioConfig *IstioConfig `json:"istioConfig,omitempty"`
  282. // KubernetesDashboard: Configuration for the Kubernetes Dashboard.
  283. KubernetesDashboard *KubernetesDashboard `json:"kubernetesDashboard,omitempty"`
  284. // NetworkPolicyConfig: Configuration for NetworkPolicy. This only
  285. // tracks whether the addon
  286. // is enabled or not on the Master, it does not track whether network
  287. // policy
  288. // is enabled for the nodes.
  289. NetworkPolicyConfig *NetworkPolicyConfig `json:"networkPolicyConfig,omitempty"`
  290. // ForceSendFields is a list of field names (e.g. "CloudRunConfig") to
  291. // unconditionally include in API requests. By default, fields with
  292. // empty values are omitted from API requests. However, any non-pointer,
  293. // non-interface field appearing in ForceSendFields will be sent to the
  294. // server regardless of whether the field is empty or not. This may be
  295. // used to include empty fields in Patch requests.
  296. ForceSendFields []string `json:"-"`
  297. // NullFields is a list of field names (e.g. "CloudRunConfig") to
  298. // include in API requests with the JSON null value. By default, fields
  299. // with empty values are omitted from API requests. However, any field
  300. // with an empty value appearing in NullFields will be sent to the
  301. // server as null. It is an error if a field in this list has a
  302. // non-empty value. This may be used to include null fields in Patch
  303. // requests.
  304. NullFields []string `json:"-"`
  305. }
  306. func (s *AddonsConfig) MarshalJSON() ([]byte, error) {
  307. type NoMethod AddonsConfig
  308. raw := NoMethod(*s)
  309. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  310. }
  311. // AutoUpgradeOptions: AutoUpgradeOptions defines the set of options for
  312. // the user to control how
  313. // the Auto Upgrades will proceed.
  314. type AutoUpgradeOptions struct {
  315. // AutoUpgradeStartTime: [Output only] This field is set when upgrades
  316. // are about to commence
  317. // with the approximate start time for the upgrades,
  318. // in
  319. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  320. AutoUpgradeStartTime string `json:"autoUpgradeStartTime,omitempty"`
  321. // Description: [Output only] This field is set when upgrades are about
  322. // to commence
  323. // with the description of the upgrade.
  324. Description string `json:"description,omitempty"`
  325. // ForceSendFields is a list of field names (e.g.
  326. // "AutoUpgradeStartTime") to unconditionally include in API requests.
  327. // By default, fields with empty values are omitted from API requests.
  328. // However, any non-pointer, non-interface field appearing in
  329. // ForceSendFields will be sent to the server regardless of whether the
  330. // field is empty or not. This may be used to include empty fields in
  331. // Patch requests.
  332. ForceSendFields []string `json:"-"`
  333. // NullFields is a list of field names (e.g. "AutoUpgradeStartTime") to
  334. // include in API requests with the JSON null value. By default, fields
  335. // with empty values are omitted from API requests. However, any field
  336. // with an empty value appearing in NullFields will be sent to the
  337. // server as null. It is an error if a field in this list has a
  338. // non-empty value. This may be used to include null fields in Patch
  339. // requests.
  340. NullFields []string `json:"-"`
  341. }
  342. func (s *AutoUpgradeOptions) MarshalJSON() ([]byte, error) {
  343. type NoMethod AutoUpgradeOptions
  344. raw := NoMethod(*s)
  345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  346. }
  347. // BigQueryDestination: Parameters for using BigQuery as the destination
  348. // of resource usage export.
  349. type BigQueryDestination struct {
  350. // DatasetId: The ID of a BigQuery Dataset.
  351. DatasetId string `json:"datasetId,omitempty"`
  352. // ForceSendFields is a list of field names (e.g. "DatasetId") to
  353. // unconditionally include in API requests. By default, fields with
  354. // empty values are omitted from API requests. However, any non-pointer,
  355. // non-interface field appearing in ForceSendFields will be sent to the
  356. // server regardless of whether the field is empty or not. This may be
  357. // used to include empty fields in Patch requests.
  358. ForceSendFields []string `json:"-"`
  359. // NullFields is a list of field names (e.g. "DatasetId") to include in
  360. // API requests with the JSON null value. By default, fields with empty
  361. // values are omitted from API requests. However, any field with an
  362. // empty value appearing in NullFields will be sent to the server as
  363. // null. It is an error if a field in this list has a non-empty value.
  364. // This may be used to include null fields in Patch requests.
  365. NullFields []string `json:"-"`
  366. }
  367. func (s *BigQueryDestination) MarshalJSON() ([]byte, error) {
  368. type NoMethod BigQueryDestination
  369. raw := NoMethod(*s)
  370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  371. }
  372. // BinaryAuthorization: Configuration for Binary Authorization.
  373. type BinaryAuthorization struct {
  374. // Enabled: Enable Binary Authorization for this cluster. If enabled,
  375. // all container
  376. // images will be validated by Google Binauthz.
  377. Enabled bool `json:"enabled,omitempty"`
  378. // ForceSendFields is a list of field names (e.g. "Enabled") to
  379. // unconditionally include in API requests. By default, fields with
  380. // empty values are omitted from API requests. However, any non-pointer,
  381. // non-interface field appearing in ForceSendFields will be sent to the
  382. // server regardless of whether the field is empty or not. This may be
  383. // used to include empty fields in Patch requests.
  384. ForceSendFields []string `json:"-"`
  385. // NullFields is a list of field names (e.g. "Enabled") to include in
  386. // API requests with the JSON null value. By default, fields with empty
  387. // values are omitted from API requests. However, any field with an
  388. // empty value appearing in NullFields will be sent to the server as
  389. // null. It is an error if a field in this list has a non-empty value.
  390. // This may be used to include null fields in Patch requests.
  391. NullFields []string `json:"-"`
  392. }
  393. func (s *BinaryAuthorization) MarshalJSON() ([]byte, error) {
  394. type NoMethod BinaryAuthorization
  395. raw := NoMethod(*s)
  396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  397. }
  398. // CancelOperationRequest: CancelOperationRequest cancels a single
  399. // operation.
  400. type CancelOperationRequest struct {
  401. // Name: The name (project, location, operation id) of the operation to
  402. // cancel.
  403. // Specified in the format 'projects/*/locations/*/operations/*'.
  404. Name string `json:"name,omitempty"`
  405. // OperationId: Deprecated. The server-assigned `name` of the
  406. // operation.
  407. // This field has been deprecated and replaced by the name field.
  408. OperationId string `json:"operationId,omitempty"`
  409. // ProjectId: Deprecated. The Google Developers Console [project ID or
  410. // project
  411. // number](https://support.google.com/cloud/answer/6158840).
  412. // This
  413. // field has been deprecated and replaced by the name field.
  414. ProjectId string `json:"projectId,omitempty"`
  415. // Zone: Deprecated. The name of the Google Compute
  416. // Engine
  417. // [zone](/compute/docs/zones#available) in which the operation
  418. // resides.
  419. // This field has been deprecated and replaced by the name field.
  420. Zone string `json:"zone,omitempty"`
  421. // ForceSendFields is a list of field names (e.g. "Name") to
  422. // unconditionally include in API requests. By default, fields with
  423. // empty values are omitted from API requests. However, any non-pointer,
  424. // non-interface field appearing in ForceSendFields will be sent to the
  425. // server regardless of whether the field is empty or not. This may be
  426. // used to include empty fields in Patch requests.
  427. ForceSendFields []string `json:"-"`
  428. // NullFields is a list of field names (e.g. "Name") to include in API
  429. // requests with the JSON null value. By default, fields with empty
  430. // values are omitted from API requests. However, any field with an
  431. // empty value appearing in NullFields will be sent to the server as
  432. // null. It is an error if a field in this list has a non-empty value.
  433. // This may be used to include null fields in Patch requests.
  434. NullFields []string `json:"-"`
  435. }
  436. func (s *CancelOperationRequest) MarshalJSON() ([]byte, error) {
  437. type NoMethod CancelOperationRequest
  438. raw := NoMethod(*s)
  439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  440. }
  441. // CidrBlock: CidrBlock contains an optional name and one CIDR block.
  442. type CidrBlock struct {
  443. // CidrBlock: cidr_block must be specified in CIDR notation.
  444. CidrBlock string `json:"cidrBlock,omitempty"`
  445. // DisplayName: display_name is an optional field for users to identify
  446. // CIDR blocks.
  447. DisplayName string `json:"displayName,omitempty"`
  448. // ForceSendFields is a list of field names (e.g. "CidrBlock") to
  449. // unconditionally include in API requests. By default, fields with
  450. // empty values are omitted from API requests. However, any non-pointer,
  451. // non-interface field appearing in ForceSendFields will be sent to the
  452. // server regardless of whether the field is empty or not. This may be
  453. // used to include empty fields in Patch requests.
  454. ForceSendFields []string `json:"-"`
  455. // NullFields is a list of field names (e.g. "CidrBlock") to include in
  456. // API requests with the JSON null value. By default, fields with empty
  457. // values are omitted from API requests. However, any field with an
  458. // empty value appearing in NullFields will be sent to the server as
  459. // null. It is an error if a field in this list has a non-empty value.
  460. // This may be used to include null fields in Patch requests.
  461. NullFields []string `json:"-"`
  462. }
  463. func (s *CidrBlock) MarshalJSON() ([]byte, error) {
  464. type NoMethod CidrBlock
  465. raw := NoMethod(*s)
  466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  467. }
  468. // ClientCertificateConfig: Configuration for client certificates on the
  469. // cluster.
  470. type ClientCertificateConfig struct {
  471. // IssueClientCertificate: Issue a client certificate.
  472. IssueClientCertificate bool `json:"issueClientCertificate,omitempty"`
  473. // ForceSendFields is a list of field names (e.g.
  474. // "IssueClientCertificate") to unconditionally include in API requests.
  475. // By default, fields with empty values are omitted from API requests.
  476. // However, any non-pointer, non-interface field appearing in
  477. // ForceSendFields will be sent to the server regardless of whether the
  478. // field is empty or not. This may be used to include empty fields in
  479. // Patch requests.
  480. ForceSendFields []string `json:"-"`
  481. // NullFields is a list of field names (e.g. "IssueClientCertificate")
  482. // to include in API requests with the JSON null value. By default,
  483. // fields with empty values are omitted from API requests. However, any
  484. // field with an empty value appearing in NullFields will be sent to the
  485. // server as null. It is an error if a field in this list has a
  486. // non-empty value. This may be used to include null fields in Patch
  487. // requests.
  488. NullFields []string `json:"-"`
  489. }
  490. func (s *ClientCertificateConfig) MarshalJSON() ([]byte, error) {
  491. type NoMethod ClientCertificateConfig
  492. raw := NoMethod(*s)
  493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  494. }
  495. // CloudRunConfig: Configuration options for the Cloud Run feature.
  496. type CloudRunConfig struct {
  497. // Disabled: Whether Cloud Run addon is enabled for this cluster.
  498. Disabled bool `json:"disabled,omitempty"`
  499. // ForceSendFields is a list of field names (e.g. "Disabled") to
  500. // unconditionally include in API requests. By default, fields with
  501. // empty values are omitted from API requests. However, any non-pointer,
  502. // non-interface field appearing in ForceSendFields will be sent to the
  503. // server regardless of whether the field is empty or not. This may be
  504. // used to include empty fields in Patch requests.
  505. ForceSendFields []string `json:"-"`
  506. // NullFields is a list of field names (e.g. "Disabled") to include in
  507. // API requests with the JSON null value. By default, fields with empty
  508. // values are omitted from API requests. However, any field with an
  509. // empty value appearing in NullFields will be sent to the server as
  510. // null. It is an error if a field in this list has a non-empty value.
  511. // This may be used to include null fields in Patch requests.
  512. NullFields []string `json:"-"`
  513. }
  514. func (s *CloudRunConfig) MarshalJSON() ([]byte, error) {
  515. type NoMethod CloudRunConfig
  516. raw := NoMethod(*s)
  517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  518. }
  519. // Cluster: A Google Kubernetes Engine cluster.
  520. type Cluster struct {
  521. // AddonsConfig: Configurations for the various addons available to run
  522. // in the cluster.
  523. AddonsConfig *AddonsConfig `json:"addonsConfig,omitempty"`
  524. // Autoscaling: Cluster-level autoscaling configuration.
  525. Autoscaling *ClusterAutoscaling `json:"autoscaling,omitempty"`
  526. // BinaryAuthorization: Configuration for Binary Authorization.
  527. BinaryAuthorization *BinaryAuthorization `json:"binaryAuthorization,omitempty"`
  528. // ClusterIpv4Cidr: The IP address range of the container pods in this
  529. // cluster,
  530. // in
  531. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  532. //
  533. // notation (e.g. `10.96.0.0/14`). Leave blank to have
  534. // one automatically chosen or specify a `/14` block in `10.0.0.0/8`.
  535. ClusterIpv4Cidr string `json:"clusterIpv4Cidr,omitempty"`
  536. // Conditions: Which conditions caused the current cluster state.
  537. Conditions []*StatusCondition `json:"conditions,omitempty"`
  538. // CreateTime: [Output only] The time the cluster was created,
  539. // in
  540. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  541. CreateTime string `json:"createTime,omitempty"`
  542. // CurrentMasterVersion: [Output only] The current software version of
  543. // the master endpoint.
  544. CurrentMasterVersion string `json:"currentMasterVersion,omitempty"`
  545. // CurrentNodeCount: [Output only] The number of nodes currently in the
  546. // cluster. Deprecated.
  547. // Call Kubernetes API directly to retrieve node information.
  548. CurrentNodeCount int64 `json:"currentNodeCount,omitempty"`
  549. // CurrentNodeVersion: [Output only] Deprecated,
  550. // use
  551. // [NodePool.version](/kubernetes-engine/docs/reference/rest/v1beta1/
  552. // projects.zones.clusters.nodePool)
  553. // instead. The current version of the node software components.
  554. // If they are currently at multiple versions because they're in the
  555. // process
  556. // of being upgraded, this reflects the minimum version of all nodes.
  557. CurrentNodeVersion string `json:"currentNodeVersion,omitempty"`
  558. // DatabaseEncryption: Configuration of etcd encryption.
  559. DatabaseEncryption *DatabaseEncryption `json:"databaseEncryption,omitempty"`
  560. // DefaultMaxPodsConstraint: The default constraint on the maximum
  561. // number of pods that can be run
  562. // simultaneously on a node in the node pool of this cluster. Only
  563. // honored
  564. // if cluster created with IP Alias support.
  565. DefaultMaxPodsConstraint *MaxPodsConstraint `json:"defaultMaxPodsConstraint,omitempty"`
  566. // Description: An optional description of this cluster.
  567. Description string `json:"description,omitempty"`
  568. // EnableKubernetesAlpha: Kubernetes alpha features are enabled on this
  569. // cluster. This includes alpha
  570. // API groups (e.g. v1beta1) and features that may not be production
  571. // ready in
  572. // the kubernetes version of the master and nodes.
  573. // The cluster has no SLA for uptime and master/node upgrades are
  574. // disabled.
  575. // Alpha enabled clusters are automatically deleted thirty days
  576. // after
  577. // creation.
  578. EnableKubernetesAlpha bool `json:"enableKubernetesAlpha,omitempty"`
  579. // EnableTpu: Enable the ability to use Cloud TPUs in this cluster.
  580. EnableTpu bool `json:"enableTpu,omitempty"`
  581. // Endpoint: [Output only] The IP address of this cluster's master
  582. // endpoint.
  583. // The endpoint can be accessed from the internet
  584. // at
  585. // `https://username:password@endpoint/`.
  586. //
  587. // See the `masterAuth` property of this resource for username
  588. // and
  589. // password information.
  590. Endpoint string `json:"endpoint,omitempty"`
  591. // ExpireTime: [Output only] The time the cluster will be
  592. // automatically
  593. // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text
  594. // format.
  595. ExpireTime string `json:"expireTime,omitempty"`
  596. // InitialClusterVersion: The initial Kubernetes version for this
  597. // cluster. Valid versions are those
  598. // found in validMasterVersions returned by getServerConfig. The
  599. // version can
  600. // be upgraded over time; such upgrades are reflected
  601. // in
  602. // currentMasterVersion and currentNodeVersion.
  603. //
  604. // Users may specify either explicit versions offered by
  605. // Kubernetes Engine or version aliases, which have the following
  606. // behavior:
  607. //
  608. // - "latest": picks the highest valid Kubernetes version
  609. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  610. // version
  611. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  612. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  613. // - "","-": picks the default Kubernetes version
  614. InitialClusterVersion string `json:"initialClusterVersion,omitempty"`
  615. // InitialNodeCount: The number of nodes to create in this cluster. You
  616. // must ensure that your
  617. // Compute Engine <a href="/compute/docs/resource-quotas">resource
  618. // quota</a>
  619. // is sufficient for this number of instances. You must also have
  620. // available
  621. // firewall and routes quota.
  622. // For requests, this field should only be used in lieu of a
  623. // "node_pool" object, since this configuration (along with
  624. // the
  625. // "node_config") will be used to create a "NodePool" object with
  626. // an
  627. // auto-generated name. Do not use this and a node_pool at the same
  628. // time.
  629. InitialNodeCount int64 `json:"initialNodeCount,omitempty"`
  630. // InstanceGroupUrls: Deprecated. Use node_pools.instance_group_urls.
  631. InstanceGroupUrls []string `json:"instanceGroupUrls,omitempty"`
  632. // IpAllocationPolicy: Configuration for cluster IP allocation.
  633. IpAllocationPolicy *IPAllocationPolicy `json:"ipAllocationPolicy,omitempty"`
  634. // LabelFingerprint: The fingerprint of the set of labels for this
  635. // cluster.
  636. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  637. // LegacyAbac: Configuration for the legacy ABAC authorization mode.
  638. LegacyAbac *LegacyAbac `json:"legacyAbac,omitempty"`
  639. // Location: [Output only] The name of the Google Compute
  640. // Engine
  641. // [zone](/compute/docs/regions-zones/regions-zones#available)
  642. // or
  643. // [region](/compute/docs/regions-zones/regions-zones#available) in
  644. // which
  645. // the cluster resides.
  646. Location string `json:"location,omitempty"`
  647. // Locations: The list of Google Compute
  648. // Engine
  649. // [zones](/compute/docs/zones#available) in which the cluster's
  650. // nodes
  651. // should be located.
  652. Locations []string `json:"locations,omitempty"`
  653. // LoggingService: The logging service the cluster should use to write
  654. // logs.
  655. // Currently available options:
  656. //
  657. // * `logging.googleapis.com` - the Google Cloud Logging service.
  658. // * `none` - no logs will be exported from the cluster.
  659. // * if left as an empty string,`logging.googleapis.com` will be used.
  660. LoggingService string `json:"loggingService,omitempty"`
  661. // MaintenancePolicy: Configure the maintenance policy for this cluster.
  662. MaintenancePolicy *MaintenancePolicy `json:"maintenancePolicy,omitempty"`
  663. // MasterAuth: The authentication information for accessing the master
  664. // endpoint.
  665. // If unspecified, the defaults are used:
  666. // For clusters before v1.12, if master_auth is unspecified, `username`
  667. // will
  668. // be set to "admin", a random password will be generated, and a
  669. // client
  670. // certificate will be issued.
  671. MasterAuth *MasterAuth `json:"masterAuth,omitempty"`
  672. // MasterAuthorizedNetworksConfig: The configuration options for master
  673. // authorized networks feature.
  674. MasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `json:"masterAuthorizedNetworksConfig,omitempty"`
  675. // MasterIpv4CidrBlock: The IP prefix in CIDR notation to use for the
  676. // hosted master network.
  677. // This prefix will be used for assigning private IP addresses to
  678. // the
  679. // master or set of masters, as well as the ILB VIP.
  680. // This field is deprecated,
  681. // use
  682. // private_cluster_config.master_ipv4_cidr_block instead.
  683. MasterIpv4CidrBlock string `json:"masterIpv4CidrBlock,omitempty"`
  684. // MonitoringService: The monitoring service the cluster should use to
  685. // write metrics.
  686. // Currently available options:
  687. //
  688. // * `monitoring.googleapis.com` - the Google Cloud Monitoring
  689. // service.
  690. // * `none` - no metrics will be exported from the cluster.
  691. // * if left as an empty string, `monitoring.googleapis.com` will be
  692. // used.
  693. MonitoringService string `json:"monitoringService,omitempty"`
  694. // Name: The name of this cluster. The name must be unique within this
  695. // project
  696. // and zone, and can be up to 40 characters with the following
  697. // restrictions:
  698. //
  699. // * Lowercase letters, numbers, and hyphens only.
  700. // * Must start with a letter.
  701. // * Must end with a number or a letter.
  702. Name string `json:"name,omitempty"`
  703. // Network: The name of the Google Compute
  704. // Engine
  705. // [network](/compute/docs/networks-and-firewalls#networks) to which
  706. // the
  707. // cluster is connected. If left unspecified, the `default` network
  708. // will be used. On output this shows the network ID instead of
  709. // the name.
  710. Network string `json:"network,omitempty"`
  711. // NetworkConfig: Configuration for cluster networking.
  712. NetworkConfig *NetworkConfig `json:"networkConfig,omitempty"`
  713. // NetworkPolicy: Configuration options for the NetworkPolicy feature.
  714. NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"`
  715. // NodeConfig: Parameters used in creating the cluster's nodes.
  716. // See `nodeConfig` for the description of its properties.
  717. // For requests, this field should only be used in lieu of a
  718. // "node_pool" object, since this configuration (along with
  719. // the
  720. // "initial_node_count") will be used to create a "NodePool" object with
  721. // an
  722. // auto-generated name. Do not use this and a node_pool at the same
  723. // time.
  724. // For responses, this field will be populated with the node
  725. // configuration of
  726. // the first node pool.
  727. //
  728. // If unspecified, the defaults are used.
  729. NodeConfig *NodeConfig `json:"nodeConfig,omitempty"`
  730. // NodeIpv4CidrSize: [Output only] The size of the address space on each
  731. // node for hosting
  732. // containers. This is provisioned from within the
  733. // `container_ipv4_cidr`
  734. // range.
  735. NodeIpv4CidrSize int64 `json:"nodeIpv4CidrSize,omitempty"`
  736. // NodePools: The node pools associated with this cluster.
  737. // This field should not be set if "node_config" or "initial_node_count"
  738. // are
  739. // specified.
  740. NodePools []*NodePool `json:"nodePools,omitempty"`
  741. // PodSecurityPolicyConfig: Configuration for the PodSecurityPolicy
  742. // feature.
  743. PodSecurityPolicyConfig *PodSecurityPolicyConfig `json:"podSecurityPolicyConfig,omitempty"`
  744. // PrivateCluster: If this is a private cluster setup. Private clusters
  745. // are clusters that, by
  746. // default have no external IP addresses on the nodes and where nodes
  747. // and the
  748. // master communicate over private IP addresses.
  749. // This field is deprecated, use
  750. // private_cluster_config.enable_private_nodes
  751. // instead.
  752. PrivateCluster bool `json:"privateCluster,omitempty"`
  753. // PrivateClusterConfig: Configuration for private cluster.
  754. PrivateClusterConfig *PrivateClusterConfig `json:"privateClusterConfig,omitempty"`
  755. // ResourceLabels: The resource labels for the cluster to use to
  756. // annotate any related
  757. // Google Compute Engine resources.
  758. ResourceLabels map[string]string `json:"resourceLabels,omitempty"`
  759. // ResourceUsageExportConfig: Configuration for exporting resource
  760. // usages. Resource usage export is
  761. // disabled when this config unspecified.
  762. ResourceUsageExportConfig *ResourceUsageExportConfig `json:"resourceUsageExportConfig,omitempty"`
  763. // SelfLink: [Output only] Server-defined URL for the resource.
  764. SelfLink string `json:"selfLink,omitempty"`
  765. // ServicesIpv4Cidr: [Output only] The IP address range of the
  766. // Kubernetes services in
  767. // this cluster,
  768. // in
  769. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  770. //
  771. // notation (e.g. `1.2.3.4/29`). Service addresses are
  772. // typically put in the last `/16` from the container CIDR.
  773. ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"`
  774. // Status: [Output only] The current status of this cluster.
  775. //
  776. // Possible values:
  777. // "STATUS_UNSPECIFIED" - Not set.
  778. // "PROVISIONING" - The PROVISIONING state indicates the cluster is
  779. // being created.
  780. // "RUNNING" - The RUNNING state indicates the cluster has been
  781. // created and is fully
  782. // usable.
  783. // "RECONCILING" - The RECONCILING state indicates that some work is
  784. // actively being done on
  785. // the cluster, such as upgrading the master or node software. Details
  786. // can
  787. // be found in the `statusMessage` field.
  788. // "STOPPING" - The STOPPING state indicates the cluster is being
  789. // deleted.
  790. // "ERROR" - The ERROR state indicates the cluster may be unusable.
  791. // Details
  792. // can be found in the `statusMessage` field.
  793. // "DEGRADED" - The DEGRADED state indicates the cluster requires user
  794. // action to restore
  795. // full functionality. Details can be found in the `statusMessage`
  796. // field.
  797. Status string `json:"status,omitempty"`
  798. // StatusMessage: [Output only] Additional information about the current
  799. // status of this
  800. // cluster, if available.
  801. StatusMessage string `json:"statusMessage,omitempty"`
  802. // Subnetwork: The name of the Google Compute
  803. // Engine
  804. // [subnetwork](/compute/docs/subnetworks) to which the
  805. // cluster is connected. On output this shows the subnetwork ID instead
  806. // of
  807. // the name.
  808. Subnetwork string `json:"subnetwork,omitempty"`
  809. // TpuIpv4CidrBlock: [Output only] The IP address range of the Cloud
  810. // TPUs in this cluster,
  811. // in
  812. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  813. //
  814. // notation (e.g. `1.2.3.4/29`).
  815. TpuIpv4CidrBlock string `json:"tpuIpv4CidrBlock,omitempty"`
  816. // VerticalPodAutoscaling: Cluster-level Vertical Pod Autoscaling
  817. // configuration.
  818. VerticalPodAutoscaling *VerticalPodAutoscaling `json:"verticalPodAutoscaling,omitempty"`
  819. // Zone: [Output only] The name of the Google Compute
  820. // Engine
  821. // [zone](/compute/docs/zones#available) in which the
  822. // cluster
  823. // resides.
  824. // This field is deprecated, use location instead.
  825. Zone string `json:"zone,omitempty"`
  826. // ServerResponse contains the HTTP response code and headers from the
  827. // server.
  828. googleapi.ServerResponse `json:"-"`
  829. // ForceSendFields is a list of field names (e.g. "AddonsConfig") to
  830. // unconditionally include in API requests. By default, fields with
  831. // empty values are omitted from API requests. However, any non-pointer,
  832. // non-interface field appearing in ForceSendFields will be sent to the
  833. // server regardless of whether the field is empty or not. This may be
  834. // used to include empty fields in Patch requests.
  835. ForceSendFields []string `json:"-"`
  836. // NullFields is a list of field names (e.g. "AddonsConfig") to include
  837. // in API requests with the JSON null value. By default, fields with
  838. // empty values are omitted from API requests. However, any field with
  839. // an empty value appearing in NullFields will be sent to the server as
  840. // null. It is an error if a field in this list has a non-empty value.
  841. // This may be used to include null fields in Patch requests.
  842. NullFields []string `json:"-"`
  843. }
  844. func (s *Cluster) MarshalJSON() ([]byte, error) {
  845. type NoMethod Cluster
  846. raw := NoMethod(*s)
  847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  848. }
  849. // ClusterAutoscaling: ClusterAutoscaling contains global, per-cluster
  850. // information
  851. // required by Cluster Autoscaler to automatically adjust
  852. // the size of the cluster and create/delete
  853. // node pools based on the current needs.
  854. type ClusterAutoscaling struct {
  855. // EnableNodeAutoprovisioning: Enables automatic node pool creation and
  856. // deletion.
  857. EnableNodeAutoprovisioning bool `json:"enableNodeAutoprovisioning,omitempty"`
  858. // ResourceLimits: Contains global constraints regarding minimum and
  859. // maximum
  860. // amount of resources in the cluster.
  861. ResourceLimits []*ResourceLimit `json:"resourceLimits,omitempty"`
  862. // ForceSendFields is a list of field names (e.g.
  863. // "EnableNodeAutoprovisioning") to unconditionally include in API
  864. // requests. By default, fields with empty values are omitted from API
  865. // requests. However, any non-pointer, non-interface field appearing in
  866. // ForceSendFields will be sent to the server regardless of whether the
  867. // field is empty or not. This may be used to include empty fields in
  868. // Patch requests.
  869. ForceSendFields []string `json:"-"`
  870. // NullFields is a list of field names (e.g.
  871. // "EnableNodeAutoprovisioning") to include in API requests with the
  872. // JSON null value. By default, fields with empty values are omitted
  873. // from API requests. However, any field with an empty value appearing
  874. // in NullFields will be sent to the server as null. It is an error if a
  875. // field in this list has a non-empty value. This may be used to include
  876. // null fields in Patch requests.
  877. NullFields []string `json:"-"`
  878. }
  879. func (s *ClusterAutoscaling) MarshalJSON() ([]byte, error) {
  880. type NoMethod ClusterAutoscaling
  881. raw := NoMethod(*s)
  882. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  883. }
  884. // ClusterUpdate: ClusterUpdate describes an update to the cluster.
  885. // Exactly one update can
  886. // be applied to a cluster with each request, so at most one field can
  887. // be
  888. // provided.
  889. type ClusterUpdate struct {
  890. // DesiredAddonsConfig: Configurations for the various addons available
  891. // to run in the cluster.
  892. DesiredAddonsConfig *AddonsConfig `json:"desiredAddonsConfig,omitempty"`
  893. // DesiredBinaryAuthorization: The desired configuration options for the
  894. // Binary Authorization feature.
  895. DesiredBinaryAuthorization *BinaryAuthorization `json:"desiredBinaryAuthorization,omitempty"`
  896. // DesiredClusterAutoscaling: Cluster-level autoscaling configuration.
  897. DesiredClusterAutoscaling *ClusterAutoscaling `json:"desiredClusterAutoscaling,omitempty"`
  898. // DesiredDatabaseEncryption: Configuration of etcd encryption.
  899. DesiredDatabaseEncryption *DatabaseEncryption `json:"desiredDatabaseEncryption,omitempty"`
  900. // DesiredImageType: The desired image type for the node pool.
  901. // NOTE: Set the "desired_node_pool" field as well.
  902. DesiredImageType string `json:"desiredImageType,omitempty"`
  903. // DesiredLocations: The desired list of Google Compute
  904. // Engine
  905. // [zones](/compute/docs/zones#available) in which the cluster's
  906. // nodes
  907. // should be located. Changing the locations a cluster is in will
  908. // result
  909. // in nodes being either created or removed from the cluster, depending
  910. // on
  911. // whether locations are being added or removed.
  912. //
  913. // This list must always include the cluster's primary zone.
  914. DesiredLocations []string `json:"desiredLocations,omitempty"`
  915. // DesiredLoggingService: The logging service the cluster should use to
  916. // write metrics.
  917. // Currently available options:
  918. //
  919. // * "logging.googleapis.com/kubernetes" - the Google Cloud
  920. // Logging
  921. // service with Kubernetes-native resource model in Stackdriver
  922. // * "logging.googleapis.com" - the Google Cloud Logging service
  923. // * "none" - no logs will be exported from the cluster
  924. DesiredLoggingService string `json:"desiredLoggingService,omitempty"`
  925. // DesiredMasterAuthorizedNetworksConfig: The desired configuration
  926. // options for master authorized networks feature.
  927. DesiredMasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `json:"desiredMasterAuthorizedNetworksConfig,omitempty"`
  928. // DesiredMasterVersion: The Kubernetes version to change the master to.
  929. // The only valid value is the
  930. // latest supported version.
  931. //
  932. // Users may specify either explicit versions offered by
  933. // Kubernetes Engine or version aliases, which have the following
  934. // behavior:
  935. //
  936. // - "latest": picks the highest valid Kubernetes version
  937. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  938. // version
  939. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  940. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  941. // - "-": picks the default Kubernetes version
  942. DesiredMasterVersion string `json:"desiredMasterVersion,omitempty"`
  943. // DesiredMonitoringService: The monitoring service the cluster should
  944. // use to write metrics.
  945. // Currently available options:
  946. //
  947. // * "monitoring.googleapis.com/kubernetes" - the Google Cloud
  948. // Monitoring
  949. // service with Kubernetes-native resource model in Stackdriver
  950. // * "monitoring.googleapis.com" - the Google Cloud Monitoring service
  951. // * "none" - no metrics will be exported from the cluster
  952. DesiredMonitoringService string `json:"desiredMonitoringService,omitempty"`
  953. // DesiredNodePoolAutoscaling: Autoscaler configuration for the node
  954. // pool specified in
  955. // desired_node_pool_id. If there is only one pool in the
  956. // cluster and desired_node_pool_id is not provided then
  957. // the change applies to that single node pool.
  958. DesiredNodePoolAutoscaling *NodePoolAutoscaling `json:"desiredNodePoolAutoscaling,omitempty"`
  959. // DesiredNodePoolId: The node pool to be upgraded. This field is
  960. // mandatory if
  961. // "desired_node_version", "desired_image_family"
  962. // or
  963. // "desired_node_pool_autoscaling" is specified and there is more than
  964. // one
  965. // node pool on the cluster.
  966. DesiredNodePoolId string `json:"desiredNodePoolId,omitempty"`
  967. // DesiredNodeVersion: The Kubernetes version to change the nodes to
  968. // (typically an
  969. // upgrade).
  970. //
  971. // Users may specify either explicit versions offered by
  972. // Kubernetes Engine or version aliases, which have the following
  973. // behavior:
  974. //
  975. // - "latest": picks the highest valid Kubernetes version
  976. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  977. // version
  978. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  979. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  980. // - "-": picks the Kubernetes master version
  981. DesiredNodeVersion string `json:"desiredNodeVersion,omitempty"`
  982. // DesiredPodSecurityPolicyConfig: The desired configuration options for
  983. // the PodSecurityPolicy feature.
  984. DesiredPodSecurityPolicyConfig *PodSecurityPolicyConfig `json:"desiredPodSecurityPolicyConfig,omitempty"`
  985. // DesiredResourceUsageExportConfig: The desired configuration for
  986. // exporting resource usage.
  987. DesiredResourceUsageExportConfig *ResourceUsageExportConfig `json:"desiredResourceUsageExportConfig,omitempty"`
  988. // DesiredVerticalPodAutoscaling: Cluster-level Vertical Pod Autoscaling
  989. // configuration.
  990. DesiredVerticalPodAutoscaling *VerticalPodAutoscaling `json:"desiredVerticalPodAutoscaling,omitempty"`
  991. // ForceSendFields is a list of field names (e.g. "DesiredAddonsConfig")
  992. // to unconditionally include in API requests. By default, fields with
  993. // empty values are omitted from API requests. However, any non-pointer,
  994. // non-interface field appearing in ForceSendFields will be sent to the
  995. // server regardless of whether the field is empty or not. This may be
  996. // used to include empty fields in Patch requests.
  997. ForceSendFields []string `json:"-"`
  998. // NullFields is a list of field names (e.g. "DesiredAddonsConfig") to
  999. // include in API requests with the JSON null value. By default, fields
  1000. // with empty values are omitted from API requests. However, any field
  1001. // with an empty value appearing in NullFields will be sent to the
  1002. // server as null. It is an error if a field in this list has a
  1003. // non-empty value. This may be used to include null fields in Patch
  1004. // requests.
  1005. NullFields []string `json:"-"`
  1006. }
  1007. func (s *ClusterUpdate) MarshalJSON() ([]byte, error) {
  1008. type NoMethod ClusterUpdate
  1009. raw := NoMethod(*s)
  1010. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1011. }
  1012. // CompleteIPRotationRequest: CompleteIPRotationRequest moves the
  1013. // cluster master back into single-IP mode.
  1014. type CompleteIPRotationRequest struct {
  1015. // ClusterId: Deprecated. The name of the cluster.
  1016. // This field has been deprecated and replaced by the name field.
  1017. ClusterId string `json:"clusterId,omitempty"`
  1018. // Name: The name (project, location, cluster id) of the cluster to
  1019. // complete IP
  1020. // rotation. Specified in the format
  1021. // 'projects/*/locations/*/clusters/*'.
  1022. Name string `json:"name,omitempty"`
  1023. // ProjectId: Deprecated. The Google Developers Console [project ID or
  1024. // project
  1025. // number](https://developers.google.com/console/help/new/#projec
  1026. // tnumber).
  1027. // This field has been deprecated and replaced by the name field.
  1028. ProjectId string `json:"projectId,omitempty"`
  1029. // Zone: Deprecated. The name of the Google Compute
  1030. // Engine
  1031. // [zone](/compute/docs/zones#available) in which the
  1032. // cluster
  1033. // resides.
  1034. // This field has been deprecated and replaced by the name field.
  1035. Zone string `json:"zone,omitempty"`
  1036. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  1037. // unconditionally include in API requests. By default, fields with
  1038. // empty values are omitted from API requests. However, any non-pointer,
  1039. // non-interface field appearing in ForceSendFields will be sent to the
  1040. // server regardless of whether the field is empty or not. This may be
  1041. // used to include empty fields in Patch requests.
  1042. ForceSendFields []string `json:"-"`
  1043. // NullFields is a list of field names (e.g. "ClusterId") to include in
  1044. // API requests with the JSON null value. By default, fields with empty
  1045. // values are omitted from API requests. However, any field with an
  1046. // empty value appearing in NullFields will be sent to the server as
  1047. // null. It is an error if a field in this list has a non-empty value.
  1048. // This may be used to include null fields in Patch requests.
  1049. NullFields []string `json:"-"`
  1050. }
  1051. func (s *CompleteIPRotationRequest) MarshalJSON() ([]byte, error) {
  1052. type NoMethod CompleteIPRotationRequest
  1053. raw := NoMethod(*s)
  1054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1055. }
  1056. // CreateClusterRequest: CreateClusterRequest creates a cluster.
  1057. type CreateClusterRequest struct {
  1058. // Cluster: A
  1059. // [cluster
  1060. // resource](/container-engine/reference/rest/v1beta1/projects.z
  1061. // ones.clusters)
  1062. Cluster *Cluster `json:"cluster,omitempty"`
  1063. // Parent: The parent (project and location) where the cluster will be
  1064. // created.
  1065. // Specified in the format 'projects/*/locations/*'.
  1066. Parent string `json:"parent,omitempty"`
  1067. // ProjectId: Deprecated. The Google Developers Console [project ID or
  1068. // project
  1069. // number](https://support.google.com/cloud/answer/6158840).
  1070. // This
  1071. // field has been deprecated and replaced by the parent field.
  1072. ProjectId string `json:"projectId,omitempty"`
  1073. // Zone: Deprecated. The name of the Google Compute
  1074. // Engine
  1075. // [zone](/compute/docs/zones#available) in which the
  1076. // cluster
  1077. // resides.
  1078. // This field has been deprecated and replaced by the parent field.
  1079. Zone string `json:"zone,omitempty"`
  1080. // ForceSendFields is a list of field names (e.g. "Cluster") to
  1081. // unconditionally include in API requests. By default, fields with
  1082. // empty values are omitted from API requests. However, any non-pointer,
  1083. // non-interface field appearing in ForceSendFields will be sent to the
  1084. // server regardless of whether the field is empty or not. This may be
  1085. // used to include empty fields in Patch requests.
  1086. ForceSendFields []string `json:"-"`
  1087. // NullFields is a list of field names (e.g. "Cluster") to include in
  1088. // API requests with the JSON null value. By default, fields with empty
  1089. // values are omitted from API requests. However, any field with an
  1090. // empty value appearing in NullFields will be sent to the server as
  1091. // null. It is an error if a field in this list has a non-empty value.
  1092. // This may be used to include null fields in Patch requests.
  1093. NullFields []string `json:"-"`
  1094. }
  1095. func (s *CreateClusterRequest) MarshalJSON() ([]byte, error) {
  1096. type NoMethod CreateClusterRequest
  1097. raw := NoMethod(*s)
  1098. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1099. }
  1100. // CreateNodePoolRequest: CreateNodePoolRequest creates a node pool for
  1101. // a cluster.
  1102. type CreateNodePoolRequest struct {
  1103. // ClusterId: Deprecated. The name of the cluster.
  1104. // This field has been deprecated and replaced by the parent field.
  1105. ClusterId string `json:"clusterId,omitempty"`
  1106. // NodePool: The node pool to create.
  1107. NodePool *NodePool `json:"nodePool,omitempty"`
  1108. // Parent: The parent (project, location, cluster id) where the node
  1109. // pool will be
  1110. // created. Specified in the format
  1111. // 'projects/*/locations/*/clusters/*'.
  1112. Parent string `json:"parent,omitempty"`
  1113. // ProjectId: Deprecated. The Google Developers Console [project ID or
  1114. // project
  1115. // number](https://developers.google.com/console/help/new/#projec
  1116. // tnumber).
  1117. // This field has been deprecated and replaced by the parent field.
  1118. ProjectId string `json:"projectId,omitempty"`
  1119. // Zone: Deprecated. The name of the Google Compute
  1120. // Engine
  1121. // [zone](/compute/docs/zones#available) in which the
  1122. // cluster
  1123. // resides.
  1124. // This field has been deprecated and replaced by the parent field.
  1125. Zone string `json:"zone,omitempty"`
  1126. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  1127. // unconditionally include in API requests. By default, fields with
  1128. // empty values are omitted from API requests. However, any non-pointer,
  1129. // non-interface field appearing in ForceSendFields will be sent to the
  1130. // server regardless of whether the field is empty or not. This may be
  1131. // used to include empty fields in Patch requests.
  1132. ForceSendFields []string `json:"-"`
  1133. // NullFields is a list of field names (e.g. "ClusterId") to include in
  1134. // API requests with the JSON null value. By default, fields with empty
  1135. // values are omitted from API requests. However, any field with an
  1136. // empty value appearing in NullFields will be sent to the server as
  1137. // null. It is an error if a field in this list has a non-empty value.
  1138. // This may be used to include null fields in Patch requests.
  1139. NullFields []string `json:"-"`
  1140. }
  1141. func (s *CreateNodePoolRequest) MarshalJSON() ([]byte, error) {
  1142. type NoMethod CreateNodePoolRequest
  1143. raw := NoMethod(*s)
  1144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1145. }
  1146. // DailyMaintenanceWindow: Time window specified for daily maintenance
  1147. // operations.
  1148. type DailyMaintenanceWindow struct {
  1149. // Duration: [Output only] Duration of the time window, automatically
  1150. // chosen to be
  1151. // smallest possible in the given scenario.
  1152. Duration string `json:"duration,omitempty"`
  1153. // StartTime: Time within the maintenance window to start the
  1154. // maintenance operations.
  1155. // It must be in format "HH:MM”, where HH : [00-23] and MM : [00-59]
  1156. // GMT.
  1157. StartTime string `json:"startTime,omitempty"`
  1158. // ForceSendFields is a list of field names (e.g. "Duration") to
  1159. // unconditionally include in API requests. By default, fields with
  1160. // empty values are omitted from API requests. However, any non-pointer,
  1161. // non-interface field appearing in ForceSendFields will be sent to the
  1162. // server regardless of whether the field is empty or not. This may be
  1163. // used to include empty fields in Patch requests.
  1164. ForceSendFields []string `json:"-"`
  1165. // NullFields is a list of field names (e.g. "Duration") to include in
  1166. // API requests with the JSON null value. By default, fields with empty
  1167. // values are omitted from API requests. However, any field with an
  1168. // empty value appearing in NullFields will be sent to the server as
  1169. // null. It is an error if a field in this list has a non-empty value.
  1170. // This may be used to include null fields in Patch requests.
  1171. NullFields []string `json:"-"`
  1172. }
  1173. func (s *DailyMaintenanceWindow) MarshalJSON() ([]byte, error) {
  1174. type NoMethod DailyMaintenanceWindow
  1175. raw := NoMethod(*s)
  1176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1177. }
  1178. // DatabaseEncryption: Configuration of etcd encryption.
  1179. type DatabaseEncryption struct {
  1180. // KeyName: Name of CloudKMS key to use for the encryption of secrets in
  1181. // etcd.
  1182. // Ex.
  1183. // projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-ke
  1184. // y
  1185. KeyName string `json:"keyName,omitempty"`
  1186. // State: Denotes the state of etcd encryption.
  1187. //
  1188. // Possible values:
  1189. // "UNKNOWN" - Should never be set
  1190. // "ENCRYPTED" - Secrets in etcd are encrypted.
  1191. // "DECRYPTED" - Secrets in etcd are stored in plain text (at etcd
  1192. // level) - this is
  1193. // unrelated to GCE level full disk encryption.
  1194. State string `json:"state,omitempty"`
  1195. // ForceSendFields is a list of field names (e.g. "KeyName") to
  1196. // unconditionally include in API requests. By default, fields with
  1197. // empty values are omitted from API requests. However, any non-pointer,
  1198. // non-interface field appearing in ForceSendFields will be sent to the
  1199. // server regardless of whether the field is empty or not. This may be
  1200. // used to include empty fields in Patch requests.
  1201. ForceSendFields []string `json:"-"`
  1202. // NullFields is a list of field names (e.g. "KeyName") to include in
  1203. // API requests with the JSON null value. By default, fields with empty
  1204. // values are omitted from API requests. However, any field with an
  1205. // empty value appearing in NullFields will be sent to the server as
  1206. // null. It is an error if a field in this list has a non-empty value.
  1207. // This may be used to include null fields in Patch requests.
  1208. NullFields []string `json:"-"`
  1209. }
  1210. func (s *DatabaseEncryption) MarshalJSON() ([]byte, error) {
  1211. type NoMethod DatabaseEncryption
  1212. raw := NoMethod(*s)
  1213. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1214. }
  1215. // Empty: A generic empty message that you can re-use to avoid defining
  1216. // duplicated
  1217. // empty messages in your APIs. A typical example is to use it as the
  1218. // request
  1219. // or the response type of an API method. For instance:
  1220. //
  1221. // service Foo {
  1222. // rpc Bar(google.protobuf.Empty) returns
  1223. // (google.protobuf.Empty);
  1224. // }
  1225. //
  1226. // The JSON representation for `Empty` is empty JSON object `{}`.
  1227. type Empty struct {
  1228. // ServerResponse contains the HTTP response code and headers from the
  1229. // server.
  1230. googleapi.ServerResponse `json:"-"`
  1231. }
  1232. // GetJSONWebKeysResponse: GetJSONWebKeysResponse is a valid JSON Web
  1233. // Key Set as specififed in rfc 7517
  1234. type GetJSONWebKeysResponse struct {
  1235. // Keys: The public component of the keys used by the cluster to sign
  1236. // token
  1237. // requests.
  1238. Keys []*Jwk `json:"keys,omitempty"`
  1239. // ServerResponse contains the HTTP response code and headers from the
  1240. // server.
  1241. googleapi.ServerResponse `json:"-"`
  1242. // ForceSendFields is a list of field names (e.g. "Keys") to
  1243. // unconditionally include in API requests. By default, fields with
  1244. // empty values are omitted from API requests. However, any non-pointer,
  1245. // non-interface field appearing in ForceSendFields will be sent to the
  1246. // server regardless of whether the field is empty or not. This may be
  1247. // used to include empty fields in Patch requests.
  1248. ForceSendFields []string `json:"-"`
  1249. // NullFields is a list of field names (e.g. "Keys") to include in API
  1250. // requests with the JSON null value. By default, fields with empty
  1251. // values are omitted from API requests. However, any field with an
  1252. // empty value appearing in NullFields will be sent to the server as
  1253. // null. It is an error if a field in this list has a non-empty value.
  1254. // This may be used to include null fields in Patch requests.
  1255. NullFields []string `json:"-"`
  1256. }
  1257. func (s *GetJSONWebKeysResponse) MarshalJSON() ([]byte, error) {
  1258. type NoMethod GetJSONWebKeysResponse
  1259. raw := NoMethod(*s)
  1260. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1261. }
  1262. // GetOpenIDConfigResponse: GetOpenIDConfigResponse is an OIDC discovery
  1263. // document for the cluster.
  1264. // See the OpenID Connect Discovery 1.0 specification for details.
  1265. type GetOpenIDConfigResponse struct {
  1266. // ClaimsSupported: NOLINT
  1267. ClaimsSupported []string `json:"claims_supported,omitempty"`
  1268. // GrantTypes: NOLINT
  1269. GrantTypes []string `json:"grant_types,omitempty"`
  1270. // IdTokenSigningAlgValuesSupported: NOLINT
  1271. IdTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported,omitempty"`
  1272. // Issuer: NOLINT
  1273. Issuer string `json:"issuer,omitempty"`
  1274. // JwksUri: NOLINT
  1275. JwksUri string `json:"jwks_uri,omitempty"`
  1276. // ResponseTypesSupported: NOLINT
  1277. ResponseTypesSupported []string `json:"response_types_supported,omitempty"`
  1278. // SubjectTypesSupported: NOLINT
  1279. SubjectTypesSupported []string `json:"subject_types_supported,omitempty"`
  1280. // ServerResponse contains the HTTP response code and headers from the
  1281. // server.
  1282. googleapi.ServerResponse `json:"-"`
  1283. // ForceSendFields is a list of field names (e.g. "ClaimsSupported") to
  1284. // unconditionally include in API requests. By default, fields with
  1285. // empty values are omitted from API requests. However, any non-pointer,
  1286. // non-interface field appearing in ForceSendFields will be sent to the
  1287. // server regardless of whether the field is empty or not. This may be
  1288. // used to include empty fields in Patch requests.
  1289. ForceSendFields []string `json:"-"`
  1290. // NullFields is a list of field names (e.g. "ClaimsSupported") to
  1291. // include in API requests with the JSON null value. By default, fields
  1292. // with empty values are omitted from API requests. However, any field
  1293. // with an empty value appearing in NullFields will be sent to the
  1294. // server as null. It is an error if a field in this list has a
  1295. // non-empty value. This may be used to include null fields in Patch
  1296. // requests.
  1297. NullFields []string `json:"-"`
  1298. }
  1299. func (s *GetOpenIDConfigResponse) MarshalJSON() ([]byte, error) {
  1300. type NoMethod GetOpenIDConfigResponse
  1301. raw := NoMethod(*s)
  1302. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1303. }
  1304. // HorizontalPodAutoscaling: Configuration options for the horizontal
  1305. // pod autoscaling feature, which
  1306. // increases or decreases the number of replica pods a replication
  1307. // controller
  1308. // has based on the resource usage of the existing pods.
  1309. type HorizontalPodAutoscaling struct {
  1310. // Disabled: Whether the Horizontal Pod Autoscaling feature is enabled
  1311. // in the cluster.
  1312. // When enabled, it ensures that a Heapster pod is running in the
  1313. // cluster,
  1314. // which is also used by the Cloud Monitoring service.
  1315. Disabled bool `json:"disabled,omitempty"`
  1316. // ForceSendFields is a list of field names (e.g. "Disabled") to
  1317. // unconditionally include in API requests. By default, fields with
  1318. // empty values are omitted from API requests. However, any non-pointer,
  1319. // non-interface field appearing in ForceSendFields will be sent to the
  1320. // server regardless of whether the field is empty or not. This may be
  1321. // used to include empty fields in Patch requests.
  1322. ForceSendFields []string `json:"-"`
  1323. // NullFields is a list of field names (e.g. "Disabled") to include in
  1324. // API requests with the JSON null value. By default, fields with empty
  1325. // values are omitted from API requests. However, any field with an
  1326. // empty value appearing in NullFields will be sent to the server as
  1327. // null. It is an error if a field in this list has a non-empty value.
  1328. // This may be used to include null fields in Patch requests.
  1329. NullFields []string `json:"-"`
  1330. }
  1331. func (s *HorizontalPodAutoscaling) MarshalJSON() ([]byte, error) {
  1332. type NoMethod HorizontalPodAutoscaling
  1333. raw := NoMethod(*s)
  1334. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1335. }
  1336. // HttpLoadBalancing: Configuration options for the HTTP (L7) load
  1337. // balancing controller addon,
  1338. // which makes it easy to set up HTTP load balancers for services in a
  1339. // cluster.
  1340. type HttpLoadBalancing struct {
  1341. // Disabled: Whether the HTTP Load Balancing controller is enabled in
  1342. // the cluster.
  1343. // When enabled, it runs a small pod in the cluster that manages the
  1344. // load
  1345. // balancers.
  1346. Disabled bool `json:"disabled,omitempty"`
  1347. // ForceSendFields is a list of field names (e.g. "Disabled") to
  1348. // unconditionally include in API requests. By default, fields with
  1349. // empty values are omitted from API requests. However, any non-pointer,
  1350. // non-interface field appearing in ForceSendFields will be sent to the
  1351. // server regardless of whether the field is empty or not. This may be
  1352. // used to include empty fields in Patch requests.
  1353. ForceSendFields []string `json:"-"`
  1354. // NullFields is a list of field names (e.g. "Disabled") to include in
  1355. // API requests with the JSON null value. By default, fields with empty
  1356. // values are omitted from API requests. However, any field with an
  1357. // empty value appearing in NullFields will be sent to the server as
  1358. // null. It is an error if a field in this list has a non-empty value.
  1359. // This may be used to include null fields in Patch requests.
  1360. NullFields []string `json:"-"`
  1361. }
  1362. func (s *HttpLoadBalancing) MarshalJSON() ([]byte, error) {
  1363. type NoMethod HttpLoadBalancing
  1364. raw := NoMethod(*s)
  1365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1366. }
  1367. // IPAllocationPolicy: Configuration for controlling how IPs are
  1368. // allocated in the cluster.
  1369. type IPAllocationPolicy struct {
  1370. // AllowRouteOverlap: If true, allow allocation of cluster CIDR ranges
  1371. // that overlap with certain
  1372. // kinds of network routes. By default we do not allow cluster CIDR
  1373. // ranges to
  1374. // intersect with any user declared routes. With allow_route_overlap ==
  1375. // true,
  1376. // we allow overlapping with CIDR ranges that are larger than the
  1377. // cluster CIDR
  1378. // range.
  1379. //
  1380. // If this field is set to true, then cluster and services CIDRs must
  1381. // be
  1382. // fully-specified (e.g. `10.96.0.0/14`, but not `/14`), which means:
  1383. // 1) When `use_ip_aliases` is true, `cluster_ipv4_cidr_block` and
  1384. // `services_ipv4_cidr_block` must be fully-specified.
  1385. // 2) When `use_ip_aliases` is false, `cluster.cluster_ipv4_cidr` muse
  1386. // be
  1387. // fully-specified.
  1388. AllowRouteOverlap bool `json:"allowRouteOverlap,omitempty"`
  1389. // ClusterIpv4Cidr: This field is deprecated, use
  1390. // cluster_ipv4_cidr_block.
  1391. ClusterIpv4Cidr string `json:"clusterIpv4Cidr,omitempty"`
  1392. // ClusterIpv4CidrBlock: The IP address range for the cluster pod IPs.
  1393. // If this field is set, then
  1394. // `cluster.cluster_ipv4_cidr` must be left blank.
  1395. //
  1396. // This field is only applicable when `use_ip_aliases` is true.
  1397. //
  1398. // Set to blank to have a range chosen with the default size.
  1399. //
  1400. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1401. // specific
  1402. // netmask.
  1403. //
  1404. // Set to
  1405. // a
  1406. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1407. //
  1408. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1409. // (e.g.
  1410. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1411. // range
  1412. // to use.
  1413. ClusterIpv4CidrBlock string `json:"clusterIpv4CidrBlock,omitempty"`
  1414. // ClusterSecondaryRangeName: The name of the secondary range to be used
  1415. // for the cluster CIDR
  1416. // block. The secondary range will be used for pod IP
  1417. // addresses. This must be an existing secondary range associated
  1418. // with the cluster subnetwork.
  1419. //
  1420. // This field is only applicable with use_ip_aliases
  1421. // and
  1422. // create_subnetwork is false.
  1423. ClusterSecondaryRangeName string `json:"clusterSecondaryRangeName,omitempty"`
  1424. // CreateSubnetwork: Whether a new subnetwork will be created
  1425. // automatically for the cluster.
  1426. //
  1427. // This field is only applicable when `use_ip_aliases` is true.
  1428. CreateSubnetwork bool `json:"createSubnetwork,omitempty"`
  1429. // NodeIpv4Cidr: This field is deprecated, use node_ipv4_cidr_block.
  1430. NodeIpv4Cidr string `json:"nodeIpv4Cidr,omitempty"`
  1431. // NodeIpv4CidrBlock: The IP address range of the instance IPs in this
  1432. // cluster.
  1433. //
  1434. // This is applicable only if `create_subnetwork` is true.
  1435. //
  1436. // Set to blank to have a range chosen with the default size.
  1437. //
  1438. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1439. // specific
  1440. // netmask.
  1441. //
  1442. // Set to
  1443. // a
  1444. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1445. //
  1446. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1447. // (e.g.
  1448. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1449. // range
  1450. // to use.
  1451. NodeIpv4CidrBlock string `json:"nodeIpv4CidrBlock,omitempty"`
  1452. // ServicesIpv4Cidr: This field is deprecated, use
  1453. // services_ipv4_cidr_block.
  1454. ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"`
  1455. // ServicesIpv4CidrBlock: The IP address range of the services IPs in
  1456. // this cluster. If blank, a range
  1457. // will be automatically chosen with the default size.
  1458. //
  1459. // This field is only applicable when `use_ip_aliases` is true.
  1460. //
  1461. // Set to blank to have a range chosen with the default size.
  1462. //
  1463. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1464. // specific
  1465. // netmask.
  1466. //
  1467. // Set to
  1468. // a
  1469. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1470. //
  1471. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1472. // (e.g.
  1473. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1474. // range
  1475. // to use.
  1476. ServicesIpv4CidrBlock string `json:"servicesIpv4CidrBlock,omitempty"`
  1477. // ServicesSecondaryRangeName: The name of the secondary range to be
  1478. // used as for the services
  1479. // CIDR block. The secondary range will be used for service
  1480. // ClusterIPs. This must be an existing secondary range associated
  1481. // with the cluster subnetwork.
  1482. //
  1483. // This field is only applicable with use_ip_aliases
  1484. // and
  1485. // create_subnetwork is false.
  1486. ServicesSecondaryRangeName string `json:"servicesSecondaryRangeName,omitempty"`
  1487. // SubnetworkName: A custom subnetwork name to be used if
  1488. // `create_subnetwork` is true. If
  1489. // this field is empty, then an automatic name will be chosen for the
  1490. // new
  1491. // subnetwork.
  1492. SubnetworkName string `json:"subnetworkName,omitempty"`
  1493. // TpuIpv4CidrBlock: The IP address range of the Cloud TPUs in this
  1494. // cluster. If unspecified, a
  1495. // range will be automatically chosen with the default size.
  1496. //
  1497. // This field is only applicable when `use_ip_aliases` is true.
  1498. //
  1499. // If unspecified, the range will use the default size.
  1500. //
  1501. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1502. // specific
  1503. // netmask.
  1504. //
  1505. // Set to
  1506. // a
  1507. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1508. //
  1509. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1510. // (e.g.
  1511. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1512. // range
  1513. // to use.
  1514. TpuIpv4CidrBlock string `json:"tpuIpv4CidrBlock,omitempty"`
  1515. // UseIpAliases: Whether alias IPs will be used for pod IPs in the
  1516. // cluster.
  1517. UseIpAliases bool `json:"useIpAliases,omitempty"`
  1518. // ForceSendFields is a list of field names (e.g. "AllowRouteOverlap")
  1519. // to unconditionally include in API requests. By default, fields with
  1520. // empty values are omitted from API requests. However, any non-pointer,
  1521. // non-interface field appearing in ForceSendFields will be sent to the
  1522. // server regardless of whether the field is empty or not. This may be
  1523. // used to include empty fields in Patch requests.
  1524. ForceSendFields []string `json:"-"`
  1525. // NullFields is a list of field names (e.g. "AllowRouteOverlap") to
  1526. // include in API requests with the JSON null value. By default, fields
  1527. // with empty values are omitted from API requests. However, any field
  1528. // with an empty value appearing in NullFields will be sent to the
  1529. // server as null. It is an error if a field in this list has a
  1530. // non-empty value. This may be used to include null fields in Patch
  1531. // requests.
  1532. NullFields []string `json:"-"`
  1533. }
  1534. func (s *IPAllocationPolicy) MarshalJSON() ([]byte, error) {
  1535. type NoMethod IPAllocationPolicy
  1536. raw := NoMethod(*s)
  1537. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1538. }
  1539. // IstioConfig: Configuration options for Istio addon.
  1540. type IstioConfig struct {
  1541. // Auth: The specified Istio auth mode, either none, or mutual TLS.
  1542. //
  1543. // Possible values:
  1544. // "AUTH_NONE" - auth not enabled
  1545. // "AUTH_MUTUAL_TLS" - auth mutual TLS enabled
  1546. Auth string `json:"auth,omitempty"`
  1547. // Disabled: Whether Istio is enabled for this cluster.
  1548. Disabled bool `json:"disabled,omitempty"`
  1549. // ForceSendFields is a list of field names (e.g. "Auth") to
  1550. // unconditionally include in API requests. By default, fields with
  1551. // empty values are omitted from API requests. However, any non-pointer,
  1552. // non-interface field appearing in ForceSendFields will be sent to the
  1553. // server regardless of whether the field is empty or not. This may be
  1554. // used to include empty fields in Patch requests.
  1555. ForceSendFields []string `json:"-"`
  1556. // NullFields is a list of field names (e.g. "Auth") to include in API
  1557. // requests with the JSON null value. By default, fields with empty
  1558. // values are omitted from API requests. However, any field with an
  1559. // empty value appearing in NullFields will be sent to the server as
  1560. // null. It is an error if a field in this list has a non-empty value.
  1561. // This may be used to include null fields in Patch requests.
  1562. NullFields []string `json:"-"`
  1563. }
  1564. func (s *IstioConfig) MarshalJSON() ([]byte, error) {
  1565. type NoMethod IstioConfig
  1566. raw := NoMethod(*s)
  1567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1568. }
  1569. // Jwk: Jwk is a JSON Web Key as specified in RFC 7517
  1570. type Jwk struct {
  1571. // Alg: NOLINT
  1572. Alg string `json:"alg,omitempty"`
  1573. // Crv: NOLINT
  1574. Crv string `json:"crv,omitempty"`
  1575. // E: NOLINT
  1576. E string `json:"e,omitempty"`
  1577. // Kid: NOLINT
  1578. Kid string `json:"kid,omitempty"`
  1579. // Kty: NOLINT
  1580. Kty string `json:"kty,omitempty"`
  1581. // N: Fields for RSA keys.
  1582. // NOLINT
  1583. N string `json:"n,omitempty"`
  1584. // Use: NOLINT
  1585. Use string `json:"use,omitempty"`
  1586. // X: Fields for ECDSA keys.
  1587. // NOLINT
  1588. X string `json:"x,omitempty"`
  1589. // Y: NOLINT
  1590. Y string `json:"y,omitempty"`
  1591. // ForceSendFields is a list of field names (e.g. "Alg") to
  1592. // unconditionally include in API requests. By default, fields with
  1593. // empty values are omitted from API requests. However, any non-pointer,
  1594. // non-interface field appearing in ForceSendFields will be sent to the
  1595. // server regardless of whether the field is empty or not. This may be
  1596. // used to include empty fields in Patch requests.
  1597. ForceSendFields []string `json:"-"`
  1598. // NullFields is a list of field names (e.g. "Alg") to include in API
  1599. // requests with the JSON null value. By default, fields with empty
  1600. // values are omitted from API requests. However, any field with an
  1601. // empty value appearing in NullFields will be sent to the server as
  1602. // null. It is an error if a field in this list has a non-empty value.
  1603. // This may be used to include null fields in Patch requests.
  1604. NullFields []string `json:"-"`
  1605. }
  1606. func (s *Jwk) MarshalJSON() ([]byte, error) {
  1607. type NoMethod Jwk
  1608. raw := NoMethod(*s)
  1609. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1610. }
  1611. // KubernetesDashboard: Configuration for the Kubernetes Dashboard.
  1612. type KubernetesDashboard struct {
  1613. // Disabled: Whether the Kubernetes Dashboard is enabled for this
  1614. // cluster.
  1615. Disabled bool `json:"disabled,omitempty"`
  1616. // ForceSendFields is a list of field names (e.g. "Disabled") to
  1617. // unconditionally include in API requests. By default, fields with
  1618. // empty values are omitted from API requests. However, any non-pointer,
  1619. // non-interface field appearing in ForceSendFields will be sent to the
  1620. // server regardless of whether the field is empty or not. This may be
  1621. // used to include empty fields in Patch requests.
  1622. ForceSendFields []string `json:"-"`
  1623. // NullFields is a list of field names (e.g. "Disabled") to include in
  1624. // API requests with the JSON null value. By default, fields with empty
  1625. // values are omitted from API requests. However, any field with an
  1626. // empty value appearing in NullFields will be sent to the server as
  1627. // null. It is an error if a field in this list has a non-empty value.
  1628. // This may be used to include null fields in Patch requests.
  1629. NullFields []string `json:"-"`
  1630. }
  1631. func (s *KubernetesDashboard) MarshalJSON() ([]byte, error) {
  1632. type NoMethod KubernetesDashboard
  1633. raw := NoMethod(*s)
  1634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1635. }
  1636. // LegacyAbac: Configuration for the legacy Attribute Based Access
  1637. // Control authorization
  1638. // mode.
  1639. type LegacyAbac struct {
  1640. // Enabled: Whether the ABAC authorizer is enabled for this cluster.
  1641. // When enabled,
  1642. // identities in the system, including service accounts, nodes,
  1643. // and
  1644. // controllers, will have statically granted permissions beyond
  1645. // those
  1646. // provided by the RBAC configuration or IAM.
  1647. Enabled bool `json:"enabled,omitempty"`
  1648. // ForceSendFields is a list of field names (e.g. "Enabled") to
  1649. // unconditionally include in API requests. By default, fields with
  1650. // empty values are omitted from API requests. However, any non-pointer,
  1651. // non-interface field appearing in ForceSendFields will be sent to the
  1652. // server regardless of whether the field is empty or not. This may be
  1653. // used to include empty fields in Patch requests.
  1654. ForceSendFields []string `json:"-"`
  1655. // NullFields is a list of field names (e.g. "Enabled") to include in
  1656. // API requests with the JSON null value. By default, fields with empty
  1657. // values are omitted from API requests. However, any field with an
  1658. // empty value appearing in NullFields will be sent to the server as
  1659. // null. It is an error if a field in this list has a non-empty value.
  1660. // This may be used to include null fields in Patch requests.
  1661. NullFields []string `json:"-"`
  1662. }
  1663. func (s *LegacyAbac) MarshalJSON() ([]byte, error) {
  1664. type NoMethod LegacyAbac
  1665. raw := NoMethod(*s)
  1666. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1667. }
  1668. // ListClustersResponse: ListClustersResponse is the result of
  1669. // ListClustersRequest.
  1670. type ListClustersResponse struct {
  1671. // Clusters: A list of clusters in the project in the specified zone,
  1672. // or
  1673. // across all ones.
  1674. Clusters []*Cluster `json:"clusters,omitempty"`
  1675. // MissingZones: If any zones are listed here, the list of clusters
  1676. // returned
  1677. // may be missing those zones.
  1678. MissingZones []string `json:"missingZones,omitempty"`
  1679. // ServerResponse contains the HTTP response code and headers from the
  1680. // server.
  1681. googleapi.ServerResponse `json:"-"`
  1682. // ForceSendFields is a list of field names (e.g. "Clusters") to
  1683. // unconditionally include in API requests. By default, fields with
  1684. // empty values are omitted from API requests. However, any non-pointer,
  1685. // non-interface field appearing in ForceSendFields will be sent to the
  1686. // server regardless of whether the field is empty or not. This may be
  1687. // used to include empty fields in Patch requests.
  1688. ForceSendFields []string `json:"-"`
  1689. // NullFields is a list of field names (e.g. "Clusters") to include in
  1690. // API requests with the JSON null value. By default, fields with empty
  1691. // values are omitted from API requests. However, any field with an
  1692. // empty value appearing in NullFields will be sent to the server as
  1693. // null. It is an error if a field in this list has a non-empty value.
  1694. // This may be used to include null fields in Patch requests.
  1695. NullFields []string `json:"-"`
  1696. }
  1697. func (s *ListClustersResponse) MarshalJSON() ([]byte, error) {
  1698. type NoMethod ListClustersResponse
  1699. raw := NoMethod(*s)
  1700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1701. }
  1702. // ListLocationsResponse: ListLocationsResponse returns the list of all
  1703. // GKE locations and their
  1704. // recommendation state.
  1705. type ListLocationsResponse struct {
  1706. // Locations: A full list of GKE locations.
  1707. Locations []*Location `json:"locations,omitempty"`
  1708. // NextPageToken: Only return ListLocationsResponse that occur after the
  1709. // page_token. This
  1710. // value should be populated from the
  1711. // ListLocationsResponse.next_page_token if
  1712. // that response token was set (which happens when listing more
  1713. // Locations than
  1714. // fit in a single ListLocationsResponse).
  1715. NextPageToken string `json:"nextPageToken,omitempty"`
  1716. // ServerResponse contains the HTTP response code and headers from the
  1717. // server.
  1718. googleapi.ServerResponse `json:"-"`
  1719. // ForceSendFields is a list of field names (e.g. "Locations") to
  1720. // unconditionally include in API requests. By default, fields with
  1721. // empty values are omitted from API requests. However, any non-pointer,
  1722. // non-interface field appearing in ForceSendFields will be sent to the
  1723. // server regardless of whether the field is empty or not. This may be
  1724. // used to include empty fields in Patch requests.
  1725. ForceSendFields []string `json:"-"`
  1726. // NullFields is a list of field names (e.g. "Locations") to include in
  1727. // API requests with the JSON null value. By default, fields with empty
  1728. // values are omitted from API requests. However, any field with an
  1729. // empty value appearing in NullFields will be sent to the server as
  1730. // null. It is an error if a field in this list has a non-empty value.
  1731. // This may be used to include null fields in Patch requests.
  1732. NullFields []string `json:"-"`
  1733. }
  1734. func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
  1735. type NoMethod ListLocationsResponse
  1736. raw := NoMethod(*s)
  1737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1738. }
  1739. // ListNodePoolsResponse: ListNodePoolsResponse is the result of
  1740. // ListNodePoolsRequest.
  1741. type ListNodePoolsResponse struct {
  1742. // NodePools: A list of node pools for a cluster.
  1743. NodePools []*NodePool `json:"nodePools,omitempty"`
  1744. // ServerResponse contains the HTTP response code and headers from the
  1745. // server.
  1746. googleapi.ServerResponse `json:"-"`
  1747. // ForceSendFields is a list of field names (e.g. "NodePools") to
  1748. // unconditionally include in API requests. By default, fields with
  1749. // empty values are omitted from API requests. However, any non-pointer,
  1750. // non-interface field appearing in ForceSendFields will be sent to the
  1751. // server regardless of whether the field is empty or not. This may be
  1752. // used to include empty fields in Patch requests.
  1753. ForceSendFields []string `json:"-"`
  1754. // NullFields is a list of field names (e.g. "NodePools") to include in
  1755. // API requests with the JSON null value. By default, fields with empty
  1756. // values are omitted from API requests. However, any field with an
  1757. // empty value appearing in NullFields will be sent to the server as
  1758. // null. It is an error if a field in this list has a non-empty value.
  1759. // This may be used to include null fields in Patch requests.
  1760. NullFields []string `json:"-"`
  1761. }
  1762. func (s *ListNodePoolsResponse) MarshalJSON() ([]byte, error) {
  1763. type NoMethod ListNodePoolsResponse
  1764. raw := NoMethod(*s)
  1765. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1766. }
  1767. // ListOperationsResponse: ListOperationsResponse is the result of
  1768. // ListOperationsRequest.
  1769. type ListOperationsResponse struct {
  1770. // MissingZones: If any zones are listed here, the list of operations
  1771. // returned
  1772. // may be missing the operations from those zones.
  1773. MissingZones []string `json:"missingZones,omitempty"`
  1774. // Operations: A list of operations in the project in the specified
  1775. // zone.
  1776. Operations []*Operation `json:"operations,omitempty"`
  1777. // ServerResponse contains the HTTP response code and headers from the
  1778. // server.
  1779. googleapi.ServerResponse `json:"-"`
  1780. // ForceSendFields is a list of field names (e.g. "MissingZones") to
  1781. // unconditionally include in API requests. By default, fields with
  1782. // empty values are omitted from API requests. However, any non-pointer,
  1783. // non-interface field appearing in ForceSendFields will be sent to the
  1784. // server regardless of whether the field is empty or not. This may be
  1785. // used to include empty fields in Patch requests.
  1786. ForceSendFields []string `json:"-"`
  1787. // NullFields is a list of field names (e.g. "MissingZones") to include
  1788. // in API requests with the JSON null value. By default, fields with
  1789. // empty values are omitted from API requests. However, any field with
  1790. // an empty value appearing in NullFields will be sent to the server as
  1791. // null. It is an error if a field in this list has a non-empty value.
  1792. // This may be used to include null fields in Patch requests.
  1793. NullFields []string `json:"-"`
  1794. }
  1795. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  1796. type NoMethod ListOperationsResponse
  1797. raw := NoMethod(*s)
  1798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1799. }
  1800. // ListUsableSubnetworksResponse: ListUsableSubnetworksResponse is the
  1801. // response of
  1802. // ListUsableSubnetworksRequest.
  1803. type ListUsableSubnetworksResponse struct {
  1804. // NextPageToken: This token allows you to get the next page of results
  1805. // for list requests.
  1806. // If the number of results is larger than `page_size`, use
  1807. // the
  1808. // `next_page_token` as a value for the query parameter `page_token` in
  1809. // the
  1810. // next request. The value will become empty when there are no more
  1811. // pages.
  1812. NextPageToken string `json:"nextPageToken,omitempty"`
  1813. // Subnetworks: A list of usable subnetworks in the specified network
  1814. // project.
  1815. Subnetworks []*UsableSubnetwork `json:"subnetworks,omitempty"`
  1816. // ServerResponse contains the HTTP response code and headers from the
  1817. // server.
  1818. googleapi.ServerResponse `json:"-"`
  1819. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1820. // unconditionally include in API requests. By default, fields with
  1821. // empty values are omitted from API requests. However, any non-pointer,
  1822. // non-interface field appearing in ForceSendFields will be sent to the
  1823. // server regardless of whether the field is empty or not. This may be
  1824. // used to include empty fields in Patch requests.
  1825. ForceSendFields []string `json:"-"`
  1826. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1827. // in API requests with the JSON null value. By default, fields with
  1828. // empty values are omitted from API requests. However, any field with
  1829. // an empty value appearing in NullFields will be sent to the server as
  1830. // null. It is an error if a field in this list has a non-empty value.
  1831. // This may be used to include null fields in Patch requests.
  1832. NullFields []string `json:"-"`
  1833. }
  1834. func (s *ListUsableSubnetworksResponse) MarshalJSON() ([]byte, error) {
  1835. type NoMethod ListUsableSubnetworksResponse
  1836. raw := NoMethod(*s)
  1837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1838. }
  1839. // Location: Location returns the location name, and if the location is
  1840. // recommended
  1841. // for GKE cluster scheduling.
  1842. type Location struct {
  1843. // Name: Contains the name of the resource requested.
  1844. // Specified in the format 'projects/*/locations/*'.
  1845. Name string `json:"name,omitempty"`
  1846. // Recommended: Whether the location is recomended for GKE cluster
  1847. // scheduling.
  1848. Recommended bool `json:"recommended,omitempty"`
  1849. // Type: Contains the type of location this Location is for.
  1850. // Regional or Zonal.
  1851. //
  1852. // Possible values:
  1853. // "LOCATION_TYPE_UNSPECIFIED" - LOCATION_TYPE_UNSPECIFIED means the
  1854. // location type was not determined.
  1855. // "ZONE" - A GKE Location where Zonal clusters can be created.
  1856. // "REGION" - A GKE Location where Regional clusters can be created.
  1857. Type string `json:"type,omitempty"`
  1858. // ForceSendFields is a list of field names (e.g. "Name") to
  1859. // unconditionally include in API requests. By default, fields with
  1860. // empty values are omitted from API requests. However, any non-pointer,
  1861. // non-interface field appearing in ForceSendFields will be sent to the
  1862. // server regardless of whether the field is empty or not. This may be
  1863. // used to include empty fields in Patch requests.
  1864. ForceSendFields []string `json:"-"`
  1865. // NullFields is a list of field names (e.g. "Name") to include in API
  1866. // requests with the JSON null value. By default, fields with empty
  1867. // values are omitted from API requests. However, any field with an
  1868. // empty value appearing in NullFields will be sent to the server as
  1869. // null. It is an error if a field in this list has a non-empty value.
  1870. // This may be used to include null fields in Patch requests.
  1871. NullFields []string `json:"-"`
  1872. }
  1873. func (s *Location) MarshalJSON() ([]byte, error) {
  1874. type NoMethod Location
  1875. raw := NoMethod(*s)
  1876. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1877. }
  1878. // MaintenancePolicy: MaintenancePolicy defines the maintenance policy
  1879. // to be used for the cluster.
  1880. type MaintenancePolicy struct {
  1881. // Window: Specifies the maintenance window in which maintenance may be
  1882. // performed.
  1883. Window *MaintenanceWindow `json:"window,omitempty"`
  1884. // ForceSendFields is a list of field names (e.g. "Window") to
  1885. // unconditionally include in API requests. By default, fields with
  1886. // empty values are omitted from API requests. However, any non-pointer,
  1887. // non-interface field appearing in ForceSendFields will be sent to the
  1888. // server regardless of whether the field is empty or not. This may be
  1889. // used to include empty fields in Patch requests.
  1890. ForceSendFields []string `json:"-"`
  1891. // NullFields is a list of field names (e.g. "Window") to include in API
  1892. // requests with the JSON null value. By default, fields with empty
  1893. // values are omitted from API requests. However, any field with an
  1894. // empty value appearing in NullFields will be sent to the server as
  1895. // null. It is an error if a field in this list has a non-empty value.
  1896. // This may be used to include null fields in Patch requests.
  1897. NullFields []string `json:"-"`
  1898. }
  1899. func (s *MaintenancePolicy) MarshalJSON() ([]byte, error) {
  1900. type NoMethod MaintenancePolicy
  1901. raw := NoMethod(*s)
  1902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1903. }
  1904. // MaintenanceWindow: MaintenanceWindow defines the maintenance window
  1905. // to be used for the cluster.
  1906. type MaintenanceWindow struct {
  1907. // DailyMaintenanceWindow: DailyMaintenanceWindow specifies a daily
  1908. // maintenance operation window.
  1909. DailyMaintenanceWindow *DailyMaintenanceWindow `json:"dailyMaintenanceWindow,omitempty"`
  1910. // ForceSendFields is a list of field names (e.g.
  1911. // "DailyMaintenanceWindow") to unconditionally include in API requests.
  1912. // By default, fields with empty values are omitted from API requests.
  1913. // However, any non-pointer, non-interface field appearing in
  1914. // ForceSendFields will be sent to the server regardless of whether the
  1915. // field is empty or not. This may be used to include empty fields in
  1916. // Patch requests.
  1917. ForceSendFields []string `json:"-"`
  1918. // NullFields is a list of field names (e.g. "DailyMaintenanceWindow")
  1919. // to include in API requests with the JSON null value. By default,
  1920. // fields with empty values are omitted from API requests. However, any
  1921. // field with an empty value appearing in NullFields will be sent to the
  1922. // server as null. It is an error if a field in this list has a
  1923. // non-empty value. This may be used to include null fields in Patch
  1924. // requests.
  1925. NullFields []string `json:"-"`
  1926. }
  1927. func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) {
  1928. type NoMethod MaintenanceWindow
  1929. raw := NoMethod(*s)
  1930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1931. }
  1932. // MasterAuth: The authentication information for accessing the master
  1933. // endpoint.
  1934. // Authentication can be done using HTTP basic auth or using
  1935. // client
  1936. // certificates.
  1937. type MasterAuth struct {
  1938. // ClientCertificate: [Output only] Base64-encoded public certificate
  1939. // used by clients to
  1940. // authenticate to the cluster endpoint.
  1941. ClientCertificate string `json:"clientCertificate,omitempty"`
  1942. // ClientCertificateConfig: Configuration for client certificate
  1943. // authentication on the cluster. For
  1944. // clusters before v1.12, if no configuration is specified, a
  1945. // client
  1946. // certificate is issued.
  1947. ClientCertificateConfig *ClientCertificateConfig `json:"clientCertificateConfig,omitempty"`
  1948. // ClientKey: [Output only] Base64-encoded private key used by clients
  1949. // to authenticate
  1950. // to the cluster endpoint.
  1951. ClientKey string `json:"clientKey,omitempty"`
  1952. // ClusterCaCertificate: [Output only] Base64-encoded public certificate
  1953. // that is the root of
  1954. // trust for the cluster.
  1955. ClusterCaCertificate string `json:"clusterCaCertificate,omitempty"`
  1956. // Password: The password to use for HTTP basic authentication to the
  1957. // master endpoint.
  1958. // Because the master endpoint is open to the Internet, you should
  1959. // create a
  1960. // strong password. If a password is provided for cluster creation,
  1961. // username
  1962. // must be non-empty.
  1963. Password string `json:"password,omitempty"`
  1964. // Username: The username to use for HTTP basic authentication to the
  1965. // master endpoint.
  1966. // For clusters v1.6.0 and later, basic authentication can be disabled
  1967. // by
  1968. // leaving username unspecified (or setting it to the empty string).
  1969. Username string `json:"username,omitempty"`
  1970. // ForceSendFields is a list of field names (e.g. "ClientCertificate")
  1971. // to unconditionally include in API requests. By default, fields with
  1972. // empty values are omitted from API requests. However, any non-pointer,
  1973. // non-interface field appearing in ForceSendFields will be sent to the
  1974. // server regardless of whether the field is empty or not. This may be
  1975. // used to include empty fields in Patch requests.
  1976. ForceSendFields []string `json:"-"`
  1977. // NullFields is a list of field names (e.g. "ClientCertificate") to
  1978. // include in API requests with the JSON null value. By default, fields
  1979. // with empty values are omitted from API requests. However, any field
  1980. // with an empty value appearing in NullFields will be sent to the
  1981. // server as null. It is an error if a field in this list has a
  1982. // non-empty value. This may be used to include null fields in Patch
  1983. // requests.
  1984. NullFields []string `json:"-"`
  1985. }
  1986. func (s *MasterAuth) MarshalJSON() ([]byte, error) {
  1987. type NoMethod MasterAuth
  1988. raw := NoMethod(*s)
  1989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1990. }
  1991. // MasterAuthorizedNetworksConfig: Configuration options for the master
  1992. // authorized networks feature. Enabled
  1993. // master authorized networks will disallow all external traffic to
  1994. // access
  1995. // Kubernetes master through HTTPS except traffic from the given CIDR
  1996. // blocks,
  1997. // Google Compute Engine Public IPs and Google Prod IPs.
  1998. type MasterAuthorizedNetworksConfig struct {
  1999. // CidrBlocks: cidr_blocks define up to 10 external networks that could
  2000. // access
  2001. // Kubernetes master through HTTPS.
  2002. CidrBlocks []*CidrBlock `json:"cidrBlocks,omitempty"`
  2003. // Enabled: Whether or not master authorized networks is enabled.
  2004. Enabled bool `json:"enabled,omitempty"`
  2005. // ForceSendFields is a list of field names (e.g. "CidrBlocks") to
  2006. // unconditionally include in API requests. By default, fields with
  2007. // empty values are omitted from API requests. However, any non-pointer,
  2008. // non-interface field appearing in ForceSendFields will be sent to the
  2009. // server regardless of whether the field is empty or not. This may be
  2010. // used to include empty fields in Patch requests.
  2011. ForceSendFields []string `json:"-"`
  2012. // NullFields is a list of field names (e.g. "CidrBlocks") to include in
  2013. // API requests with the JSON null value. By default, fields with empty
  2014. // values are omitted from API requests. However, any field with an
  2015. // empty value appearing in NullFields will be sent to the server as
  2016. // null. It is an error if a field in this list has a non-empty value.
  2017. // This may be used to include null fields in Patch requests.
  2018. NullFields []string `json:"-"`
  2019. }
  2020. func (s *MasterAuthorizedNetworksConfig) MarshalJSON() ([]byte, error) {
  2021. type NoMethod MasterAuthorizedNetworksConfig
  2022. raw := NoMethod(*s)
  2023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2024. }
  2025. // MaxPodsConstraint: Constraints applied to pods.
  2026. type MaxPodsConstraint struct {
  2027. // MaxPodsPerNode: Constraint enforced on the max num of pods per node.
  2028. MaxPodsPerNode int64 `json:"maxPodsPerNode,omitempty,string"`
  2029. // ForceSendFields is a list of field names (e.g. "MaxPodsPerNode") to
  2030. // unconditionally include in API requests. By default, fields with
  2031. // empty values are omitted from API requests. However, any non-pointer,
  2032. // non-interface field appearing in ForceSendFields will be sent to the
  2033. // server regardless of whether the field is empty or not. This may be
  2034. // used to include empty fields in Patch requests.
  2035. ForceSendFields []string `json:"-"`
  2036. // NullFields is a list of field names (e.g. "MaxPodsPerNode") to
  2037. // include in API requests with the JSON null value. By default, fields
  2038. // with empty values are omitted from API requests. However, any field
  2039. // with an empty value appearing in NullFields will be sent to the
  2040. // server as null. It is an error if a field in this list has a
  2041. // non-empty value. This may be used to include null fields in Patch
  2042. // requests.
  2043. NullFields []string `json:"-"`
  2044. }
  2045. func (s *MaxPodsConstraint) MarshalJSON() ([]byte, error) {
  2046. type NoMethod MaxPodsConstraint
  2047. raw := NoMethod(*s)
  2048. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2049. }
  2050. // Metric: Progress metric is (string, int|float|string) pair.
  2051. type Metric struct {
  2052. // DoubleValue: For metrics with floating point value.
  2053. DoubleValue float64 `json:"doubleValue,omitempty"`
  2054. // IntValue: For metrics with integer value.
  2055. IntValue int64 `json:"intValue,omitempty,string"`
  2056. // Name: Metric name, required.
  2057. // e.g., "nodes total", "percent done"
  2058. Name string `json:"name,omitempty"`
  2059. // StringValue: For metrics with custom values (ratios, visual progress,
  2060. // etc.).
  2061. StringValue string `json:"stringValue,omitempty"`
  2062. // ForceSendFields is a list of field names (e.g. "DoubleValue") to
  2063. // unconditionally include in API requests. By default, fields with
  2064. // empty values are omitted from API requests. However, any non-pointer,
  2065. // non-interface field appearing in ForceSendFields will be sent to the
  2066. // server regardless of whether the field is empty or not. This may be
  2067. // used to include empty fields in Patch requests.
  2068. ForceSendFields []string `json:"-"`
  2069. // NullFields is a list of field names (e.g. "DoubleValue") to include
  2070. // in API requests with the JSON null value. By default, fields with
  2071. // empty values are omitted from API requests. However, any field with
  2072. // an empty value appearing in NullFields will be sent to the server as
  2073. // null. It is an error if a field in this list has a non-empty value.
  2074. // This may be used to include null fields in Patch requests.
  2075. NullFields []string `json:"-"`
  2076. }
  2077. func (s *Metric) MarshalJSON() ([]byte, error) {
  2078. type NoMethod Metric
  2079. raw := NoMethod(*s)
  2080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2081. }
  2082. func (s *Metric) UnmarshalJSON(data []byte) error {
  2083. type NoMethod Metric
  2084. var s1 struct {
  2085. DoubleValue gensupport.JSONFloat64 `json:"doubleValue"`
  2086. *NoMethod
  2087. }
  2088. s1.NoMethod = (*NoMethod)(s)
  2089. if err := json.Unmarshal(data, &s1); err != nil {
  2090. return err
  2091. }
  2092. s.DoubleValue = float64(s1.DoubleValue)
  2093. return nil
  2094. }
  2095. // NetworkConfig: NetworkConfig reports the relative names of network &
  2096. // subnetwork.
  2097. type NetworkConfig struct {
  2098. // Network: Output only. The relative name of the Google Compute
  2099. // Engine
  2100. // network(/compute/docs/networks-and-firewalls#networks) to which
  2101. // the cluster is connected.
  2102. // Example: projects/my-project/global/networks/my-network
  2103. Network string `json:"network,omitempty"`
  2104. // Subnetwork: Output only. The relative name of the Google Compute
  2105. // Engine
  2106. // [subnetwork](/compute/docs/vpc) to which the cluster is
  2107. // connected.
  2108. // Example:
  2109. // projects/my-project/regions/us-central1/subnetworks/my-subnet
  2110. Subnetwork string `json:"subnetwork,omitempty"`
  2111. // ForceSendFields is a list of field names (e.g. "Network") to
  2112. // unconditionally include in API requests. By default, fields with
  2113. // empty values are omitted from API requests. However, any non-pointer,
  2114. // non-interface field appearing in ForceSendFields will be sent to the
  2115. // server regardless of whether the field is empty or not. This may be
  2116. // used to include empty fields in Patch requests.
  2117. ForceSendFields []string `json:"-"`
  2118. // NullFields is a list of field names (e.g. "Network") to include in
  2119. // API requests with the JSON null value. By default, fields with empty
  2120. // values are omitted from API requests. However, any field with an
  2121. // empty value appearing in NullFields will be sent to the server as
  2122. // null. It is an error if a field in this list has a non-empty value.
  2123. // This may be used to include null fields in Patch requests.
  2124. NullFields []string `json:"-"`
  2125. }
  2126. func (s *NetworkConfig) MarshalJSON() ([]byte, error) {
  2127. type NoMethod NetworkConfig
  2128. raw := NoMethod(*s)
  2129. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2130. }
  2131. // NetworkPolicy: Configuration options for the NetworkPolicy
  2132. // feature.
  2133. // https://kubernetes.io/docs/concepts/services-networking/netwo
  2134. // rkpolicies/
  2135. type NetworkPolicy struct {
  2136. // Enabled: Whether network policy is enabled on the cluster.
  2137. Enabled bool `json:"enabled,omitempty"`
  2138. // Provider: The selected network policy provider.
  2139. //
  2140. // Possible values:
  2141. // "PROVIDER_UNSPECIFIED" - Not set
  2142. // "CALICO" - Tigera (Calico Felix).
  2143. Provider string `json:"provider,omitempty"`
  2144. // ForceSendFields is a list of field names (e.g. "Enabled") to
  2145. // unconditionally include in API requests. By default, fields with
  2146. // empty values are omitted from API requests. However, any non-pointer,
  2147. // non-interface field appearing in ForceSendFields will be sent to the
  2148. // server regardless of whether the field is empty or not. This may be
  2149. // used to include empty fields in Patch requests.
  2150. ForceSendFields []string `json:"-"`
  2151. // NullFields is a list of field names (e.g. "Enabled") to include in
  2152. // API requests with the JSON null value. By default, fields with empty
  2153. // values are omitted from API requests. However, any field with an
  2154. // empty value appearing in NullFields will be sent to the server as
  2155. // null. It is an error if a field in this list has a non-empty value.
  2156. // This may be used to include null fields in Patch requests.
  2157. NullFields []string `json:"-"`
  2158. }
  2159. func (s *NetworkPolicy) MarshalJSON() ([]byte, error) {
  2160. type NoMethod NetworkPolicy
  2161. raw := NoMethod(*s)
  2162. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2163. }
  2164. // NetworkPolicyConfig: Configuration for NetworkPolicy. This only
  2165. // tracks whether the addon
  2166. // is enabled or not on the Master, it does not track whether network
  2167. // policy
  2168. // is enabled for the nodes.
  2169. type NetworkPolicyConfig struct {
  2170. // Disabled: Whether NetworkPolicy is enabled for this cluster.
  2171. Disabled bool `json:"disabled,omitempty"`
  2172. // ForceSendFields is a list of field names (e.g. "Disabled") to
  2173. // unconditionally include in API requests. By default, fields with
  2174. // empty values are omitted from API requests. However, any non-pointer,
  2175. // non-interface field appearing in ForceSendFields will be sent to the
  2176. // server regardless of whether the field is empty or not. This may be
  2177. // used to include empty fields in Patch requests.
  2178. ForceSendFields []string `json:"-"`
  2179. // NullFields is a list of field names (e.g. "Disabled") to include in
  2180. // API requests with the JSON null value. By default, fields with empty
  2181. // values are omitted from API requests. However, any field with an
  2182. // empty value appearing in NullFields will be sent to the server as
  2183. // null. It is an error if a field in this list has a non-empty value.
  2184. // This may be used to include null fields in Patch requests.
  2185. NullFields []string `json:"-"`
  2186. }
  2187. func (s *NetworkPolicyConfig) MarshalJSON() ([]byte, error) {
  2188. type NoMethod NetworkPolicyConfig
  2189. raw := NoMethod(*s)
  2190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2191. }
  2192. // NodeConfig: Parameters that describe the nodes in a cluster.
  2193. type NodeConfig struct {
  2194. // Accelerators: A list of hardware accelerators to be attached to each
  2195. // node.
  2196. // See https://cloud.google.com/compute/docs/gpus for more information
  2197. // about
  2198. // support for GPUs.
  2199. Accelerators []*AcceleratorConfig `json:"accelerators,omitempty"`
  2200. // DiskSizeGb: Size of the disk attached to each node, specified in
  2201. // GB.
  2202. // The smallest allowed disk size is 10GB.
  2203. //
  2204. // If unspecified, the default disk size is 100GB.
  2205. DiskSizeGb int64 `json:"diskSizeGb,omitempty"`
  2206. // DiskType: Type of the disk attached to each node (e.g. 'pd-standard'
  2207. // or 'pd-ssd')
  2208. //
  2209. // If unspecified, the default disk type is 'pd-standard'
  2210. DiskType string `json:"diskType,omitempty"`
  2211. // ImageType: The image type to use for this node. Note that for a given
  2212. // image type,
  2213. // the latest version of it will be used.
  2214. ImageType string `json:"imageType,omitempty"`
  2215. // Labels: The map of Kubernetes labels (key/value pairs) to be applied
  2216. // to each node.
  2217. // These will added in addition to any default label(s) that
  2218. // Kubernetes may apply to the node.
  2219. // In case of conflict in label keys, the applied set may differ
  2220. // depending on
  2221. // the Kubernetes version -- it's best to assume the behavior is
  2222. // undefined
  2223. // and conflicts should be avoided.
  2224. // For more information, including usage and the valid values,
  2225. // see:
  2226. // https://kubernetes.io/docs/concepts/overview/working-with-objects
  2227. // /labels/
  2228. Labels map[string]string `json:"labels,omitempty"`
  2229. // LocalSsdCount: The number of local SSD disks to be attached to the
  2230. // node.
  2231. //
  2232. // The limit for this value is dependant upon the maximum number
  2233. // of
  2234. // disks available on a machine per zone.
  2235. // See:
  2236. // https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_l
  2237. // imits
  2238. // for more information.
  2239. LocalSsdCount int64 `json:"localSsdCount,omitempty"`
  2240. // MachineType: The name of a Google Compute Engine
  2241. // [machine
  2242. // type](/compute/docs/machine-types) (e.g.
  2243. // `n1-standard-1`).
  2244. //
  2245. // If unspecified, the default machine type is
  2246. // `n1-standard-1`.
  2247. MachineType string `json:"machineType,omitempty"`
  2248. // Metadata: The metadata key/value pairs assigned to instances in the
  2249. // cluster.
  2250. //
  2251. // Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128
  2252. // bytes
  2253. // in length. These are reflected as part of a URL in the metadata
  2254. // server.
  2255. // Additionally, to avoid ambiguity, keys must not conflict with any
  2256. // other
  2257. // metadata keys for the project or be one of the reserved keys:
  2258. // "cluster-location"
  2259. // "cluster-name"
  2260. // "cluster-uid"
  2261. // "configure-sh"
  2262. // "containerd-configure-sh"
  2263. // "enable-oslogin"
  2264. // "gci-ensure-gke-docker"
  2265. // "gci-update-strategy"
  2266. // "instance-template"
  2267. // "kube-env"
  2268. // "startup-script"
  2269. // "user-data"
  2270. //
  2271. // Values are free-form strings, and only have meaning as interpreted
  2272. // by
  2273. // the image running in the instance. The only restriction placed on
  2274. // them is
  2275. // that each value's size must be less than or equal to 32 KB.
  2276. //
  2277. // The total size of all keys and values must be less than 512 KB.
  2278. Metadata map[string]string `json:"metadata,omitempty"`
  2279. // MinCpuPlatform: Minimum CPU platform to be used by this instance. The
  2280. // instance may be
  2281. // scheduled on the specified or newer CPU platform. Applicable values
  2282. // are the
  2283. // friendly names of CPU platforms, such as
  2284. // <code>minCpuPlatform: &quot;Intel Haswell&quot;</code>
  2285. // or
  2286. // <code>minCpuPlatform: &quot;Intel Sandy Bridge&quot;</code>. For
  2287. // more
  2288. // information, read [how to specify min
  2289. // CPU
  2290. // platform](https://cloud.google.com/compute/docs/instances/specify-
  2291. // min-cpu-platform)
  2292. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  2293. // OauthScopes: The set of Google API scopes to be made available on all
  2294. // of the
  2295. // node VMs under the "default" service account.
  2296. //
  2297. // The following scopes are recommended, but not required, and by
  2298. // default are
  2299. // not included:
  2300. //
  2301. // * `https://www.googleapis.com/auth/compute` is required for
  2302. // mounting
  2303. // persistent storage on your nodes.
  2304. // * `https://www.googleapis.com/auth/devstorage.read_only` is required
  2305. // for
  2306. // communicating with **gcr.io**
  2307. // (the [Google Container Registry](/container-registry/)).
  2308. //
  2309. // If unspecified, no scopes are added, unless Cloud Logging or
  2310. // Cloud
  2311. // Monitoring are enabled, in which case their required scopes will be
  2312. // added.
  2313. OauthScopes []string `json:"oauthScopes,omitempty"`
  2314. // Preemptible: Whether the nodes are created as preemptible VM
  2315. // instances.
  2316. // See:
  2317. // https://cloud.google.com/compute/docs/instances/preemptible for
  2318. // more
  2319. // inforamtion about preemptible VM instances.
  2320. Preemptible bool `json:"preemptible,omitempty"`
  2321. // ServiceAccount: The Google Cloud Platform Service Account to be used
  2322. // by the node VMs. If
  2323. // no Service Account is specified, the "default" service account is
  2324. // used.
  2325. ServiceAccount string `json:"serviceAccount,omitempty"`
  2326. // Tags: The list of instance tags applied to all nodes. Tags are used
  2327. // to identify
  2328. // valid sources or targets for network firewalls and are specified
  2329. // by
  2330. // the client during cluster or node pool creation. Each tag within the
  2331. // list
  2332. // must comply with RFC1035.
  2333. Tags []string `json:"tags,omitempty"`
  2334. // Taints: List of kubernetes taints to be applied to each node.
  2335. //
  2336. // For more information, including usage and the valid values,
  2337. // see:
  2338. // https://kubernetes.io/docs/concepts/configuration/taint-and-toler
  2339. // ation/
  2340. Taints []*NodeTaint `json:"taints,omitempty"`
  2341. // WorkloadMetadataConfig: The workload metadata configuration for this
  2342. // node.
  2343. WorkloadMetadataConfig *WorkloadMetadataConfig `json:"workloadMetadataConfig,omitempty"`
  2344. // ForceSendFields is a list of field names (e.g. "Accelerators") to
  2345. // unconditionally include in API requests. By default, fields with
  2346. // empty values are omitted from API requests. However, any non-pointer,
  2347. // non-interface field appearing in ForceSendFields will be sent to the
  2348. // server regardless of whether the field is empty or not. This may be
  2349. // used to include empty fields in Patch requests.
  2350. ForceSendFields []string `json:"-"`
  2351. // NullFields is a list of field names (e.g. "Accelerators") to include
  2352. // in API requests with the JSON null value. By default, fields with
  2353. // empty values are omitted from API requests. However, any field with
  2354. // an empty value appearing in NullFields will be sent to the server as
  2355. // null. It is an error if a field in this list has a non-empty value.
  2356. // This may be used to include null fields in Patch requests.
  2357. NullFields []string `json:"-"`
  2358. }
  2359. func (s *NodeConfig) MarshalJSON() ([]byte, error) {
  2360. type NoMethod NodeConfig
  2361. raw := NoMethod(*s)
  2362. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2363. }
  2364. // NodeManagement: NodeManagement defines the set of node management
  2365. // services turned on for the
  2366. // node pool.
  2367. type NodeManagement struct {
  2368. // AutoRepair: Whether the nodes will be automatically repaired.
  2369. AutoRepair bool `json:"autoRepair,omitempty"`
  2370. // AutoUpgrade: Whether the nodes will be automatically upgraded.
  2371. AutoUpgrade bool `json:"autoUpgrade,omitempty"`
  2372. // UpgradeOptions: Specifies the Auto Upgrade knobs for the node pool.
  2373. UpgradeOptions *AutoUpgradeOptions `json:"upgradeOptions,omitempty"`
  2374. // ForceSendFields is a list of field names (e.g. "AutoRepair") to
  2375. // unconditionally include in API requests. By default, fields with
  2376. // empty values are omitted from API requests. However, any non-pointer,
  2377. // non-interface field appearing in ForceSendFields will be sent to the
  2378. // server regardless of whether the field is empty or not. This may be
  2379. // used to include empty fields in Patch requests.
  2380. ForceSendFields []string `json:"-"`
  2381. // NullFields is a list of field names (e.g. "AutoRepair") to include in
  2382. // API requests with the JSON null value. By default, fields with empty
  2383. // values are omitted from API requests. However, any field with an
  2384. // empty value appearing in NullFields will be sent to the server as
  2385. // null. It is an error if a field in this list has a non-empty value.
  2386. // This may be used to include null fields in Patch requests.
  2387. NullFields []string `json:"-"`
  2388. }
  2389. func (s *NodeManagement) MarshalJSON() ([]byte, error) {
  2390. type NoMethod NodeManagement
  2391. raw := NoMethod(*s)
  2392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2393. }
  2394. // NodePool: NodePool contains the name and configuration for a
  2395. // cluster's node pool.
  2396. // Node pools are a set of nodes (i.e. VM's), with a common
  2397. // configuration and
  2398. // specification, under the control of the cluster master. They may have
  2399. // a set
  2400. // of Kubernetes labels applied to them, which may be used to reference
  2401. // them
  2402. // during pod scheduling. They may also be resized up or down, to
  2403. // accommodate
  2404. // the workload.
  2405. type NodePool struct {
  2406. // Autoscaling: Autoscaler configuration for this NodePool. Autoscaler
  2407. // is enabled
  2408. // only if a valid configuration is present.
  2409. Autoscaling *NodePoolAutoscaling `json:"autoscaling,omitempty"`
  2410. // Conditions: Which conditions caused the current node pool state.
  2411. Conditions []*StatusCondition `json:"conditions,omitempty"`
  2412. // Config: The node configuration of the pool.
  2413. Config *NodeConfig `json:"config,omitempty"`
  2414. // InitialNodeCount: The initial node count for the pool. You must
  2415. // ensure that your
  2416. // Compute Engine <a href="/compute/docs/resource-quotas">resource
  2417. // quota</a>
  2418. // is sufficient for this number of instances. You must also have
  2419. // available
  2420. // firewall and routes quota.
  2421. InitialNodeCount int64 `json:"initialNodeCount,omitempty"`
  2422. // InstanceGroupUrls: [Output only] The resource URLs of the [managed
  2423. // instance
  2424. // groups](/compute/docs/instance-groups/creating-groups-of-mana
  2425. // ged-instances)
  2426. // associated with this node pool.
  2427. InstanceGroupUrls []string `json:"instanceGroupUrls,omitempty"`
  2428. // Management: NodeManagement configuration for this NodePool.
  2429. Management *NodeManagement `json:"management,omitempty"`
  2430. // MaxPodsConstraint: The constraint on the maximum number of pods that
  2431. // can be run
  2432. // simultaneously on a node in the node pool.
  2433. MaxPodsConstraint *MaxPodsConstraint `json:"maxPodsConstraint,omitempty"`
  2434. // Name: The name of the node pool.
  2435. Name string `json:"name,omitempty"`
  2436. // SelfLink: [Output only] Server-defined URL for the resource.
  2437. SelfLink string `json:"selfLink,omitempty"`
  2438. // Status: [Output only] The status of the nodes in this pool instance.
  2439. //
  2440. // Possible values:
  2441. // "STATUS_UNSPECIFIED" - Not set.
  2442. // "PROVISIONING" - The PROVISIONING state indicates the node pool is
  2443. // being created.
  2444. // "RUNNING" - The RUNNING state indicates the node pool has been
  2445. // created
  2446. // and is fully usable.
  2447. // "RUNNING_WITH_ERROR" - The RUNNING_WITH_ERROR state indicates the
  2448. // node pool has been created
  2449. // and is partially usable. Some error state has occurred and
  2450. // some
  2451. // functionality may be impaired. Customer may need to reissue a
  2452. // request
  2453. // or trigger a new update.
  2454. // "RECONCILING" - The RECONCILING state indicates that some work is
  2455. // actively being done on
  2456. // the node pool, such as upgrading node software. Details can
  2457. // be found in the `statusMessage` field.
  2458. // "STOPPING" - The STOPPING state indicates the node pool is being
  2459. // deleted.
  2460. // "ERROR" - The ERROR state indicates the node pool may be unusable.
  2461. // Details
  2462. // can be found in the `statusMessage` field.
  2463. Status string `json:"status,omitempty"`
  2464. // StatusMessage: [Output only] Additional information about the current
  2465. // status of this
  2466. // node pool instance, if available.
  2467. StatusMessage string `json:"statusMessage,omitempty"`
  2468. // Version: The version of the Kubernetes of this node.
  2469. Version string `json:"version,omitempty"`
  2470. // ServerResponse contains the HTTP response code and headers from the
  2471. // server.
  2472. googleapi.ServerResponse `json:"-"`
  2473. // ForceSendFields is a list of field names (e.g. "Autoscaling") to
  2474. // unconditionally include in API requests. By default, fields with
  2475. // empty values are omitted from API requests. However, any non-pointer,
  2476. // non-interface field appearing in ForceSendFields will be sent to the
  2477. // server regardless of whether the field is empty or not. This may be
  2478. // used to include empty fields in Patch requests.
  2479. ForceSendFields []string `json:"-"`
  2480. // NullFields is a list of field names (e.g. "Autoscaling") to include
  2481. // in API requests with the JSON null value. By default, fields with
  2482. // empty values are omitted from API requests. However, any field with
  2483. // an empty value appearing in NullFields will be sent to the server as
  2484. // null. It is an error if a field in this list has a non-empty value.
  2485. // This may be used to include null fields in Patch requests.
  2486. NullFields []string `json:"-"`
  2487. }
  2488. func (s *NodePool) MarshalJSON() ([]byte, error) {
  2489. type NoMethod NodePool
  2490. raw := NoMethod(*s)
  2491. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2492. }
  2493. // NodePoolAutoscaling: NodePoolAutoscaling contains information
  2494. // required by cluster autoscaler to
  2495. // adjust the size of the node pool to the current cluster usage.
  2496. type NodePoolAutoscaling struct {
  2497. // Autoprovisioned: Can this node pool be deleted automatically.
  2498. Autoprovisioned bool `json:"autoprovisioned,omitempty"`
  2499. // Enabled: Is autoscaling enabled for this node pool.
  2500. Enabled bool `json:"enabled,omitempty"`
  2501. // MaxNodeCount: Maximum number of nodes in the NodePool. Must be >=
  2502. // min_node_count. There
  2503. // has to enough quota to scale up the cluster.
  2504. MaxNodeCount int64 `json:"maxNodeCount,omitempty"`
  2505. // MinNodeCount: Minimum number of nodes in the NodePool. Must be >= 1
  2506. // and <=
  2507. // max_node_count.
  2508. MinNodeCount int64 `json:"minNodeCount,omitempty"`
  2509. // ForceSendFields is a list of field names (e.g. "Autoprovisioned") to
  2510. // unconditionally include in API requests. By default, fields with
  2511. // empty values are omitted from API requests. However, any non-pointer,
  2512. // non-interface field appearing in ForceSendFields will be sent to the
  2513. // server regardless of whether the field is empty or not. This may be
  2514. // used to include empty fields in Patch requests.
  2515. ForceSendFields []string `json:"-"`
  2516. // NullFields is a list of field names (e.g. "Autoprovisioned") to
  2517. // include in API requests with the JSON null value. By default, fields
  2518. // with empty values are omitted from API requests. However, any field
  2519. // with an empty value appearing in NullFields will be sent to the
  2520. // server as null. It is an error if a field in this list has a
  2521. // non-empty value. This may be used to include null fields in Patch
  2522. // requests.
  2523. NullFields []string `json:"-"`
  2524. }
  2525. func (s *NodePoolAutoscaling) MarshalJSON() ([]byte, error) {
  2526. type NoMethod NodePoolAutoscaling
  2527. raw := NoMethod(*s)
  2528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2529. }
  2530. // NodeTaint: Kubernetes taint is comprised of three fields: key, value,
  2531. // and effect. Effect
  2532. // can only be one of three types: NoSchedule, PreferNoSchedule or
  2533. // NoExecute.
  2534. //
  2535. // For more information, including usage and the valid values,
  2536. // see:
  2537. // https://kubernetes.io/docs/concepts/configuration/taint-and-toler
  2538. // ation/
  2539. type NodeTaint struct {
  2540. // Effect: Effect for taint.
  2541. //
  2542. // Possible values:
  2543. // "EFFECT_UNSPECIFIED" - Not set
  2544. // "NO_SCHEDULE" - NoSchedule
  2545. // "PREFER_NO_SCHEDULE" - PreferNoSchedule
  2546. // "NO_EXECUTE" - NoExecute
  2547. Effect string `json:"effect,omitempty"`
  2548. // Key: Key for taint.
  2549. Key string `json:"key,omitempty"`
  2550. // Value: Value for taint.
  2551. Value string `json:"value,omitempty"`
  2552. // ForceSendFields is a list of field names (e.g. "Effect") to
  2553. // unconditionally include in API requests. By default, fields with
  2554. // empty values are omitted from API requests. However, any non-pointer,
  2555. // non-interface field appearing in ForceSendFields will be sent to the
  2556. // server regardless of whether the field is empty or not. This may be
  2557. // used to include empty fields in Patch requests.
  2558. ForceSendFields []string `json:"-"`
  2559. // NullFields is a list of field names (e.g. "Effect") to include in API
  2560. // requests with the JSON null value. By default, fields with empty
  2561. // values are omitted from API requests. However, any field with an
  2562. // empty value appearing in NullFields will be sent to the server as
  2563. // null. It is an error if a field in this list has a non-empty value.
  2564. // This may be used to include null fields in Patch requests.
  2565. NullFields []string `json:"-"`
  2566. }
  2567. func (s *NodeTaint) MarshalJSON() ([]byte, error) {
  2568. type NoMethod NodeTaint
  2569. raw := NoMethod(*s)
  2570. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2571. }
  2572. // Operation: This operation resource represents operations that may
  2573. // have happened or are
  2574. // happening on the cluster. All fields are output only.
  2575. type Operation struct {
  2576. // ClusterConditions: Which conditions caused the current cluster state.
  2577. ClusterConditions []*StatusCondition `json:"clusterConditions,omitempty"`
  2578. // Detail: Detailed operation progress, if available.
  2579. Detail string `json:"detail,omitempty"`
  2580. // EndTime: [Output only] The time the operation completed,
  2581. // in
  2582. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  2583. EndTime string `json:"endTime,omitempty"`
  2584. // Location: [Output only] The name of the Google Compute
  2585. // Engine
  2586. // [zone](/compute/docs/regions-zones/regions-zones#available)
  2587. // or
  2588. // [region](/compute/docs/regions-zones/regions-zones#available) in
  2589. // which
  2590. // the cluster resides.
  2591. Location string `json:"location,omitempty"`
  2592. // Name: The server-assigned ID for the operation.
  2593. Name string `json:"name,omitempty"`
  2594. // NodepoolConditions: Which conditions caused the current node pool
  2595. // state.
  2596. NodepoolConditions []*StatusCondition `json:"nodepoolConditions,omitempty"`
  2597. // OperationType: The operation type.
  2598. //
  2599. // Possible values:
  2600. // "TYPE_UNSPECIFIED" - Not set.
  2601. // "CREATE_CLUSTER" - Cluster create.
  2602. // "DELETE_CLUSTER" - Cluster delete.
  2603. // "UPGRADE_MASTER" - A master upgrade.
  2604. // "UPGRADE_NODES" - A node upgrade.
  2605. // "REPAIR_CLUSTER" - Cluster repair.
  2606. // "UPDATE_CLUSTER" - Cluster update.
  2607. // "CREATE_NODE_POOL" - Node pool create.
  2608. // "DELETE_NODE_POOL" - Node pool delete.
  2609. // "SET_NODE_POOL_MANAGEMENT" - Set node pool management.
  2610. // "AUTO_REPAIR_NODES" - Automatic node pool repair.
  2611. // "AUTO_UPGRADE_NODES" - Automatic node upgrade.
  2612. // "SET_LABELS" - Set labels.
  2613. // "SET_MASTER_AUTH" - Set/generate master auth materials
  2614. // "SET_NODE_POOL_SIZE" - Set node pool size.
  2615. // "SET_NETWORK_POLICY" - Updates network policy for a cluster.
  2616. // "SET_MAINTENANCE_POLICY" - Set the maintenance policy.
  2617. OperationType string `json:"operationType,omitempty"`
  2618. // Progress: [Output only] Progress information for an operation.
  2619. Progress *OperationProgress `json:"progress,omitempty"`
  2620. // SelfLink: Server-defined URL for the resource.
  2621. SelfLink string `json:"selfLink,omitempty"`
  2622. // StartTime: [Output only] The time the operation started,
  2623. // in
  2624. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  2625. StartTime string `json:"startTime,omitempty"`
  2626. // Status: The current status of the operation.
  2627. //
  2628. // Possible values:
  2629. // "STATUS_UNSPECIFIED" - Not set.
  2630. // "PENDING" - The operation has been created.
  2631. // "RUNNING" - The operation is currently running.
  2632. // "DONE" - The operation is done, either cancelled or completed.
  2633. // "ABORTING" - The operation is aborting.
  2634. Status string `json:"status,omitempty"`
  2635. // StatusMessage: If an error has occurred, a textual description of the
  2636. // error.
  2637. StatusMessage string `json:"statusMessage,omitempty"`
  2638. // TargetLink: Server-defined URL for the target of the operation.
  2639. TargetLink string `json:"targetLink,omitempty"`
  2640. // Zone: The name of the Google Compute
  2641. // Engine
  2642. // [zone](/compute/docs/zones#available) in which the operation
  2643. // is taking place.
  2644. // This field is deprecated, use location instead.
  2645. Zone string `json:"zone,omitempty"`
  2646. // ServerResponse contains the HTTP response code and headers from the
  2647. // server.
  2648. googleapi.ServerResponse `json:"-"`
  2649. // ForceSendFields is a list of field names (e.g. "ClusterConditions")
  2650. // to unconditionally include in API requests. By default, fields with
  2651. // empty values are omitted from API requests. However, any non-pointer,
  2652. // non-interface field appearing in ForceSendFields will be sent to the
  2653. // server regardless of whether the field is empty or not. This may be
  2654. // used to include empty fields in Patch requests.
  2655. ForceSendFields []string `json:"-"`
  2656. // NullFields is a list of field names (e.g. "ClusterConditions") to
  2657. // include in API requests with the JSON null value. By default, fields
  2658. // with empty values are omitted from API requests. However, any field
  2659. // with an empty value appearing in NullFields will be sent to the
  2660. // server as null. It is an error if a field in this list has a
  2661. // non-empty value. This may be used to include null fields in Patch
  2662. // requests.
  2663. NullFields []string `json:"-"`
  2664. }
  2665. func (s *Operation) MarshalJSON() ([]byte, error) {
  2666. type NoMethod Operation
  2667. raw := NoMethod(*s)
  2668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2669. }
  2670. // OperationProgress: Information about operation (or operation stage)
  2671. // progress.
  2672. type OperationProgress struct {
  2673. // Metrics: Progress metric bundle, for example:
  2674. // metrics: [{name: "nodes done", int_value: 15},
  2675. // {name: "nodes total", int_value: 32}]
  2676. // or
  2677. // metrics: [{name: "progress", double_value: 0.56},
  2678. // {name: "progress scale", double_value: 1.0}]
  2679. Metrics []*Metric `json:"metrics,omitempty"`
  2680. // Name: A non-parameterized string describing an operation stage.
  2681. // Unset for single-stage operations.
  2682. Name string `json:"name,omitempty"`
  2683. // Stages: Substages of an operation or a stage.
  2684. Stages []*OperationProgress `json:"stages,omitempty"`
  2685. // Status: Status of an operation stage.
  2686. // Unset for single-stage operations.
  2687. //
  2688. // Possible values:
  2689. // "STATUS_UNSPECIFIED" - Not set.
  2690. // "PENDING" - The operation has been created.
  2691. // "RUNNING" - The operation is currently running.
  2692. // "DONE" - The operation is done, either cancelled or completed.
  2693. // "ABORTING" - The operation is aborting.
  2694. Status string `json:"status,omitempty"`
  2695. // ForceSendFields is a list of field names (e.g. "Metrics") to
  2696. // unconditionally include in API requests. By default, fields with
  2697. // empty values are omitted from API requests. However, any non-pointer,
  2698. // non-interface field appearing in ForceSendFields will be sent to the
  2699. // server regardless of whether the field is empty or not. This may be
  2700. // used to include empty fields in Patch requests.
  2701. ForceSendFields []string `json:"-"`
  2702. // NullFields is a list of field names (e.g. "Metrics") to include in
  2703. // API requests with the JSON null value. By default, fields with empty
  2704. // values are omitted from API requests. However, any field with an
  2705. // empty value appearing in NullFields will be sent to the server as
  2706. // null. It is an error if a field in this list has a non-empty value.
  2707. // This may be used to include null fields in Patch requests.
  2708. NullFields []string `json:"-"`
  2709. }
  2710. func (s *OperationProgress) MarshalJSON() ([]byte, error) {
  2711. type NoMethod OperationProgress
  2712. raw := NoMethod(*s)
  2713. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2714. }
  2715. // PodSecurityPolicyConfig: Configuration for the PodSecurityPolicy
  2716. // feature.
  2717. type PodSecurityPolicyConfig struct {
  2718. // Enabled: Enable the PodSecurityPolicy controller for this cluster. If
  2719. // enabled, pods
  2720. // must be valid under a PodSecurityPolicy to be created.
  2721. Enabled bool `json:"enabled,omitempty"`
  2722. // ForceSendFields is a list of field names (e.g. "Enabled") to
  2723. // unconditionally include in API requests. By default, fields with
  2724. // empty values are omitted from API requests. However, any non-pointer,
  2725. // non-interface field appearing in ForceSendFields will be sent to the
  2726. // server regardless of whether the field is empty or not. This may be
  2727. // used to include empty fields in Patch requests.
  2728. ForceSendFields []string `json:"-"`
  2729. // NullFields is a list of field names (e.g. "Enabled") to include in
  2730. // API requests with the JSON null value. By default, fields with empty
  2731. // values are omitted from API requests. However, any field with an
  2732. // empty value appearing in NullFields will be sent to the server as
  2733. // null. It is an error if a field in this list has a non-empty value.
  2734. // This may be used to include null fields in Patch requests.
  2735. NullFields []string `json:"-"`
  2736. }
  2737. func (s *PodSecurityPolicyConfig) MarshalJSON() ([]byte, error) {
  2738. type NoMethod PodSecurityPolicyConfig
  2739. raw := NoMethod(*s)
  2740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2741. }
  2742. // PrivateClusterConfig: Configuration options for private clusters.
  2743. type PrivateClusterConfig struct {
  2744. // EnablePrivateEndpoint: Whether the master's internal IP address is
  2745. // used as the cluster endpoint.
  2746. EnablePrivateEndpoint bool `json:"enablePrivateEndpoint,omitempty"`
  2747. // EnablePrivateNodes: Whether nodes have internal IP addresses only. If
  2748. // enabled, all nodes are
  2749. // given only RFC 1918 private addresses and communicate with the master
  2750. // via
  2751. // private networking.
  2752. EnablePrivateNodes bool `json:"enablePrivateNodes,omitempty"`
  2753. // MasterIpv4CidrBlock: The IP range in CIDR notation to use for the
  2754. // hosted master network. This
  2755. // range will be used for assigning internal IP addresses to the master
  2756. // or
  2757. // set of masters, as well as the ILB VIP. This range must not overlap
  2758. // with
  2759. // any other ranges in use within the cluster's network.
  2760. MasterIpv4CidrBlock string `json:"masterIpv4CidrBlock,omitempty"`
  2761. // PrivateEndpoint: Output only. The internal IP address of this
  2762. // cluster's master endpoint.
  2763. PrivateEndpoint string `json:"privateEndpoint,omitempty"`
  2764. // PublicEndpoint: Output only. The external IP address of this
  2765. // cluster's master endpoint.
  2766. PublicEndpoint string `json:"publicEndpoint,omitempty"`
  2767. // ForceSendFields is a list of field names (e.g.
  2768. // "EnablePrivateEndpoint") to unconditionally include in API requests.
  2769. // By default, fields with empty values are omitted from API requests.
  2770. // However, any non-pointer, non-interface field appearing in
  2771. // ForceSendFields will be sent to the server regardless of whether the
  2772. // field is empty or not. This may be used to include empty fields in
  2773. // Patch requests.
  2774. ForceSendFields []string `json:"-"`
  2775. // NullFields is a list of field names (e.g. "EnablePrivateEndpoint") to
  2776. // include in API requests with the JSON null value. By default, fields
  2777. // with empty values are omitted from API requests. However, any field
  2778. // with an empty value appearing in NullFields will be sent to the
  2779. // server as null. It is an error if a field in this list has a
  2780. // non-empty value. This may be used to include null fields in Patch
  2781. // requests.
  2782. NullFields []string `json:"-"`
  2783. }
  2784. func (s *PrivateClusterConfig) MarshalJSON() ([]byte, error) {
  2785. type NoMethod PrivateClusterConfig
  2786. raw := NoMethod(*s)
  2787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2788. }
  2789. // ResourceLimit: Contains information about amount of some resource in
  2790. // the cluster.
  2791. // For memory, value should be in GB.
  2792. type ResourceLimit struct {
  2793. // Maximum: Maximum amount of the resource in the cluster.
  2794. Maximum int64 `json:"maximum,omitempty,string"`
  2795. // Minimum: Minimum amount of the resource in the cluster.
  2796. Minimum int64 `json:"minimum,omitempty,string"`
  2797. // ResourceType: Resource name "cpu", "memory" or gpu-specific string.
  2798. ResourceType string `json:"resourceType,omitempty"`
  2799. // ForceSendFields is a list of field names (e.g. "Maximum") to
  2800. // unconditionally include in API requests. By default, fields with
  2801. // empty values are omitted from API requests. However, any non-pointer,
  2802. // non-interface field appearing in ForceSendFields will be sent to the
  2803. // server regardless of whether the field is empty or not. This may be
  2804. // used to include empty fields in Patch requests.
  2805. ForceSendFields []string `json:"-"`
  2806. // NullFields is a list of field names (e.g. "Maximum") to include in
  2807. // API requests with the JSON null value. By default, fields with empty
  2808. // values are omitted from API requests. However, any field with an
  2809. // empty value appearing in NullFields will be sent to the server as
  2810. // null. It is an error if a field in this list has a non-empty value.
  2811. // This may be used to include null fields in Patch requests.
  2812. NullFields []string `json:"-"`
  2813. }
  2814. func (s *ResourceLimit) MarshalJSON() ([]byte, error) {
  2815. type NoMethod ResourceLimit
  2816. raw := NoMethod(*s)
  2817. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2818. }
  2819. // ResourceUsageExportConfig: Configuration for exporting cluster
  2820. // resource usages.
  2821. type ResourceUsageExportConfig struct {
  2822. // BigqueryDestination: Configuration to use BigQuery as usage export
  2823. // destination.
  2824. BigqueryDestination *BigQueryDestination `json:"bigqueryDestination,omitempty"`
  2825. // EnableNetworkEgressMetering: Whether to enable network egress
  2826. // metering for this cluster. If enabled, a
  2827. // daemonset will be created in the cluster to meter network egress
  2828. // traffic.
  2829. EnableNetworkEgressMetering bool `json:"enableNetworkEgressMetering,omitempty"`
  2830. // ForceSendFields is a list of field names (e.g. "BigqueryDestination")
  2831. // to unconditionally include in API requests. By default, fields with
  2832. // empty values are omitted from API requests. However, any non-pointer,
  2833. // non-interface field appearing in ForceSendFields will be sent to the
  2834. // server regardless of whether the field is empty or not. This may be
  2835. // used to include empty fields in Patch requests.
  2836. ForceSendFields []string `json:"-"`
  2837. // NullFields is a list of field names (e.g. "BigqueryDestination") to
  2838. // include in API requests with the JSON null value. By default, fields
  2839. // with empty values are omitted from API requests. However, any field
  2840. // with an empty value appearing in NullFields will be sent to the
  2841. // server as null. It is an error if a field in this list has a
  2842. // non-empty value. This may be used to include null fields in Patch
  2843. // requests.
  2844. NullFields []string `json:"-"`
  2845. }
  2846. func (s *ResourceUsageExportConfig) MarshalJSON() ([]byte, error) {
  2847. type NoMethod ResourceUsageExportConfig
  2848. raw := NoMethod(*s)
  2849. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2850. }
  2851. // RollbackNodePoolUpgradeRequest: RollbackNodePoolUpgradeRequest
  2852. // rollbacks the previously Aborted or Failed
  2853. // NodePool upgrade. This will be an no-op if the last upgrade
  2854. // successfully
  2855. // completed.
  2856. type RollbackNodePoolUpgradeRequest struct {
  2857. // ClusterId: Deprecated. The name of the cluster to rollback.
  2858. // This field has been deprecated and replaced by the name field.
  2859. ClusterId string `json:"clusterId,omitempty"`
  2860. // Name: The name (project, location, cluster, node pool id) of the node
  2861. // poll to
  2862. // rollback upgrade.
  2863. // Specified in the format
  2864. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2865. Name string `json:"name,omitempty"`
  2866. // NodePoolId: Deprecated. The name of the node pool to rollback.
  2867. // This field has been deprecated and replaced by the name field.
  2868. NodePoolId string `json:"nodePoolId,omitempty"`
  2869. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2870. // project
  2871. // number](https://support.google.com/cloud/answer/6158840).
  2872. // This
  2873. // field has been deprecated and replaced by the name field.
  2874. ProjectId string `json:"projectId,omitempty"`
  2875. // Zone: Deprecated. The name of the Google Compute
  2876. // Engine
  2877. // [zone](/compute/docs/zones#available) in which the
  2878. // cluster
  2879. // resides.
  2880. // This field has been deprecated and replaced by the name field.
  2881. Zone string `json:"zone,omitempty"`
  2882. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2883. // unconditionally include in API requests. By default, fields with
  2884. // empty values are omitted from API requests. However, any non-pointer,
  2885. // non-interface field appearing in ForceSendFields will be sent to the
  2886. // server regardless of whether the field is empty or not. This may be
  2887. // used to include empty fields in Patch requests.
  2888. ForceSendFields []string `json:"-"`
  2889. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2890. // API requests with the JSON null value. By default, fields with empty
  2891. // values are omitted from API requests. However, any field with an
  2892. // empty value appearing in NullFields will be sent to the server as
  2893. // null. It is an error if a field in this list has a non-empty value.
  2894. // This may be used to include null fields in Patch requests.
  2895. NullFields []string `json:"-"`
  2896. }
  2897. func (s *RollbackNodePoolUpgradeRequest) MarshalJSON() ([]byte, error) {
  2898. type NoMethod RollbackNodePoolUpgradeRequest
  2899. raw := NoMethod(*s)
  2900. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2901. }
  2902. // ServerConfig: Kubernetes Engine service configuration.
  2903. type ServerConfig struct {
  2904. // DefaultClusterVersion: Version of Kubernetes the service deploys by
  2905. // default.
  2906. DefaultClusterVersion string `json:"defaultClusterVersion,omitempty"`
  2907. // DefaultImageType: Default image type.
  2908. DefaultImageType string `json:"defaultImageType,omitempty"`
  2909. // ValidImageTypes: List of valid image types.
  2910. ValidImageTypes []string `json:"validImageTypes,omitempty"`
  2911. // ValidMasterVersions: List of valid master versions.
  2912. ValidMasterVersions []string `json:"validMasterVersions,omitempty"`
  2913. // ValidNodeVersions: List of valid node upgrade target versions.
  2914. ValidNodeVersions []string `json:"validNodeVersions,omitempty"`
  2915. // ServerResponse contains the HTTP response code and headers from the
  2916. // server.
  2917. googleapi.ServerResponse `json:"-"`
  2918. // ForceSendFields is a list of field names (e.g.
  2919. // "DefaultClusterVersion") to unconditionally include in API requests.
  2920. // By default, fields with empty values are omitted from API requests.
  2921. // However, any non-pointer, non-interface field appearing in
  2922. // ForceSendFields will be sent to the server regardless of whether the
  2923. // field is empty or not. This may be used to include empty fields in
  2924. // Patch requests.
  2925. ForceSendFields []string `json:"-"`
  2926. // NullFields is a list of field names (e.g. "DefaultClusterVersion") to
  2927. // include in API requests with the JSON null value. By default, fields
  2928. // with empty values are omitted from API requests. However, any field
  2929. // with an empty value appearing in NullFields will be sent to the
  2930. // server as null. It is an error if a field in this list has a
  2931. // non-empty value. This may be used to include null fields in Patch
  2932. // requests.
  2933. NullFields []string `json:"-"`
  2934. }
  2935. func (s *ServerConfig) MarshalJSON() ([]byte, error) {
  2936. type NoMethod ServerConfig
  2937. raw := NoMethod(*s)
  2938. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2939. }
  2940. // SetAddonsConfigRequest: SetAddonsRequest sets the addons associated
  2941. // with the cluster.
  2942. type SetAddonsConfigRequest struct {
  2943. // AddonsConfig: The desired configurations for the various addons
  2944. // available to run in the
  2945. // cluster.
  2946. AddonsConfig *AddonsConfig `json:"addonsConfig,omitempty"`
  2947. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2948. // This field has been deprecated and replaced by the name field.
  2949. ClusterId string `json:"clusterId,omitempty"`
  2950. // Name: The name (project, location, cluster) of the cluster to set
  2951. // addons.
  2952. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2953. Name string `json:"name,omitempty"`
  2954. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2955. // project
  2956. // number](https://support.google.com/cloud/answer/6158840).
  2957. // This
  2958. // field has been deprecated and replaced by the name field.
  2959. ProjectId string `json:"projectId,omitempty"`
  2960. // Zone: Deprecated. The name of the Google Compute
  2961. // Engine
  2962. // [zone](/compute/docs/zones#available) in which the
  2963. // cluster
  2964. // resides.
  2965. // This field has been deprecated and replaced by the name field.
  2966. Zone string `json:"zone,omitempty"`
  2967. // ForceSendFields is a list of field names (e.g. "AddonsConfig") to
  2968. // unconditionally include in API requests. By default, fields with
  2969. // empty values are omitted from API requests. However, any non-pointer,
  2970. // non-interface field appearing in ForceSendFields will be sent to the
  2971. // server regardless of whether the field is empty or not. This may be
  2972. // used to include empty fields in Patch requests.
  2973. ForceSendFields []string `json:"-"`
  2974. // NullFields is a list of field names (e.g. "AddonsConfig") to include
  2975. // in API requests with the JSON null value. By default, fields with
  2976. // empty values are omitted from API requests. However, any field with
  2977. // an empty value appearing in NullFields will be sent to the server as
  2978. // null. It is an error if a field in this list has a non-empty value.
  2979. // This may be used to include null fields in Patch requests.
  2980. NullFields []string `json:"-"`
  2981. }
  2982. func (s *SetAddonsConfigRequest) MarshalJSON() ([]byte, error) {
  2983. type NoMethod SetAddonsConfigRequest
  2984. raw := NoMethod(*s)
  2985. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2986. }
  2987. // SetLabelsRequest: SetLabelsRequest sets the Google Cloud Platform
  2988. // labels on a Google Container
  2989. // Engine cluster, which will in turn set them for Google Compute
  2990. // Engine
  2991. // resources used by that cluster
  2992. type SetLabelsRequest struct {
  2993. // ClusterId: Deprecated. The name of the cluster.
  2994. // This field has been deprecated and replaced by the name field.
  2995. ClusterId string `json:"clusterId,omitempty"`
  2996. // LabelFingerprint: The fingerprint of the previous set of labels for
  2997. // this resource,
  2998. // used to detect conflicts. The fingerprint is initially generated
  2999. // by
  3000. // Kubernetes Engine and changes after every request to modify or
  3001. // update
  3002. // labels. You must always provide an up-to-date fingerprint hash
  3003. // when
  3004. // updating or changing labels. Make a <code>get()</code> request to
  3005. // the
  3006. // resource to get the latest fingerprint.
  3007. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  3008. // Name: The name (project, location, cluster id) of the cluster to set
  3009. // labels.
  3010. // Specified in the format 'projects/*/locations/*/clusters/*'.
  3011. Name string `json:"name,omitempty"`
  3012. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3013. // project
  3014. // number](https://developers.google.com/console/help/new/#projec
  3015. // tnumber).
  3016. // This field has been deprecated and replaced by the name field.
  3017. ProjectId string `json:"projectId,omitempty"`
  3018. // ResourceLabels: The labels to set for that cluster.
  3019. ResourceLabels map[string]string `json:"resourceLabels,omitempty"`
  3020. // Zone: Deprecated. The name of the Google Compute
  3021. // Engine
  3022. // [zone](/compute/docs/zones#available) in which the
  3023. // cluster
  3024. // resides.
  3025. // This field has been deprecated and replaced by the name field.
  3026. Zone string `json:"zone,omitempty"`
  3027. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3028. // unconditionally include in API requests. By default, fields with
  3029. // empty values are omitted from API requests. However, any non-pointer,
  3030. // non-interface field appearing in ForceSendFields will be sent to the
  3031. // server regardless of whether the field is empty or not. This may be
  3032. // used to include empty fields in Patch requests.
  3033. ForceSendFields []string `json:"-"`
  3034. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3035. // API requests with the JSON null value. By default, fields with empty
  3036. // values are omitted from API requests. However, any field with an
  3037. // empty value appearing in NullFields will be sent to the server as
  3038. // null. It is an error if a field in this list has a non-empty value.
  3039. // This may be used to include null fields in Patch requests.
  3040. NullFields []string `json:"-"`
  3041. }
  3042. func (s *SetLabelsRequest) MarshalJSON() ([]byte, error) {
  3043. type NoMethod SetLabelsRequest
  3044. raw := NoMethod(*s)
  3045. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3046. }
  3047. // SetLegacyAbacRequest: SetLegacyAbacRequest enables or disables the
  3048. // ABAC authorization mechanism for
  3049. // a cluster.
  3050. type SetLegacyAbacRequest struct {
  3051. // ClusterId: Deprecated. The name of the cluster to update.
  3052. // This field has been deprecated and replaced by the name field.
  3053. ClusterId string `json:"clusterId,omitempty"`
  3054. // Enabled: Whether ABAC authorization will be enabled in the cluster.
  3055. Enabled bool `json:"enabled,omitempty"`
  3056. // Name: The name (project, location, cluster id) of the cluster to set
  3057. // legacy abac.
  3058. // Specified in the format 'projects/*/locations/*/clusters/*'.
  3059. Name string `json:"name,omitempty"`
  3060. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3061. // project
  3062. // number](https://support.google.com/cloud/answer/6158840).
  3063. // This
  3064. // field has been deprecated and replaced by the name field.
  3065. ProjectId string `json:"projectId,omitempty"`
  3066. // Zone: Deprecated. The name of the Google Compute
  3067. // Engine
  3068. // [zone](/compute/docs/zones#available) in which the
  3069. // cluster
  3070. // resides.
  3071. // This field has been deprecated and replaced by the name field.
  3072. Zone string `json:"zone,omitempty"`
  3073. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3074. // unconditionally include in API requests. By default, fields with
  3075. // empty values are omitted from API requests. However, any non-pointer,
  3076. // non-interface field appearing in ForceSendFields will be sent to the
  3077. // server regardless of whether the field is empty or not. This may be
  3078. // used to include empty fields in Patch requests.
  3079. ForceSendFields []string `json:"-"`
  3080. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3081. // API requests with the JSON null value. By default, fields with empty
  3082. // values are omitted from API requests. However, any field with an
  3083. // empty value appearing in NullFields will be sent to the server as
  3084. // null. It is an error if a field in this list has a non-empty value.
  3085. // This may be used to include null fields in Patch requests.
  3086. NullFields []string `json:"-"`
  3087. }
  3088. func (s *SetLegacyAbacRequest) MarshalJSON() ([]byte, error) {
  3089. type NoMethod SetLegacyAbacRequest
  3090. raw := NoMethod(*s)
  3091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3092. }
  3093. // SetLocationsRequest: SetLocationsRequest sets the locations of the
  3094. // cluster.
  3095. type SetLocationsRequest struct {
  3096. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3097. // This field has been deprecated and replaced by the name field.
  3098. ClusterId string `json:"clusterId,omitempty"`
  3099. // Locations: The desired list of Google Compute
  3100. // Engine
  3101. // [zones](/compute/docs/zones#available) in which the cluster's
  3102. // nodes
  3103. // should be located. Changing the locations a cluster is in will
  3104. // result
  3105. // in nodes being either created or removed from the cluster, depending
  3106. // on
  3107. // whether locations are being added or removed.
  3108. //
  3109. // This list must always include the cluster's primary zone.
  3110. Locations []string `json:"locations,omitempty"`
  3111. // Name: The name (project, location, cluster) of the cluster to set
  3112. // locations.
  3113. // Specified in the format 'projects/*/locations/*/clusters/*'.
  3114. Name string `json:"name,omitempty"`
  3115. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3116. // project
  3117. // number](https://support.google.com/cloud/answer/6158840).
  3118. // This
  3119. // field has been deprecated and replaced by the name field.
  3120. ProjectId string `json:"projectId,omitempty"`
  3121. // Zone: Deprecated. The name of the Google Compute
  3122. // Engine
  3123. // [zone](/compute/docs/zones#available) in which the
  3124. // cluster
  3125. // resides.
  3126. // This field has been deprecated and replaced by the name field.
  3127. Zone string `json:"zone,omitempty"`
  3128. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3129. // unconditionally include in API requests. By default, fields with
  3130. // empty values are omitted from API requests. However, any non-pointer,
  3131. // non-interface field appearing in ForceSendFields will be sent to the
  3132. // server regardless of whether the field is empty or not. This may be
  3133. // used to include empty fields in Patch requests.
  3134. ForceSendFields []string `json:"-"`
  3135. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3136. // API requests with the JSON null value. By default, fields with empty
  3137. // values are omitted from API requests. However, any field with an
  3138. // empty value appearing in NullFields will be sent to the server as
  3139. // null. It is an error if a field in this list has a non-empty value.
  3140. // This may be used to include null fields in Patch requests.
  3141. NullFields []string `json:"-"`
  3142. }
  3143. func (s *SetLocationsRequest) MarshalJSON() ([]byte, error) {
  3144. type NoMethod SetLocationsRequest
  3145. raw := NoMethod(*s)
  3146. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3147. }
  3148. // SetLoggingServiceRequest: SetLoggingServiceRequest sets the logging
  3149. // service of a cluster.
  3150. type SetLoggingServiceRequest struct {
  3151. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3152. // This field has been deprecated and replaced by the name field.
  3153. ClusterId string `json:"clusterId,omitempty"`
  3154. // LoggingService: The logging service the cluster should use to write
  3155. // metrics.
  3156. // Currently available options:
  3157. //
  3158. // * "logging.googleapis.com" - the Google Cloud Logging service
  3159. // * "none" - no metrics will be exported from the cluster
  3160. LoggingService string `json:"loggingService,omitempty"`
  3161. // Name: The name (project, location, cluster) of the cluster to set
  3162. // logging.
  3163. // Specified in the format 'projects/*/locations/*/clusters/*'.
  3164. Name string `json:"name,omitempty"`
  3165. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3166. // project
  3167. // number](https://support.google.com/cloud/answer/6158840).
  3168. // This
  3169. // field has been deprecated and replaced by the name field.
  3170. ProjectId string `json:"projectId,omitempty"`
  3171. // Zone: Deprecated. The name of the Google Compute
  3172. // Engine
  3173. // [zone](/compute/docs/zones#available) in which the
  3174. // cluster
  3175. // resides.
  3176. // This field has been deprecated and replaced by the name field.
  3177. Zone string `json:"zone,omitempty"`
  3178. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3179. // unconditionally include in API requests. By default, fields with
  3180. // empty values are omitted from API requests. However, any non-pointer,
  3181. // non-interface field appearing in ForceSendFields will be sent to the
  3182. // server regardless of whether the field is empty or not. This may be
  3183. // used to include empty fields in Patch requests.
  3184. ForceSendFields []string `json:"-"`
  3185. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3186. // API requests with the JSON null value. By default, fields with empty
  3187. // values are omitted from API requests. However, any field with an
  3188. // empty value appearing in NullFields will be sent to the server as
  3189. // null. It is an error if a field in this list has a non-empty value.
  3190. // This may be used to include null fields in Patch requests.
  3191. NullFields []string `json:"-"`
  3192. }
  3193. func (s *SetLoggingServiceRequest) MarshalJSON() ([]byte, error) {
  3194. type NoMethod SetLoggingServiceRequest
  3195. raw := NoMethod(*s)
  3196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3197. }
  3198. // SetMaintenancePolicyRequest: SetMaintenancePolicyRequest sets the
  3199. // maintenance policy for a cluster.
  3200. type SetMaintenancePolicyRequest struct {
  3201. // ClusterId: The name of the cluster to update.
  3202. ClusterId string `json:"clusterId,omitempty"`
  3203. // MaintenancePolicy: The maintenance policy to be set for the cluster.
  3204. // An empty field
  3205. // clears the existing maintenance policy.
  3206. MaintenancePolicy *MaintenancePolicy `json:"maintenancePolicy,omitempty"`
  3207. // Name: The name (project, location, cluster id) of the cluster to set
  3208. // maintenance
  3209. // policy.
  3210. // Specified in the format 'projects/*/locations/*/clusters/*'.
  3211. Name string `json:"name,omitempty"`
  3212. // ProjectId: The Google Developers Console [project ID or
  3213. // project
  3214. // number](https://support.google.com/cloud/answer/6158840).
  3215. ProjectId string `json:"projectId,omitempty"`
  3216. // Zone: The name of the Google Compute
  3217. // Engine
  3218. // [zone](/compute/docs/zones#available) in which the cluster
  3219. // resides.
  3220. Zone string `json:"zone,omitempty"`
  3221. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3222. // unconditionally include in API requests. By default, fields with
  3223. // empty values are omitted from API requests. However, any non-pointer,
  3224. // non-interface field appearing in ForceSendFields will be sent to the
  3225. // server regardless of whether the field is empty or not. This may be
  3226. // used to include empty fields in Patch requests.
  3227. ForceSendFields []string `json:"-"`
  3228. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3229. // API requests with the JSON null value. By default, fields with empty
  3230. // values are omitted from API requests. However, any field with an
  3231. // empty value appearing in NullFields will be sent to the server as
  3232. // null. It is an error if a field in this list has a non-empty value.
  3233. // This may be used to include null fields in Patch requests.
  3234. NullFields []string `json:"-"`
  3235. }
  3236. func (s *SetMaintenancePolicyRequest) MarshalJSON() ([]byte, error) {
  3237. type NoMethod SetMaintenancePolicyRequest
  3238. raw := NoMethod(*s)
  3239. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3240. }
  3241. // SetMasterAuthRequest: SetMasterAuthRequest updates the admin password
  3242. // of a cluster.
  3243. type SetMasterAuthRequest struct {
  3244. // Action: The exact form of action to be taken on the master auth.
  3245. //
  3246. // Possible values:
  3247. // "UNKNOWN" - Operation is unknown and will error out.
  3248. // "SET_PASSWORD" - Set the password to a user generated value.
  3249. // "GENERATE_PASSWORD" - Generate a new password and set it to that.
  3250. // "SET_USERNAME" - Set the username. If an empty username is
  3251. // provided, basic authentication
  3252. // is disabled for the cluster. If a non-empty username is provided,
  3253. // basic
  3254. // authentication is enabled, with either a provided password or a
  3255. // generated
  3256. // one.
  3257. Action string `json:"action,omitempty"`
  3258. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3259. // This field has been deprecated and replaced by the name field.
  3260. ClusterId string `json:"clusterId,omitempty"`
  3261. // Name: The name (project, location, cluster) of the cluster to set
  3262. // auth.
  3263. // Specified in the format 'projects/*/locations/*/clusters/*'.
  3264. Name string `json:"name,omitempty"`
  3265. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3266. // project
  3267. // number](https://support.google.com/cloud/answer/6158840).
  3268. // This
  3269. // field has been deprecated and replaced by the name field.
  3270. ProjectId string `json:"projectId,omitempty"`
  3271. // Update: A description of the update.
  3272. Update *MasterAuth `json:"update,omitempty"`
  3273. // Zone: Deprecated. The name of the Google Compute
  3274. // Engine
  3275. // [zone](/compute/docs/zones#available) in which the
  3276. // cluster
  3277. // resides.
  3278. // This field has been deprecated and replaced by the name field.
  3279. Zone string `json:"zone,omitempty"`
  3280. // ForceSendFields is a list of field names (e.g. "Action") to
  3281. // unconditionally include in API requests. By default, fields with
  3282. // empty values are omitted from API requests. However, any non-pointer,
  3283. // non-interface field appearing in ForceSendFields will be sent to the
  3284. // server regardless of whether the field is empty or not. This may be
  3285. // used to include empty fields in Patch requests.
  3286. ForceSendFields []string `json:"-"`
  3287. // NullFields is a list of field names (e.g. "Action") to include in API
  3288. // requests with the JSON null value. By default, fields with empty
  3289. // values are omitted from API requests. However, any field with an
  3290. // empty value appearing in NullFields will be sent to the server as
  3291. // null. It is an error if a field in this list has a non-empty value.
  3292. // This may be used to include null fields in Patch requests.
  3293. NullFields []string `json:"-"`
  3294. }
  3295. func (s *SetMasterAuthRequest) MarshalJSON() ([]byte, error) {
  3296. type NoMethod SetMasterAuthRequest
  3297. raw := NoMethod(*s)
  3298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3299. }
  3300. // SetMonitoringServiceRequest: SetMonitoringServiceRequest sets the
  3301. // monitoring service of a cluster.
  3302. type SetMonitoringServiceRequest struct {
  3303. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3304. // This field has been deprecated and replaced by the name field.
  3305. ClusterId string `json:"clusterId,omitempty"`
  3306. // MonitoringService: The monitoring service the cluster should use to
  3307. // write metrics.
  3308. // Currently available options:
  3309. //
  3310. // * "monitoring.googleapis.com" - the Google Cloud Monitoring service
  3311. // * "none" - no metrics will be exported from the cluster
  3312. MonitoringService string `json:"monitoringService,omitempty"`
  3313. // Name: The name (project, location, cluster) of the cluster to set
  3314. // monitoring.
  3315. // Specified in the format 'projects/*/locations/*/clusters/*'.
  3316. Name string `json:"name,omitempty"`
  3317. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3318. // project
  3319. // number](https://support.google.com/cloud/answer/6158840).
  3320. // This
  3321. // field has been deprecated and replaced by the name field.
  3322. ProjectId string `json:"projectId,omitempty"`
  3323. // Zone: Deprecated. The name of the Google Compute
  3324. // Engine
  3325. // [zone](/compute/docs/zones#available) in which the
  3326. // cluster
  3327. // resides.
  3328. // This field has been deprecated and replaced by the name field.
  3329. Zone string `json:"zone,omitempty"`
  3330. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3331. // unconditionally include in API requests. By default, fields with
  3332. // empty values are omitted from API requests. However, any non-pointer,
  3333. // non-interface field appearing in ForceSendFields will be sent to the
  3334. // server regardless of whether the field is empty or not. This may be
  3335. // used to include empty fields in Patch requests.
  3336. ForceSendFields []string `json:"-"`
  3337. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3338. // API requests with the JSON null value. By default, fields with empty
  3339. // values are omitted from API requests. However, any field with an
  3340. // empty value appearing in NullFields will be sent to the server as
  3341. // null. It is an error if a field in this list has a non-empty value.
  3342. // This may be used to include null fields in Patch requests.
  3343. NullFields []string `json:"-"`
  3344. }
  3345. func (s *SetMonitoringServiceRequest) MarshalJSON() ([]byte, error) {
  3346. type NoMethod SetMonitoringServiceRequest
  3347. raw := NoMethod(*s)
  3348. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3349. }
  3350. // SetNetworkPolicyRequest: SetNetworkPolicyRequest enables/disables
  3351. // network policy for a cluster.
  3352. type SetNetworkPolicyRequest struct {
  3353. // ClusterId: Deprecated. The name of the cluster.
  3354. // This field has been deprecated and replaced by the name field.
  3355. ClusterId string `json:"clusterId,omitempty"`
  3356. // Name: The name (project, location, cluster id) of the cluster to set
  3357. // networking
  3358. // policy. Specified in the format 'projects/*/locations/*/clusters/*'.
  3359. Name string `json:"name,omitempty"`
  3360. // NetworkPolicy: Configuration options for the NetworkPolicy feature.
  3361. NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"`
  3362. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3363. // project
  3364. // number](https://developers.google.com/console/help/new/#projec
  3365. // tnumber).
  3366. // This field has been deprecated and replaced by the name field.
  3367. ProjectId string `json:"projectId,omitempty"`
  3368. // Zone: Deprecated. The name of the Google Compute
  3369. // Engine
  3370. // [zone](/compute/docs/zones#available) in which the
  3371. // cluster
  3372. // resides.
  3373. // This field has been deprecated and replaced by the name field.
  3374. Zone string `json:"zone,omitempty"`
  3375. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3376. // unconditionally include in API requests. By default, fields with
  3377. // empty values are omitted from API requests. However, any non-pointer,
  3378. // non-interface field appearing in ForceSendFields will be sent to the
  3379. // server regardless of whether the field is empty or not. This may be
  3380. // used to include empty fields in Patch requests.
  3381. ForceSendFields []string `json:"-"`
  3382. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3383. // API requests with the JSON null value. By default, fields with empty
  3384. // values are omitted from API requests. However, any field with an
  3385. // empty value appearing in NullFields will be sent to the server as
  3386. // null. It is an error if a field in this list has a non-empty value.
  3387. // This may be used to include null fields in Patch requests.
  3388. NullFields []string `json:"-"`
  3389. }
  3390. func (s *SetNetworkPolicyRequest) MarshalJSON() ([]byte, error) {
  3391. type NoMethod SetNetworkPolicyRequest
  3392. raw := NoMethod(*s)
  3393. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3394. }
  3395. // SetNodePoolAutoscalingRequest: SetNodePoolAutoscalingRequest sets the
  3396. // autoscaler settings of a node pool.
  3397. type SetNodePoolAutoscalingRequest struct {
  3398. // Autoscaling: Autoscaling configuration for the node pool.
  3399. Autoscaling *NodePoolAutoscaling `json:"autoscaling,omitempty"`
  3400. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3401. // This field has been deprecated and replaced by the name field.
  3402. ClusterId string `json:"clusterId,omitempty"`
  3403. // Name: The name (project, location, cluster, node pool) of the node
  3404. // pool to set
  3405. // autoscaler settings. Specified in the
  3406. // format
  3407. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  3408. Name string `json:"name,omitempty"`
  3409. // NodePoolId: Deprecated. The name of the node pool to upgrade.
  3410. // This field has been deprecated and replaced by the name field.
  3411. NodePoolId string `json:"nodePoolId,omitempty"`
  3412. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3413. // project
  3414. // number](https://support.google.com/cloud/answer/6158840).
  3415. // This
  3416. // field has been deprecated and replaced by the name field.
  3417. ProjectId string `json:"projectId,omitempty"`
  3418. // Zone: Deprecated. The name of the Google Compute
  3419. // Engine
  3420. // [zone](/compute/docs/zones#available) in which the
  3421. // cluster
  3422. // resides.
  3423. // This field has been deprecated and replaced by the name field.
  3424. Zone string `json:"zone,omitempty"`
  3425. // ForceSendFields is a list of field names (e.g. "Autoscaling") to
  3426. // unconditionally include in API requests. By default, fields with
  3427. // empty values are omitted from API requests. However, any non-pointer,
  3428. // non-interface field appearing in ForceSendFields will be sent to the
  3429. // server regardless of whether the field is empty or not. This may be
  3430. // used to include empty fields in Patch requests.
  3431. ForceSendFields []string `json:"-"`
  3432. // NullFields is a list of field names (e.g. "Autoscaling") to include
  3433. // in API requests with the JSON null value. By default, fields with
  3434. // empty values are omitted from API requests. However, any field with
  3435. // an empty value appearing in NullFields will be sent to the server as
  3436. // null. It is an error if a field in this list has a non-empty value.
  3437. // This may be used to include null fields in Patch requests.
  3438. NullFields []string `json:"-"`
  3439. }
  3440. func (s *SetNodePoolAutoscalingRequest) MarshalJSON() ([]byte, error) {
  3441. type NoMethod SetNodePoolAutoscalingRequest
  3442. raw := NoMethod(*s)
  3443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3444. }
  3445. // SetNodePoolManagementRequest: SetNodePoolManagementRequest sets the
  3446. // node management properties of a node
  3447. // pool.
  3448. type SetNodePoolManagementRequest struct {
  3449. // ClusterId: Deprecated. The name of the cluster to update.
  3450. // This field has been deprecated and replaced by the name field.
  3451. ClusterId string `json:"clusterId,omitempty"`
  3452. // Management: NodeManagement configuration for the node pool.
  3453. Management *NodeManagement `json:"management,omitempty"`
  3454. // Name: The name (project, location, cluster, node pool id) of the node
  3455. // pool to set
  3456. // management properties. Specified in the
  3457. // format
  3458. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  3459. Name string `json:"name,omitempty"`
  3460. // NodePoolId: Deprecated. The name of the node pool to update.
  3461. // This field has been deprecated and replaced by the name field.
  3462. NodePoolId string `json:"nodePoolId,omitempty"`
  3463. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3464. // project
  3465. // number](https://support.google.com/cloud/answer/6158840).
  3466. // This
  3467. // field has been deprecated and replaced by the name field.
  3468. ProjectId string `json:"projectId,omitempty"`
  3469. // Zone: Deprecated. The name of the Google Compute
  3470. // Engine
  3471. // [zone](/compute/docs/zones#available) in which the
  3472. // cluster
  3473. // resides.
  3474. // This field has been deprecated and replaced by the name field.
  3475. Zone string `json:"zone,omitempty"`
  3476. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3477. // unconditionally include in API requests. By default, fields with
  3478. // empty values are omitted from API requests. However, any non-pointer,
  3479. // non-interface field appearing in ForceSendFields will be sent to the
  3480. // server regardless of whether the field is empty or not. This may be
  3481. // used to include empty fields in Patch requests.
  3482. ForceSendFields []string `json:"-"`
  3483. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3484. // API requests with the JSON null value. By default, fields with empty
  3485. // values are omitted from API requests. However, any field with an
  3486. // empty value appearing in NullFields will be sent to the server as
  3487. // null. It is an error if a field in this list has a non-empty value.
  3488. // This may be used to include null fields in Patch requests.
  3489. NullFields []string `json:"-"`
  3490. }
  3491. func (s *SetNodePoolManagementRequest) MarshalJSON() ([]byte, error) {
  3492. type NoMethod SetNodePoolManagementRequest
  3493. raw := NoMethod(*s)
  3494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3495. }
  3496. // SetNodePoolSizeRequest: SetNodePoolSizeRequest sets the size a
  3497. // node
  3498. // pool.
  3499. type SetNodePoolSizeRequest struct {
  3500. // ClusterId: Deprecated. The name of the cluster to update.
  3501. // This field has been deprecated and replaced by the name field.
  3502. ClusterId string `json:"clusterId,omitempty"`
  3503. // Name: The name (project, location, cluster, node pool id) of the node
  3504. // pool to set
  3505. // size.
  3506. // Specified in the format
  3507. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  3508. Name string `json:"name,omitempty"`
  3509. // NodeCount: The desired node count for the pool.
  3510. NodeCount int64 `json:"nodeCount,omitempty"`
  3511. // NodePoolId: Deprecated. The name of the node pool to update.
  3512. // This field has been deprecated and replaced by the name field.
  3513. NodePoolId string `json:"nodePoolId,omitempty"`
  3514. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3515. // project
  3516. // number](https://support.google.com/cloud/answer/6158840).
  3517. // This
  3518. // field has been deprecated and replaced by the name field.
  3519. ProjectId string `json:"projectId,omitempty"`
  3520. // Zone: Deprecated. The name of the Google Compute
  3521. // Engine
  3522. // [zone](/compute/docs/zones#available) in which the
  3523. // cluster
  3524. // resides.
  3525. // This field has been deprecated and replaced by the name field.
  3526. Zone string `json:"zone,omitempty"`
  3527. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3528. // unconditionally include in API requests. By default, fields with
  3529. // empty values are omitted from API requests. However, any non-pointer,
  3530. // non-interface field appearing in ForceSendFields will be sent to the
  3531. // server regardless of whether the field is empty or not. This may be
  3532. // used to include empty fields in Patch requests.
  3533. ForceSendFields []string `json:"-"`
  3534. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3535. // API requests with the JSON null value. By default, fields with empty
  3536. // values are omitted from API requests. However, any field with an
  3537. // empty value appearing in NullFields will be sent to the server as
  3538. // null. It is an error if a field in this list has a non-empty value.
  3539. // This may be used to include null fields in Patch requests.
  3540. NullFields []string `json:"-"`
  3541. }
  3542. func (s *SetNodePoolSizeRequest) MarshalJSON() ([]byte, error) {
  3543. type NoMethod SetNodePoolSizeRequest
  3544. raw := NoMethod(*s)
  3545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3546. }
  3547. // StartIPRotationRequest: StartIPRotationRequest creates a new IP for
  3548. // the cluster and then performs
  3549. // a node upgrade on each node pool to point to the new IP.
  3550. type StartIPRotationRequest struct {
  3551. // ClusterId: Deprecated. The name of the cluster.
  3552. // This field has been deprecated and replaced by the name field.
  3553. ClusterId string `json:"clusterId,omitempty"`
  3554. // Name: The name (project, location, cluster id) of the cluster to
  3555. // start IP
  3556. // rotation. Specified in the format
  3557. // 'projects/*/locations/*/clusters/*'.
  3558. Name string `json:"name,omitempty"`
  3559. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3560. // project
  3561. // number](https://developers.google.com/console/help/new/#projec
  3562. // tnumber).
  3563. // This field has been deprecated and replaced by the name field.
  3564. ProjectId string `json:"projectId,omitempty"`
  3565. // RotateCredentials: Whether to rotate credentials during IP rotation.
  3566. RotateCredentials bool `json:"rotateCredentials,omitempty"`
  3567. // Zone: Deprecated. The name of the Google Compute
  3568. // Engine
  3569. // [zone](/compute/docs/zones#available) in which the
  3570. // cluster
  3571. // resides.
  3572. // This field has been deprecated and replaced by the name field.
  3573. Zone string `json:"zone,omitempty"`
  3574. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3575. // unconditionally include in API requests. By default, fields with
  3576. // empty values are omitted from API requests. However, any non-pointer,
  3577. // non-interface field appearing in ForceSendFields will be sent to the
  3578. // server regardless of whether the field is empty or not. This may be
  3579. // used to include empty fields in Patch requests.
  3580. ForceSendFields []string `json:"-"`
  3581. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3582. // API requests with the JSON null value. By default, fields with empty
  3583. // values are omitted from API requests. However, any field with an
  3584. // empty value appearing in NullFields will be sent to the server as
  3585. // null. It is an error if a field in this list has a non-empty value.
  3586. // This may be used to include null fields in Patch requests.
  3587. NullFields []string `json:"-"`
  3588. }
  3589. func (s *StartIPRotationRequest) MarshalJSON() ([]byte, error) {
  3590. type NoMethod StartIPRotationRequest
  3591. raw := NoMethod(*s)
  3592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3593. }
  3594. // StatusCondition: StatusCondition describes why a cluster or a node
  3595. // pool has a certain status
  3596. // (e.g., ERROR or DEGRADED).
  3597. type StatusCondition struct {
  3598. // Code: Machine-friendly representation of the condition
  3599. //
  3600. // Possible values:
  3601. // "UNKNOWN" - UNKNOWN indicates a generic condition.
  3602. // "GCE_STOCKOUT" - GCE_STOCKOUT indicates a Google Compute Engine
  3603. // stockout.
  3604. // "GKE_SERVICE_ACCOUNT_DELETED" - GKE_SERVICE_ACCOUNT_DELETED
  3605. // indicates that the user deleted their robot
  3606. // service account.
  3607. // "GCE_QUOTA_EXCEEDED" - Google Compute Engine quota was exceeded.
  3608. // "SET_BY_OPERATOR" - Cluster state was manually changed by an SRE
  3609. // due to a system logic error.
  3610. // More codes TBA
  3611. Code string `json:"code,omitempty"`
  3612. // Message: Human-friendly representation of the condition
  3613. Message string `json:"message,omitempty"`
  3614. // ForceSendFields is a list of field names (e.g. "Code") to
  3615. // unconditionally include in API requests. By default, fields with
  3616. // empty values are omitted from API requests. However, any non-pointer,
  3617. // non-interface field appearing in ForceSendFields will be sent to the
  3618. // server regardless of whether the field is empty or not. This may be
  3619. // used to include empty fields in Patch requests.
  3620. ForceSendFields []string `json:"-"`
  3621. // NullFields is a list of field names (e.g. "Code") to include in API
  3622. // requests with the JSON null value. By default, fields with empty
  3623. // values are omitted from API requests. However, any field with an
  3624. // empty value appearing in NullFields will be sent to the server as
  3625. // null. It is an error if a field in this list has a non-empty value.
  3626. // This may be used to include null fields in Patch requests.
  3627. NullFields []string `json:"-"`
  3628. }
  3629. func (s *StatusCondition) MarshalJSON() ([]byte, error) {
  3630. type NoMethod StatusCondition
  3631. raw := NoMethod(*s)
  3632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3633. }
  3634. // UpdateClusterRequest: UpdateClusterRequest updates the settings of a
  3635. // cluster.
  3636. type UpdateClusterRequest struct {
  3637. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3638. // This field has been deprecated and replaced by the name field.
  3639. ClusterId string `json:"clusterId,omitempty"`
  3640. // Name: The name (project, location, cluster) of the cluster to
  3641. // update.
  3642. // Specified in the format 'projects/*/locations/*/clusters/*'.
  3643. Name string `json:"name,omitempty"`
  3644. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3645. // project
  3646. // number](https://support.google.com/cloud/answer/6158840).
  3647. // This
  3648. // field has been deprecated and replaced by the name field.
  3649. ProjectId string `json:"projectId,omitempty"`
  3650. // Update: A description of the update.
  3651. Update *ClusterUpdate `json:"update,omitempty"`
  3652. // Zone: Deprecated. The name of the Google Compute
  3653. // Engine
  3654. // [zone](/compute/docs/zones#available) in which the
  3655. // cluster
  3656. // resides.
  3657. // This field has been deprecated and replaced by the name field.
  3658. Zone string `json:"zone,omitempty"`
  3659. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3660. // unconditionally include in API requests. By default, fields with
  3661. // empty values are omitted from API requests. However, any non-pointer,
  3662. // non-interface field appearing in ForceSendFields will be sent to the
  3663. // server regardless of whether the field is empty or not. This may be
  3664. // used to include empty fields in Patch requests.
  3665. ForceSendFields []string `json:"-"`
  3666. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3667. // API requests with the JSON null value. By default, fields with empty
  3668. // values are omitted from API requests. However, any field with an
  3669. // empty value appearing in NullFields will be sent to the server as
  3670. // null. It is an error if a field in this list has a non-empty value.
  3671. // This may be used to include null fields in Patch requests.
  3672. NullFields []string `json:"-"`
  3673. }
  3674. func (s *UpdateClusterRequest) MarshalJSON() ([]byte, error) {
  3675. type NoMethod UpdateClusterRequest
  3676. raw := NoMethod(*s)
  3677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3678. }
  3679. // UpdateMasterRequest: UpdateMasterRequest updates the master of the
  3680. // cluster.
  3681. type UpdateMasterRequest struct {
  3682. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3683. // This field has been deprecated and replaced by the name field.
  3684. ClusterId string `json:"clusterId,omitempty"`
  3685. // MasterVersion: The Kubernetes version to change the master to.
  3686. //
  3687. // Users may specify either explicit versions offered by
  3688. // Kubernetes Engine or version aliases, which have the following
  3689. // behavior:
  3690. //
  3691. // - "latest": picks the highest valid Kubernetes version
  3692. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  3693. // version
  3694. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  3695. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  3696. // - "-": picks the default Kubernetes version
  3697. MasterVersion string `json:"masterVersion,omitempty"`
  3698. // Name: The name (project, location, cluster) of the cluster to
  3699. // update.
  3700. // Specified in the format 'projects/*/locations/*/clusters/*'.
  3701. Name string `json:"name,omitempty"`
  3702. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3703. // project
  3704. // number](https://support.google.com/cloud/answer/6158840).
  3705. // This
  3706. // field has been deprecated and replaced by the name field.
  3707. ProjectId string `json:"projectId,omitempty"`
  3708. // Zone: Deprecated. The name of the Google Compute
  3709. // Engine
  3710. // [zone](/compute/docs/zones#available) in which the
  3711. // cluster
  3712. // resides.
  3713. // This field has been deprecated and replaced by the name field.
  3714. Zone string `json:"zone,omitempty"`
  3715. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3716. // unconditionally include in API requests. By default, fields with
  3717. // empty values are omitted from API requests. However, any non-pointer,
  3718. // non-interface field appearing in ForceSendFields will be sent to the
  3719. // server regardless of whether the field is empty or not. This may be
  3720. // used to include empty fields in Patch requests.
  3721. ForceSendFields []string `json:"-"`
  3722. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3723. // API requests with the JSON null value. By default, fields with empty
  3724. // values are omitted from API requests. However, any field with an
  3725. // empty value appearing in NullFields will be sent to the server as
  3726. // null. It is an error if a field in this list has a non-empty value.
  3727. // This may be used to include null fields in Patch requests.
  3728. NullFields []string `json:"-"`
  3729. }
  3730. func (s *UpdateMasterRequest) MarshalJSON() ([]byte, error) {
  3731. type NoMethod UpdateMasterRequest
  3732. raw := NoMethod(*s)
  3733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3734. }
  3735. // UpdateNodePoolRequest: SetNodePoolVersionRequest updates the version
  3736. // of a node pool.
  3737. type UpdateNodePoolRequest struct {
  3738. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3739. // This field has been deprecated and replaced by the name field.
  3740. ClusterId string `json:"clusterId,omitempty"`
  3741. // ImageType: The desired image type for the node pool.
  3742. ImageType string `json:"imageType,omitempty"`
  3743. // Name: The name (project, location, cluster, node pool) of the node
  3744. // pool to
  3745. // update. Specified in the
  3746. // format
  3747. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  3748. Name string `json:"name,omitempty"`
  3749. // NodePoolId: Deprecated. The name of the node pool to upgrade.
  3750. // This field has been deprecated and replaced by the name field.
  3751. NodePoolId string `json:"nodePoolId,omitempty"`
  3752. // NodeVersion: The Kubernetes version to change the nodes to (typically
  3753. // an
  3754. // upgrade).
  3755. //
  3756. // Users may specify either explicit versions offered by Kubernetes
  3757. // Engine or
  3758. // version aliases, which have the following behavior:
  3759. //
  3760. // - "latest": picks the highest valid Kubernetes version
  3761. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  3762. // version
  3763. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  3764. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  3765. // - "-": picks the Kubernetes master version
  3766. NodeVersion string `json:"nodeVersion,omitempty"`
  3767. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3768. // project
  3769. // number](https://support.google.com/cloud/answer/6158840).
  3770. // This
  3771. // field has been deprecated and replaced by the name field.
  3772. ProjectId string `json:"projectId,omitempty"`
  3773. // Zone: Deprecated. The name of the Google Compute
  3774. // Engine
  3775. // [zone](/compute/docs/zones#available) in which the
  3776. // cluster
  3777. // resides.
  3778. // This field has been deprecated and replaced by the name field.
  3779. Zone string `json:"zone,omitempty"`
  3780. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3781. // unconditionally include in API requests. By default, fields with
  3782. // empty values are omitted from API requests. However, any non-pointer,
  3783. // non-interface field appearing in ForceSendFields will be sent to the
  3784. // server regardless of whether the field is empty or not. This may be
  3785. // used to include empty fields in Patch requests.
  3786. ForceSendFields []string `json:"-"`
  3787. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3788. // API requests with the JSON null value. By default, fields with empty
  3789. // values are omitted from API requests. However, any field with an
  3790. // empty value appearing in NullFields will be sent to the server as
  3791. // null. It is an error if a field in this list has a non-empty value.
  3792. // This may be used to include null fields in Patch requests.
  3793. NullFields []string `json:"-"`
  3794. }
  3795. func (s *UpdateNodePoolRequest) MarshalJSON() ([]byte, error) {
  3796. type NoMethod UpdateNodePoolRequest
  3797. raw := NoMethod(*s)
  3798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3799. }
  3800. // UsableSubnetwork: UsableSubnetwork resource returns the subnetwork
  3801. // name, its associated network
  3802. // and the primary CIDR range.
  3803. type UsableSubnetwork struct {
  3804. // IpCidrRange: The range of internal addresses that are owned by this
  3805. // subnetwork.
  3806. IpCidrRange string `json:"ipCidrRange,omitempty"`
  3807. // Network: Network Name.
  3808. // Example: projects/my-project/global/networks/my-network
  3809. Network string `json:"network,omitempty"`
  3810. // SecondaryIpRanges: Secondary IP ranges.
  3811. SecondaryIpRanges []*UsableSubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  3812. // StatusMessage: A human readable status message representing the
  3813. // reasons for cases where
  3814. // the caller cannot use the secondary ranges under the subnet. For
  3815. // example if
  3816. // the secondary_ip_ranges is empty due to a permission issue, an
  3817. // insufficient
  3818. // permission message will be given by status_message.
  3819. StatusMessage string `json:"statusMessage,omitempty"`
  3820. // Subnetwork: Subnetwork Name.
  3821. // Example:
  3822. // projects/my-project/regions/us-central1/subnetworks/my-subnet
  3823. Subnetwork string `json:"subnetwork,omitempty"`
  3824. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  3825. // unconditionally include in API requests. By default, fields with
  3826. // empty values are omitted from API requests. However, any non-pointer,
  3827. // non-interface field appearing in ForceSendFields will be sent to the
  3828. // server regardless of whether the field is empty or not. This may be
  3829. // used to include empty fields in Patch requests.
  3830. ForceSendFields []string `json:"-"`
  3831. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  3832. // in API requests with the JSON null value. By default, fields with
  3833. // empty values are omitted from API requests. However, any field with
  3834. // an empty value appearing in NullFields will be sent to the server as
  3835. // null. It is an error if a field in this list has a non-empty value.
  3836. // This may be used to include null fields in Patch requests.
  3837. NullFields []string `json:"-"`
  3838. }
  3839. func (s *UsableSubnetwork) MarshalJSON() ([]byte, error) {
  3840. type NoMethod UsableSubnetwork
  3841. raw := NoMethod(*s)
  3842. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3843. }
  3844. // UsableSubnetworkSecondaryRange: Secondary IP range of a usable
  3845. // subnetwork.
  3846. type UsableSubnetworkSecondaryRange struct {
  3847. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  3848. // secondary range.
  3849. IpCidrRange string `json:"ipCidrRange,omitempty"`
  3850. // RangeName: The name associated with this subnetwork secondary range,
  3851. // used when adding
  3852. // an alias IP range to a VM instance.
  3853. RangeName string `json:"rangeName,omitempty"`
  3854. // Status: This field is to determine the status of the secondary range
  3855. // programmably.
  3856. //
  3857. // Possible values:
  3858. // "UNKNOWN" - UNKNOWN is the zero value of the Status enum. It's not
  3859. // a valid status.
  3860. // "UNUSED" - UNUSED denotes that this range is unclaimed by any
  3861. // cluster.
  3862. // "IN_USE_SERVICE" - IN_USE_SERVICE denotes that this range is
  3863. // claimed by a cluster for
  3864. // services. It cannot be used for other clusters.
  3865. // "IN_USE_SHAREABLE_POD" - IN_USE_SHAREABLE_POD denotes this range
  3866. // was created by the network admin
  3867. // and is currently claimed by a cluster for pods. It can only be used
  3868. // by
  3869. // other clusters as a pod range.
  3870. // "IN_USE_MANAGED_POD" - IN_USE_MANAGED_POD denotes this range was
  3871. // created by GKE and is claimed
  3872. // for pods. It cannot be used for other clusters.
  3873. Status string `json:"status,omitempty"`
  3874. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  3875. // unconditionally include in API requests. By default, fields with
  3876. // empty values are omitted from API requests. However, any non-pointer,
  3877. // non-interface field appearing in ForceSendFields will be sent to the
  3878. // server regardless of whether the field is empty or not. This may be
  3879. // used to include empty fields in Patch requests.
  3880. ForceSendFields []string `json:"-"`
  3881. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  3882. // in API requests with the JSON null value. By default, fields with
  3883. // empty values are omitted from API requests. However, any field with
  3884. // an empty value appearing in NullFields will be sent to the server as
  3885. // null. It is an error if a field in this list has a non-empty value.
  3886. // This may be used to include null fields in Patch requests.
  3887. NullFields []string `json:"-"`
  3888. }
  3889. func (s *UsableSubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  3890. type NoMethod UsableSubnetworkSecondaryRange
  3891. raw := NoMethod(*s)
  3892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3893. }
  3894. // VerticalPodAutoscaling: VerticalPodAutoscaling contains global,
  3895. // per-cluster information
  3896. // required by Vertical Pod Autoscaler to automatically adjust
  3897. // the resources of pods controlled by it.
  3898. type VerticalPodAutoscaling struct {
  3899. // Enabled: Enables vertical pod autoscaling.
  3900. Enabled bool `json:"enabled,omitempty"`
  3901. // ForceSendFields is a list of field names (e.g. "Enabled") to
  3902. // unconditionally include in API requests. By default, fields with
  3903. // empty values are omitted from API requests. However, any non-pointer,
  3904. // non-interface field appearing in ForceSendFields will be sent to the
  3905. // server regardless of whether the field is empty or not. This may be
  3906. // used to include empty fields in Patch requests.
  3907. ForceSendFields []string `json:"-"`
  3908. // NullFields is a list of field names (e.g. "Enabled") to include in
  3909. // API requests with the JSON null value. By default, fields with empty
  3910. // values are omitted from API requests. However, any field with an
  3911. // empty value appearing in NullFields will be sent to the server as
  3912. // null. It is an error if a field in this list has a non-empty value.
  3913. // This may be used to include null fields in Patch requests.
  3914. NullFields []string `json:"-"`
  3915. }
  3916. func (s *VerticalPodAutoscaling) MarshalJSON() ([]byte, error) {
  3917. type NoMethod VerticalPodAutoscaling
  3918. raw := NoMethod(*s)
  3919. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3920. }
  3921. // WorkloadMetadataConfig: WorkloadMetadataConfig defines the metadata
  3922. // configuration to expose to
  3923. // workloads on the node pool.
  3924. type WorkloadMetadataConfig struct {
  3925. // NodeMetadata: NodeMetadata is the configuration for how to expose the
  3926. // node metadata to
  3927. // the workload running on the node.
  3928. //
  3929. // Possible values:
  3930. // "UNSPECIFIED" - Not set.
  3931. // "SECURE" - Prevent workloads not in hostNetwork from accessing
  3932. // certain VM metadata,
  3933. // specifically kube-env, which contains Kubelet credentials, and
  3934. // the
  3935. // instance identity token.
  3936. //
  3937. // Metadata concealment is a temporary security solution available while
  3938. // the
  3939. // bootstrapping process for cluster nodes is being redesigned
  3940. // with
  3941. // significant security improvements. This feature is scheduled to
  3942. // be
  3943. // deprecated in the future and later removed.
  3944. // "EXPOSE" - Expose all VM metadata to pods.
  3945. NodeMetadata string `json:"nodeMetadata,omitempty"`
  3946. // ForceSendFields is a list of field names (e.g. "NodeMetadata") to
  3947. // unconditionally include in API requests. By default, fields with
  3948. // empty values are omitted from API requests. However, any non-pointer,
  3949. // non-interface field appearing in ForceSendFields will be sent to the
  3950. // server regardless of whether the field is empty or not. This may be
  3951. // used to include empty fields in Patch requests.
  3952. ForceSendFields []string `json:"-"`
  3953. // NullFields is a list of field names (e.g. "NodeMetadata") to include
  3954. // in API requests with the JSON null value. By default, fields with
  3955. // empty values are omitted from API requests. However, any field with
  3956. // an empty value appearing in NullFields will be sent to the server as
  3957. // null. It is an error if a field in this list has a non-empty value.
  3958. // This may be used to include null fields in Patch requests.
  3959. NullFields []string `json:"-"`
  3960. }
  3961. func (s *WorkloadMetadataConfig) MarshalJSON() ([]byte, error) {
  3962. type NoMethod WorkloadMetadataConfig
  3963. raw := NoMethod(*s)
  3964. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3965. }
  3966. // method id "container.projects.aggregated.usableSubnetworks.list":
  3967. type ProjectsAggregatedUsableSubnetworksListCall struct {
  3968. s *Service
  3969. parent string
  3970. urlParams_ gensupport.URLParams
  3971. ifNoneMatch_ string
  3972. ctx_ context.Context
  3973. header_ http.Header
  3974. }
  3975. // List: Lists subnetworks that are usable for creating clusters in a
  3976. // project.
  3977. func (r *ProjectsAggregatedUsableSubnetworksService) List(parent string) *ProjectsAggregatedUsableSubnetworksListCall {
  3978. c := &ProjectsAggregatedUsableSubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3979. c.parent = parent
  3980. return c
  3981. }
  3982. // Filter sets the optional parameter "filter": Filtering currently only
  3983. // supports equality on the networkProjectId and must
  3984. // be in the form: "networkProjectId=[PROJECTID]", where
  3985. // `networkProjectId`
  3986. // is the project which owns the listed subnetworks. This defaults to
  3987. // the
  3988. // parent project ID.
  3989. func (c *ProjectsAggregatedUsableSubnetworksListCall) Filter(filter string) *ProjectsAggregatedUsableSubnetworksListCall {
  3990. c.urlParams_.Set("filter", filter)
  3991. return c
  3992. }
  3993. // PageSize sets the optional parameter "pageSize": The max number of
  3994. // results per page that should be returned. If the number
  3995. // of available results is larger than `page_size`, a `next_page_token`
  3996. // is
  3997. // returned which can be used to get the next page of results in
  3998. // subsequent
  3999. // requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
  4000. func (c *ProjectsAggregatedUsableSubnetworksListCall) PageSize(pageSize int64) *ProjectsAggregatedUsableSubnetworksListCall {
  4001. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4002. return c
  4003. }
  4004. // PageToken sets the optional parameter "pageToken": Specifies a page
  4005. // token to use. Set this to the nextPageToken returned by
  4006. // previous list requests to get the next page of results.
  4007. func (c *ProjectsAggregatedUsableSubnetworksListCall) PageToken(pageToken string) *ProjectsAggregatedUsableSubnetworksListCall {
  4008. c.urlParams_.Set("pageToken", pageToken)
  4009. return c
  4010. }
  4011. // Fields allows partial responses to be retrieved. See
  4012. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4013. // for more information.
  4014. func (c *ProjectsAggregatedUsableSubnetworksListCall) Fields(s ...googleapi.Field) *ProjectsAggregatedUsableSubnetworksListCall {
  4015. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4016. return c
  4017. }
  4018. // IfNoneMatch sets the optional parameter which makes the operation
  4019. // fail if the object's ETag matches the given value. This is useful for
  4020. // getting updates only after the object has changed since the last
  4021. // request. Use googleapi.IsNotModified to check whether the response
  4022. // error from Do is the result of In-None-Match.
  4023. func (c *ProjectsAggregatedUsableSubnetworksListCall) IfNoneMatch(entityTag string) *ProjectsAggregatedUsableSubnetworksListCall {
  4024. c.ifNoneMatch_ = entityTag
  4025. return c
  4026. }
  4027. // Context sets the context to be used in this call's Do method. Any
  4028. // pending HTTP request will be aborted if the provided context is
  4029. // canceled.
  4030. func (c *ProjectsAggregatedUsableSubnetworksListCall) Context(ctx context.Context) *ProjectsAggregatedUsableSubnetworksListCall {
  4031. c.ctx_ = ctx
  4032. return c
  4033. }
  4034. // Header returns an http.Header that can be modified by the caller to
  4035. // add HTTP headers to the request.
  4036. func (c *ProjectsAggregatedUsableSubnetworksListCall) Header() http.Header {
  4037. if c.header_ == nil {
  4038. c.header_ = make(http.Header)
  4039. }
  4040. return c.header_
  4041. }
  4042. func (c *ProjectsAggregatedUsableSubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  4043. reqHeaders := make(http.Header)
  4044. for k, v := range c.header_ {
  4045. reqHeaders[k] = v
  4046. }
  4047. reqHeaders.Set("User-Agent", c.s.userAgent())
  4048. if c.ifNoneMatch_ != "" {
  4049. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4050. }
  4051. var body io.Reader = nil
  4052. c.urlParams_.Set("alt", alt)
  4053. c.urlParams_.Set("prettyPrint", "false")
  4054. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/aggregated/usableSubnetworks")
  4055. urls += "?" + c.urlParams_.Encode()
  4056. req, err := http.NewRequest("GET", urls, body)
  4057. if err != nil {
  4058. return nil, err
  4059. }
  4060. req.Header = reqHeaders
  4061. googleapi.Expand(req.URL, map[string]string{
  4062. "parent": c.parent,
  4063. })
  4064. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4065. }
  4066. // Do executes the "container.projects.aggregated.usableSubnetworks.list" call.
  4067. // Exactly one of *ListUsableSubnetworksResponse or error will be
  4068. // non-nil. Any non-2xx status code is an error. Response headers are in
  4069. // either *ListUsableSubnetworksResponse.ServerResponse.Header or (if a
  4070. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4071. // googleapi.IsNotModified to check whether the returned error was
  4072. // because http.StatusNotModified was returned.
  4073. func (c *ProjectsAggregatedUsableSubnetworksListCall) Do(opts ...googleapi.CallOption) (*ListUsableSubnetworksResponse, error) {
  4074. gensupport.SetOptions(c.urlParams_, opts...)
  4075. res, err := c.doRequest("json")
  4076. if res != nil && res.StatusCode == http.StatusNotModified {
  4077. if res.Body != nil {
  4078. res.Body.Close()
  4079. }
  4080. return nil, &googleapi.Error{
  4081. Code: res.StatusCode,
  4082. Header: res.Header,
  4083. }
  4084. }
  4085. if err != nil {
  4086. return nil, err
  4087. }
  4088. defer googleapi.CloseBody(res)
  4089. if err := googleapi.CheckResponse(res); err != nil {
  4090. return nil, err
  4091. }
  4092. ret := &ListUsableSubnetworksResponse{
  4093. ServerResponse: googleapi.ServerResponse{
  4094. Header: res.Header,
  4095. HTTPStatusCode: res.StatusCode,
  4096. },
  4097. }
  4098. target := &ret
  4099. if err := gensupport.DecodeResponse(target, res); err != nil {
  4100. return nil, err
  4101. }
  4102. return ret, nil
  4103. // {
  4104. // "description": "Lists subnetworks that are usable for creating clusters in a project.",
  4105. // "flatPath": "v1beta1/projects/{projectsId}/aggregated/usableSubnetworks",
  4106. // "httpMethod": "GET",
  4107. // "id": "container.projects.aggregated.usableSubnetworks.list",
  4108. // "parameterOrder": [
  4109. // "parent"
  4110. // ],
  4111. // "parameters": {
  4112. // "filter": {
  4113. // "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.",
  4114. // "location": "query",
  4115. // "type": "string"
  4116. // },
  4117. // "pageSize": {
  4118. // "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)",
  4119. // "format": "int32",
  4120. // "location": "query",
  4121. // "type": "integer"
  4122. // },
  4123. // "pageToken": {
  4124. // "description": "Specifies a page token to use. Set this to the nextPageToken returned by\nprevious list requests to get the next page of results.",
  4125. // "location": "query",
  4126. // "type": "string"
  4127. // },
  4128. // "parent": {
  4129. // "description": "The parent project where subnetworks are usable.\nSpecified in the format 'projects/*'.",
  4130. // "location": "path",
  4131. // "pattern": "^projects/[^/]+$",
  4132. // "required": true,
  4133. // "type": "string"
  4134. // }
  4135. // },
  4136. // "path": "v1beta1/{+parent}/aggregated/usableSubnetworks",
  4137. // "response": {
  4138. // "$ref": "ListUsableSubnetworksResponse"
  4139. // },
  4140. // "scopes": [
  4141. // "https://www.googleapis.com/auth/cloud-platform"
  4142. // ]
  4143. // }
  4144. }
  4145. // Pages invokes f for each page of results.
  4146. // A non-nil error returned from f will halt the iteration.
  4147. // The provided context supersedes any context provided to the Context method.
  4148. func (c *ProjectsAggregatedUsableSubnetworksListCall) Pages(ctx context.Context, f func(*ListUsableSubnetworksResponse) error) error {
  4149. c.ctx_ = ctx
  4150. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4151. for {
  4152. x, err := c.Do()
  4153. if err != nil {
  4154. return err
  4155. }
  4156. if err := f(x); err != nil {
  4157. return err
  4158. }
  4159. if x.NextPageToken == "" {
  4160. return nil
  4161. }
  4162. c.PageToken(x.NextPageToken)
  4163. }
  4164. }
  4165. // method id "container.projects.locations.getServerConfig":
  4166. type ProjectsLocationsGetServerConfigCall struct {
  4167. s *Service
  4168. name string
  4169. urlParams_ gensupport.URLParams
  4170. ifNoneMatch_ string
  4171. ctx_ context.Context
  4172. header_ http.Header
  4173. }
  4174. // GetServerConfig: Returns configuration info about the Kubernetes
  4175. // Engine service.
  4176. func (r *ProjectsLocationsService) GetServerConfig(name string) *ProjectsLocationsGetServerConfigCall {
  4177. c := &ProjectsLocationsGetServerConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4178. c.name = name
  4179. return c
  4180. }
  4181. // ProjectId sets the optional parameter "projectId": Deprecated. The
  4182. // Google Developers Console [project ID or
  4183. // project
  4184. // number](https://support.google.com/cloud/answer/6158840).
  4185. // This
  4186. // field has been deprecated and replaced by the name field.
  4187. func (c *ProjectsLocationsGetServerConfigCall) ProjectId(projectId string) *ProjectsLocationsGetServerConfigCall {
  4188. c.urlParams_.Set("projectId", projectId)
  4189. return c
  4190. }
  4191. // Zone sets the optional parameter "zone": Deprecated. The name of the
  4192. // Google Compute Engine
  4193. // [zone](/compute/docs/zones#available) to return operations for.
  4194. // This field has been deprecated and replaced by the name field.
  4195. func (c *ProjectsLocationsGetServerConfigCall) Zone(zone string) *ProjectsLocationsGetServerConfigCall {
  4196. c.urlParams_.Set("zone", zone)
  4197. return c
  4198. }
  4199. // Fields allows partial responses to be retrieved. See
  4200. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4201. // for more information.
  4202. func (c *ProjectsLocationsGetServerConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetServerConfigCall {
  4203. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4204. return c
  4205. }
  4206. // IfNoneMatch sets the optional parameter which makes the operation
  4207. // fail if the object's ETag matches the given value. This is useful for
  4208. // getting updates only after the object has changed since the last
  4209. // request. Use googleapi.IsNotModified to check whether the response
  4210. // error from Do is the result of In-None-Match.
  4211. func (c *ProjectsLocationsGetServerConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetServerConfigCall {
  4212. c.ifNoneMatch_ = entityTag
  4213. return c
  4214. }
  4215. // Context sets the context to be used in this call's Do method. Any
  4216. // pending HTTP request will be aborted if the provided context is
  4217. // canceled.
  4218. func (c *ProjectsLocationsGetServerConfigCall) Context(ctx context.Context) *ProjectsLocationsGetServerConfigCall {
  4219. c.ctx_ = ctx
  4220. return c
  4221. }
  4222. // Header returns an http.Header that can be modified by the caller to
  4223. // add HTTP headers to the request.
  4224. func (c *ProjectsLocationsGetServerConfigCall) Header() http.Header {
  4225. if c.header_ == nil {
  4226. c.header_ = make(http.Header)
  4227. }
  4228. return c.header_
  4229. }
  4230. func (c *ProjectsLocationsGetServerConfigCall) doRequest(alt string) (*http.Response, error) {
  4231. reqHeaders := make(http.Header)
  4232. for k, v := range c.header_ {
  4233. reqHeaders[k] = v
  4234. }
  4235. reqHeaders.Set("User-Agent", c.s.userAgent())
  4236. if c.ifNoneMatch_ != "" {
  4237. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4238. }
  4239. var body io.Reader = nil
  4240. c.urlParams_.Set("alt", alt)
  4241. c.urlParams_.Set("prettyPrint", "false")
  4242. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/serverConfig")
  4243. urls += "?" + c.urlParams_.Encode()
  4244. req, err := http.NewRequest("GET", urls, body)
  4245. if err != nil {
  4246. return nil, err
  4247. }
  4248. req.Header = reqHeaders
  4249. googleapi.Expand(req.URL, map[string]string{
  4250. "name": c.name,
  4251. })
  4252. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4253. }
  4254. // Do executes the "container.projects.locations.getServerConfig" call.
  4255. // Exactly one of *ServerConfig or error will be non-nil. Any non-2xx
  4256. // status code is an error. Response headers are in either
  4257. // *ServerConfig.ServerResponse.Header or (if a response was returned at
  4258. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4259. // to check whether the returned error was because
  4260. // http.StatusNotModified was returned.
  4261. func (c *ProjectsLocationsGetServerConfigCall) Do(opts ...googleapi.CallOption) (*ServerConfig, error) {
  4262. gensupport.SetOptions(c.urlParams_, opts...)
  4263. res, err := c.doRequest("json")
  4264. if res != nil && res.StatusCode == http.StatusNotModified {
  4265. if res.Body != nil {
  4266. res.Body.Close()
  4267. }
  4268. return nil, &googleapi.Error{
  4269. Code: res.StatusCode,
  4270. Header: res.Header,
  4271. }
  4272. }
  4273. if err != nil {
  4274. return nil, err
  4275. }
  4276. defer googleapi.CloseBody(res)
  4277. if err := googleapi.CheckResponse(res); err != nil {
  4278. return nil, err
  4279. }
  4280. ret := &ServerConfig{
  4281. ServerResponse: googleapi.ServerResponse{
  4282. Header: res.Header,
  4283. HTTPStatusCode: res.StatusCode,
  4284. },
  4285. }
  4286. target := &ret
  4287. if err := gensupport.DecodeResponse(target, res); err != nil {
  4288. return nil, err
  4289. }
  4290. return ret, nil
  4291. // {
  4292. // "description": "Returns configuration info about the Kubernetes Engine service.",
  4293. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/serverConfig",
  4294. // "httpMethod": "GET",
  4295. // "id": "container.projects.locations.getServerConfig",
  4296. // "parameterOrder": [
  4297. // "name"
  4298. // ],
  4299. // "parameters": {
  4300. // "name": {
  4301. // "description": "The name (project and location) of the server config to get,\nspecified in the format 'projects/*/locations/*'.",
  4302. // "location": "path",
  4303. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  4304. // "required": true,
  4305. // "type": "string"
  4306. // },
  4307. // "projectId": {
  4308. // "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.",
  4309. // "location": "query",
  4310. // "type": "string"
  4311. // },
  4312. // "zone": {
  4313. // "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.",
  4314. // "location": "query",
  4315. // "type": "string"
  4316. // }
  4317. // },
  4318. // "path": "v1beta1/{+name}/serverConfig",
  4319. // "response": {
  4320. // "$ref": "ServerConfig"
  4321. // },
  4322. // "scopes": [
  4323. // "https://www.googleapis.com/auth/cloud-platform"
  4324. // ]
  4325. // }
  4326. }
  4327. // method id "container.projects.locations.list":
  4328. type ProjectsLocationsListCall struct {
  4329. s *Service
  4330. parent string
  4331. urlParams_ gensupport.URLParams
  4332. ifNoneMatch_ string
  4333. ctx_ context.Context
  4334. header_ http.Header
  4335. }
  4336. // List: Used to fetch locations that offer GKE.
  4337. func (r *ProjectsLocationsService) List(parent string) *ProjectsLocationsListCall {
  4338. c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4339. c.parent = parent
  4340. return c
  4341. }
  4342. // Fields allows partial responses to be retrieved. See
  4343. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4344. // for more information.
  4345. func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
  4346. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4347. return c
  4348. }
  4349. // IfNoneMatch sets the optional parameter which makes the operation
  4350. // fail if the object's ETag matches the given value. This is useful for
  4351. // getting updates only after the object has changed since the last
  4352. // request. Use googleapi.IsNotModified to check whether the response
  4353. // error from Do is the result of In-None-Match.
  4354. func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  4355. c.ifNoneMatch_ = entityTag
  4356. return c
  4357. }
  4358. // Context sets the context to be used in this call's Do method. Any
  4359. // pending HTTP request will be aborted if the provided context is
  4360. // canceled.
  4361. func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  4362. c.ctx_ = ctx
  4363. return c
  4364. }
  4365. // Header returns an http.Header that can be modified by the caller to
  4366. // add HTTP headers to the request.
  4367. func (c *ProjectsLocationsListCall) Header() http.Header {
  4368. if c.header_ == nil {
  4369. c.header_ = make(http.Header)
  4370. }
  4371. return c.header_
  4372. }
  4373. func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  4374. reqHeaders := make(http.Header)
  4375. for k, v := range c.header_ {
  4376. reqHeaders[k] = v
  4377. }
  4378. reqHeaders.Set("User-Agent", c.s.userAgent())
  4379. if c.ifNoneMatch_ != "" {
  4380. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4381. }
  4382. var body io.Reader = nil
  4383. c.urlParams_.Set("alt", alt)
  4384. c.urlParams_.Set("prettyPrint", "false")
  4385. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/locations")
  4386. urls += "?" + c.urlParams_.Encode()
  4387. req, err := http.NewRequest("GET", urls, body)
  4388. if err != nil {
  4389. return nil, err
  4390. }
  4391. req.Header = reqHeaders
  4392. googleapi.Expand(req.URL, map[string]string{
  4393. "parent": c.parent,
  4394. })
  4395. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4396. }
  4397. // Do executes the "container.projects.locations.list" call.
  4398. // Exactly one of *ListLocationsResponse or error will be non-nil. Any
  4399. // non-2xx status code is an error. Response headers are in either
  4400. // *ListLocationsResponse.ServerResponse.Header or (if a response was
  4401. // returned at all) in error.(*googleapi.Error).Header. Use
  4402. // googleapi.IsNotModified to check whether the returned error was
  4403. // because http.StatusNotModified was returned.
  4404. func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  4405. gensupport.SetOptions(c.urlParams_, opts...)
  4406. res, err := c.doRequest("json")
  4407. if res != nil && res.StatusCode == http.StatusNotModified {
  4408. if res.Body != nil {
  4409. res.Body.Close()
  4410. }
  4411. return nil, &googleapi.Error{
  4412. Code: res.StatusCode,
  4413. Header: res.Header,
  4414. }
  4415. }
  4416. if err != nil {
  4417. return nil, err
  4418. }
  4419. defer googleapi.CloseBody(res)
  4420. if err := googleapi.CheckResponse(res); err != nil {
  4421. return nil, err
  4422. }
  4423. ret := &ListLocationsResponse{
  4424. ServerResponse: googleapi.ServerResponse{
  4425. Header: res.Header,
  4426. HTTPStatusCode: res.StatusCode,
  4427. },
  4428. }
  4429. target := &ret
  4430. if err := gensupport.DecodeResponse(target, res); err != nil {
  4431. return nil, err
  4432. }
  4433. return ret, nil
  4434. // {
  4435. // "description": "Used to fetch locations that offer GKE.",
  4436. // "flatPath": "v1beta1/projects/{projectsId}/locations",
  4437. // "httpMethod": "GET",
  4438. // "id": "container.projects.locations.list",
  4439. // "parameterOrder": [
  4440. // "parent"
  4441. // ],
  4442. // "parameters": {
  4443. // "parent": {
  4444. // "description": "Contains the name of the resource requested.\nSpecified in the format 'projects/*'.",
  4445. // "location": "path",
  4446. // "pattern": "^projects/[^/]+$",
  4447. // "required": true,
  4448. // "type": "string"
  4449. // }
  4450. // },
  4451. // "path": "v1beta1/{+parent}/locations",
  4452. // "response": {
  4453. // "$ref": "ListLocationsResponse"
  4454. // },
  4455. // "scopes": [
  4456. // "https://www.googleapis.com/auth/cloud-platform"
  4457. // ]
  4458. // }
  4459. }
  4460. // method id "container.projects.locations.clusters.completeIpRotation":
  4461. type ProjectsLocationsClustersCompleteIpRotationCall struct {
  4462. s *Service
  4463. name string
  4464. completeiprotationrequest *CompleteIPRotationRequest
  4465. urlParams_ gensupport.URLParams
  4466. ctx_ context.Context
  4467. header_ http.Header
  4468. }
  4469. // CompleteIpRotation: Completes master IP rotation.
  4470. func (r *ProjectsLocationsClustersService) CompleteIpRotation(name string, completeiprotationrequest *CompleteIPRotationRequest) *ProjectsLocationsClustersCompleteIpRotationCall {
  4471. c := &ProjectsLocationsClustersCompleteIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4472. c.name = name
  4473. c.completeiprotationrequest = completeiprotationrequest
  4474. return c
  4475. }
  4476. // Fields allows partial responses to be retrieved. See
  4477. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4478. // for more information.
  4479. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersCompleteIpRotationCall {
  4480. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4481. return c
  4482. }
  4483. // Context sets the context to be used in this call's Do method. Any
  4484. // pending HTTP request will be aborted if the provided context is
  4485. // canceled.
  4486. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Context(ctx context.Context) *ProjectsLocationsClustersCompleteIpRotationCall {
  4487. c.ctx_ = ctx
  4488. return c
  4489. }
  4490. // Header returns an http.Header that can be modified by the caller to
  4491. // add HTTP headers to the request.
  4492. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Header() http.Header {
  4493. if c.header_ == nil {
  4494. c.header_ = make(http.Header)
  4495. }
  4496. return c.header_
  4497. }
  4498. func (c *ProjectsLocationsClustersCompleteIpRotationCall) doRequest(alt string) (*http.Response, error) {
  4499. reqHeaders := make(http.Header)
  4500. for k, v := range c.header_ {
  4501. reqHeaders[k] = v
  4502. }
  4503. reqHeaders.Set("User-Agent", c.s.userAgent())
  4504. var body io.Reader = nil
  4505. body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeiprotationrequest)
  4506. if err != nil {
  4507. return nil, err
  4508. }
  4509. reqHeaders.Set("Content-Type", "application/json")
  4510. c.urlParams_.Set("alt", alt)
  4511. c.urlParams_.Set("prettyPrint", "false")
  4512. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:completeIpRotation")
  4513. urls += "?" + c.urlParams_.Encode()
  4514. req, err := http.NewRequest("POST", urls, body)
  4515. if err != nil {
  4516. return nil, err
  4517. }
  4518. req.Header = reqHeaders
  4519. googleapi.Expand(req.URL, map[string]string{
  4520. "name": c.name,
  4521. })
  4522. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4523. }
  4524. // Do executes the "container.projects.locations.clusters.completeIpRotation" call.
  4525. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4526. // status code is an error. Response headers are in either
  4527. // *Operation.ServerResponse.Header or (if a response was returned at
  4528. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4529. // to check whether the returned error was because
  4530. // http.StatusNotModified was returned.
  4531. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4532. gensupport.SetOptions(c.urlParams_, opts...)
  4533. res, err := c.doRequest("json")
  4534. if res != nil && res.StatusCode == http.StatusNotModified {
  4535. if res.Body != nil {
  4536. res.Body.Close()
  4537. }
  4538. return nil, &googleapi.Error{
  4539. Code: res.StatusCode,
  4540. Header: res.Header,
  4541. }
  4542. }
  4543. if err != nil {
  4544. return nil, err
  4545. }
  4546. defer googleapi.CloseBody(res)
  4547. if err := googleapi.CheckResponse(res); err != nil {
  4548. return nil, err
  4549. }
  4550. ret := &Operation{
  4551. ServerResponse: googleapi.ServerResponse{
  4552. Header: res.Header,
  4553. HTTPStatusCode: res.StatusCode,
  4554. },
  4555. }
  4556. target := &ret
  4557. if err := gensupport.DecodeResponse(target, res); err != nil {
  4558. return nil, err
  4559. }
  4560. return ret, nil
  4561. // {
  4562. // "description": "Completes master IP rotation.",
  4563. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:completeIpRotation",
  4564. // "httpMethod": "POST",
  4565. // "id": "container.projects.locations.clusters.completeIpRotation",
  4566. // "parameterOrder": [
  4567. // "name"
  4568. // ],
  4569. // "parameters": {
  4570. // "name": {
  4571. // "description": "The name (project, location, cluster id) of the cluster to complete IP\nrotation. Specified in the format 'projects/*/locations/*/clusters/*'.",
  4572. // "location": "path",
  4573. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4574. // "required": true,
  4575. // "type": "string"
  4576. // }
  4577. // },
  4578. // "path": "v1beta1/{+name}:completeIpRotation",
  4579. // "request": {
  4580. // "$ref": "CompleteIPRotationRequest"
  4581. // },
  4582. // "response": {
  4583. // "$ref": "Operation"
  4584. // },
  4585. // "scopes": [
  4586. // "https://www.googleapis.com/auth/cloud-platform"
  4587. // ]
  4588. // }
  4589. }
  4590. // method id "container.projects.locations.clusters.create":
  4591. type ProjectsLocationsClustersCreateCall struct {
  4592. s *Service
  4593. parent string
  4594. createclusterrequest *CreateClusterRequest
  4595. urlParams_ gensupport.URLParams
  4596. ctx_ context.Context
  4597. header_ http.Header
  4598. }
  4599. // Create: Creates a cluster, consisting of the specified number and
  4600. // type of Google
  4601. // Compute Engine instances.
  4602. //
  4603. // By default, the cluster is created in the project's
  4604. // [default
  4605. // network](/compute/docs/networks-and-firewalls#networks).
  4606. //
  4607. // One firewall is added for the cluster. After cluster creation,
  4608. // the cluster creates routes for each node to allow the containers
  4609. // on that node to communicate with all other instances in
  4610. // the
  4611. // cluster.
  4612. //
  4613. // Finally, an entry is added to the project's global metadata
  4614. // indicating
  4615. // which CIDR range is being used by the cluster.
  4616. func (r *ProjectsLocationsClustersService) Create(parent string, createclusterrequest *CreateClusterRequest) *ProjectsLocationsClustersCreateCall {
  4617. c := &ProjectsLocationsClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4618. c.parent = parent
  4619. c.createclusterrequest = createclusterrequest
  4620. return c
  4621. }
  4622. // Fields allows partial responses to be retrieved. See
  4623. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4624. // for more information.
  4625. func (c *ProjectsLocationsClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersCreateCall {
  4626. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4627. return c
  4628. }
  4629. // Context sets the context to be used in this call's Do method. Any
  4630. // pending HTTP request will be aborted if the provided context is
  4631. // canceled.
  4632. func (c *ProjectsLocationsClustersCreateCall) Context(ctx context.Context) *ProjectsLocationsClustersCreateCall {
  4633. c.ctx_ = ctx
  4634. return c
  4635. }
  4636. // Header returns an http.Header that can be modified by the caller to
  4637. // add HTTP headers to the request.
  4638. func (c *ProjectsLocationsClustersCreateCall) Header() http.Header {
  4639. if c.header_ == nil {
  4640. c.header_ = make(http.Header)
  4641. }
  4642. return c.header_
  4643. }
  4644. func (c *ProjectsLocationsClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  4645. reqHeaders := make(http.Header)
  4646. for k, v := range c.header_ {
  4647. reqHeaders[k] = v
  4648. }
  4649. reqHeaders.Set("User-Agent", c.s.userAgent())
  4650. var body io.Reader = nil
  4651. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest)
  4652. if err != nil {
  4653. return nil, err
  4654. }
  4655. reqHeaders.Set("Content-Type", "application/json")
  4656. c.urlParams_.Set("alt", alt)
  4657. c.urlParams_.Set("prettyPrint", "false")
  4658. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/clusters")
  4659. urls += "?" + c.urlParams_.Encode()
  4660. req, err := http.NewRequest("POST", urls, body)
  4661. if err != nil {
  4662. return nil, err
  4663. }
  4664. req.Header = reqHeaders
  4665. googleapi.Expand(req.URL, map[string]string{
  4666. "parent": c.parent,
  4667. })
  4668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4669. }
  4670. // Do executes the "container.projects.locations.clusters.create" call.
  4671. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4672. // status code is an error. Response headers are in either
  4673. // *Operation.ServerResponse.Header or (if a response was returned at
  4674. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4675. // to check whether the returned error was because
  4676. // http.StatusNotModified was returned.
  4677. func (c *ProjectsLocationsClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4678. gensupport.SetOptions(c.urlParams_, opts...)
  4679. res, err := c.doRequest("json")
  4680. if res != nil && res.StatusCode == http.StatusNotModified {
  4681. if res.Body != nil {
  4682. res.Body.Close()
  4683. }
  4684. return nil, &googleapi.Error{
  4685. Code: res.StatusCode,
  4686. Header: res.Header,
  4687. }
  4688. }
  4689. if err != nil {
  4690. return nil, err
  4691. }
  4692. defer googleapi.CloseBody(res)
  4693. if err := googleapi.CheckResponse(res); err != nil {
  4694. return nil, err
  4695. }
  4696. ret := &Operation{
  4697. ServerResponse: googleapi.ServerResponse{
  4698. Header: res.Header,
  4699. HTTPStatusCode: res.StatusCode,
  4700. },
  4701. }
  4702. target := &ret
  4703. if err := gensupport.DecodeResponse(target, res); err != nil {
  4704. return nil, err
  4705. }
  4706. return ret, nil
  4707. // {
  4708. // "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.",
  4709. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters",
  4710. // "httpMethod": "POST",
  4711. // "id": "container.projects.locations.clusters.create",
  4712. // "parameterOrder": [
  4713. // "parent"
  4714. // ],
  4715. // "parameters": {
  4716. // "parent": {
  4717. // "description": "The parent (project and location) where the cluster will be created.\nSpecified in the format 'projects/*/locations/*'.",
  4718. // "location": "path",
  4719. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  4720. // "required": true,
  4721. // "type": "string"
  4722. // }
  4723. // },
  4724. // "path": "v1beta1/{+parent}/clusters",
  4725. // "request": {
  4726. // "$ref": "CreateClusterRequest"
  4727. // },
  4728. // "response": {
  4729. // "$ref": "Operation"
  4730. // },
  4731. // "scopes": [
  4732. // "https://www.googleapis.com/auth/cloud-platform"
  4733. // ]
  4734. // }
  4735. }
  4736. // method id "container.projects.locations.clusters.delete":
  4737. type ProjectsLocationsClustersDeleteCall struct {
  4738. s *Service
  4739. name string
  4740. urlParams_ gensupport.URLParams
  4741. ctx_ context.Context
  4742. header_ http.Header
  4743. }
  4744. // Delete: Deletes the cluster, including the Kubernetes endpoint and
  4745. // all worker
  4746. // nodes.
  4747. //
  4748. // Firewalls and routes that were configured during cluster creation
  4749. // are also deleted.
  4750. //
  4751. // Other Google Compute Engine resources that might be in use by the
  4752. // cluster
  4753. // (e.g. load balancer resources) will not be deleted if they weren't
  4754. // present
  4755. // at the initial create time.
  4756. func (r *ProjectsLocationsClustersService) Delete(name string) *ProjectsLocationsClustersDeleteCall {
  4757. c := &ProjectsLocationsClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4758. c.name = name
  4759. return c
  4760. }
  4761. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  4762. // name of the cluster to delete.
  4763. // This field has been deprecated and replaced by the name field.
  4764. func (c *ProjectsLocationsClustersDeleteCall) ClusterId(clusterId string) *ProjectsLocationsClustersDeleteCall {
  4765. c.urlParams_.Set("clusterId", clusterId)
  4766. return c
  4767. }
  4768. // ProjectId sets the optional parameter "projectId": Deprecated. The
  4769. // Google Developers Console [project ID or
  4770. // project
  4771. // number](https://support.google.com/cloud/answer/6158840).
  4772. // This
  4773. // field has been deprecated and replaced by the name field.
  4774. func (c *ProjectsLocationsClustersDeleteCall) ProjectId(projectId string) *ProjectsLocationsClustersDeleteCall {
  4775. c.urlParams_.Set("projectId", projectId)
  4776. return c
  4777. }
  4778. // Zone sets the optional parameter "zone": Deprecated. The name of the
  4779. // Google Compute Engine
  4780. // [zone](/compute/docs/zones#available) in which the
  4781. // cluster
  4782. // resides.
  4783. // This field has been deprecated and replaced by the name field.
  4784. func (c *ProjectsLocationsClustersDeleteCall) Zone(zone string) *ProjectsLocationsClustersDeleteCall {
  4785. c.urlParams_.Set("zone", zone)
  4786. return c
  4787. }
  4788. // Fields allows partial responses to be retrieved. See
  4789. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4790. // for more information.
  4791. func (c *ProjectsLocationsClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersDeleteCall {
  4792. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4793. return c
  4794. }
  4795. // Context sets the context to be used in this call's Do method. Any
  4796. // pending HTTP request will be aborted if the provided context is
  4797. // canceled.
  4798. func (c *ProjectsLocationsClustersDeleteCall) Context(ctx context.Context) *ProjectsLocationsClustersDeleteCall {
  4799. c.ctx_ = ctx
  4800. return c
  4801. }
  4802. // Header returns an http.Header that can be modified by the caller to
  4803. // add HTTP headers to the request.
  4804. func (c *ProjectsLocationsClustersDeleteCall) Header() http.Header {
  4805. if c.header_ == nil {
  4806. c.header_ = make(http.Header)
  4807. }
  4808. return c.header_
  4809. }
  4810. func (c *ProjectsLocationsClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  4811. reqHeaders := make(http.Header)
  4812. for k, v := range c.header_ {
  4813. reqHeaders[k] = v
  4814. }
  4815. reqHeaders.Set("User-Agent", c.s.userAgent())
  4816. var body io.Reader = nil
  4817. c.urlParams_.Set("alt", alt)
  4818. c.urlParams_.Set("prettyPrint", "false")
  4819. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  4820. urls += "?" + c.urlParams_.Encode()
  4821. req, err := http.NewRequest("DELETE", urls, body)
  4822. if err != nil {
  4823. return nil, err
  4824. }
  4825. req.Header = reqHeaders
  4826. googleapi.Expand(req.URL, map[string]string{
  4827. "name": c.name,
  4828. })
  4829. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4830. }
  4831. // Do executes the "container.projects.locations.clusters.delete" call.
  4832. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4833. // status code is an error. Response headers are in either
  4834. // *Operation.ServerResponse.Header or (if a response was returned at
  4835. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4836. // to check whether the returned error was because
  4837. // http.StatusNotModified was returned.
  4838. func (c *ProjectsLocationsClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4839. gensupport.SetOptions(c.urlParams_, opts...)
  4840. res, err := c.doRequest("json")
  4841. if res != nil && res.StatusCode == http.StatusNotModified {
  4842. if res.Body != nil {
  4843. res.Body.Close()
  4844. }
  4845. return nil, &googleapi.Error{
  4846. Code: res.StatusCode,
  4847. Header: res.Header,
  4848. }
  4849. }
  4850. if err != nil {
  4851. return nil, err
  4852. }
  4853. defer googleapi.CloseBody(res)
  4854. if err := googleapi.CheckResponse(res); err != nil {
  4855. return nil, err
  4856. }
  4857. ret := &Operation{
  4858. ServerResponse: googleapi.ServerResponse{
  4859. Header: res.Header,
  4860. HTTPStatusCode: res.StatusCode,
  4861. },
  4862. }
  4863. target := &ret
  4864. if err := gensupport.DecodeResponse(target, res); err != nil {
  4865. return nil, err
  4866. }
  4867. return ret, nil
  4868. // {
  4869. // "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.",
  4870. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
  4871. // "httpMethod": "DELETE",
  4872. // "id": "container.projects.locations.clusters.delete",
  4873. // "parameterOrder": [
  4874. // "name"
  4875. // ],
  4876. // "parameters": {
  4877. // "clusterId": {
  4878. // "description": "Deprecated. The name of the cluster to delete.\nThis field has been deprecated and replaced by the name field.",
  4879. // "location": "query",
  4880. // "type": "string"
  4881. // },
  4882. // "name": {
  4883. // "description": "The name (project, location, cluster) of the cluster to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4884. // "location": "path",
  4885. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4886. // "required": true,
  4887. // "type": "string"
  4888. // },
  4889. // "projectId": {
  4890. // "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.",
  4891. // "location": "query",
  4892. // "type": "string"
  4893. // },
  4894. // "zone": {
  4895. // "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.",
  4896. // "location": "query",
  4897. // "type": "string"
  4898. // }
  4899. // },
  4900. // "path": "v1beta1/{+name}",
  4901. // "response": {
  4902. // "$ref": "Operation"
  4903. // },
  4904. // "scopes": [
  4905. // "https://www.googleapis.com/auth/cloud-platform"
  4906. // ]
  4907. // }
  4908. }
  4909. // method id "container.projects.locations.clusters.get":
  4910. type ProjectsLocationsClustersGetCall struct {
  4911. s *Service
  4912. name string
  4913. urlParams_ gensupport.URLParams
  4914. ifNoneMatch_ string
  4915. ctx_ context.Context
  4916. header_ http.Header
  4917. }
  4918. // Get: Gets the details for a specific cluster.
  4919. func (r *ProjectsLocationsClustersService) Get(name string) *ProjectsLocationsClustersGetCall {
  4920. c := &ProjectsLocationsClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4921. c.name = name
  4922. return c
  4923. }
  4924. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  4925. // name of the cluster to retrieve.
  4926. // This field has been deprecated and replaced by the name field.
  4927. func (c *ProjectsLocationsClustersGetCall) ClusterId(clusterId string) *ProjectsLocationsClustersGetCall {
  4928. c.urlParams_.Set("clusterId", clusterId)
  4929. return c
  4930. }
  4931. // ProjectId sets the optional parameter "projectId": Deprecated. The
  4932. // Google Developers Console [project ID or
  4933. // project
  4934. // number](https://support.google.com/cloud/answer/6158840).
  4935. // This
  4936. // field has been deprecated and replaced by the name field.
  4937. func (c *ProjectsLocationsClustersGetCall) ProjectId(projectId string) *ProjectsLocationsClustersGetCall {
  4938. c.urlParams_.Set("projectId", projectId)
  4939. return c
  4940. }
  4941. // Zone sets the optional parameter "zone": Deprecated. The name of the
  4942. // Google Compute Engine
  4943. // [zone](/compute/docs/zones#available) in which the
  4944. // cluster
  4945. // resides.
  4946. // This field has been deprecated and replaced by the name field.
  4947. func (c *ProjectsLocationsClustersGetCall) Zone(zone string) *ProjectsLocationsClustersGetCall {
  4948. c.urlParams_.Set("zone", zone)
  4949. return c
  4950. }
  4951. // Fields allows partial responses to be retrieved. See
  4952. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4953. // for more information.
  4954. func (c *ProjectsLocationsClustersGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersGetCall {
  4955. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4956. return c
  4957. }
  4958. // IfNoneMatch sets the optional parameter which makes the operation
  4959. // fail if the object's ETag matches the given value. This is useful for
  4960. // getting updates only after the object has changed since the last
  4961. // request. Use googleapi.IsNotModified to check whether the response
  4962. // error from Do is the result of In-None-Match.
  4963. func (c *ProjectsLocationsClustersGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersGetCall {
  4964. c.ifNoneMatch_ = entityTag
  4965. return c
  4966. }
  4967. // Context sets the context to be used in this call's Do method. Any
  4968. // pending HTTP request will be aborted if the provided context is
  4969. // canceled.
  4970. func (c *ProjectsLocationsClustersGetCall) Context(ctx context.Context) *ProjectsLocationsClustersGetCall {
  4971. c.ctx_ = ctx
  4972. return c
  4973. }
  4974. // Header returns an http.Header that can be modified by the caller to
  4975. // add HTTP headers to the request.
  4976. func (c *ProjectsLocationsClustersGetCall) Header() http.Header {
  4977. if c.header_ == nil {
  4978. c.header_ = make(http.Header)
  4979. }
  4980. return c.header_
  4981. }
  4982. func (c *ProjectsLocationsClustersGetCall) doRequest(alt string) (*http.Response, error) {
  4983. reqHeaders := make(http.Header)
  4984. for k, v := range c.header_ {
  4985. reqHeaders[k] = v
  4986. }
  4987. reqHeaders.Set("User-Agent", c.s.userAgent())
  4988. if c.ifNoneMatch_ != "" {
  4989. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4990. }
  4991. var body io.Reader = nil
  4992. c.urlParams_.Set("alt", alt)
  4993. c.urlParams_.Set("prettyPrint", "false")
  4994. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  4995. urls += "?" + c.urlParams_.Encode()
  4996. req, err := http.NewRequest("GET", urls, body)
  4997. if err != nil {
  4998. return nil, err
  4999. }
  5000. req.Header = reqHeaders
  5001. googleapi.Expand(req.URL, map[string]string{
  5002. "name": c.name,
  5003. })
  5004. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5005. }
  5006. // Do executes the "container.projects.locations.clusters.get" call.
  5007. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  5008. // code is an error. Response headers are in either
  5009. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  5010. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5011. // check whether the returned error was because http.StatusNotModified
  5012. // was returned.
  5013. func (c *ProjectsLocationsClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  5014. gensupport.SetOptions(c.urlParams_, opts...)
  5015. res, err := c.doRequest("json")
  5016. if res != nil && res.StatusCode == http.StatusNotModified {
  5017. if res.Body != nil {
  5018. res.Body.Close()
  5019. }
  5020. return nil, &googleapi.Error{
  5021. Code: res.StatusCode,
  5022. Header: res.Header,
  5023. }
  5024. }
  5025. if err != nil {
  5026. return nil, err
  5027. }
  5028. defer googleapi.CloseBody(res)
  5029. if err := googleapi.CheckResponse(res); err != nil {
  5030. return nil, err
  5031. }
  5032. ret := &Cluster{
  5033. ServerResponse: googleapi.ServerResponse{
  5034. Header: res.Header,
  5035. HTTPStatusCode: res.StatusCode,
  5036. },
  5037. }
  5038. target := &ret
  5039. if err := gensupport.DecodeResponse(target, res); err != nil {
  5040. return nil, err
  5041. }
  5042. return ret, nil
  5043. // {
  5044. // "description": "Gets the details for a specific cluster.",
  5045. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
  5046. // "httpMethod": "GET",
  5047. // "id": "container.projects.locations.clusters.get",
  5048. // "parameterOrder": [
  5049. // "name"
  5050. // ],
  5051. // "parameters": {
  5052. // "clusterId": {
  5053. // "description": "Deprecated. The name of the cluster to retrieve.\nThis field has been deprecated and replaced by the name field.",
  5054. // "location": "query",
  5055. // "type": "string"
  5056. // },
  5057. // "name": {
  5058. // "description": "The name (project, location, cluster) of the cluster to retrieve.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5059. // "location": "path",
  5060. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5061. // "required": true,
  5062. // "type": "string"
  5063. // },
  5064. // "projectId": {
  5065. // "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.",
  5066. // "location": "query",
  5067. // "type": "string"
  5068. // },
  5069. // "zone": {
  5070. // "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.",
  5071. // "location": "query",
  5072. // "type": "string"
  5073. // }
  5074. // },
  5075. // "path": "v1beta1/{+name}",
  5076. // "response": {
  5077. // "$ref": "Cluster"
  5078. // },
  5079. // "scopes": [
  5080. // "https://www.googleapis.com/auth/cloud-platform"
  5081. // ]
  5082. // }
  5083. }
  5084. // method id "container.projects.locations.clusters.getJwks":
  5085. type ProjectsLocationsClustersGetJwksCall struct {
  5086. s *Service
  5087. parent string
  5088. urlParams_ gensupport.URLParams
  5089. ifNoneMatch_ string
  5090. ctx_ context.Context
  5091. header_ http.Header
  5092. }
  5093. // GetJwks: GetJSONWebKeys gets the public component of the cluster
  5094. // signing keys in
  5095. // JSON Web Key format.
  5096. // This API is not yet intended for general use, and is not available
  5097. // for all
  5098. // clusters.
  5099. func (r *ProjectsLocationsClustersService) GetJwks(parent string) *ProjectsLocationsClustersGetJwksCall {
  5100. c := &ProjectsLocationsClustersGetJwksCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5101. c.parent = parent
  5102. return c
  5103. }
  5104. // Fields allows partial responses to be retrieved. See
  5105. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5106. // for more information.
  5107. func (c *ProjectsLocationsClustersGetJwksCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersGetJwksCall {
  5108. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5109. return c
  5110. }
  5111. // IfNoneMatch sets the optional parameter which makes the operation
  5112. // fail if the object's ETag matches the given value. This is useful for
  5113. // getting updates only after the object has changed since the last
  5114. // request. Use googleapi.IsNotModified to check whether the response
  5115. // error from Do is the result of In-None-Match.
  5116. func (c *ProjectsLocationsClustersGetJwksCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersGetJwksCall {
  5117. c.ifNoneMatch_ = entityTag
  5118. return c
  5119. }
  5120. // Context sets the context to be used in this call's Do method. Any
  5121. // pending HTTP request will be aborted if the provided context is
  5122. // canceled.
  5123. func (c *ProjectsLocationsClustersGetJwksCall) Context(ctx context.Context) *ProjectsLocationsClustersGetJwksCall {
  5124. c.ctx_ = ctx
  5125. return c
  5126. }
  5127. // Header returns an http.Header that can be modified by the caller to
  5128. // add HTTP headers to the request.
  5129. func (c *ProjectsLocationsClustersGetJwksCall) Header() http.Header {
  5130. if c.header_ == nil {
  5131. c.header_ = make(http.Header)
  5132. }
  5133. return c.header_
  5134. }
  5135. func (c *ProjectsLocationsClustersGetJwksCall) doRequest(alt string) (*http.Response, error) {
  5136. reqHeaders := make(http.Header)
  5137. for k, v := range c.header_ {
  5138. reqHeaders[k] = v
  5139. }
  5140. reqHeaders.Set("User-Agent", c.s.userAgent())
  5141. if c.ifNoneMatch_ != "" {
  5142. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5143. }
  5144. var body io.Reader = nil
  5145. c.urlParams_.Set("alt", alt)
  5146. c.urlParams_.Set("prettyPrint", "false")
  5147. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/jwks")
  5148. urls += "?" + c.urlParams_.Encode()
  5149. req, err := http.NewRequest("GET", urls, body)
  5150. if err != nil {
  5151. return nil, err
  5152. }
  5153. req.Header = reqHeaders
  5154. googleapi.Expand(req.URL, map[string]string{
  5155. "parent": c.parent,
  5156. })
  5157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5158. }
  5159. // Do executes the "container.projects.locations.clusters.getJwks" call.
  5160. // Exactly one of *GetJSONWebKeysResponse or error will be non-nil. Any
  5161. // non-2xx status code is an error. Response headers are in either
  5162. // *GetJSONWebKeysResponse.ServerResponse.Header or (if a response was
  5163. // returned at all) in error.(*googleapi.Error).Header. Use
  5164. // googleapi.IsNotModified to check whether the returned error was
  5165. // because http.StatusNotModified was returned.
  5166. func (c *ProjectsLocationsClustersGetJwksCall) Do(opts ...googleapi.CallOption) (*GetJSONWebKeysResponse, error) {
  5167. gensupport.SetOptions(c.urlParams_, opts...)
  5168. res, err := c.doRequest("json")
  5169. if res != nil && res.StatusCode == http.StatusNotModified {
  5170. if res.Body != nil {
  5171. res.Body.Close()
  5172. }
  5173. return nil, &googleapi.Error{
  5174. Code: res.StatusCode,
  5175. Header: res.Header,
  5176. }
  5177. }
  5178. if err != nil {
  5179. return nil, err
  5180. }
  5181. defer googleapi.CloseBody(res)
  5182. if err := googleapi.CheckResponse(res); err != nil {
  5183. return nil, err
  5184. }
  5185. ret := &GetJSONWebKeysResponse{
  5186. ServerResponse: googleapi.ServerResponse{
  5187. Header: res.Header,
  5188. HTTPStatusCode: res.StatusCode,
  5189. },
  5190. }
  5191. target := &ret
  5192. if err := gensupport.DecodeResponse(target, res); err != nil {
  5193. return nil, err
  5194. }
  5195. return ret, nil
  5196. // {
  5197. // "description": "GetJSONWebKeys gets the public component of the cluster signing keys in\nJSON Web Key format.\nThis API is not yet intended for general use, and is not available for all\nclusters.",
  5198. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/jwks",
  5199. // "httpMethod": "GET",
  5200. // "id": "container.projects.locations.clusters.getJwks",
  5201. // "parameterOrder": [
  5202. // "parent"
  5203. // ],
  5204. // "parameters": {
  5205. // "parent": {
  5206. // "description": "The cluster (project, location, cluster id) to get keys for. Specified in\nthe format 'projects/*/locations/*/clusters/*'.",
  5207. // "location": "path",
  5208. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5209. // "required": true,
  5210. // "type": "string"
  5211. // }
  5212. // },
  5213. // "path": "v1beta1/{+parent}/jwks",
  5214. // "response": {
  5215. // "$ref": "GetJSONWebKeysResponse"
  5216. // },
  5217. // "scopes": [
  5218. // "https://www.googleapis.com/auth/cloud-platform"
  5219. // ]
  5220. // }
  5221. }
  5222. // method id "container.projects.locations.clusters.list":
  5223. type ProjectsLocationsClustersListCall struct {
  5224. s *Service
  5225. parent string
  5226. urlParams_ gensupport.URLParams
  5227. ifNoneMatch_ string
  5228. ctx_ context.Context
  5229. header_ http.Header
  5230. }
  5231. // List: Lists all clusters owned by a project in either the specified
  5232. // zone or all
  5233. // zones.
  5234. func (r *ProjectsLocationsClustersService) List(parent string) *ProjectsLocationsClustersListCall {
  5235. c := &ProjectsLocationsClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5236. c.parent = parent
  5237. return c
  5238. }
  5239. // ProjectId sets the optional parameter "projectId": Deprecated. The
  5240. // Google Developers Console [project ID or
  5241. // project
  5242. // number](https://support.google.com/cloud/answer/6158840).
  5243. // This
  5244. // field has been deprecated and replaced by the parent field.
  5245. func (c *ProjectsLocationsClustersListCall) ProjectId(projectId string) *ProjectsLocationsClustersListCall {
  5246. c.urlParams_.Set("projectId", projectId)
  5247. return c
  5248. }
  5249. // Zone sets the optional parameter "zone": Deprecated. The name of the
  5250. // Google Compute Engine
  5251. // [zone](/compute/docs/zones#available) in which the cluster
  5252. // resides, or "-" for all zones.
  5253. // This field has been deprecated and replaced by the parent field.
  5254. func (c *ProjectsLocationsClustersListCall) Zone(zone string) *ProjectsLocationsClustersListCall {
  5255. c.urlParams_.Set("zone", zone)
  5256. return c
  5257. }
  5258. // Fields allows partial responses to be retrieved. See
  5259. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5260. // for more information.
  5261. func (c *ProjectsLocationsClustersListCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersListCall {
  5262. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5263. return c
  5264. }
  5265. // IfNoneMatch sets the optional parameter which makes the operation
  5266. // fail if the object's ETag matches the given value. This is useful for
  5267. // getting updates only after the object has changed since the last
  5268. // request. Use googleapi.IsNotModified to check whether the response
  5269. // error from Do is the result of In-None-Match.
  5270. func (c *ProjectsLocationsClustersListCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersListCall {
  5271. c.ifNoneMatch_ = entityTag
  5272. return c
  5273. }
  5274. // Context sets the context to be used in this call's Do method. Any
  5275. // pending HTTP request will be aborted if the provided context is
  5276. // canceled.
  5277. func (c *ProjectsLocationsClustersListCall) Context(ctx context.Context) *ProjectsLocationsClustersListCall {
  5278. c.ctx_ = ctx
  5279. return c
  5280. }
  5281. // Header returns an http.Header that can be modified by the caller to
  5282. // add HTTP headers to the request.
  5283. func (c *ProjectsLocationsClustersListCall) Header() http.Header {
  5284. if c.header_ == nil {
  5285. c.header_ = make(http.Header)
  5286. }
  5287. return c.header_
  5288. }
  5289. func (c *ProjectsLocationsClustersListCall) doRequest(alt string) (*http.Response, error) {
  5290. reqHeaders := make(http.Header)
  5291. for k, v := range c.header_ {
  5292. reqHeaders[k] = v
  5293. }
  5294. reqHeaders.Set("User-Agent", c.s.userAgent())
  5295. if c.ifNoneMatch_ != "" {
  5296. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5297. }
  5298. var body io.Reader = nil
  5299. c.urlParams_.Set("alt", alt)
  5300. c.urlParams_.Set("prettyPrint", "false")
  5301. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/clusters")
  5302. urls += "?" + c.urlParams_.Encode()
  5303. req, err := http.NewRequest("GET", urls, body)
  5304. if err != nil {
  5305. return nil, err
  5306. }
  5307. req.Header = reqHeaders
  5308. googleapi.Expand(req.URL, map[string]string{
  5309. "parent": c.parent,
  5310. })
  5311. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5312. }
  5313. // Do executes the "container.projects.locations.clusters.list" call.
  5314. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  5315. // non-2xx status code is an error. Response headers are in either
  5316. // *ListClustersResponse.ServerResponse.Header or (if a response was
  5317. // returned at all) in error.(*googleapi.Error).Header. Use
  5318. // googleapi.IsNotModified to check whether the returned error was
  5319. // because http.StatusNotModified was returned.
  5320. func (c *ProjectsLocationsClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  5321. gensupport.SetOptions(c.urlParams_, opts...)
  5322. res, err := c.doRequest("json")
  5323. if res != nil && res.StatusCode == http.StatusNotModified {
  5324. if res.Body != nil {
  5325. res.Body.Close()
  5326. }
  5327. return nil, &googleapi.Error{
  5328. Code: res.StatusCode,
  5329. Header: res.Header,
  5330. }
  5331. }
  5332. if err != nil {
  5333. return nil, err
  5334. }
  5335. defer googleapi.CloseBody(res)
  5336. if err := googleapi.CheckResponse(res); err != nil {
  5337. return nil, err
  5338. }
  5339. ret := &ListClustersResponse{
  5340. ServerResponse: googleapi.ServerResponse{
  5341. Header: res.Header,
  5342. HTTPStatusCode: res.StatusCode,
  5343. },
  5344. }
  5345. target := &ret
  5346. if err := gensupport.DecodeResponse(target, res); err != nil {
  5347. return nil, err
  5348. }
  5349. return ret, nil
  5350. // {
  5351. // "description": "Lists all clusters owned by a project in either the specified zone or all\nzones.",
  5352. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters",
  5353. // "httpMethod": "GET",
  5354. // "id": "container.projects.locations.clusters.list",
  5355. // "parameterOrder": [
  5356. // "parent"
  5357. // ],
  5358. // "parameters": {
  5359. // "parent": {
  5360. // "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.",
  5361. // "location": "path",
  5362. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  5363. // "required": true,
  5364. // "type": "string"
  5365. // },
  5366. // "projectId": {
  5367. // "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.",
  5368. // "location": "query",
  5369. // "type": "string"
  5370. // },
  5371. // "zone": {
  5372. // "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.",
  5373. // "location": "query",
  5374. // "type": "string"
  5375. // }
  5376. // },
  5377. // "path": "v1beta1/{+parent}/clusters",
  5378. // "response": {
  5379. // "$ref": "ListClustersResponse"
  5380. // },
  5381. // "scopes": [
  5382. // "https://www.googleapis.com/auth/cloud-platform"
  5383. // ]
  5384. // }
  5385. }
  5386. // method id "container.projects.locations.clusters.setAddons":
  5387. type ProjectsLocationsClustersSetAddonsCall struct {
  5388. s *Service
  5389. name string
  5390. setaddonsconfigrequest *SetAddonsConfigRequest
  5391. urlParams_ gensupport.URLParams
  5392. ctx_ context.Context
  5393. header_ http.Header
  5394. }
  5395. // SetAddons: Sets the addons for a specific cluster.
  5396. func (r *ProjectsLocationsClustersService) SetAddons(name string, setaddonsconfigrequest *SetAddonsConfigRequest) *ProjectsLocationsClustersSetAddonsCall {
  5397. c := &ProjectsLocationsClustersSetAddonsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5398. c.name = name
  5399. c.setaddonsconfigrequest = setaddonsconfigrequest
  5400. return c
  5401. }
  5402. // Fields allows partial responses to be retrieved. See
  5403. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5404. // for more information.
  5405. func (c *ProjectsLocationsClustersSetAddonsCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetAddonsCall {
  5406. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5407. return c
  5408. }
  5409. // Context sets the context to be used in this call's Do method. Any
  5410. // pending HTTP request will be aborted if the provided context is
  5411. // canceled.
  5412. func (c *ProjectsLocationsClustersSetAddonsCall) Context(ctx context.Context) *ProjectsLocationsClustersSetAddonsCall {
  5413. c.ctx_ = ctx
  5414. return c
  5415. }
  5416. // Header returns an http.Header that can be modified by the caller to
  5417. // add HTTP headers to the request.
  5418. func (c *ProjectsLocationsClustersSetAddonsCall) Header() http.Header {
  5419. if c.header_ == nil {
  5420. c.header_ = make(http.Header)
  5421. }
  5422. return c.header_
  5423. }
  5424. func (c *ProjectsLocationsClustersSetAddonsCall) doRequest(alt string) (*http.Response, error) {
  5425. reqHeaders := make(http.Header)
  5426. for k, v := range c.header_ {
  5427. reqHeaders[k] = v
  5428. }
  5429. reqHeaders.Set("User-Agent", c.s.userAgent())
  5430. var body io.Reader = nil
  5431. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setaddonsconfigrequest)
  5432. if err != nil {
  5433. return nil, err
  5434. }
  5435. reqHeaders.Set("Content-Type", "application/json")
  5436. c.urlParams_.Set("alt", alt)
  5437. c.urlParams_.Set("prettyPrint", "false")
  5438. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setAddons")
  5439. urls += "?" + c.urlParams_.Encode()
  5440. req, err := http.NewRequest("POST", urls, body)
  5441. if err != nil {
  5442. return nil, err
  5443. }
  5444. req.Header = reqHeaders
  5445. googleapi.Expand(req.URL, map[string]string{
  5446. "name": c.name,
  5447. })
  5448. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5449. }
  5450. // Do executes the "container.projects.locations.clusters.setAddons" call.
  5451. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5452. // status code is an error. Response headers are in either
  5453. // *Operation.ServerResponse.Header or (if a response was returned at
  5454. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5455. // to check whether the returned error was because
  5456. // http.StatusNotModified was returned.
  5457. func (c *ProjectsLocationsClustersSetAddonsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5458. gensupport.SetOptions(c.urlParams_, opts...)
  5459. res, err := c.doRequest("json")
  5460. if res != nil && res.StatusCode == http.StatusNotModified {
  5461. if res.Body != nil {
  5462. res.Body.Close()
  5463. }
  5464. return nil, &googleapi.Error{
  5465. Code: res.StatusCode,
  5466. Header: res.Header,
  5467. }
  5468. }
  5469. if err != nil {
  5470. return nil, err
  5471. }
  5472. defer googleapi.CloseBody(res)
  5473. if err := googleapi.CheckResponse(res); err != nil {
  5474. return nil, err
  5475. }
  5476. ret := &Operation{
  5477. ServerResponse: googleapi.ServerResponse{
  5478. Header: res.Header,
  5479. HTTPStatusCode: res.StatusCode,
  5480. },
  5481. }
  5482. target := &ret
  5483. if err := gensupport.DecodeResponse(target, res); err != nil {
  5484. return nil, err
  5485. }
  5486. return ret, nil
  5487. // {
  5488. // "description": "Sets the addons for a specific cluster.",
  5489. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setAddons",
  5490. // "httpMethod": "POST",
  5491. // "id": "container.projects.locations.clusters.setAddons",
  5492. // "parameterOrder": [
  5493. // "name"
  5494. // ],
  5495. // "parameters": {
  5496. // "name": {
  5497. // "description": "The name (project, location, cluster) of the cluster to set addons.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5498. // "location": "path",
  5499. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5500. // "required": true,
  5501. // "type": "string"
  5502. // }
  5503. // },
  5504. // "path": "v1beta1/{+name}:setAddons",
  5505. // "request": {
  5506. // "$ref": "SetAddonsConfigRequest"
  5507. // },
  5508. // "response": {
  5509. // "$ref": "Operation"
  5510. // },
  5511. // "scopes": [
  5512. // "https://www.googleapis.com/auth/cloud-platform"
  5513. // ]
  5514. // }
  5515. }
  5516. // method id "container.projects.locations.clusters.setLegacyAbac":
  5517. type ProjectsLocationsClustersSetLegacyAbacCall struct {
  5518. s *Service
  5519. name string
  5520. setlegacyabacrequest *SetLegacyAbacRequest
  5521. urlParams_ gensupport.URLParams
  5522. ctx_ context.Context
  5523. header_ http.Header
  5524. }
  5525. // SetLegacyAbac: Enables or disables the ABAC authorization mechanism
  5526. // on a cluster.
  5527. func (r *ProjectsLocationsClustersService) SetLegacyAbac(name string, setlegacyabacrequest *SetLegacyAbacRequest) *ProjectsLocationsClustersSetLegacyAbacCall {
  5528. c := &ProjectsLocationsClustersSetLegacyAbacCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5529. c.name = name
  5530. c.setlegacyabacrequest = setlegacyabacrequest
  5531. return c
  5532. }
  5533. // Fields allows partial responses to be retrieved. See
  5534. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5535. // for more information.
  5536. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetLegacyAbacCall {
  5537. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5538. return c
  5539. }
  5540. // Context sets the context to be used in this call's Do method. Any
  5541. // pending HTTP request will be aborted if the provided context is
  5542. // canceled.
  5543. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Context(ctx context.Context) *ProjectsLocationsClustersSetLegacyAbacCall {
  5544. c.ctx_ = ctx
  5545. return c
  5546. }
  5547. // Header returns an http.Header that can be modified by the caller to
  5548. // add HTTP headers to the request.
  5549. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Header() http.Header {
  5550. if c.header_ == nil {
  5551. c.header_ = make(http.Header)
  5552. }
  5553. return c.header_
  5554. }
  5555. func (c *ProjectsLocationsClustersSetLegacyAbacCall) doRequest(alt string) (*http.Response, error) {
  5556. reqHeaders := make(http.Header)
  5557. for k, v := range c.header_ {
  5558. reqHeaders[k] = v
  5559. }
  5560. reqHeaders.Set("User-Agent", c.s.userAgent())
  5561. var body io.Reader = nil
  5562. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlegacyabacrequest)
  5563. if err != nil {
  5564. return nil, err
  5565. }
  5566. reqHeaders.Set("Content-Type", "application/json")
  5567. c.urlParams_.Set("alt", alt)
  5568. c.urlParams_.Set("prettyPrint", "false")
  5569. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setLegacyAbac")
  5570. urls += "?" + c.urlParams_.Encode()
  5571. req, err := http.NewRequest("POST", urls, body)
  5572. if err != nil {
  5573. return nil, err
  5574. }
  5575. req.Header = reqHeaders
  5576. googleapi.Expand(req.URL, map[string]string{
  5577. "name": c.name,
  5578. })
  5579. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5580. }
  5581. // Do executes the "container.projects.locations.clusters.setLegacyAbac" call.
  5582. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5583. // status code is an error. Response headers are in either
  5584. // *Operation.ServerResponse.Header or (if a response was returned at
  5585. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5586. // to check whether the returned error was because
  5587. // http.StatusNotModified was returned.
  5588. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5589. gensupport.SetOptions(c.urlParams_, opts...)
  5590. res, err := c.doRequest("json")
  5591. if res != nil && res.StatusCode == http.StatusNotModified {
  5592. if res.Body != nil {
  5593. res.Body.Close()
  5594. }
  5595. return nil, &googleapi.Error{
  5596. Code: res.StatusCode,
  5597. Header: res.Header,
  5598. }
  5599. }
  5600. if err != nil {
  5601. return nil, err
  5602. }
  5603. defer googleapi.CloseBody(res)
  5604. if err := googleapi.CheckResponse(res); err != nil {
  5605. return nil, err
  5606. }
  5607. ret := &Operation{
  5608. ServerResponse: googleapi.ServerResponse{
  5609. Header: res.Header,
  5610. HTTPStatusCode: res.StatusCode,
  5611. },
  5612. }
  5613. target := &ret
  5614. if err := gensupport.DecodeResponse(target, res); err != nil {
  5615. return nil, err
  5616. }
  5617. return ret, nil
  5618. // {
  5619. // "description": "Enables or disables the ABAC authorization mechanism on a cluster.",
  5620. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLegacyAbac",
  5621. // "httpMethod": "POST",
  5622. // "id": "container.projects.locations.clusters.setLegacyAbac",
  5623. // "parameterOrder": [
  5624. // "name"
  5625. // ],
  5626. // "parameters": {
  5627. // "name": {
  5628. // "description": "The name (project, location, cluster id) of the cluster to set legacy abac.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5629. // "location": "path",
  5630. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5631. // "required": true,
  5632. // "type": "string"
  5633. // }
  5634. // },
  5635. // "path": "v1beta1/{+name}:setLegacyAbac",
  5636. // "request": {
  5637. // "$ref": "SetLegacyAbacRequest"
  5638. // },
  5639. // "response": {
  5640. // "$ref": "Operation"
  5641. // },
  5642. // "scopes": [
  5643. // "https://www.googleapis.com/auth/cloud-platform"
  5644. // ]
  5645. // }
  5646. }
  5647. // method id "container.projects.locations.clusters.setLocations":
  5648. type ProjectsLocationsClustersSetLocationsCall struct {
  5649. s *Service
  5650. name string
  5651. setlocationsrequest *SetLocationsRequest
  5652. urlParams_ gensupport.URLParams
  5653. ctx_ context.Context
  5654. header_ http.Header
  5655. }
  5656. // SetLocations: Sets the locations for a specific cluster.
  5657. func (r *ProjectsLocationsClustersService) SetLocations(name string, setlocationsrequest *SetLocationsRequest) *ProjectsLocationsClustersSetLocationsCall {
  5658. c := &ProjectsLocationsClustersSetLocationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5659. c.name = name
  5660. c.setlocationsrequest = setlocationsrequest
  5661. return c
  5662. }
  5663. // Fields allows partial responses to be retrieved. See
  5664. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5665. // for more information.
  5666. func (c *ProjectsLocationsClustersSetLocationsCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetLocationsCall {
  5667. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5668. return c
  5669. }
  5670. // Context sets the context to be used in this call's Do method. Any
  5671. // pending HTTP request will be aborted if the provided context is
  5672. // canceled.
  5673. func (c *ProjectsLocationsClustersSetLocationsCall) Context(ctx context.Context) *ProjectsLocationsClustersSetLocationsCall {
  5674. c.ctx_ = ctx
  5675. return c
  5676. }
  5677. // Header returns an http.Header that can be modified by the caller to
  5678. // add HTTP headers to the request.
  5679. func (c *ProjectsLocationsClustersSetLocationsCall) Header() http.Header {
  5680. if c.header_ == nil {
  5681. c.header_ = make(http.Header)
  5682. }
  5683. return c.header_
  5684. }
  5685. func (c *ProjectsLocationsClustersSetLocationsCall) doRequest(alt string) (*http.Response, error) {
  5686. reqHeaders := make(http.Header)
  5687. for k, v := range c.header_ {
  5688. reqHeaders[k] = v
  5689. }
  5690. reqHeaders.Set("User-Agent", c.s.userAgent())
  5691. var body io.Reader = nil
  5692. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlocationsrequest)
  5693. if err != nil {
  5694. return nil, err
  5695. }
  5696. reqHeaders.Set("Content-Type", "application/json")
  5697. c.urlParams_.Set("alt", alt)
  5698. c.urlParams_.Set("prettyPrint", "false")
  5699. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setLocations")
  5700. urls += "?" + c.urlParams_.Encode()
  5701. req, err := http.NewRequest("POST", urls, body)
  5702. if err != nil {
  5703. return nil, err
  5704. }
  5705. req.Header = reqHeaders
  5706. googleapi.Expand(req.URL, map[string]string{
  5707. "name": c.name,
  5708. })
  5709. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5710. }
  5711. // Do executes the "container.projects.locations.clusters.setLocations" call.
  5712. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5713. // status code is an error. Response headers are in either
  5714. // *Operation.ServerResponse.Header or (if a response was returned at
  5715. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5716. // to check whether the returned error was because
  5717. // http.StatusNotModified was returned.
  5718. func (c *ProjectsLocationsClustersSetLocationsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5719. gensupport.SetOptions(c.urlParams_, opts...)
  5720. res, err := c.doRequest("json")
  5721. if res != nil && res.StatusCode == http.StatusNotModified {
  5722. if res.Body != nil {
  5723. res.Body.Close()
  5724. }
  5725. return nil, &googleapi.Error{
  5726. Code: res.StatusCode,
  5727. Header: res.Header,
  5728. }
  5729. }
  5730. if err != nil {
  5731. return nil, err
  5732. }
  5733. defer googleapi.CloseBody(res)
  5734. if err := googleapi.CheckResponse(res); err != nil {
  5735. return nil, err
  5736. }
  5737. ret := &Operation{
  5738. ServerResponse: googleapi.ServerResponse{
  5739. Header: res.Header,
  5740. HTTPStatusCode: res.StatusCode,
  5741. },
  5742. }
  5743. target := &ret
  5744. if err := gensupport.DecodeResponse(target, res); err != nil {
  5745. return nil, err
  5746. }
  5747. return ret, nil
  5748. // {
  5749. // "description": "Sets the locations for a specific cluster.",
  5750. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLocations",
  5751. // "httpMethod": "POST",
  5752. // "id": "container.projects.locations.clusters.setLocations",
  5753. // "parameterOrder": [
  5754. // "name"
  5755. // ],
  5756. // "parameters": {
  5757. // "name": {
  5758. // "description": "The name (project, location, cluster) of the cluster to set locations.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5759. // "location": "path",
  5760. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5761. // "required": true,
  5762. // "type": "string"
  5763. // }
  5764. // },
  5765. // "path": "v1beta1/{+name}:setLocations",
  5766. // "request": {
  5767. // "$ref": "SetLocationsRequest"
  5768. // },
  5769. // "response": {
  5770. // "$ref": "Operation"
  5771. // },
  5772. // "scopes": [
  5773. // "https://www.googleapis.com/auth/cloud-platform"
  5774. // ]
  5775. // }
  5776. }
  5777. // method id "container.projects.locations.clusters.setLogging":
  5778. type ProjectsLocationsClustersSetLoggingCall struct {
  5779. s *Service
  5780. name string
  5781. setloggingservicerequest *SetLoggingServiceRequest
  5782. urlParams_ gensupport.URLParams
  5783. ctx_ context.Context
  5784. header_ http.Header
  5785. }
  5786. // SetLogging: Sets the logging service for a specific cluster.
  5787. func (r *ProjectsLocationsClustersService) SetLogging(name string, setloggingservicerequest *SetLoggingServiceRequest) *ProjectsLocationsClustersSetLoggingCall {
  5788. c := &ProjectsLocationsClustersSetLoggingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5789. c.name = name
  5790. c.setloggingservicerequest = setloggingservicerequest
  5791. return c
  5792. }
  5793. // Fields allows partial responses to be retrieved. See
  5794. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5795. // for more information.
  5796. func (c *ProjectsLocationsClustersSetLoggingCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetLoggingCall {
  5797. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5798. return c
  5799. }
  5800. // Context sets the context to be used in this call's Do method. Any
  5801. // pending HTTP request will be aborted if the provided context is
  5802. // canceled.
  5803. func (c *ProjectsLocationsClustersSetLoggingCall) Context(ctx context.Context) *ProjectsLocationsClustersSetLoggingCall {
  5804. c.ctx_ = ctx
  5805. return c
  5806. }
  5807. // Header returns an http.Header that can be modified by the caller to
  5808. // add HTTP headers to the request.
  5809. func (c *ProjectsLocationsClustersSetLoggingCall) Header() http.Header {
  5810. if c.header_ == nil {
  5811. c.header_ = make(http.Header)
  5812. }
  5813. return c.header_
  5814. }
  5815. func (c *ProjectsLocationsClustersSetLoggingCall) doRequest(alt string) (*http.Response, error) {
  5816. reqHeaders := make(http.Header)
  5817. for k, v := range c.header_ {
  5818. reqHeaders[k] = v
  5819. }
  5820. reqHeaders.Set("User-Agent", c.s.userAgent())
  5821. var body io.Reader = nil
  5822. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setloggingservicerequest)
  5823. if err != nil {
  5824. return nil, err
  5825. }
  5826. reqHeaders.Set("Content-Type", "application/json")
  5827. c.urlParams_.Set("alt", alt)
  5828. c.urlParams_.Set("prettyPrint", "false")
  5829. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setLogging")
  5830. urls += "?" + c.urlParams_.Encode()
  5831. req, err := http.NewRequest("POST", urls, body)
  5832. if err != nil {
  5833. return nil, err
  5834. }
  5835. req.Header = reqHeaders
  5836. googleapi.Expand(req.URL, map[string]string{
  5837. "name": c.name,
  5838. })
  5839. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5840. }
  5841. // Do executes the "container.projects.locations.clusters.setLogging" call.
  5842. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5843. // status code is an error. Response headers are in either
  5844. // *Operation.ServerResponse.Header or (if a response was returned at
  5845. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5846. // to check whether the returned error was because
  5847. // http.StatusNotModified was returned.
  5848. func (c *ProjectsLocationsClustersSetLoggingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5849. gensupport.SetOptions(c.urlParams_, opts...)
  5850. res, err := c.doRequest("json")
  5851. if res != nil && res.StatusCode == http.StatusNotModified {
  5852. if res.Body != nil {
  5853. res.Body.Close()
  5854. }
  5855. return nil, &googleapi.Error{
  5856. Code: res.StatusCode,
  5857. Header: res.Header,
  5858. }
  5859. }
  5860. if err != nil {
  5861. return nil, err
  5862. }
  5863. defer googleapi.CloseBody(res)
  5864. if err := googleapi.CheckResponse(res); err != nil {
  5865. return nil, err
  5866. }
  5867. ret := &Operation{
  5868. ServerResponse: googleapi.ServerResponse{
  5869. Header: res.Header,
  5870. HTTPStatusCode: res.StatusCode,
  5871. },
  5872. }
  5873. target := &ret
  5874. if err := gensupport.DecodeResponse(target, res); err != nil {
  5875. return nil, err
  5876. }
  5877. return ret, nil
  5878. // {
  5879. // "description": "Sets the logging service for a specific cluster.",
  5880. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLogging",
  5881. // "httpMethod": "POST",
  5882. // "id": "container.projects.locations.clusters.setLogging",
  5883. // "parameterOrder": [
  5884. // "name"
  5885. // ],
  5886. // "parameters": {
  5887. // "name": {
  5888. // "description": "The name (project, location, cluster) of the cluster to set logging.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5889. // "location": "path",
  5890. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5891. // "required": true,
  5892. // "type": "string"
  5893. // }
  5894. // },
  5895. // "path": "v1beta1/{+name}:setLogging",
  5896. // "request": {
  5897. // "$ref": "SetLoggingServiceRequest"
  5898. // },
  5899. // "response": {
  5900. // "$ref": "Operation"
  5901. // },
  5902. // "scopes": [
  5903. // "https://www.googleapis.com/auth/cloud-platform"
  5904. // ]
  5905. // }
  5906. }
  5907. // method id "container.projects.locations.clusters.setMaintenancePolicy":
  5908. type ProjectsLocationsClustersSetMaintenancePolicyCall struct {
  5909. s *Service
  5910. name string
  5911. setmaintenancepolicyrequest *SetMaintenancePolicyRequest
  5912. urlParams_ gensupport.URLParams
  5913. ctx_ context.Context
  5914. header_ http.Header
  5915. }
  5916. // SetMaintenancePolicy: Sets the maintenance policy for a cluster.
  5917. func (r *ProjectsLocationsClustersService) SetMaintenancePolicy(name string, setmaintenancepolicyrequest *SetMaintenancePolicyRequest) *ProjectsLocationsClustersSetMaintenancePolicyCall {
  5918. c := &ProjectsLocationsClustersSetMaintenancePolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5919. c.name = name
  5920. c.setmaintenancepolicyrequest = setmaintenancepolicyrequest
  5921. return c
  5922. }
  5923. // Fields allows partial responses to be retrieved. See
  5924. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5925. // for more information.
  5926. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetMaintenancePolicyCall {
  5927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5928. return c
  5929. }
  5930. // Context sets the context to be used in this call's Do method. Any
  5931. // pending HTTP request will be aborted if the provided context is
  5932. // canceled.
  5933. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Context(ctx context.Context) *ProjectsLocationsClustersSetMaintenancePolicyCall {
  5934. c.ctx_ = ctx
  5935. return c
  5936. }
  5937. // Header returns an http.Header that can be modified by the caller to
  5938. // add HTTP headers to the request.
  5939. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Header() http.Header {
  5940. if c.header_ == nil {
  5941. c.header_ = make(http.Header)
  5942. }
  5943. return c.header_
  5944. }
  5945. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) doRequest(alt string) (*http.Response, error) {
  5946. reqHeaders := make(http.Header)
  5947. for k, v := range c.header_ {
  5948. reqHeaders[k] = v
  5949. }
  5950. reqHeaders.Set("User-Agent", c.s.userAgent())
  5951. var body io.Reader = nil
  5952. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmaintenancepolicyrequest)
  5953. if err != nil {
  5954. return nil, err
  5955. }
  5956. reqHeaders.Set("Content-Type", "application/json")
  5957. c.urlParams_.Set("alt", alt)
  5958. c.urlParams_.Set("prettyPrint", "false")
  5959. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setMaintenancePolicy")
  5960. urls += "?" + c.urlParams_.Encode()
  5961. req, err := http.NewRequest("POST", urls, body)
  5962. if err != nil {
  5963. return nil, err
  5964. }
  5965. req.Header = reqHeaders
  5966. googleapi.Expand(req.URL, map[string]string{
  5967. "name": c.name,
  5968. })
  5969. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5970. }
  5971. // Do executes the "container.projects.locations.clusters.setMaintenancePolicy" call.
  5972. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5973. // status code is an error. Response headers are in either
  5974. // *Operation.ServerResponse.Header or (if a response was returned at
  5975. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5976. // to check whether the returned error was because
  5977. // http.StatusNotModified was returned.
  5978. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5979. gensupport.SetOptions(c.urlParams_, opts...)
  5980. res, err := c.doRequest("json")
  5981. if res != nil && res.StatusCode == http.StatusNotModified {
  5982. if res.Body != nil {
  5983. res.Body.Close()
  5984. }
  5985. return nil, &googleapi.Error{
  5986. Code: res.StatusCode,
  5987. Header: res.Header,
  5988. }
  5989. }
  5990. if err != nil {
  5991. return nil, err
  5992. }
  5993. defer googleapi.CloseBody(res)
  5994. if err := googleapi.CheckResponse(res); err != nil {
  5995. return nil, err
  5996. }
  5997. ret := &Operation{
  5998. ServerResponse: googleapi.ServerResponse{
  5999. Header: res.Header,
  6000. HTTPStatusCode: res.StatusCode,
  6001. },
  6002. }
  6003. target := &ret
  6004. if err := gensupport.DecodeResponse(target, res); err != nil {
  6005. return nil, err
  6006. }
  6007. return ret, nil
  6008. // {
  6009. // "description": "Sets the maintenance policy for a cluster.",
  6010. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMaintenancePolicy",
  6011. // "httpMethod": "POST",
  6012. // "id": "container.projects.locations.clusters.setMaintenancePolicy",
  6013. // "parameterOrder": [
  6014. // "name"
  6015. // ],
  6016. // "parameters": {
  6017. // "name": {
  6018. // "description": "The name (project, location, cluster id) of the cluster to set maintenance\npolicy.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  6019. // "location": "path",
  6020. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6021. // "required": true,
  6022. // "type": "string"
  6023. // }
  6024. // },
  6025. // "path": "v1beta1/{+name}:setMaintenancePolicy",
  6026. // "request": {
  6027. // "$ref": "SetMaintenancePolicyRequest"
  6028. // },
  6029. // "response": {
  6030. // "$ref": "Operation"
  6031. // },
  6032. // "scopes": [
  6033. // "https://www.googleapis.com/auth/cloud-platform"
  6034. // ]
  6035. // }
  6036. }
  6037. // method id "container.projects.locations.clusters.setMasterAuth":
  6038. type ProjectsLocationsClustersSetMasterAuthCall struct {
  6039. s *Service
  6040. name string
  6041. setmasterauthrequest *SetMasterAuthRequest
  6042. urlParams_ gensupport.URLParams
  6043. ctx_ context.Context
  6044. header_ http.Header
  6045. }
  6046. // SetMasterAuth: Used to set master auth materials. Currently supports
  6047. // :-
  6048. // Changing the admin password for a specific cluster.
  6049. // This can be either via password generation or explicitly set.
  6050. // Modify basic_auth.csv and reset the K8S API server.
  6051. func (r *ProjectsLocationsClustersService) SetMasterAuth(name string, setmasterauthrequest *SetMasterAuthRequest) *ProjectsLocationsClustersSetMasterAuthCall {
  6052. c := &ProjectsLocationsClustersSetMasterAuthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6053. c.name = name
  6054. c.setmasterauthrequest = setmasterauthrequest
  6055. return c
  6056. }
  6057. // Fields allows partial responses to be retrieved. See
  6058. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6059. // for more information.
  6060. func (c *ProjectsLocationsClustersSetMasterAuthCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetMasterAuthCall {
  6061. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6062. return c
  6063. }
  6064. // Context sets the context to be used in this call's Do method. Any
  6065. // pending HTTP request will be aborted if the provided context is
  6066. // canceled.
  6067. func (c *ProjectsLocationsClustersSetMasterAuthCall) Context(ctx context.Context) *ProjectsLocationsClustersSetMasterAuthCall {
  6068. c.ctx_ = ctx
  6069. return c
  6070. }
  6071. // Header returns an http.Header that can be modified by the caller to
  6072. // add HTTP headers to the request.
  6073. func (c *ProjectsLocationsClustersSetMasterAuthCall) Header() http.Header {
  6074. if c.header_ == nil {
  6075. c.header_ = make(http.Header)
  6076. }
  6077. return c.header_
  6078. }
  6079. func (c *ProjectsLocationsClustersSetMasterAuthCall) doRequest(alt string) (*http.Response, error) {
  6080. reqHeaders := make(http.Header)
  6081. for k, v := range c.header_ {
  6082. reqHeaders[k] = v
  6083. }
  6084. reqHeaders.Set("User-Agent", c.s.userAgent())
  6085. var body io.Reader = nil
  6086. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmasterauthrequest)
  6087. if err != nil {
  6088. return nil, err
  6089. }
  6090. reqHeaders.Set("Content-Type", "application/json")
  6091. c.urlParams_.Set("alt", alt)
  6092. c.urlParams_.Set("prettyPrint", "false")
  6093. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setMasterAuth")
  6094. urls += "?" + c.urlParams_.Encode()
  6095. req, err := http.NewRequest("POST", urls, body)
  6096. if err != nil {
  6097. return nil, err
  6098. }
  6099. req.Header = reqHeaders
  6100. googleapi.Expand(req.URL, map[string]string{
  6101. "name": c.name,
  6102. })
  6103. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6104. }
  6105. // Do executes the "container.projects.locations.clusters.setMasterAuth" call.
  6106. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6107. // status code is an error. Response headers are in either
  6108. // *Operation.ServerResponse.Header or (if a response was returned at
  6109. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6110. // to check whether the returned error was because
  6111. // http.StatusNotModified was returned.
  6112. func (c *ProjectsLocationsClustersSetMasterAuthCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6113. gensupport.SetOptions(c.urlParams_, opts...)
  6114. res, err := c.doRequest("json")
  6115. if res != nil && res.StatusCode == http.StatusNotModified {
  6116. if res.Body != nil {
  6117. res.Body.Close()
  6118. }
  6119. return nil, &googleapi.Error{
  6120. Code: res.StatusCode,
  6121. Header: res.Header,
  6122. }
  6123. }
  6124. if err != nil {
  6125. return nil, err
  6126. }
  6127. defer googleapi.CloseBody(res)
  6128. if err := googleapi.CheckResponse(res); err != nil {
  6129. return nil, err
  6130. }
  6131. ret := &Operation{
  6132. ServerResponse: googleapi.ServerResponse{
  6133. Header: res.Header,
  6134. HTTPStatusCode: res.StatusCode,
  6135. },
  6136. }
  6137. target := &ret
  6138. if err := gensupport.DecodeResponse(target, res); err != nil {
  6139. return nil, err
  6140. }
  6141. return ret, nil
  6142. // {
  6143. // "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.",
  6144. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMasterAuth",
  6145. // "httpMethod": "POST",
  6146. // "id": "container.projects.locations.clusters.setMasterAuth",
  6147. // "parameterOrder": [
  6148. // "name"
  6149. // ],
  6150. // "parameters": {
  6151. // "name": {
  6152. // "description": "The name (project, location, cluster) of the cluster to set auth.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  6153. // "location": "path",
  6154. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6155. // "required": true,
  6156. // "type": "string"
  6157. // }
  6158. // },
  6159. // "path": "v1beta1/{+name}:setMasterAuth",
  6160. // "request": {
  6161. // "$ref": "SetMasterAuthRequest"
  6162. // },
  6163. // "response": {
  6164. // "$ref": "Operation"
  6165. // },
  6166. // "scopes": [
  6167. // "https://www.googleapis.com/auth/cloud-platform"
  6168. // ]
  6169. // }
  6170. }
  6171. // method id "container.projects.locations.clusters.setMonitoring":
  6172. type ProjectsLocationsClustersSetMonitoringCall struct {
  6173. s *Service
  6174. name string
  6175. setmonitoringservicerequest *SetMonitoringServiceRequest
  6176. urlParams_ gensupport.URLParams
  6177. ctx_ context.Context
  6178. header_ http.Header
  6179. }
  6180. // SetMonitoring: Sets the monitoring service for a specific cluster.
  6181. func (r *ProjectsLocationsClustersService) SetMonitoring(name string, setmonitoringservicerequest *SetMonitoringServiceRequest) *ProjectsLocationsClustersSetMonitoringCall {
  6182. c := &ProjectsLocationsClustersSetMonitoringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6183. c.name = name
  6184. c.setmonitoringservicerequest = setmonitoringservicerequest
  6185. return c
  6186. }
  6187. // Fields allows partial responses to be retrieved. See
  6188. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6189. // for more information.
  6190. func (c *ProjectsLocationsClustersSetMonitoringCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetMonitoringCall {
  6191. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6192. return c
  6193. }
  6194. // Context sets the context to be used in this call's Do method. Any
  6195. // pending HTTP request will be aborted if the provided context is
  6196. // canceled.
  6197. func (c *ProjectsLocationsClustersSetMonitoringCall) Context(ctx context.Context) *ProjectsLocationsClustersSetMonitoringCall {
  6198. c.ctx_ = ctx
  6199. return c
  6200. }
  6201. // Header returns an http.Header that can be modified by the caller to
  6202. // add HTTP headers to the request.
  6203. func (c *ProjectsLocationsClustersSetMonitoringCall) Header() http.Header {
  6204. if c.header_ == nil {
  6205. c.header_ = make(http.Header)
  6206. }
  6207. return c.header_
  6208. }
  6209. func (c *ProjectsLocationsClustersSetMonitoringCall) doRequest(alt string) (*http.Response, error) {
  6210. reqHeaders := make(http.Header)
  6211. for k, v := range c.header_ {
  6212. reqHeaders[k] = v
  6213. }
  6214. reqHeaders.Set("User-Agent", c.s.userAgent())
  6215. var body io.Reader = nil
  6216. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmonitoringservicerequest)
  6217. if err != nil {
  6218. return nil, err
  6219. }
  6220. reqHeaders.Set("Content-Type", "application/json")
  6221. c.urlParams_.Set("alt", alt)
  6222. c.urlParams_.Set("prettyPrint", "false")
  6223. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setMonitoring")
  6224. urls += "?" + c.urlParams_.Encode()
  6225. req, err := http.NewRequest("POST", urls, body)
  6226. if err != nil {
  6227. return nil, err
  6228. }
  6229. req.Header = reqHeaders
  6230. googleapi.Expand(req.URL, map[string]string{
  6231. "name": c.name,
  6232. })
  6233. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6234. }
  6235. // Do executes the "container.projects.locations.clusters.setMonitoring" call.
  6236. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6237. // status code is an error. Response headers are in either
  6238. // *Operation.ServerResponse.Header or (if a response was returned at
  6239. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6240. // to check whether the returned error was because
  6241. // http.StatusNotModified was returned.
  6242. func (c *ProjectsLocationsClustersSetMonitoringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6243. gensupport.SetOptions(c.urlParams_, opts...)
  6244. res, err := c.doRequest("json")
  6245. if res != nil && res.StatusCode == http.StatusNotModified {
  6246. if res.Body != nil {
  6247. res.Body.Close()
  6248. }
  6249. return nil, &googleapi.Error{
  6250. Code: res.StatusCode,
  6251. Header: res.Header,
  6252. }
  6253. }
  6254. if err != nil {
  6255. return nil, err
  6256. }
  6257. defer googleapi.CloseBody(res)
  6258. if err := googleapi.CheckResponse(res); err != nil {
  6259. return nil, err
  6260. }
  6261. ret := &Operation{
  6262. ServerResponse: googleapi.ServerResponse{
  6263. Header: res.Header,
  6264. HTTPStatusCode: res.StatusCode,
  6265. },
  6266. }
  6267. target := &ret
  6268. if err := gensupport.DecodeResponse(target, res); err != nil {
  6269. return nil, err
  6270. }
  6271. return ret, nil
  6272. // {
  6273. // "description": "Sets the monitoring service for a specific cluster.",
  6274. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMonitoring",
  6275. // "httpMethod": "POST",
  6276. // "id": "container.projects.locations.clusters.setMonitoring",
  6277. // "parameterOrder": [
  6278. // "name"
  6279. // ],
  6280. // "parameters": {
  6281. // "name": {
  6282. // "description": "The name (project, location, cluster) of the cluster to set monitoring.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  6283. // "location": "path",
  6284. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6285. // "required": true,
  6286. // "type": "string"
  6287. // }
  6288. // },
  6289. // "path": "v1beta1/{+name}:setMonitoring",
  6290. // "request": {
  6291. // "$ref": "SetMonitoringServiceRequest"
  6292. // },
  6293. // "response": {
  6294. // "$ref": "Operation"
  6295. // },
  6296. // "scopes": [
  6297. // "https://www.googleapis.com/auth/cloud-platform"
  6298. // ]
  6299. // }
  6300. }
  6301. // method id "container.projects.locations.clusters.setNetworkPolicy":
  6302. type ProjectsLocationsClustersSetNetworkPolicyCall struct {
  6303. s *Service
  6304. name string
  6305. setnetworkpolicyrequest *SetNetworkPolicyRequest
  6306. urlParams_ gensupport.URLParams
  6307. ctx_ context.Context
  6308. header_ http.Header
  6309. }
  6310. // SetNetworkPolicy: Enables/Disables Network Policy for a cluster.
  6311. func (r *ProjectsLocationsClustersService) SetNetworkPolicy(name string, setnetworkpolicyrequest *SetNetworkPolicyRequest) *ProjectsLocationsClustersSetNetworkPolicyCall {
  6312. c := &ProjectsLocationsClustersSetNetworkPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6313. c.name = name
  6314. c.setnetworkpolicyrequest = setnetworkpolicyrequest
  6315. return c
  6316. }
  6317. // Fields allows partial responses to be retrieved. See
  6318. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6319. // for more information.
  6320. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetNetworkPolicyCall {
  6321. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6322. return c
  6323. }
  6324. // Context sets the context to be used in this call's Do method. Any
  6325. // pending HTTP request will be aborted if the provided context is
  6326. // canceled.
  6327. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Context(ctx context.Context) *ProjectsLocationsClustersSetNetworkPolicyCall {
  6328. c.ctx_ = ctx
  6329. return c
  6330. }
  6331. // Header returns an http.Header that can be modified by the caller to
  6332. // add HTTP headers to the request.
  6333. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Header() http.Header {
  6334. if c.header_ == nil {
  6335. c.header_ = make(http.Header)
  6336. }
  6337. return c.header_
  6338. }
  6339. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) doRequest(alt string) (*http.Response, error) {
  6340. reqHeaders := make(http.Header)
  6341. for k, v := range c.header_ {
  6342. reqHeaders[k] = v
  6343. }
  6344. reqHeaders.Set("User-Agent", c.s.userAgent())
  6345. var body io.Reader = nil
  6346. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnetworkpolicyrequest)
  6347. if err != nil {
  6348. return nil, err
  6349. }
  6350. reqHeaders.Set("Content-Type", "application/json")
  6351. c.urlParams_.Set("alt", alt)
  6352. c.urlParams_.Set("prettyPrint", "false")
  6353. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setNetworkPolicy")
  6354. urls += "?" + c.urlParams_.Encode()
  6355. req, err := http.NewRequest("POST", urls, body)
  6356. if err != nil {
  6357. return nil, err
  6358. }
  6359. req.Header = reqHeaders
  6360. googleapi.Expand(req.URL, map[string]string{
  6361. "name": c.name,
  6362. })
  6363. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6364. }
  6365. // Do executes the "container.projects.locations.clusters.setNetworkPolicy" call.
  6366. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6367. // status code is an error. Response headers are in either
  6368. // *Operation.ServerResponse.Header or (if a response was returned at
  6369. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6370. // to check whether the returned error was because
  6371. // http.StatusNotModified was returned.
  6372. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6373. gensupport.SetOptions(c.urlParams_, opts...)
  6374. res, err := c.doRequest("json")
  6375. if res != nil && res.StatusCode == http.StatusNotModified {
  6376. if res.Body != nil {
  6377. res.Body.Close()
  6378. }
  6379. return nil, &googleapi.Error{
  6380. Code: res.StatusCode,
  6381. Header: res.Header,
  6382. }
  6383. }
  6384. if err != nil {
  6385. return nil, err
  6386. }
  6387. defer googleapi.CloseBody(res)
  6388. if err := googleapi.CheckResponse(res); err != nil {
  6389. return nil, err
  6390. }
  6391. ret := &Operation{
  6392. ServerResponse: googleapi.ServerResponse{
  6393. Header: res.Header,
  6394. HTTPStatusCode: res.StatusCode,
  6395. },
  6396. }
  6397. target := &ret
  6398. if err := gensupport.DecodeResponse(target, res); err != nil {
  6399. return nil, err
  6400. }
  6401. return ret, nil
  6402. // {
  6403. // "description": "Enables/Disables Network Policy for a cluster.",
  6404. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setNetworkPolicy",
  6405. // "httpMethod": "POST",
  6406. // "id": "container.projects.locations.clusters.setNetworkPolicy",
  6407. // "parameterOrder": [
  6408. // "name"
  6409. // ],
  6410. // "parameters": {
  6411. // "name": {
  6412. // "description": "The name (project, location, cluster id) of the cluster to set networking\npolicy. Specified in the format 'projects/*/locations/*/clusters/*'.",
  6413. // "location": "path",
  6414. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6415. // "required": true,
  6416. // "type": "string"
  6417. // }
  6418. // },
  6419. // "path": "v1beta1/{+name}:setNetworkPolicy",
  6420. // "request": {
  6421. // "$ref": "SetNetworkPolicyRequest"
  6422. // },
  6423. // "response": {
  6424. // "$ref": "Operation"
  6425. // },
  6426. // "scopes": [
  6427. // "https://www.googleapis.com/auth/cloud-platform"
  6428. // ]
  6429. // }
  6430. }
  6431. // method id "container.projects.locations.clusters.setResourceLabels":
  6432. type ProjectsLocationsClustersSetResourceLabelsCall struct {
  6433. s *Service
  6434. name string
  6435. setlabelsrequest *SetLabelsRequest
  6436. urlParams_ gensupport.URLParams
  6437. ctx_ context.Context
  6438. header_ http.Header
  6439. }
  6440. // SetResourceLabels: Sets labels on a cluster.
  6441. func (r *ProjectsLocationsClustersService) SetResourceLabels(name string, setlabelsrequest *SetLabelsRequest) *ProjectsLocationsClustersSetResourceLabelsCall {
  6442. c := &ProjectsLocationsClustersSetResourceLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6443. c.name = name
  6444. c.setlabelsrequest = setlabelsrequest
  6445. return c
  6446. }
  6447. // Fields allows partial responses to be retrieved. See
  6448. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6449. // for more information.
  6450. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetResourceLabelsCall {
  6451. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6452. return c
  6453. }
  6454. // Context sets the context to be used in this call's Do method. Any
  6455. // pending HTTP request will be aborted if the provided context is
  6456. // canceled.
  6457. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Context(ctx context.Context) *ProjectsLocationsClustersSetResourceLabelsCall {
  6458. c.ctx_ = ctx
  6459. return c
  6460. }
  6461. // Header returns an http.Header that can be modified by the caller to
  6462. // add HTTP headers to the request.
  6463. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Header() http.Header {
  6464. if c.header_ == nil {
  6465. c.header_ = make(http.Header)
  6466. }
  6467. return c.header_
  6468. }
  6469. func (c *ProjectsLocationsClustersSetResourceLabelsCall) doRequest(alt string) (*http.Response, error) {
  6470. reqHeaders := make(http.Header)
  6471. for k, v := range c.header_ {
  6472. reqHeaders[k] = v
  6473. }
  6474. reqHeaders.Set("User-Agent", c.s.userAgent())
  6475. var body io.Reader = nil
  6476. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlabelsrequest)
  6477. if err != nil {
  6478. return nil, err
  6479. }
  6480. reqHeaders.Set("Content-Type", "application/json")
  6481. c.urlParams_.Set("alt", alt)
  6482. c.urlParams_.Set("prettyPrint", "false")
  6483. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setResourceLabels")
  6484. urls += "?" + c.urlParams_.Encode()
  6485. req, err := http.NewRequest("POST", urls, body)
  6486. if err != nil {
  6487. return nil, err
  6488. }
  6489. req.Header = reqHeaders
  6490. googleapi.Expand(req.URL, map[string]string{
  6491. "name": c.name,
  6492. })
  6493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6494. }
  6495. // Do executes the "container.projects.locations.clusters.setResourceLabels" call.
  6496. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6497. // status code is an error. Response headers are in either
  6498. // *Operation.ServerResponse.Header or (if a response was returned at
  6499. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6500. // to check whether the returned error was because
  6501. // http.StatusNotModified was returned.
  6502. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6503. gensupport.SetOptions(c.urlParams_, opts...)
  6504. res, err := c.doRequest("json")
  6505. if res != nil && res.StatusCode == http.StatusNotModified {
  6506. if res.Body != nil {
  6507. res.Body.Close()
  6508. }
  6509. return nil, &googleapi.Error{
  6510. Code: res.StatusCode,
  6511. Header: res.Header,
  6512. }
  6513. }
  6514. if err != nil {
  6515. return nil, err
  6516. }
  6517. defer googleapi.CloseBody(res)
  6518. if err := googleapi.CheckResponse(res); err != nil {
  6519. return nil, err
  6520. }
  6521. ret := &Operation{
  6522. ServerResponse: googleapi.ServerResponse{
  6523. Header: res.Header,
  6524. HTTPStatusCode: res.StatusCode,
  6525. },
  6526. }
  6527. target := &ret
  6528. if err := gensupport.DecodeResponse(target, res); err != nil {
  6529. return nil, err
  6530. }
  6531. return ret, nil
  6532. // {
  6533. // "description": "Sets labels on a cluster.",
  6534. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setResourceLabels",
  6535. // "httpMethod": "POST",
  6536. // "id": "container.projects.locations.clusters.setResourceLabels",
  6537. // "parameterOrder": [
  6538. // "name"
  6539. // ],
  6540. // "parameters": {
  6541. // "name": {
  6542. // "description": "The name (project, location, cluster id) of the cluster to set labels.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  6543. // "location": "path",
  6544. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6545. // "required": true,
  6546. // "type": "string"
  6547. // }
  6548. // },
  6549. // "path": "v1beta1/{+name}:setResourceLabels",
  6550. // "request": {
  6551. // "$ref": "SetLabelsRequest"
  6552. // },
  6553. // "response": {
  6554. // "$ref": "Operation"
  6555. // },
  6556. // "scopes": [
  6557. // "https://www.googleapis.com/auth/cloud-platform"
  6558. // ]
  6559. // }
  6560. }
  6561. // method id "container.projects.locations.clusters.startIpRotation":
  6562. type ProjectsLocationsClustersStartIpRotationCall struct {
  6563. s *Service
  6564. name string
  6565. startiprotationrequest *StartIPRotationRequest
  6566. urlParams_ gensupport.URLParams
  6567. ctx_ context.Context
  6568. header_ http.Header
  6569. }
  6570. // StartIpRotation: Start master IP rotation.
  6571. func (r *ProjectsLocationsClustersService) StartIpRotation(name string, startiprotationrequest *StartIPRotationRequest) *ProjectsLocationsClustersStartIpRotationCall {
  6572. c := &ProjectsLocationsClustersStartIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6573. c.name = name
  6574. c.startiprotationrequest = startiprotationrequest
  6575. return c
  6576. }
  6577. // Fields allows partial responses to be retrieved. See
  6578. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6579. // for more information.
  6580. func (c *ProjectsLocationsClustersStartIpRotationCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersStartIpRotationCall {
  6581. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6582. return c
  6583. }
  6584. // Context sets the context to be used in this call's Do method. Any
  6585. // pending HTTP request will be aborted if the provided context is
  6586. // canceled.
  6587. func (c *ProjectsLocationsClustersStartIpRotationCall) Context(ctx context.Context) *ProjectsLocationsClustersStartIpRotationCall {
  6588. c.ctx_ = ctx
  6589. return c
  6590. }
  6591. // Header returns an http.Header that can be modified by the caller to
  6592. // add HTTP headers to the request.
  6593. func (c *ProjectsLocationsClustersStartIpRotationCall) Header() http.Header {
  6594. if c.header_ == nil {
  6595. c.header_ = make(http.Header)
  6596. }
  6597. return c.header_
  6598. }
  6599. func (c *ProjectsLocationsClustersStartIpRotationCall) doRequest(alt string) (*http.Response, error) {
  6600. reqHeaders := make(http.Header)
  6601. for k, v := range c.header_ {
  6602. reqHeaders[k] = v
  6603. }
  6604. reqHeaders.Set("User-Agent", c.s.userAgent())
  6605. var body io.Reader = nil
  6606. body, err := googleapi.WithoutDataWrapper.JSONReader(c.startiprotationrequest)
  6607. if err != nil {
  6608. return nil, err
  6609. }
  6610. reqHeaders.Set("Content-Type", "application/json")
  6611. c.urlParams_.Set("alt", alt)
  6612. c.urlParams_.Set("prettyPrint", "false")
  6613. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:startIpRotation")
  6614. urls += "?" + c.urlParams_.Encode()
  6615. req, err := http.NewRequest("POST", urls, body)
  6616. if err != nil {
  6617. return nil, err
  6618. }
  6619. req.Header = reqHeaders
  6620. googleapi.Expand(req.URL, map[string]string{
  6621. "name": c.name,
  6622. })
  6623. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6624. }
  6625. // Do executes the "container.projects.locations.clusters.startIpRotation" call.
  6626. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6627. // status code is an error. Response headers are in either
  6628. // *Operation.ServerResponse.Header or (if a response was returned at
  6629. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6630. // to check whether the returned error was because
  6631. // http.StatusNotModified was returned.
  6632. func (c *ProjectsLocationsClustersStartIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6633. gensupport.SetOptions(c.urlParams_, opts...)
  6634. res, err := c.doRequest("json")
  6635. if res != nil && res.StatusCode == http.StatusNotModified {
  6636. if res.Body != nil {
  6637. res.Body.Close()
  6638. }
  6639. return nil, &googleapi.Error{
  6640. Code: res.StatusCode,
  6641. Header: res.Header,
  6642. }
  6643. }
  6644. if err != nil {
  6645. return nil, err
  6646. }
  6647. defer googleapi.CloseBody(res)
  6648. if err := googleapi.CheckResponse(res); err != nil {
  6649. return nil, err
  6650. }
  6651. ret := &Operation{
  6652. ServerResponse: googleapi.ServerResponse{
  6653. Header: res.Header,
  6654. HTTPStatusCode: res.StatusCode,
  6655. },
  6656. }
  6657. target := &ret
  6658. if err := gensupport.DecodeResponse(target, res); err != nil {
  6659. return nil, err
  6660. }
  6661. return ret, nil
  6662. // {
  6663. // "description": "Start master IP rotation.",
  6664. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:startIpRotation",
  6665. // "httpMethod": "POST",
  6666. // "id": "container.projects.locations.clusters.startIpRotation",
  6667. // "parameterOrder": [
  6668. // "name"
  6669. // ],
  6670. // "parameters": {
  6671. // "name": {
  6672. // "description": "The name (project, location, cluster id) of the cluster to start IP\nrotation. Specified in the format 'projects/*/locations/*/clusters/*'.",
  6673. // "location": "path",
  6674. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6675. // "required": true,
  6676. // "type": "string"
  6677. // }
  6678. // },
  6679. // "path": "v1beta1/{+name}:startIpRotation",
  6680. // "request": {
  6681. // "$ref": "StartIPRotationRequest"
  6682. // },
  6683. // "response": {
  6684. // "$ref": "Operation"
  6685. // },
  6686. // "scopes": [
  6687. // "https://www.googleapis.com/auth/cloud-platform"
  6688. // ]
  6689. // }
  6690. }
  6691. // method id "container.projects.locations.clusters.update":
  6692. type ProjectsLocationsClustersUpdateCall struct {
  6693. s *Service
  6694. name string
  6695. updateclusterrequest *UpdateClusterRequest
  6696. urlParams_ gensupport.URLParams
  6697. ctx_ context.Context
  6698. header_ http.Header
  6699. }
  6700. // Update: Updates the settings for a specific cluster.
  6701. func (r *ProjectsLocationsClustersService) Update(name string, updateclusterrequest *UpdateClusterRequest) *ProjectsLocationsClustersUpdateCall {
  6702. c := &ProjectsLocationsClustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6703. c.name = name
  6704. c.updateclusterrequest = updateclusterrequest
  6705. return c
  6706. }
  6707. // Fields allows partial responses to be retrieved. See
  6708. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6709. // for more information.
  6710. func (c *ProjectsLocationsClustersUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersUpdateCall {
  6711. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6712. return c
  6713. }
  6714. // Context sets the context to be used in this call's Do method. Any
  6715. // pending HTTP request will be aborted if the provided context is
  6716. // canceled.
  6717. func (c *ProjectsLocationsClustersUpdateCall) Context(ctx context.Context) *ProjectsLocationsClustersUpdateCall {
  6718. c.ctx_ = ctx
  6719. return c
  6720. }
  6721. // Header returns an http.Header that can be modified by the caller to
  6722. // add HTTP headers to the request.
  6723. func (c *ProjectsLocationsClustersUpdateCall) Header() http.Header {
  6724. if c.header_ == nil {
  6725. c.header_ = make(http.Header)
  6726. }
  6727. return c.header_
  6728. }
  6729. func (c *ProjectsLocationsClustersUpdateCall) doRequest(alt string) (*http.Response, error) {
  6730. reqHeaders := make(http.Header)
  6731. for k, v := range c.header_ {
  6732. reqHeaders[k] = v
  6733. }
  6734. reqHeaders.Set("User-Agent", c.s.userAgent())
  6735. var body io.Reader = nil
  6736. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest)
  6737. if err != nil {
  6738. return nil, err
  6739. }
  6740. reqHeaders.Set("Content-Type", "application/json")
  6741. c.urlParams_.Set("alt", alt)
  6742. c.urlParams_.Set("prettyPrint", "false")
  6743. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  6744. urls += "?" + c.urlParams_.Encode()
  6745. req, err := http.NewRequest("PUT", urls, body)
  6746. if err != nil {
  6747. return nil, err
  6748. }
  6749. req.Header = reqHeaders
  6750. googleapi.Expand(req.URL, map[string]string{
  6751. "name": c.name,
  6752. })
  6753. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6754. }
  6755. // Do executes the "container.projects.locations.clusters.update" call.
  6756. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6757. // status code is an error. Response headers are in either
  6758. // *Operation.ServerResponse.Header or (if a response was returned at
  6759. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6760. // to check whether the returned error was because
  6761. // http.StatusNotModified was returned.
  6762. func (c *ProjectsLocationsClustersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6763. gensupport.SetOptions(c.urlParams_, opts...)
  6764. res, err := c.doRequest("json")
  6765. if res != nil && res.StatusCode == http.StatusNotModified {
  6766. if res.Body != nil {
  6767. res.Body.Close()
  6768. }
  6769. return nil, &googleapi.Error{
  6770. Code: res.StatusCode,
  6771. Header: res.Header,
  6772. }
  6773. }
  6774. if err != nil {
  6775. return nil, err
  6776. }
  6777. defer googleapi.CloseBody(res)
  6778. if err := googleapi.CheckResponse(res); err != nil {
  6779. return nil, err
  6780. }
  6781. ret := &Operation{
  6782. ServerResponse: googleapi.ServerResponse{
  6783. Header: res.Header,
  6784. HTTPStatusCode: res.StatusCode,
  6785. },
  6786. }
  6787. target := &ret
  6788. if err := gensupport.DecodeResponse(target, res); err != nil {
  6789. return nil, err
  6790. }
  6791. return ret, nil
  6792. // {
  6793. // "description": "Updates the settings for a specific cluster.",
  6794. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
  6795. // "httpMethod": "PUT",
  6796. // "id": "container.projects.locations.clusters.update",
  6797. // "parameterOrder": [
  6798. // "name"
  6799. // ],
  6800. // "parameters": {
  6801. // "name": {
  6802. // "description": "The name (project, location, cluster) of the cluster to update.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  6803. // "location": "path",
  6804. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6805. // "required": true,
  6806. // "type": "string"
  6807. // }
  6808. // },
  6809. // "path": "v1beta1/{+name}",
  6810. // "request": {
  6811. // "$ref": "UpdateClusterRequest"
  6812. // },
  6813. // "response": {
  6814. // "$ref": "Operation"
  6815. // },
  6816. // "scopes": [
  6817. // "https://www.googleapis.com/auth/cloud-platform"
  6818. // ]
  6819. // }
  6820. }
  6821. // method id "container.projects.locations.clusters.updateMaster":
  6822. type ProjectsLocationsClustersUpdateMasterCall struct {
  6823. s *Service
  6824. name string
  6825. updatemasterrequest *UpdateMasterRequest
  6826. urlParams_ gensupport.URLParams
  6827. ctx_ context.Context
  6828. header_ http.Header
  6829. }
  6830. // UpdateMaster: Updates the master for a specific cluster.
  6831. func (r *ProjectsLocationsClustersService) UpdateMaster(name string, updatemasterrequest *UpdateMasterRequest) *ProjectsLocationsClustersUpdateMasterCall {
  6832. c := &ProjectsLocationsClustersUpdateMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6833. c.name = name
  6834. c.updatemasterrequest = updatemasterrequest
  6835. return c
  6836. }
  6837. // Fields allows partial responses to be retrieved. See
  6838. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6839. // for more information.
  6840. func (c *ProjectsLocationsClustersUpdateMasterCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersUpdateMasterCall {
  6841. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6842. return c
  6843. }
  6844. // Context sets the context to be used in this call's Do method. Any
  6845. // pending HTTP request will be aborted if the provided context is
  6846. // canceled.
  6847. func (c *ProjectsLocationsClustersUpdateMasterCall) Context(ctx context.Context) *ProjectsLocationsClustersUpdateMasterCall {
  6848. c.ctx_ = ctx
  6849. return c
  6850. }
  6851. // Header returns an http.Header that can be modified by the caller to
  6852. // add HTTP headers to the request.
  6853. func (c *ProjectsLocationsClustersUpdateMasterCall) Header() http.Header {
  6854. if c.header_ == nil {
  6855. c.header_ = make(http.Header)
  6856. }
  6857. return c.header_
  6858. }
  6859. func (c *ProjectsLocationsClustersUpdateMasterCall) doRequest(alt string) (*http.Response, error) {
  6860. reqHeaders := make(http.Header)
  6861. for k, v := range c.header_ {
  6862. reqHeaders[k] = v
  6863. }
  6864. reqHeaders.Set("User-Agent", c.s.userAgent())
  6865. var body io.Reader = nil
  6866. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatemasterrequest)
  6867. if err != nil {
  6868. return nil, err
  6869. }
  6870. reqHeaders.Set("Content-Type", "application/json")
  6871. c.urlParams_.Set("alt", alt)
  6872. c.urlParams_.Set("prettyPrint", "false")
  6873. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:updateMaster")
  6874. urls += "?" + c.urlParams_.Encode()
  6875. req, err := http.NewRequest("POST", urls, body)
  6876. if err != nil {
  6877. return nil, err
  6878. }
  6879. req.Header = reqHeaders
  6880. googleapi.Expand(req.URL, map[string]string{
  6881. "name": c.name,
  6882. })
  6883. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6884. }
  6885. // Do executes the "container.projects.locations.clusters.updateMaster" call.
  6886. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6887. // status code is an error. Response headers are in either
  6888. // *Operation.ServerResponse.Header or (if a response was returned at
  6889. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6890. // to check whether the returned error was because
  6891. // http.StatusNotModified was returned.
  6892. func (c *ProjectsLocationsClustersUpdateMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6893. gensupport.SetOptions(c.urlParams_, opts...)
  6894. res, err := c.doRequest("json")
  6895. if res != nil && res.StatusCode == http.StatusNotModified {
  6896. if res.Body != nil {
  6897. res.Body.Close()
  6898. }
  6899. return nil, &googleapi.Error{
  6900. Code: res.StatusCode,
  6901. Header: res.Header,
  6902. }
  6903. }
  6904. if err != nil {
  6905. return nil, err
  6906. }
  6907. defer googleapi.CloseBody(res)
  6908. if err := googleapi.CheckResponse(res); err != nil {
  6909. return nil, err
  6910. }
  6911. ret := &Operation{
  6912. ServerResponse: googleapi.ServerResponse{
  6913. Header: res.Header,
  6914. HTTPStatusCode: res.StatusCode,
  6915. },
  6916. }
  6917. target := &ret
  6918. if err := gensupport.DecodeResponse(target, res); err != nil {
  6919. return nil, err
  6920. }
  6921. return ret, nil
  6922. // {
  6923. // "description": "Updates the master for a specific cluster.",
  6924. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:updateMaster",
  6925. // "httpMethod": "POST",
  6926. // "id": "container.projects.locations.clusters.updateMaster",
  6927. // "parameterOrder": [
  6928. // "name"
  6929. // ],
  6930. // "parameters": {
  6931. // "name": {
  6932. // "description": "The name (project, location, cluster) of the cluster to update.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  6933. // "location": "path",
  6934. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6935. // "required": true,
  6936. // "type": "string"
  6937. // }
  6938. // },
  6939. // "path": "v1beta1/{+name}:updateMaster",
  6940. // "request": {
  6941. // "$ref": "UpdateMasterRequest"
  6942. // },
  6943. // "response": {
  6944. // "$ref": "Operation"
  6945. // },
  6946. // "scopes": [
  6947. // "https://www.googleapis.com/auth/cloud-platform"
  6948. // ]
  6949. // }
  6950. }
  6951. // method id "container.projects.locations.clusters.nodePools.create":
  6952. type ProjectsLocationsClustersNodePoolsCreateCall struct {
  6953. s *Service
  6954. parent string
  6955. createnodepoolrequest *CreateNodePoolRequest
  6956. urlParams_ gensupport.URLParams
  6957. ctx_ context.Context
  6958. header_ http.Header
  6959. }
  6960. // Create: Creates a node pool for a cluster.
  6961. func (r *ProjectsLocationsClustersNodePoolsService) Create(parent string, createnodepoolrequest *CreateNodePoolRequest) *ProjectsLocationsClustersNodePoolsCreateCall {
  6962. c := &ProjectsLocationsClustersNodePoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6963. c.parent = parent
  6964. c.createnodepoolrequest = createnodepoolrequest
  6965. return c
  6966. }
  6967. // Fields allows partial responses to be retrieved. See
  6968. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6969. // for more information.
  6970. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsCreateCall {
  6971. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6972. return c
  6973. }
  6974. // Context sets the context to be used in this call's Do method. Any
  6975. // pending HTTP request will be aborted if the provided context is
  6976. // canceled.
  6977. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsCreateCall {
  6978. c.ctx_ = ctx
  6979. return c
  6980. }
  6981. // Header returns an http.Header that can be modified by the caller to
  6982. // add HTTP headers to the request.
  6983. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Header() http.Header {
  6984. if c.header_ == nil {
  6985. c.header_ = make(http.Header)
  6986. }
  6987. return c.header_
  6988. }
  6989. func (c *ProjectsLocationsClustersNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) {
  6990. reqHeaders := make(http.Header)
  6991. for k, v := range c.header_ {
  6992. reqHeaders[k] = v
  6993. }
  6994. reqHeaders.Set("User-Agent", c.s.userAgent())
  6995. var body io.Reader = nil
  6996. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createnodepoolrequest)
  6997. if err != nil {
  6998. return nil, err
  6999. }
  7000. reqHeaders.Set("Content-Type", "application/json")
  7001. c.urlParams_.Set("alt", alt)
  7002. c.urlParams_.Set("prettyPrint", "false")
  7003. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/nodePools")
  7004. urls += "?" + c.urlParams_.Encode()
  7005. req, err := http.NewRequest("POST", urls, body)
  7006. if err != nil {
  7007. return nil, err
  7008. }
  7009. req.Header = reqHeaders
  7010. googleapi.Expand(req.URL, map[string]string{
  7011. "parent": c.parent,
  7012. })
  7013. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7014. }
  7015. // Do executes the "container.projects.locations.clusters.nodePools.create" call.
  7016. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7017. // status code is an error. Response headers are in either
  7018. // *Operation.ServerResponse.Header or (if a response was returned at
  7019. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7020. // to check whether the returned error was because
  7021. // http.StatusNotModified was returned.
  7022. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7023. gensupport.SetOptions(c.urlParams_, opts...)
  7024. res, err := c.doRequest("json")
  7025. if res != nil && res.StatusCode == http.StatusNotModified {
  7026. if res.Body != nil {
  7027. res.Body.Close()
  7028. }
  7029. return nil, &googleapi.Error{
  7030. Code: res.StatusCode,
  7031. Header: res.Header,
  7032. }
  7033. }
  7034. if err != nil {
  7035. return nil, err
  7036. }
  7037. defer googleapi.CloseBody(res)
  7038. if err := googleapi.CheckResponse(res); err != nil {
  7039. return nil, err
  7040. }
  7041. ret := &Operation{
  7042. ServerResponse: googleapi.ServerResponse{
  7043. Header: res.Header,
  7044. HTTPStatusCode: res.StatusCode,
  7045. },
  7046. }
  7047. target := &ret
  7048. if err := gensupport.DecodeResponse(target, res); err != nil {
  7049. return nil, err
  7050. }
  7051. return ret, nil
  7052. // {
  7053. // "description": "Creates a node pool for a cluster.",
  7054. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools",
  7055. // "httpMethod": "POST",
  7056. // "id": "container.projects.locations.clusters.nodePools.create",
  7057. // "parameterOrder": [
  7058. // "parent"
  7059. // ],
  7060. // "parameters": {
  7061. // "parent": {
  7062. // "description": "The parent (project, location, cluster id) where the node pool will be\ncreated. Specified in the format\n'projects/*/locations/*/clusters/*'.",
  7063. // "location": "path",
  7064. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  7065. // "required": true,
  7066. // "type": "string"
  7067. // }
  7068. // },
  7069. // "path": "v1beta1/{+parent}/nodePools",
  7070. // "request": {
  7071. // "$ref": "CreateNodePoolRequest"
  7072. // },
  7073. // "response": {
  7074. // "$ref": "Operation"
  7075. // },
  7076. // "scopes": [
  7077. // "https://www.googleapis.com/auth/cloud-platform"
  7078. // ]
  7079. // }
  7080. }
  7081. // method id "container.projects.locations.clusters.nodePools.delete":
  7082. type ProjectsLocationsClustersNodePoolsDeleteCall struct {
  7083. s *Service
  7084. name string
  7085. urlParams_ gensupport.URLParams
  7086. ctx_ context.Context
  7087. header_ http.Header
  7088. }
  7089. // Delete: Deletes a node pool from a cluster.
  7090. func (r *ProjectsLocationsClustersNodePoolsService) Delete(name string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  7091. c := &ProjectsLocationsClustersNodePoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7092. c.name = name
  7093. return c
  7094. }
  7095. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  7096. // name of the cluster.
  7097. // This field has been deprecated and replaced by the name field.
  7098. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) ClusterId(clusterId string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  7099. c.urlParams_.Set("clusterId", clusterId)
  7100. return c
  7101. }
  7102. // NodePoolId sets the optional parameter "nodePoolId": Deprecated. The
  7103. // name of the node pool to delete.
  7104. // This field has been deprecated and replaced by the name field.
  7105. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) NodePoolId(nodePoolId string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  7106. c.urlParams_.Set("nodePoolId", nodePoolId)
  7107. return c
  7108. }
  7109. // ProjectId sets the optional parameter "projectId": Deprecated. The
  7110. // Google Developers Console [project ID or
  7111. // project
  7112. // number](https://developers.google.com/console/help/new/#projec
  7113. // tnumber).
  7114. // This field has been deprecated and replaced by the name field.
  7115. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) ProjectId(projectId string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  7116. c.urlParams_.Set("projectId", projectId)
  7117. return c
  7118. }
  7119. // Zone sets the optional parameter "zone": Deprecated. The name of the
  7120. // Google Compute Engine
  7121. // [zone](/compute/docs/zones#available) in which the
  7122. // cluster
  7123. // resides.
  7124. // This field has been deprecated and replaced by the name field.
  7125. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Zone(zone string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  7126. c.urlParams_.Set("zone", zone)
  7127. return c
  7128. }
  7129. // Fields allows partial responses to be retrieved. See
  7130. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7131. // for more information.
  7132. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsDeleteCall {
  7133. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7134. return c
  7135. }
  7136. // Context sets the context to be used in this call's Do method. Any
  7137. // pending HTTP request will be aborted if the provided context is
  7138. // canceled.
  7139. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsDeleteCall {
  7140. c.ctx_ = ctx
  7141. return c
  7142. }
  7143. // Header returns an http.Header that can be modified by the caller to
  7144. // add HTTP headers to the request.
  7145. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Header() http.Header {
  7146. if c.header_ == nil {
  7147. c.header_ = make(http.Header)
  7148. }
  7149. return c.header_
  7150. }
  7151. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7152. reqHeaders := make(http.Header)
  7153. for k, v := range c.header_ {
  7154. reqHeaders[k] = v
  7155. }
  7156. reqHeaders.Set("User-Agent", c.s.userAgent())
  7157. var body io.Reader = nil
  7158. c.urlParams_.Set("alt", alt)
  7159. c.urlParams_.Set("prettyPrint", "false")
  7160. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  7161. urls += "?" + c.urlParams_.Encode()
  7162. req, err := http.NewRequest("DELETE", urls, body)
  7163. if err != nil {
  7164. return nil, err
  7165. }
  7166. req.Header = reqHeaders
  7167. googleapi.Expand(req.URL, map[string]string{
  7168. "name": c.name,
  7169. })
  7170. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7171. }
  7172. // Do executes the "container.projects.locations.clusters.nodePools.delete" call.
  7173. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7174. // status code is an error. Response headers are in either
  7175. // *Operation.ServerResponse.Header or (if a response was returned at
  7176. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7177. // to check whether the returned error was because
  7178. // http.StatusNotModified was returned.
  7179. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7180. gensupport.SetOptions(c.urlParams_, opts...)
  7181. res, err := c.doRequest("json")
  7182. if res != nil && res.StatusCode == http.StatusNotModified {
  7183. if res.Body != nil {
  7184. res.Body.Close()
  7185. }
  7186. return nil, &googleapi.Error{
  7187. Code: res.StatusCode,
  7188. Header: res.Header,
  7189. }
  7190. }
  7191. if err != nil {
  7192. return nil, err
  7193. }
  7194. defer googleapi.CloseBody(res)
  7195. if err := googleapi.CheckResponse(res); err != nil {
  7196. return nil, err
  7197. }
  7198. ret := &Operation{
  7199. ServerResponse: googleapi.ServerResponse{
  7200. Header: res.Header,
  7201. HTTPStatusCode: res.StatusCode,
  7202. },
  7203. }
  7204. target := &ret
  7205. if err := gensupport.DecodeResponse(target, res); err != nil {
  7206. return nil, err
  7207. }
  7208. return ret, nil
  7209. // {
  7210. // "description": "Deletes a node pool from a cluster.",
  7211. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
  7212. // "httpMethod": "DELETE",
  7213. // "id": "container.projects.locations.clusters.nodePools.delete",
  7214. // "parameterOrder": [
  7215. // "name"
  7216. // ],
  7217. // "parameters": {
  7218. // "clusterId": {
  7219. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  7220. // "location": "query",
  7221. // "type": "string"
  7222. // },
  7223. // "name": {
  7224. // "description": "The name (project, location, cluster, node pool id) of the node pool to\ndelete. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  7225. // "location": "path",
  7226. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  7227. // "required": true,
  7228. // "type": "string"
  7229. // },
  7230. // "nodePoolId": {
  7231. // "description": "Deprecated. The name of the node pool to delete.\nThis field has been deprecated and replaced by the name field.",
  7232. // "location": "query",
  7233. // "type": "string"
  7234. // },
  7235. // "projectId": {
  7236. // "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.",
  7237. // "location": "query",
  7238. // "type": "string"
  7239. // },
  7240. // "zone": {
  7241. // "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.",
  7242. // "location": "query",
  7243. // "type": "string"
  7244. // }
  7245. // },
  7246. // "path": "v1beta1/{+name}",
  7247. // "response": {
  7248. // "$ref": "Operation"
  7249. // },
  7250. // "scopes": [
  7251. // "https://www.googleapis.com/auth/cloud-platform"
  7252. // ]
  7253. // }
  7254. }
  7255. // method id "container.projects.locations.clusters.nodePools.get":
  7256. type ProjectsLocationsClustersNodePoolsGetCall struct {
  7257. s *Service
  7258. name string
  7259. urlParams_ gensupport.URLParams
  7260. ifNoneMatch_ string
  7261. ctx_ context.Context
  7262. header_ http.Header
  7263. }
  7264. // Get: Retrieves the node pool requested.
  7265. func (r *ProjectsLocationsClustersNodePoolsService) Get(name string) *ProjectsLocationsClustersNodePoolsGetCall {
  7266. c := &ProjectsLocationsClustersNodePoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7267. c.name = name
  7268. return c
  7269. }
  7270. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  7271. // name of the cluster.
  7272. // This field has been deprecated and replaced by the name field.
  7273. func (c *ProjectsLocationsClustersNodePoolsGetCall) ClusterId(clusterId string) *ProjectsLocationsClustersNodePoolsGetCall {
  7274. c.urlParams_.Set("clusterId", clusterId)
  7275. return c
  7276. }
  7277. // NodePoolId sets the optional parameter "nodePoolId": Deprecated. The
  7278. // name of the node pool.
  7279. // This field has been deprecated and replaced by the name field.
  7280. func (c *ProjectsLocationsClustersNodePoolsGetCall) NodePoolId(nodePoolId string) *ProjectsLocationsClustersNodePoolsGetCall {
  7281. c.urlParams_.Set("nodePoolId", nodePoolId)
  7282. return c
  7283. }
  7284. // ProjectId sets the optional parameter "projectId": Deprecated. The
  7285. // Google Developers Console [project ID or
  7286. // project
  7287. // number](https://developers.google.com/console/help/new/#projec
  7288. // tnumber).
  7289. // This field has been deprecated and replaced by the name field.
  7290. func (c *ProjectsLocationsClustersNodePoolsGetCall) ProjectId(projectId string) *ProjectsLocationsClustersNodePoolsGetCall {
  7291. c.urlParams_.Set("projectId", projectId)
  7292. return c
  7293. }
  7294. // Zone sets the optional parameter "zone": Deprecated. The name of the
  7295. // Google Compute Engine
  7296. // [zone](/compute/docs/zones#available) in which the
  7297. // cluster
  7298. // resides.
  7299. // This field has been deprecated and replaced by the name field.
  7300. func (c *ProjectsLocationsClustersNodePoolsGetCall) Zone(zone string) *ProjectsLocationsClustersNodePoolsGetCall {
  7301. c.urlParams_.Set("zone", zone)
  7302. return c
  7303. }
  7304. // Fields allows partial responses to be retrieved. See
  7305. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7306. // for more information.
  7307. func (c *ProjectsLocationsClustersNodePoolsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsGetCall {
  7308. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7309. return c
  7310. }
  7311. // IfNoneMatch sets the optional parameter which makes the operation
  7312. // fail if the object's ETag matches the given value. This is useful for
  7313. // getting updates only after the object has changed since the last
  7314. // request. Use googleapi.IsNotModified to check whether the response
  7315. // error from Do is the result of In-None-Match.
  7316. func (c *ProjectsLocationsClustersNodePoolsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersNodePoolsGetCall {
  7317. c.ifNoneMatch_ = entityTag
  7318. return c
  7319. }
  7320. // Context sets the context to be used in this call's Do method. Any
  7321. // pending HTTP request will be aborted if the provided context is
  7322. // canceled.
  7323. func (c *ProjectsLocationsClustersNodePoolsGetCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsGetCall {
  7324. c.ctx_ = ctx
  7325. return c
  7326. }
  7327. // Header returns an http.Header that can be modified by the caller to
  7328. // add HTTP headers to the request.
  7329. func (c *ProjectsLocationsClustersNodePoolsGetCall) Header() http.Header {
  7330. if c.header_ == nil {
  7331. c.header_ = make(http.Header)
  7332. }
  7333. return c.header_
  7334. }
  7335. func (c *ProjectsLocationsClustersNodePoolsGetCall) doRequest(alt string) (*http.Response, error) {
  7336. reqHeaders := make(http.Header)
  7337. for k, v := range c.header_ {
  7338. reqHeaders[k] = v
  7339. }
  7340. reqHeaders.Set("User-Agent", c.s.userAgent())
  7341. if c.ifNoneMatch_ != "" {
  7342. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7343. }
  7344. var body io.Reader = nil
  7345. c.urlParams_.Set("alt", alt)
  7346. c.urlParams_.Set("prettyPrint", "false")
  7347. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  7348. urls += "?" + c.urlParams_.Encode()
  7349. req, err := http.NewRequest("GET", urls, body)
  7350. if err != nil {
  7351. return nil, err
  7352. }
  7353. req.Header = reqHeaders
  7354. googleapi.Expand(req.URL, map[string]string{
  7355. "name": c.name,
  7356. })
  7357. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7358. }
  7359. // Do executes the "container.projects.locations.clusters.nodePools.get" call.
  7360. // Exactly one of *NodePool or error will be non-nil. Any non-2xx status
  7361. // code is an error. Response headers are in either
  7362. // *NodePool.ServerResponse.Header or (if a response was returned at
  7363. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7364. // to check whether the returned error was because
  7365. // http.StatusNotModified was returned.
  7366. func (c *ProjectsLocationsClustersNodePoolsGetCall) Do(opts ...googleapi.CallOption) (*NodePool, error) {
  7367. gensupport.SetOptions(c.urlParams_, opts...)
  7368. res, err := c.doRequest("json")
  7369. if res != nil && res.StatusCode == http.StatusNotModified {
  7370. if res.Body != nil {
  7371. res.Body.Close()
  7372. }
  7373. return nil, &googleapi.Error{
  7374. Code: res.StatusCode,
  7375. Header: res.Header,
  7376. }
  7377. }
  7378. if err != nil {
  7379. return nil, err
  7380. }
  7381. defer googleapi.CloseBody(res)
  7382. if err := googleapi.CheckResponse(res); err != nil {
  7383. return nil, err
  7384. }
  7385. ret := &NodePool{
  7386. ServerResponse: googleapi.ServerResponse{
  7387. Header: res.Header,
  7388. HTTPStatusCode: res.StatusCode,
  7389. },
  7390. }
  7391. target := &ret
  7392. if err := gensupport.DecodeResponse(target, res); err != nil {
  7393. return nil, err
  7394. }
  7395. return ret, nil
  7396. // {
  7397. // "description": "Retrieves the node pool requested.",
  7398. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
  7399. // "httpMethod": "GET",
  7400. // "id": "container.projects.locations.clusters.nodePools.get",
  7401. // "parameterOrder": [
  7402. // "name"
  7403. // ],
  7404. // "parameters": {
  7405. // "clusterId": {
  7406. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  7407. // "location": "query",
  7408. // "type": "string"
  7409. // },
  7410. // "name": {
  7411. // "description": "The name (project, location, cluster, node pool id) of the node pool to\nget. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  7412. // "location": "path",
  7413. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  7414. // "required": true,
  7415. // "type": "string"
  7416. // },
  7417. // "nodePoolId": {
  7418. // "description": "Deprecated. The name of the node pool.\nThis field has been deprecated and replaced by the name field.",
  7419. // "location": "query",
  7420. // "type": "string"
  7421. // },
  7422. // "projectId": {
  7423. // "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.",
  7424. // "location": "query",
  7425. // "type": "string"
  7426. // },
  7427. // "zone": {
  7428. // "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.",
  7429. // "location": "query",
  7430. // "type": "string"
  7431. // }
  7432. // },
  7433. // "path": "v1beta1/{+name}",
  7434. // "response": {
  7435. // "$ref": "NodePool"
  7436. // },
  7437. // "scopes": [
  7438. // "https://www.googleapis.com/auth/cloud-platform"
  7439. // ]
  7440. // }
  7441. }
  7442. // method id "container.projects.locations.clusters.nodePools.list":
  7443. type ProjectsLocationsClustersNodePoolsListCall struct {
  7444. s *Service
  7445. parent string
  7446. urlParams_ gensupport.URLParams
  7447. ifNoneMatch_ string
  7448. ctx_ context.Context
  7449. header_ http.Header
  7450. }
  7451. // List: Lists the node pools for a cluster.
  7452. func (r *ProjectsLocationsClustersNodePoolsService) List(parent string) *ProjectsLocationsClustersNodePoolsListCall {
  7453. c := &ProjectsLocationsClustersNodePoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7454. c.parent = parent
  7455. return c
  7456. }
  7457. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  7458. // name of the cluster.
  7459. // This field has been deprecated and replaced by the parent field.
  7460. func (c *ProjectsLocationsClustersNodePoolsListCall) ClusterId(clusterId string) *ProjectsLocationsClustersNodePoolsListCall {
  7461. c.urlParams_.Set("clusterId", clusterId)
  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://developers.google.com/console/help/new/#projec
  7468. // tnumber).
  7469. // This field has been deprecated and replaced by the parent field.
  7470. func (c *ProjectsLocationsClustersNodePoolsListCall) ProjectId(projectId string) *ProjectsLocationsClustersNodePoolsListCall {
  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 parent field.
  7480. func (c *ProjectsLocationsClustersNodePoolsListCall) Zone(zone string) *ProjectsLocationsClustersNodePoolsListCall {
  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 *ProjectsLocationsClustersNodePoolsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsListCall {
  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 *ProjectsLocationsClustersNodePoolsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersNodePoolsListCall {
  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 *ProjectsLocationsClustersNodePoolsListCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsListCall {
  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 *ProjectsLocationsClustersNodePoolsListCall) Header() http.Header {
  7510. if c.header_ == nil {
  7511. c.header_ = make(http.Header)
  7512. }
  7513. return c.header_
  7514. }
  7515. func (c *ProjectsLocationsClustersNodePoolsListCall) 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. c.urlParams_.Set("prettyPrint", "false")
  7527. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/nodePools")
  7528. urls += "?" + c.urlParams_.Encode()
  7529. req, err := http.NewRequest("GET", urls, body)
  7530. if err != nil {
  7531. return nil, err
  7532. }
  7533. req.Header = reqHeaders
  7534. googleapi.Expand(req.URL, map[string]string{
  7535. "parent": c.parent,
  7536. })
  7537. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7538. }
  7539. // Do executes the "container.projects.locations.clusters.nodePools.list" call.
  7540. // Exactly one of *ListNodePoolsResponse or error will be non-nil. Any
  7541. // non-2xx status code is an error. Response headers are in either
  7542. // *ListNodePoolsResponse.ServerResponse.Header or (if a response was
  7543. // returned at all) in error.(*googleapi.Error).Header. Use
  7544. // googleapi.IsNotModified to check whether the returned error was
  7545. // because http.StatusNotModified was returned.
  7546. func (c *ProjectsLocationsClustersNodePoolsListCall) Do(opts ...googleapi.CallOption) (*ListNodePoolsResponse, error) {
  7547. gensupport.SetOptions(c.urlParams_, opts...)
  7548. res, err := c.doRequest("json")
  7549. if res != nil && res.StatusCode == http.StatusNotModified {
  7550. if res.Body != nil {
  7551. res.Body.Close()
  7552. }
  7553. return nil, &googleapi.Error{
  7554. Code: res.StatusCode,
  7555. Header: res.Header,
  7556. }
  7557. }
  7558. if err != nil {
  7559. return nil, err
  7560. }
  7561. defer googleapi.CloseBody(res)
  7562. if err := googleapi.CheckResponse(res); err != nil {
  7563. return nil, err
  7564. }
  7565. ret := &ListNodePoolsResponse{
  7566. ServerResponse: googleapi.ServerResponse{
  7567. Header: res.Header,
  7568. HTTPStatusCode: res.StatusCode,
  7569. },
  7570. }
  7571. target := &ret
  7572. if err := gensupport.DecodeResponse(target, res); err != nil {
  7573. return nil, err
  7574. }
  7575. return ret, nil
  7576. // {
  7577. // "description": "Lists the node pools for a cluster.",
  7578. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools",
  7579. // "httpMethod": "GET",
  7580. // "id": "container.projects.locations.clusters.nodePools.list",
  7581. // "parameterOrder": [
  7582. // "parent"
  7583. // ],
  7584. // "parameters": {
  7585. // "clusterId": {
  7586. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the parent field.",
  7587. // "location": "query",
  7588. // "type": "string"
  7589. // },
  7590. // "parent": {
  7591. // "description": "The parent (project, location, cluster id) where the node pools will be\nlisted. Specified in the format 'projects/*/locations/*/clusters/*'.",
  7592. // "location": "path",
  7593. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  7594. // "required": true,
  7595. // "type": "string"
  7596. // },
  7597. // "projectId": {
  7598. // "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.",
  7599. // "location": "query",
  7600. // "type": "string"
  7601. // },
  7602. // "zone": {
  7603. // "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.",
  7604. // "location": "query",
  7605. // "type": "string"
  7606. // }
  7607. // },
  7608. // "path": "v1beta1/{+parent}/nodePools",
  7609. // "response": {
  7610. // "$ref": "ListNodePoolsResponse"
  7611. // },
  7612. // "scopes": [
  7613. // "https://www.googleapis.com/auth/cloud-platform"
  7614. // ]
  7615. // }
  7616. }
  7617. // method id "container.projects.locations.clusters.nodePools.rollback":
  7618. type ProjectsLocationsClustersNodePoolsRollbackCall struct {
  7619. s *Service
  7620. name string
  7621. rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest
  7622. urlParams_ gensupport.URLParams
  7623. ctx_ context.Context
  7624. header_ http.Header
  7625. }
  7626. // Rollback: Roll back the previously Aborted or Failed NodePool
  7627. // upgrade.
  7628. // This will be an no-op if the last upgrade successfully completed.
  7629. func (r *ProjectsLocationsClustersNodePoolsService) Rollback(name string, rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest) *ProjectsLocationsClustersNodePoolsRollbackCall {
  7630. c := &ProjectsLocationsClustersNodePoolsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7631. c.name = name
  7632. c.rollbacknodepoolupgraderequest = rollbacknodepoolupgraderequest
  7633. return c
  7634. }
  7635. // Fields allows partial responses to be retrieved. See
  7636. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7637. // for more information.
  7638. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsRollbackCall {
  7639. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7640. return c
  7641. }
  7642. // Context sets the context to be used in this call's Do method. Any
  7643. // pending HTTP request will be aborted if the provided context is
  7644. // canceled.
  7645. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsRollbackCall {
  7646. c.ctx_ = ctx
  7647. return c
  7648. }
  7649. // Header returns an http.Header that can be modified by the caller to
  7650. // add HTTP headers to the request.
  7651. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Header() http.Header {
  7652. if c.header_ == nil {
  7653. c.header_ = make(http.Header)
  7654. }
  7655. return c.header_
  7656. }
  7657. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) doRequest(alt string) (*http.Response, error) {
  7658. reqHeaders := make(http.Header)
  7659. for k, v := range c.header_ {
  7660. reqHeaders[k] = v
  7661. }
  7662. reqHeaders.Set("User-Agent", c.s.userAgent())
  7663. var body io.Reader = nil
  7664. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbacknodepoolupgraderequest)
  7665. if err != nil {
  7666. return nil, err
  7667. }
  7668. reqHeaders.Set("Content-Type", "application/json")
  7669. c.urlParams_.Set("alt", alt)
  7670. c.urlParams_.Set("prettyPrint", "false")
  7671. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:rollback")
  7672. urls += "?" + c.urlParams_.Encode()
  7673. req, err := http.NewRequest("POST", urls, body)
  7674. if err != nil {
  7675. return nil, err
  7676. }
  7677. req.Header = reqHeaders
  7678. googleapi.Expand(req.URL, map[string]string{
  7679. "name": c.name,
  7680. })
  7681. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7682. }
  7683. // Do executes the "container.projects.locations.clusters.nodePools.rollback" call.
  7684. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7685. // status code is an error. Response headers are in either
  7686. // *Operation.ServerResponse.Header or (if a response was returned at
  7687. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7688. // to check whether the returned error was because
  7689. // http.StatusNotModified was returned.
  7690. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7691. gensupport.SetOptions(c.urlParams_, opts...)
  7692. res, err := c.doRequest("json")
  7693. if res != nil && res.StatusCode == http.StatusNotModified {
  7694. if res.Body != nil {
  7695. res.Body.Close()
  7696. }
  7697. return nil, &googleapi.Error{
  7698. Code: res.StatusCode,
  7699. Header: res.Header,
  7700. }
  7701. }
  7702. if err != nil {
  7703. return nil, err
  7704. }
  7705. defer googleapi.CloseBody(res)
  7706. if err := googleapi.CheckResponse(res); err != nil {
  7707. return nil, err
  7708. }
  7709. ret := &Operation{
  7710. ServerResponse: googleapi.ServerResponse{
  7711. Header: res.Header,
  7712. HTTPStatusCode: res.StatusCode,
  7713. },
  7714. }
  7715. target := &ret
  7716. if err := gensupport.DecodeResponse(target, res); err != nil {
  7717. return nil, err
  7718. }
  7719. return ret, nil
  7720. // {
  7721. // "description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed.",
  7722. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:rollback",
  7723. // "httpMethod": "POST",
  7724. // "id": "container.projects.locations.clusters.nodePools.rollback",
  7725. // "parameterOrder": [
  7726. // "name"
  7727. // ],
  7728. // "parameters": {
  7729. // "name": {
  7730. // "description": "The name (project, location, cluster, node pool id) of the node poll to\nrollback upgrade.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.",
  7731. // "location": "path",
  7732. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  7733. // "required": true,
  7734. // "type": "string"
  7735. // }
  7736. // },
  7737. // "path": "v1beta1/{+name}:rollback",
  7738. // "request": {
  7739. // "$ref": "RollbackNodePoolUpgradeRequest"
  7740. // },
  7741. // "response": {
  7742. // "$ref": "Operation"
  7743. // },
  7744. // "scopes": [
  7745. // "https://www.googleapis.com/auth/cloud-platform"
  7746. // ]
  7747. // }
  7748. }
  7749. // method id "container.projects.locations.clusters.nodePools.setAutoscaling":
  7750. type ProjectsLocationsClustersNodePoolsSetAutoscalingCall struct {
  7751. s *Service
  7752. name string
  7753. setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest
  7754. urlParams_ gensupport.URLParams
  7755. ctx_ context.Context
  7756. header_ http.Header
  7757. }
  7758. // SetAutoscaling: Sets the autoscaling settings of a specific node
  7759. // pool.
  7760. func (r *ProjectsLocationsClustersNodePoolsService) SetAutoscaling(name string, setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest) *ProjectsLocationsClustersNodePoolsSetAutoscalingCall {
  7761. c := &ProjectsLocationsClustersNodePoolsSetAutoscalingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7762. c.name = name
  7763. c.setnodepoolautoscalingrequest = setnodepoolautoscalingrequest
  7764. return c
  7765. }
  7766. // Fields allows partial responses to be retrieved. See
  7767. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7768. // for more information.
  7769. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsSetAutoscalingCall {
  7770. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7771. return c
  7772. }
  7773. // Context sets the context to be used in this call's Do method. Any
  7774. // pending HTTP request will be aborted if the provided context is
  7775. // canceled.
  7776. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsSetAutoscalingCall {
  7777. c.ctx_ = ctx
  7778. return c
  7779. }
  7780. // Header returns an http.Header that can be modified by the caller to
  7781. // add HTTP headers to the request.
  7782. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Header() http.Header {
  7783. if c.header_ == nil {
  7784. c.header_ = make(http.Header)
  7785. }
  7786. return c.header_
  7787. }
  7788. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) doRequest(alt string) (*http.Response, error) {
  7789. reqHeaders := make(http.Header)
  7790. for k, v := range c.header_ {
  7791. reqHeaders[k] = v
  7792. }
  7793. reqHeaders.Set("User-Agent", c.s.userAgent())
  7794. var body io.Reader = nil
  7795. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolautoscalingrequest)
  7796. if err != nil {
  7797. return nil, err
  7798. }
  7799. reqHeaders.Set("Content-Type", "application/json")
  7800. c.urlParams_.Set("alt", alt)
  7801. c.urlParams_.Set("prettyPrint", "false")
  7802. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setAutoscaling")
  7803. urls += "?" + c.urlParams_.Encode()
  7804. req, err := http.NewRequest("POST", urls, body)
  7805. if err != nil {
  7806. return nil, err
  7807. }
  7808. req.Header = reqHeaders
  7809. googleapi.Expand(req.URL, map[string]string{
  7810. "name": c.name,
  7811. })
  7812. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7813. }
  7814. // Do executes the "container.projects.locations.clusters.nodePools.setAutoscaling" call.
  7815. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7816. // status code is an error. Response headers are in either
  7817. // *Operation.ServerResponse.Header or (if a response was returned at
  7818. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7819. // to check whether the returned error was because
  7820. // http.StatusNotModified was returned.
  7821. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7822. gensupport.SetOptions(c.urlParams_, opts...)
  7823. res, err := c.doRequest("json")
  7824. if res != nil && res.StatusCode == http.StatusNotModified {
  7825. if res.Body != nil {
  7826. res.Body.Close()
  7827. }
  7828. return nil, &googleapi.Error{
  7829. Code: res.StatusCode,
  7830. Header: res.Header,
  7831. }
  7832. }
  7833. if err != nil {
  7834. return nil, err
  7835. }
  7836. defer googleapi.CloseBody(res)
  7837. if err := googleapi.CheckResponse(res); err != nil {
  7838. return nil, err
  7839. }
  7840. ret := &Operation{
  7841. ServerResponse: googleapi.ServerResponse{
  7842. Header: res.Header,
  7843. HTTPStatusCode: res.StatusCode,
  7844. },
  7845. }
  7846. target := &ret
  7847. if err := gensupport.DecodeResponse(target, res); err != nil {
  7848. return nil, err
  7849. }
  7850. return ret, nil
  7851. // {
  7852. // "description": "Sets the autoscaling settings of a specific node pool.",
  7853. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setAutoscaling",
  7854. // "httpMethod": "POST",
  7855. // "id": "container.projects.locations.clusters.nodePools.setAutoscaling",
  7856. // "parameterOrder": [
  7857. // "name"
  7858. // ],
  7859. // "parameters": {
  7860. // "name": {
  7861. // "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/*'.",
  7862. // "location": "path",
  7863. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  7864. // "required": true,
  7865. // "type": "string"
  7866. // }
  7867. // },
  7868. // "path": "v1beta1/{+name}:setAutoscaling",
  7869. // "request": {
  7870. // "$ref": "SetNodePoolAutoscalingRequest"
  7871. // },
  7872. // "response": {
  7873. // "$ref": "Operation"
  7874. // },
  7875. // "scopes": [
  7876. // "https://www.googleapis.com/auth/cloud-platform"
  7877. // ]
  7878. // }
  7879. }
  7880. // method id "container.projects.locations.clusters.nodePools.setManagement":
  7881. type ProjectsLocationsClustersNodePoolsSetManagementCall struct {
  7882. s *Service
  7883. name string
  7884. setnodepoolmanagementrequest *SetNodePoolManagementRequest
  7885. urlParams_ gensupport.URLParams
  7886. ctx_ context.Context
  7887. header_ http.Header
  7888. }
  7889. // SetManagement: Sets the NodeManagement options for a node pool.
  7890. func (r *ProjectsLocationsClustersNodePoolsService) SetManagement(name string, setnodepoolmanagementrequest *SetNodePoolManagementRequest) *ProjectsLocationsClustersNodePoolsSetManagementCall {
  7891. c := &ProjectsLocationsClustersNodePoolsSetManagementCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7892. c.name = name
  7893. c.setnodepoolmanagementrequest = setnodepoolmanagementrequest
  7894. return c
  7895. }
  7896. // Fields allows partial responses to be retrieved. See
  7897. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7898. // for more information.
  7899. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsSetManagementCall {
  7900. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7901. return c
  7902. }
  7903. // Context sets the context to be used in this call's Do method. Any
  7904. // pending HTTP request will be aborted if the provided context is
  7905. // canceled.
  7906. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsSetManagementCall {
  7907. c.ctx_ = ctx
  7908. return c
  7909. }
  7910. // Header returns an http.Header that can be modified by the caller to
  7911. // add HTTP headers to the request.
  7912. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Header() http.Header {
  7913. if c.header_ == nil {
  7914. c.header_ = make(http.Header)
  7915. }
  7916. return c.header_
  7917. }
  7918. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) doRequest(alt string) (*http.Response, error) {
  7919. reqHeaders := make(http.Header)
  7920. for k, v := range c.header_ {
  7921. reqHeaders[k] = v
  7922. }
  7923. reqHeaders.Set("User-Agent", c.s.userAgent())
  7924. var body io.Reader = nil
  7925. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolmanagementrequest)
  7926. if err != nil {
  7927. return nil, err
  7928. }
  7929. reqHeaders.Set("Content-Type", "application/json")
  7930. c.urlParams_.Set("alt", alt)
  7931. c.urlParams_.Set("prettyPrint", "false")
  7932. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setManagement")
  7933. urls += "?" + c.urlParams_.Encode()
  7934. req, err := http.NewRequest("POST", urls, body)
  7935. if err != nil {
  7936. return nil, err
  7937. }
  7938. req.Header = reqHeaders
  7939. googleapi.Expand(req.URL, map[string]string{
  7940. "name": c.name,
  7941. })
  7942. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7943. }
  7944. // Do executes the "container.projects.locations.clusters.nodePools.setManagement" call.
  7945. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7946. // status code is an error. Response headers are in either
  7947. // *Operation.ServerResponse.Header or (if a response was returned at
  7948. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7949. // to check whether the returned error was because
  7950. // http.StatusNotModified was returned.
  7951. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7952. gensupport.SetOptions(c.urlParams_, opts...)
  7953. res, err := c.doRequest("json")
  7954. if res != nil && res.StatusCode == http.StatusNotModified {
  7955. if res.Body != nil {
  7956. res.Body.Close()
  7957. }
  7958. return nil, &googleapi.Error{
  7959. Code: res.StatusCode,
  7960. Header: res.Header,
  7961. }
  7962. }
  7963. if err != nil {
  7964. return nil, err
  7965. }
  7966. defer googleapi.CloseBody(res)
  7967. if err := googleapi.CheckResponse(res); err != nil {
  7968. return nil, err
  7969. }
  7970. ret := &Operation{
  7971. ServerResponse: googleapi.ServerResponse{
  7972. Header: res.Header,
  7973. HTTPStatusCode: res.StatusCode,
  7974. },
  7975. }
  7976. target := &ret
  7977. if err := gensupport.DecodeResponse(target, res); err != nil {
  7978. return nil, err
  7979. }
  7980. return ret, nil
  7981. // {
  7982. // "description": "Sets the NodeManagement options for a node pool.",
  7983. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setManagement",
  7984. // "httpMethod": "POST",
  7985. // "id": "container.projects.locations.clusters.nodePools.setManagement",
  7986. // "parameterOrder": [
  7987. // "name"
  7988. // ],
  7989. // "parameters": {
  7990. // "name": {
  7991. // "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/*'.",
  7992. // "location": "path",
  7993. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  7994. // "required": true,
  7995. // "type": "string"
  7996. // }
  7997. // },
  7998. // "path": "v1beta1/{+name}:setManagement",
  7999. // "request": {
  8000. // "$ref": "SetNodePoolManagementRequest"
  8001. // },
  8002. // "response": {
  8003. // "$ref": "Operation"
  8004. // },
  8005. // "scopes": [
  8006. // "https://www.googleapis.com/auth/cloud-platform"
  8007. // ]
  8008. // }
  8009. }
  8010. // method id "container.projects.locations.clusters.nodePools.setSize":
  8011. type ProjectsLocationsClustersNodePoolsSetSizeCall struct {
  8012. s *Service
  8013. name string
  8014. setnodepoolsizerequest *SetNodePoolSizeRequest
  8015. urlParams_ gensupport.URLParams
  8016. ctx_ context.Context
  8017. header_ http.Header
  8018. }
  8019. // SetSize: Sets the size for a specific node pool.
  8020. func (r *ProjectsLocationsClustersNodePoolsService) SetSize(name string, setnodepoolsizerequest *SetNodePoolSizeRequest) *ProjectsLocationsClustersNodePoolsSetSizeCall {
  8021. c := &ProjectsLocationsClustersNodePoolsSetSizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8022. c.name = name
  8023. c.setnodepoolsizerequest = setnodepoolsizerequest
  8024. return c
  8025. }
  8026. // Fields allows partial responses to be retrieved. See
  8027. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8028. // for more information.
  8029. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsSetSizeCall {
  8030. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8031. return c
  8032. }
  8033. // Context sets the context to be used in this call's Do method. Any
  8034. // pending HTTP request will be aborted if the provided context is
  8035. // canceled.
  8036. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsSetSizeCall {
  8037. c.ctx_ = ctx
  8038. return c
  8039. }
  8040. // Header returns an http.Header that can be modified by the caller to
  8041. // add HTTP headers to the request.
  8042. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Header() http.Header {
  8043. if c.header_ == nil {
  8044. c.header_ = make(http.Header)
  8045. }
  8046. return c.header_
  8047. }
  8048. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) doRequest(alt string) (*http.Response, error) {
  8049. reqHeaders := make(http.Header)
  8050. for k, v := range c.header_ {
  8051. reqHeaders[k] = v
  8052. }
  8053. reqHeaders.Set("User-Agent", c.s.userAgent())
  8054. var body io.Reader = nil
  8055. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolsizerequest)
  8056. if err != nil {
  8057. return nil, err
  8058. }
  8059. reqHeaders.Set("Content-Type", "application/json")
  8060. c.urlParams_.Set("alt", alt)
  8061. c.urlParams_.Set("prettyPrint", "false")
  8062. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:setSize")
  8063. urls += "?" + c.urlParams_.Encode()
  8064. req, err := http.NewRequest("POST", urls, body)
  8065. if err != nil {
  8066. return nil, err
  8067. }
  8068. req.Header = reqHeaders
  8069. googleapi.Expand(req.URL, map[string]string{
  8070. "name": c.name,
  8071. })
  8072. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8073. }
  8074. // Do executes the "container.projects.locations.clusters.nodePools.setSize" call.
  8075. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8076. // status code is an error. Response headers are in either
  8077. // *Operation.ServerResponse.Header or (if a response was returned at
  8078. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8079. // to check whether the returned error was because
  8080. // http.StatusNotModified was returned.
  8081. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8082. gensupport.SetOptions(c.urlParams_, opts...)
  8083. res, err := c.doRequest("json")
  8084. if res != nil && res.StatusCode == http.StatusNotModified {
  8085. if res.Body != nil {
  8086. res.Body.Close()
  8087. }
  8088. return nil, &googleapi.Error{
  8089. Code: res.StatusCode,
  8090. Header: res.Header,
  8091. }
  8092. }
  8093. if err != nil {
  8094. return nil, err
  8095. }
  8096. defer googleapi.CloseBody(res)
  8097. if err := googleapi.CheckResponse(res); err != nil {
  8098. return nil, err
  8099. }
  8100. ret := &Operation{
  8101. ServerResponse: googleapi.ServerResponse{
  8102. Header: res.Header,
  8103. HTTPStatusCode: res.StatusCode,
  8104. },
  8105. }
  8106. target := &ret
  8107. if err := gensupport.DecodeResponse(target, res); err != nil {
  8108. return nil, err
  8109. }
  8110. return ret, nil
  8111. // {
  8112. // "description": "Sets the size for a specific node pool.",
  8113. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setSize",
  8114. // "httpMethod": "POST",
  8115. // "id": "container.projects.locations.clusters.nodePools.setSize",
  8116. // "parameterOrder": [
  8117. // "name"
  8118. // ],
  8119. // "parameters": {
  8120. // "name": {
  8121. // "description": "The name (project, location, cluster, node pool id) of the node pool to set\nsize.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.",
  8122. // "location": "path",
  8123. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  8124. // "required": true,
  8125. // "type": "string"
  8126. // }
  8127. // },
  8128. // "path": "v1beta1/{+name}:setSize",
  8129. // "request": {
  8130. // "$ref": "SetNodePoolSizeRequest"
  8131. // },
  8132. // "response": {
  8133. // "$ref": "Operation"
  8134. // },
  8135. // "scopes": [
  8136. // "https://www.googleapis.com/auth/cloud-platform"
  8137. // ]
  8138. // }
  8139. }
  8140. // method id "container.projects.locations.clusters.nodePools.update":
  8141. type ProjectsLocationsClustersNodePoolsUpdateCall struct {
  8142. s *Service
  8143. name string
  8144. updatenodepoolrequest *UpdateNodePoolRequest
  8145. urlParams_ gensupport.URLParams
  8146. ctx_ context.Context
  8147. header_ http.Header
  8148. }
  8149. // Update: Updates the version and/or image type of a specific node
  8150. // pool.
  8151. func (r *ProjectsLocationsClustersNodePoolsService) Update(name string, updatenodepoolrequest *UpdateNodePoolRequest) *ProjectsLocationsClustersNodePoolsUpdateCall {
  8152. c := &ProjectsLocationsClustersNodePoolsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8153. c.name = name
  8154. c.updatenodepoolrequest = updatenodepoolrequest
  8155. return c
  8156. }
  8157. // Fields allows partial responses to be retrieved. See
  8158. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8159. // for more information.
  8160. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsUpdateCall {
  8161. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8162. return c
  8163. }
  8164. // Context sets the context to be used in this call's Do method. Any
  8165. // pending HTTP request will be aborted if the provided context is
  8166. // canceled.
  8167. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsUpdateCall {
  8168. c.ctx_ = ctx
  8169. return c
  8170. }
  8171. // Header returns an http.Header that can be modified by the caller to
  8172. // add HTTP headers to the request.
  8173. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Header() http.Header {
  8174. if c.header_ == nil {
  8175. c.header_ = make(http.Header)
  8176. }
  8177. return c.header_
  8178. }
  8179. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) doRequest(alt string) (*http.Response, error) {
  8180. reqHeaders := make(http.Header)
  8181. for k, v := range c.header_ {
  8182. reqHeaders[k] = v
  8183. }
  8184. reqHeaders.Set("User-Agent", c.s.userAgent())
  8185. var body io.Reader = nil
  8186. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatenodepoolrequest)
  8187. if err != nil {
  8188. return nil, err
  8189. }
  8190. reqHeaders.Set("Content-Type", "application/json")
  8191. c.urlParams_.Set("alt", alt)
  8192. c.urlParams_.Set("prettyPrint", "false")
  8193. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  8194. urls += "?" + c.urlParams_.Encode()
  8195. req, err := http.NewRequest("PUT", urls, body)
  8196. if err != nil {
  8197. return nil, err
  8198. }
  8199. req.Header = reqHeaders
  8200. googleapi.Expand(req.URL, map[string]string{
  8201. "name": c.name,
  8202. })
  8203. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8204. }
  8205. // Do executes the "container.projects.locations.clusters.nodePools.update" call.
  8206. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8207. // status code is an error. Response headers are in either
  8208. // *Operation.ServerResponse.Header or (if a response was returned at
  8209. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8210. // to check whether the returned error was because
  8211. // http.StatusNotModified was returned.
  8212. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8213. gensupport.SetOptions(c.urlParams_, opts...)
  8214. res, err := c.doRequest("json")
  8215. if res != nil && res.StatusCode == http.StatusNotModified {
  8216. if res.Body != nil {
  8217. res.Body.Close()
  8218. }
  8219. return nil, &googleapi.Error{
  8220. Code: res.StatusCode,
  8221. Header: res.Header,
  8222. }
  8223. }
  8224. if err != nil {
  8225. return nil, err
  8226. }
  8227. defer googleapi.CloseBody(res)
  8228. if err := googleapi.CheckResponse(res); err != nil {
  8229. return nil, err
  8230. }
  8231. ret := &Operation{
  8232. ServerResponse: googleapi.ServerResponse{
  8233. Header: res.Header,
  8234. HTTPStatusCode: res.StatusCode,
  8235. },
  8236. }
  8237. target := &ret
  8238. if err := gensupport.DecodeResponse(target, res); err != nil {
  8239. return nil, err
  8240. }
  8241. return ret, nil
  8242. // {
  8243. // "description": "Updates the version and/or image type of a specific node pool.",
  8244. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
  8245. // "httpMethod": "PUT",
  8246. // "id": "container.projects.locations.clusters.nodePools.update",
  8247. // "parameterOrder": [
  8248. // "name"
  8249. // ],
  8250. // "parameters": {
  8251. // "name": {
  8252. // "description": "The name (project, location, cluster, node pool) of the node pool to\nupdate. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  8253. // "location": "path",
  8254. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  8255. // "required": true,
  8256. // "type": "string"
  8257. // }
  8258. // },
  8259. // "path": "v1beta1/{+name}",
  8260. // "request": {
  8261. // "$ref": "UpdateNodePoolRequest"
  8262. // },
  8263. // "response": {
  8264. // "$ref": "Operation"
  8265. // },
  8266. // "scopes": [
  8267. // "https://www.googleapis.com/auth/cloud-platform"
  8268. // ]
  8269. // }
  8270. }
  8271. // method id "container.projects.locations.clusters.well-known.getOpenid-configuration":
  8272. type ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall struct {
  8273. s *Service
  8274. parent string
  8275. urlParams_ gensupport.URLParams
  8276. ifNoneMatch_ string
  8277. ctx_ context.Context
  8278. header_ http.Header
  8279. }
  8280. // GetOpenidConfiguration: GetOpenIDConfig gets the OIDC discovery
  8281. // document for the cluster.
  8282. // See the OpenID Connect Discovery 1.0 specification for
  8283. // details.
  8284. // https://openid.net/specs/openid-connect-discovery-1_0.html
  8285. // Th
  8286. // is API is not yet intended for general use, and is not available for
  8287. // all
  8288. // clusters.
  8289. func (r *ProjectsLocationsClustersWellKnownService) GetOpenidConfiguration(parent string) *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall {
  8290. c := &ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8291. c.parent = parent
  8292. return c
  8293. }
  8294. // Fields allows partial responses to be retrieved. See
  8295. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8296. // for more information.
  8297. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall {
  8298. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8299. return c
  8300. }
  8301. // IfNoneMatch sets the optional parameter which makes the operation
  8302. // fail if the object's ETag matches the given value. This is useful for
  8303. // getting updates only after the object has changed since the last
  8304. // request. Use googleapi.IsNotModified to check whether the response
  8305. // error from Do is the result of In-None-Match.
  8306. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall {
  8307. c.ifNoneMatch_ = entityTag
  8308. return c
  8309. }
  8310. // Context sets the context to be used in this call's Do method. Any
  8311. // pending HTTP request will be aborted if the provided context is
  8312. // canceled.
  8313. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) Context(ctx context.Context) *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall {
  8314. c.ctx_ = ctx
  8315. return c
  8316. }
  8317. // Header returns an http.Header that can be modified by the caller to
  8318. // add HTTP headers to the request.
  8319. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) Header() http.Header {
  8320. if c.header_ == nil {
  8321. c.header_ = make(http.Header)
  8322. }
  8323. return c.header_
  8324. }
  8325. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) doRequest(alt string) (*http.Response, error) {
  8326. reqHeaders := make(http.Header)
  8327. for k, v := range c.header_ {
  8328. reqHeaders[k] = v
  8329. }
  8330. reqHeaders.Set("User-Agent", c.s.userAgent())
  8331. if c.ifNoneMatch_ != "" {
  8332. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8333. }
  8334. var body io.Reader = nil
  8335. c.urlParams_.Set("alt", alt)
  8336. c.urlParams_.Set("prettyPrint", "false")
  8337. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/.well-known/openid-configuration")
  8338. urls += "?" + c.urlParams_.Encode()
  8339. req, err := http.NewRequest("GET", urls, body)
  8340. if err != nil {
  8341. return nil, err
  8342. }
  8343. req.Header = reqHeaders
  8344. googleapi.Expand(req.URL, map[string]string{
  8345. "parent": c.parent,
  8346. })
  8347. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8348. }
  8349. // Do executes the "container.projects.locations.clusters.well-known.getOpenid-configuration" call.
  8350. // Exactly one of *GetOpenIDConfigResponse or error will be non-nil. Any
  8351. // non-2xx status code is an error. Response headers are in either
  8352. // *GetOpenIDConfigResponse.ServerResponse.Header or (if a response was
  8353. // returned at all) in error.(*googleapi.Error).Header. Use
  8354. // googleapi.IsNotModified to check whether the returned error was
  8355. // because http.StatusNotModified was returned.
  8356. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) Do(opts ...googleapi.CallOption) (*GetOpenIDConfigResponse, error) {
  8357. gensupport.SetOptions(c.urlParams_, opts...)
  8358. res, err := c.doRequest("json")
  8359. if res != nil && res.StatusCode == http.StatusNotModified {
  8360. if res.Body != nil {
  8361. res.Body.Close()
  8362. }
  8363. return nil, &googleapi.Error{
  8364. Code: res.StatusCode,
  8365. Header: res.Header,
  8366. }
  8367. }
  8368. if err != nil {
  8369. return nil, err
  8370. }
  8371. defer googleapi.CloseBody(res)
  8372. if err := googleapi.CheckResponse(res); err != nil {
  8373. return nil, err
  8374. }
  8375. ret := &GetOpenIDConfigResponse{
  8376. ServerResponse: googleapi.ServerResponse{
  8377. Header: res.Header,
  8378. HTTPStatusCode: res.StatusCode,
  8379. },
  8380. }
  8381. target := &ret
  8382. if err := gensupport.DecodeResponse(target, res); err != nil {
  8383. return nil, err
  8384. }
  8385. return ret, nil
  8386. // {
  8387. // "description": "GetOpenIDConfig gets the OIDC discovery document for the cluster.\nSee the OpenID Connect Discovery 1.0 specification for details.\nhttps://openid.net/specs/openid-connect-discovery-1_0.html\nThis API is not yet intended for general use, and is not available for all\nclusters.",
  8388. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/.well-known/openid-configuration",
  8389. // "httpMethod": "GET",
  8390. // "id": "container.projects.locations.clusters.well-known.getOpenid-configuration",
  8391. // "parameterOrder": [
  8392. // "parent"
  8393. // ],
  8394. // "parameters": {
  8395. // "parent": {
  8396. // "description": "The cluster (project, location, cluster id) to get the discovery document\nfor. Specified in the format 'projects/*/locations/*/clusters/*'.",
  8397. // "location": "path",
  8398. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  8399. // "required": true,
  8400. // "type": "string"
  8401. // }
  8402. // },
  8403. // "path": "v1beta1/{+parent}/.well-known/openid-configuration",
  8404. // "response": {
  8405. // "$ref": "GetOpenIDConfigResponse"
  8406. // },
  8407. // "scopes": [
  8408. // "https://www.googleapis.com/auth/cloud-platform"
  8409. // ]
  8410. // }
  8411. }
  8412. // method id "container.projects.locations.operations.cancel":
  8413. type ProjectsLocationsOperationsCancelCall struct {
  8414. s *Service
  8415. name string
  8416. canceloperationrequest *CancelOperationRequest
  8417. urlParams_ gensupport.URLParams
  8418. ctx_ context.Context
  8419. header_ http.Header
  8420. }
  8421. // Cancel: Cancels the specified operation.
  8422. func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
  8423. c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8424. c.name = name
  8425. c.canceloperationrequest = canceloperationrequest
  8426. return c
  8427. }
  8428. // Fields allows partial responses to be retrieved. See
  8429. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8430. // for more information.
  8431. func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
  8432. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8433. return c
  8434. }
  8435. // Context sets the context to be used in this call's Do method. Any
  8436. // pending HTTP request will be aborted if the provided context is
  8437. // canceled.
  8438. func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
  8439. c.ctx_ = ctx
  8440. return c
  8441. }
  8442. // Header returns an http.Header that can be modified by the caller to
  8443. // add HTTP headers to the request.
  8444. func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
  8445. if c.header_ == nil {
  8446. c.header_ = make(http.Header)
  8447. }
  8448. return c.header_
  8449. }
  8450. func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  8451. reqHeaders := make(http.Header)
  8452. for k, v := range c.header_ {
  8453. reqHeaders[k] = v
  8454. }
  8455. reqHeaders.Set("User-Agent", c.s.userAgent())
  8456. var body io.Reader = nil
  8457. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  8458. if err != nil {
  8459. return nil, err
  8460. }
  8461. reqHeaders.Set("Content-Type", "application/json")
  8462. c.urlParams_.Set("alt", alt)
  8463. c.urlParams_.Set("prettyPrint", "false")
  8464. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel")
  8465. urls += "?" + c.urlParams_.Encode()
  8466. req, err := http.NewRequest("POST", urls, body)
  8467. if err != nil {
  8468. return nil, err
  8469. }
  8470. req.Header = reqHeaders
  8471. googleapi.Expand(req.URL, map[string]string{
  8472. "name": c.name,
  8473. })
  8474. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8475. }
  8476. // Do executes the "container.projects.locations.operations.cancel" call.
  8477. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  8478. // code is an error. Response headers are in either
  8479. // *Empty.ServerResponse.Header or (if a response was returned at all)
  8480. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8481. // check whether the returned error was because http.StatusNotModified
  8482. // was returned.
  8483. func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  8484. gensupport.SetOptions(c.urlParams_, opts...)
  8485. res, err := c.doRequest("json")
  8486. if res != nil && res.StatusCode == http.StatusNotModified {
  8487. if res.Body != nil {
  8488. res.Body.Close()
  8489. }
  8490. return nil, &googleapi.Error{
  8491. Code: res.StatusCode,
  8492. Header: res.Header,
  8493. }
  8494. }
  8495. if err != nil {
  8496. return nil, err
  8497. }
  8498. defer googleapi.CloseBody(res)
  8499. if err := googleapi.CheckResponse(res); err != nil {
  8500. return nil, err
  8501. }
  8502. ret := &Empty{
  8503. ServerResponse: googleapi.ServerResponse{
  8504. Header: res.Header,
  8505. HTTPStatusCode: res.StatusCode,
  8506. },
  8507. }
  8508. target := &ret
  8509. if err := gensupport.DecodeResponse(target, res); err != nil {
  8510. return nil, err
  8511. }
  8512. return ret, nil
  8513. // {
  8514. // "description": "Cancels the specified operation.",
  8515. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel",
  8516. // "httpMethod": "POST",
  8517. // "id": "container.projects.locations.operations.cancel",
  8518. // "parameterOrder": [
  8519. // "name"
  8520. // ],
  8521. // "parameters": {
  8522. // "name": {
  8523. // "description": "The name (project, location, operation id) of the operation to cancel.\nSpecified in the format 'projects/*/locations/*/operations/*'.",
  8524. // "location": "path",
  8525. // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  8526. // "required": true,
  8527. // "type": "string"
  8528. // }
  8529. // },
  8530. // "path": "v1beta1/{+name}:cancel",
  8531. // "request": {
  8532. // "$ref": "CancelOperationRequest"
  8533. // },
  8534. // "response": {
  8535. // "$ref": "Empty"
  8536. // },
  8537. // "scopes": [
  8538. // "https://www.googleapis.com/auth/cloud-platform"
  8539. // ]
  8540. // }
  8541. }
  8542. // method id "container.projects.locations.operations.get":
  8543. type ProjectsLocationsOperationsGetCall struct {
  8544. s *Service
  8545. name string
  8546. urlParams_ gensupport.URLParams
  8547. ifNoneMatch_ string
  8548. ctx_ context.Context
  8549. header_ http.Header
  8550. }
  8551. // Get: Gets the specified operation.
  8552. func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  8553. c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8554. c.name = name
  8555. return c
  8556. }
  8557. // OperationId sets the optional parameter "operationId": Deprecated.
  8558. // The server-assigned `name` of the operation.
  8559. // This field has been deprecated and replaced by the name field.
  8560. func (c *ProjectsLocationsOperationsGetCall) OperationId(operationId string) *ProjectsLocationsOperationsGetCall {
  8561. c.urlParams_.Set("operationId", operationId)
  8562. return c
  8563. }
  8564. // ProjectId sets the optional parameter "projectId": Deprecated. The
  8565. // Google Developers Console [project ID or
  8566. // project
  8567. // number](https://support.google.com/cloud/answer/6158840).
  8568. // This
  8569. // field has been deprecated and replaced by the name field.
  8570. func (c *ProjectsLocationsOperationsGetCall) ProjectId(projectId string) *ProjectsLocationsOperationsGetCall {
  8571. c.urlParams_.Set("projectId", projectId)
  8572. return c
  8573. }
  8574. // Zone sets the optional parameter "zone": Deprecated. The name of the
  8575. // Google Compute Engine
  8576. // [zone](/compute/docs/zones#available) in which the
  8577. // cluster
  8578. // resides.
  8579. // This field has been deprecated and replaced by the name field.
  8580. func (c *ProjectsLocationsOperationsGetCall) Zone(zone string) *ProjectsLocationsOperationsGetCall {
  8581. c.urlParams_.Set("zone", zone)
  8582. return c
  8583. }
  8584. // Fields allows partial responses to be retrieved. See
  8585. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8586. // for more information.
  8587. func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  8588. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8589. return c
  8590. }
  8591. // IfNoneMatch sets the optional parameter which makes the operation
  8592. // fail if the object's ETag matches the given value. This is useful for
  8593. // getting updates only after the object has changed since the last
  8594. // request. Use googleapi.IsNotModified to check whether the response
  8595. // error from Do is the result of In-None-Match.
  8596. func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  8597. c.ifNoneMatch_ = entityTag
  8598. return c
  8599. }
  8600. // Context sets the context to be used in this call's Do method. Any
  8601. // pending HTTP request will be aborted if the provided context is
  8602. // canceled.
  8603. func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  8604. c.ctx_ = ctx
  8605. return c
  8606. }
  8607. // Header returns an http.Header that can be modified by the caller to
  8608. // add HTTP headers to the request.
  8609. func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  8610. if c.header_ == nil {
  8611. c.header_ = make(http.Header)
  8612. }
  8613. return c.header_
  8614. }
  8615. func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  8616. reqHeaders := make(http.Header)
  8617. for k, v := range c.header_ {
  8618. reqHeaders[k] = v
  8619. }
  8620. reqHeaders.Set("User-Agent", c.s.userAgent())
  8621. if c.ifNoneMatch_ != "" {
  8622. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8623. }
  8624. var body io.Reader = nil
  8625. c.urlParams_.Set("alt", alt)
  8626. c.urlParams_.Set("prettyPrint", "false")
  8627. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  8628. urls += "?" + c.urlParams_.Encode()
  8629. req, err := http.NewRequest("GET", urls, body)
  8630. if err != nil {
  8631. return nil, err
  8632. }
  8633. req.Header = reqHeaders
  8634. googleapi.Expand(req.URL, map[string]string{
  8635. "name": c.name,
  8636. })
  8637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8638. }
  8639. // Do executes the "container.projects.locations.operations.get" call.
  8640. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8641. // status code is an error. Response headers are in either
  8642. // *Operation.ServerResponse.Header or (if a response was returned at
  8643. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8644. // to check whether the returned error was because
  8645. // http.StatusNotModified was returned.
  8646. func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8647. gensupport.SetOptions(c.urlParams_, opts...)
  8648. res, err := c.doRequest("json")
  8649. if res != nil && res.StatusCode == http.StatusNotModified {
  8650. if res.Body != nil {
  8651. res.Body.Close()
  8652. }
  8653. return nil, &googleapi.Error{
  8654. Code: res.StatusCode,
  8655. Header: res.Header,
  8656. }
  8657. }
  8658. if err != nil {
  8659. return nil, err
  8660. }
  8661. defer googleapi.CloseBody(res)
  8662. if err := googleapi.CheckResponse(res); err != nil {
  8663. return nil, err
  8664. }
  8665. ret := &Operation{
  8666. ServerResponse: googleapi.ServerResponse{
  8667. Header: res.Header,
  8668. HTTPStatusCode: res.StatusCode,
  8669. },
  8670. }
  8671. target := &ret
  8672. if err := gensupport.DecodeResponse(target, res); err != nil {
  8673. return nil, err
  8674. }
  8675. return ret, nil
  8676. // {
  8677. // "description": "Gets the specified operation.",
  8678. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
  8679. // "httpMethod": "GET",
  8680. // "id": "container.projects.locations.operations.get",
  8681. // "parameterOrder": [
  8682. // "name"
  8683. // ],
  8684. // "parameters": {
  8685. // "name": {
  8686. // "description": "The name (project, location, operation id) of the operation to get.\nSpecified in the format 'projects/*/locations/*/operations/*'.",
  8687. // "location": "path",
  8688. // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  8689. // "required": true,
  8690. // "type": "string"
  8691. // },
  8692. // "operationId": {
  8693. // "description": "Deprecated. The server-assigned `name` of the operation.\nThis field has been deprecated and replaced by the name field.",
  8694. // "location": "query",
  8695. // "type": "string"
  8696. // },
  8697. // "projectId": {
  8698. // "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.",
  8699. // "location": "query",
  8700. // "type": "string"
  8701. // },
  8702. // "zone": {
  8703. // "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.",
  8704. // "location": "query",
  8705. // "type": "string"
  8706. // }
  8707. // },
  8708. // "path": "v1beta1/{+name}",
  8709. // "response": {
  8710. // "$ref": "Operation"
  8711. // },
  8712. // "scopes": [
  8713. // "https://www.googleapis.com/auth/cloud-platform"
  8714. // ]
  8715. // }
  8716. }
  8717. // method id "container.projects.locations.operations.list":
  8718. type ProjectsLocationsOperationsListCall struct {
  8719. s *Service
  8720. parent string
  8721. urlParams_ gensupport.URLParams
  8722. ifNoneMatch_ string
  8723. ctx_ context.Context
  8724. header_ http.Header
  8725. }
  8726. // List: Lists all operations in a project in a specific zone or all
  8727. // zones.
  8728. func (r *ProjectsLocationsOperationsService) List(parent string) *ProjectsLocationsOperationsListCall {
  8729. c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8730. c.parent = parent
  8731. return c
  8732. }
  8733. // ProjectId sets the optional parameter "projectId": Deprecated. The
  8734. // Google Developers Console [project ID or
  8735. // project
  8736. // number](https://support.google.com/cloud/answer/6158840).
  8737. // This
  8738. // field has been deprecated and replaced by the parent field.
  8739. func (c *ProjectsLocationsOperationsListCall) ProjectId(projectId string) *ProjectsLocationsOperationsListCall {
  8740. c.urlParams_.Set("projectId", projectId)
  8741. return c
  8742. }
  8743. // Zone sets the optional parameter "zone": Deprecated. The name of the
  8744. // Google Compute Engine
  8745. // [zone](/compute/docs/zones#available) to return operations for, or
  8746. // `-` for
  8747. // all zones. This field has been deprecated and replaced by the parent
  8748. // field.
  8749. func (c *ProjectsLocationsOperationsListCall) Zone(zone string) *ProjectsLocationsOperationsListCall {
  8750. c.urlParams_.Set("zone", zone)
  8751. return c
  8752. }
  8753. // Fields allows partial responses to be retrieved. See
  8754. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8755. // for more information.
  8756. func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  8757. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8758. return c
  8759. }
  8760. // IfNoneMatch sets the optional parameter which makes the operation
  8761. // fail if the object's ETag matches the given value. This is useful for
  8762. // getting updates only after the object has changed since the last
  8763. // request. Use googleapi.IsNotModified to check whether the response
  8764. // error from Do is the result of In-None-Match.
  8765. func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  8766. c.ifNoneMatch_ = entityTag
  8767. return c
  8768. }
  8769. // Context sets the context to be used in this call's Do method. Any
  8770. // pending HTTP request will be aborted if the provided context is
  8771. // canceled.
  8772. func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  8773. c.ctx_ = ctx
  8774. return c
  8775. }
  8776. // Header returns an http.Header that can be modified by the caller to
  8777. // add HTTP headers to the request.
  8778. func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  8779. if c.header_ == nil {
  8780. c.header_ = make(http.Header)
  8781. }
  8782. return c.header_
  8783. }
  8784. func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  8785. reqHeaders := make(http.Header)
  8786. for k, v := range c.header_ {
  8787. reqHeaders[k] = v
  8788. }
  8789. reqHeaders.Set("User-Agent", c.s.userAgent())
  8790. if c.ifNoneMatch_ != "" {
  8791. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8792. }
  8793. var body io.Reader = nil
  8794. c.urlParams_.Set("alt", alt)
  8795. c.urlParams_.Set("prettyPrint", "false")
  8796. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/operations")
  8797. urls += "?" + c.urlParams_.Encode()
  8798. req, err := http.NewRequest("GET", urls, body)
  8799. if err != nil {
  8800. return nil, err
  8801. }
  8802. req.Header = reqHeaders
  8803. googleapi.Expand(req.URL, map[string]string{
  8804. "parent": c.parent,
  8805. })
  8806. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8807. }
  8808. // Do executes the "container.projects.locations.operations.list" call.
  8809. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  8810. // non-2xx status code is an error. Response headers are in either
  8811. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  8812. // returned at all) in error.(*googleapi.Error).Header. Use
  8813. // googleapi.IsNotModified to check whether the returned error was
  8814. // because http.StatusNotModified was returned.
  8815. func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  8816. gensupport.SetOptions(c.urlParams_, opts...)
  8817. res, err := c.doRequest("json")
  8818. if res != nil && res.StatusCode == http.StatusNotModified {
  8819. if res.Body != nil {
  8820. res.Body.Close()
  8821. }
  8822. return nil, &googleapi.Error{
  8823. Code: res.StatusCode,
  8824. Header: res.Header,
  8825. }
  8826. }
  8827. if err != nil {
  8828. return nil, err
  8829. }
  8830. defer googleapi.CloseBody(res)
  8831. if err := googleapi.CheckResponse(res); err != nil {
  8832. return nil, err
  8833. }
  8834. ret := &ListOperationsResponse{
  8835. ServerResponse: googleapi.ServerResponse{
  8836. Header: res.Header,
  8837. HTTPStatusCode: res.StatusCode,
  8838. },
  8839. }
  8840. target := &ret
  8841. if err := gensupport.DecodeResponse(target, res); err != nil {
  8842. return nil, err
  8843. }
  8844. return ret, nil
  8845. // {
  8846. // "description": "Lists all operations in a project in a specific zone or all zones.",
  8847. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations",
  8848. // "httpMethod": "GET",
  8849. // "id": "container.projects.locations.operations.list",
  8850. // "parameterOrder": [
  8851. // "parent"
  8852. // ],
  8853. // "parameters": {
  8854. // "parent": {
  8855. // "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.",
  8856. // "location": "path",
  8857. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  8858. // "required": true,
  8859. // "type": "string"
  8860. // },
  8861. // "projectId": {
  8862. // "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.",
  8863. // "location": "query",
  8864. // "type": "string"
  8865. // },
  8866. // "zone": {
  8867. // "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.",
  8868. // "location": "query",
  8869. // "type": "string"
  8870. // }
  8871. // },
  8872. // "path": "v1beta1/{+parent}/operations",
  8873. // "response": {
  8874. // "$ref": "ListOperationsResponse"
  8875. // },
  8876. // "scopes": [
  8877. // "https://www.googleapis.com/auth/cloud-platform"
  8878. // ]
  8879. // }
  8880. }
  8881. // method id "container.projects.zones.getServerconfig":
  8882. type ProjectsZonesGetServerconfigCall struct {
  8883. s *Service
  8884. projectId string
  8885. zone string
  8886. urlParams_ gensupport.URLParams
  8887. ifNoneMatch_ string
  8888. ctx_ context.Context
  8889. header_ http.Header
  8890. }
  8891. // GetServerconfig: Returns configuration info about the Kubernetes
  8892. // Engine service.
  8893. func (r *ProjectsZonesService) GetServerconfig(projectId string, zone string) *ProjectsZonesGetServerconfigCall {
  8894. c := &ProjectsZonesGetServerconfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8895. c.projectId = projectId
  8896. c.zone = zone
  8897. return c
  8898. }
  8899. // Name sets the optional parameter "name": The name (project and
  8900. // location) of the server config to get,
  8901. // specified in the format 'projects/*/locations/*'.
  8902. func (c *ProjectsZonesGetServerconfigCall) Name(name string) *ProjectsZonesGetServerconfigCall {
  8903. c.urlParams_.Set("name", name)
  8904. return c
  8905. }
  8906. // Fields allows partial responses to be retrieved. See
  8907. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8908. // for more information.
  8909. func (c *ProjectsZonesGetServerconfigCall) Fields(s ...googleapi.Field) *ProjectsZonesGetServerconfigCall {
  8910. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8911. return c
  8912. }
  8913. // IfNoneMatch sets the optional parameter which makes the operation
  8914. // fail if the object's ETag matches the given value. This is useful for
  8915. // getting updates only after the object has changed since the last
  8916. // request. Use googleapi.IsNotModified to check whether the response
  8917. // error from Do is the result of In-None-Match.
  8918. func (c *ProjectsZonesGetServerconfigCall) IfNoneMatch(entityTag string) *ProjectsZonesGetServerconfigCall {
  8919. c.ifNoneMatch_ = entityTag
  8920. return c
  8921. }
  8922. // Context sets the context to be used in this call's Do method. Any
  8923. // pending HTTP request will be aborted if the provided context is
  8924. // canceled.
  8925. func (c *ProjectsZonesGetServerconfigCall) Context(ctx context.Context) *ProjectsZonesGetServerconfigCall {
  8926. c.ctx_ = ctx
  8927. return c
  8928. }
  8929. // Header returns an http.Header that can be modified by the caller to
  8930. // add HTTP headers to the request.
  8931. func (c *ProjectsZonesGetServerconfigCall) Header() http.Header {
  8932. if c.header_ == nil {
  8933. c.header_ = make(http.Header)
  8934. }
  8935. return c.header_
  8936. }
  8937. func (c *ProjectsZonesGetServerconfigCall) doRequest(alt string) (*http.Response, error) {
  8938. reqHeaders := make(http.Header)
  8939. for k, v := range c.header_ {
  8940. reqHeaders[k] = v
  8941. }
  8942. reqHeaders.Set("User-Agent", c.s.userAgent())
  8943. if c.ifNoneMatch_ != "" {
  8944. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8945. }
  8946. var body io.Reader = nil
  8947. c.urlParams_.Set("alt", alt)
  8948. c.urlParams_.Set("prettyPrint", "false")
  8949. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/serverconfig")
  8950. urls += "?" + c.urlParams_.Encode()
  8951. req, err := http.NewRequest("GET", urls, body)
  8952. if err != nil {
  8953. return nil, err
  8954. }
  8955. req.Header = reqHeaders
  8956. googleapi.Expand(req.URL, map[string]string{
  8957. "projectId": c.projectId,
  8958. "zone": c.zone,
  8959. })
  8960. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8961. }
  8962. // Do executes the "container.projects.zones.getServerconfig" call.
  8963. // Exactly one of *ServerConfig or error will be non-nil. Any non-2xx
  8964. // status code is an error. Response headers are in either
  8965. // *ServerConfig.ServerResponse.Header or (if a response was returned at
  8966. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8967. // to check whether the returned error was because
  8968. // http.StatusNotModified was returned.
  8969. func (c *ProjectsZonesGetServerconfigCall) Do(opts ...googleapi.CallOption) (*ServerConfig, error) {
  8970. gensupport.SetOptions(c.urlParams_, opts...)
  8971. res, err := c.doRequest("json")
  8972. if res != nil && res.StatusCode == http.StatusNotModified {
  8973. if res.Body != nil {
  8974. res.Body.Close()
  8975. }
  8976. return nil, &googleapi.Error{
  8977. Code: res.StatusCode,
  8978. Header: res.Header,
  8979. }
  8980. }
  8981. if err != nil {
  8982. return nil, err
  8983. }
  8984. defer googleapi.CloseBody(res)
  8985. if err := googleapi.CheckResponse(res); err != nil {
  8986. return nil, err
  8987. }
  8988. ret := &ServerConfig{
  8989. ServerResponse: googleapi.ServerResponse{
  8990. Header: res.Header,
  8991. HTTPStatusCode: res.StatusCode,
  8992. },
  8993. }
  8994. target := &ret
  8995. if err := gensupport.DecodeResponse(target, res); err != nil {
  8996. return nil, err
  8997. }
  8998. return ret, nil
  8999. // {
  9000. // "description": "Returns configuration info about the Kubernetes Engine service.",
  9001. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/serverconfig",
  9002. // "httpMethod": "GET",
  9003. // "id": "container.projects.zones.getServerconfig",
  9004. // "parameterOrder": [
  9005. // "projectId",
  9006. // "zone"
  9007. // ],
  9008. // "parameters": {
  9009. // "name": {
  9010. // "description": "The name (project and location) of the server config to get,\nspecified in the format 'projects/*/locations/*'.",
  9011. // "location": "query",
  9012. // "type": "string"
  9013. // },
  9014. // "projectId": {
  9015. // "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.",
  9016. // "location": "path",
  9017. // "required": true,
  9018. // "type": "string"
  9019. // },
  9020. // "zone": {
  9021. // "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.",
  9022. // "location": "path",
  9023. // "required": true,
  9024. // "type": "string"
  9025. // }
  9026. // },
  9027. // "path": "v1beta1/projects/{projectId}/zones/{zone}/serverconfig",
  9028. // "response": {
  9029. // "$ref": "ServerConfig"
  9030. // },
  9031. // "scopes": [
  9032. // "https://www.googleapis.com/auth/cloud-platform"
  9033. // ]
  9034. // }
  9035. }
  9036. // method id "container.projects.zones.clusters.addons":
  9037. type ProjectsZonesClustersAddonsCall struct {
  9038. s *Service
  9039. projectId string
  9040. zone string
  9041. clusterId string
  9042. setaddonsconfigrequest *SetAddonsConfigRequest
  9043. urlParams_ gensupport.URLParams
  9044. ctx_ context.Context
  9045. header_ http.Header
  9046. }
  9047. // Addons: Sets the addons for a specific cluster.
  9048. func (r *ProjectsZonesClustersService) Addons(projectId string, zone string, clusterId string, setaddonsconfigrequest *SetAddonsConfigRequest) *ProjectsZonesClustersAddonsCall {
  9049. c := &ProjectsZonesClustersAddonsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9050. c.projectId = projectId
  9051. c.zone = zone
  9052. c.clusterId = clusterId
  9053. c.setaddonsconfigrequest = setaddonsconfigrequest
  9054. return c
  9055. }
  9056. // Fields allows partial responses to be retrieved. See
  9057. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9058. // for more information.
  9059. func (c *ProjectsZonesClustersAddonsCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersAddonsCall {
  9060. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9061. return c
  9062. }
  9063. // Context sets the context to be used in this call's Do method. Any
  9064. // pending HTTP request will be aborted if the provided context is
  9065. // canceled.
  9066. func (c *ProjectsZonesClustersAddonsCall) Context(ctx context.Context) *ProjectsZonesClustersAddonsCall {
  9067. c.ctx_ = ctx
  9068. return c
  9069. }
  9070. // Header returns an http.Header that can be modified by the caller to
  9071. // add HTTP headers to the request.
  9072. func (c *ProjectsZonesClustersAddonsCall) Header() http.Header {
  9073. if c.header_ == nil {
  9074. c.header_ = make(http.Header)
  9075. }
  9076. return c.header_
  9077. }
  9078. func (c *ProjectsZonesClustersAddonsCall) doRequest(alt string) (*http.Response, error) {
  9079. reqHeaders := make(http.Header)
  9080. for k, v := range c.header_ {
  9081. reqHeaders[k] = v
  9082. }
  9083. reqHeaders.Set("User-Agent", c.s.userAgent())
  9084. var body io.Reader = nil
  9085. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setaddonsconfigrequest)
  9086. if err != nil {
  9087. return nil, err
  9088. }
  9089. reqHeaders.Set("Content-Type", "application/json")
  9090. c.urlParams_.Set("alt", alt)
  9091. c.urlParams_.Set("prettyPrint", "false")
  9092. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons")
  9093. urls += "?" + c.urlParams_.Encode()
  9094. req, err := http.NewRequest("POST", urls, body)
  9095. if err != nil {
  9096. return nil, err
  9097. }
  9098. req.Header = reqHeaders
  9099. googleapi.Expand(req.URL, map[string]string{
  9100. "projectId": c.projectId,
  9101. "zone": c.zone,
  9102. "clusterId": c.clusterId,
  9103. })
  9104. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9105. }
  9106. // Do executes the "container.projects.zones.clusters.addons" call.
  9107. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9108. // status code is an error. Response headers are in either
  9109. // *Operation.ServerResponse.Header or (if a response was returned at
  9110. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9111. // to check whether the returned error was because
  9112. // http.StatusNotModified was returned.
  9113. func (c *ProjectsZonesClustersAddonsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9114. gensupport.SetOptions(c.urlParams_, opts...)
  9115. res, err := c.doRequest("json")
  9116. if res != nil && res.StatusCode == http.StatusNotModified {
  9117. if res.Body != nil {
  9118. res.Body.Close()
  9119. }
  9120. return nil, &googleapi.Error{
  9121. Code: res.StatusCode,
  9122. Header: res.Header,
  9123. }
  9124. }
  9125. if err != nil {
  9126. return nil, err
  9127. }
  9128. defer googleapi.CloseBody(res)
  9129. if err := googleapi.CheckResponse(res); err != nil {
  9130. return nil, err
  9131. }
  9132. ret := &Operation{
  9133. ServerResponse: googleapi.ServerResponse{
  9134. Header: res.Header,
  9135. HTTPStatusCode: res.StatusCode,
  9136. },
  9137. }
  9138. target := &ret
  9139. if err := gensupport.DecodeResponse(target, res); err != nil {
  9140. return nil, err
  9141. }
  9142. return ret, nil
  9143. // {
  9144. // "description": "Sets the addons for a specific cluster.",
  9145. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons",
  9146. // "httpMethod": "POST",
  9147. // "id": "container.projects.zones.clusters.addons",
  9148. // "parameterOrder": [
  9149. // "projectId",
  9150. // "zone",
  9151. // "clusterId"
  9152. // ],
  9153. // "parameters": {
  9154. // "clusterId": {
  9155. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9156. // "location": "path",
  9157. // "required": true,
  9158. // "type": "string"
  9159. // },
  9160. // "projectId": {
  9161. // "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.",
  9162. // "location": "path",
  9163. // "required": true,
  9164. // "type": "string"
  9165. // },
  9166. // "zone": {
  9167. // "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.",
  9168. // "location": "path",
  9169. // "required": true,
  9170. // "type": "string"
  9171. // }
  9172. // },
  9173. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons",
  9174. // "request": {
  9175. // "$ref": "SetAddonsConfigRequest"
  9176. // },
  9177. // "response": {
  9178. // "$ref": "Operation"
  9179. // },
  9180. // "scopes": [
  9181. // "https://www.googleapis.com/auth/cloud-platform"
  9182. // ]
  9183. // }
  9184. }
  9185. // method id "container.projects.zones.clusters.completeIpRotation":
  9186. type ProjectsZonesClustersCompleteIpRotationCall struct {
  9187. s *Service
  9188. projectId string
  9189. zone string
  9190. clusterId string
  9191. completeiprotationrequest *CompleteIPRotationRequest
  9192. urlParams_ gensupport.URLParams
  9193. ctx_ context.Context
  9194. header_ http.Header
  9195. }
  9196. // CompleteIpRotation: Completes master IP rotation.
  9197. func (r *ProjectsZonesClustersService) CompleteIpRotation(projectId string, zone string, clusterId string, completeiprotationrequest *CompleteIPRotationRequest) *ProjectsZonesClustersCompleteIpRotationCall {
  9198. c := &ProjectsZonesClustersCompleteIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9199. c.projectId = projectId
  9200. c.zone = zone
  9201. c.clusterId = clusterId
  9202. c.completeiprotationrequest = completeiprotationrequest
  9203. return c
  9204. }
  9205. // Fields allows partial responses to be retrieved. See
  9206. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9207. // for more information.
  9208. func (c *ProjectsZonesClustersCompleteIpRotationCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersCompleteIpRotationCall {
  9209. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9210. return c
  9211. }
  9212. // Context sets the context to be used in this call's Do method. Any
  9213. // pending HTTP request will be aborted if the provided context is
  9214. // canceled.
  9215. func (c *ProjectsZonesClustersCompleteIpRotationCall) Context(ctx context.Context) *ProjectsZonesClustersCompleteIpRotationCall {
  9216. c.ctx_ = ctx
  9217. return c
  9218. }
  9219. // Header returns an http.Header that can be modified by the caller to
  9220. // add HTTP headers to the request.
  9221. func (c *ProjectsZonesClustersCompleteIpRotationCall) Header() http.Header {
  9222. if c.header_ == nil {
  9223. c.header_ = make(http.Header)
  9224. }
  9225. return c.header_
  9226. }
  9227. func (c *ProjectsZonesClustersCompleteIpRotationCall) doRequest(alt string) (*http.Response, error) {
  9228. reqHeaders := make(http.Header)
  9229. for k, v := range c.header_ {
  9230. reqHeaders[k] = v
  9231. }
  9232. reqHeaders.Set("User-Agent", c.s.userAgent())
  9233. var body io.Reader = nil
  9234. body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeiprotationrequest)
  9235. if err != nil {
  9236. return nil, err
  9237. }
  9238. reqHeaders.Set("Content-Type", "application/json")
  9239. c.urlParams_.Set("alt", alt)
  9240. c.urlParams_.Set("prettyPrint", "false")
  9241. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation")
  9242. urls += "?" + c.urlParams_.Encode()
  9243. req, err := http.NewRequest("POST", urls, body)
  9244. if err != nil {
  9245. return nil, err
  9246. }
  9247. req.Header = reqHeaders
  9248. googleapi.Expand(req.URL, map[string]string{
  9249. "projectId": c.projectId,
  9250. "zone": c.zone,
  9251. "clusterId": c.clusterId,
  9252. })
  9253. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9254. }
  9255. // Do executes the "container.projects.zones.clusters.completeIpRotation" call.
  9256. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9257. // status code is an error. Response headers are in either
  9258. // *Operation.ServerResponse.Header or (if a response was returned at
  9259. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9260. // to check whether the returned error was because
  9261. // http.StatusNotModified was returned.
  9262. func (c *ProjectsZonesClustersCompleteIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9263. gensupport.SetOptions(c.urlParams_, opts...)
  9264. res, err := c.doRequest("json")
  9265. if res != nil && res.StatusCode == http.StatusNotModified {
  9266. if res.Body != nil {
  9267. res.Body.Close()
  9268. }
  9269. return nil, &googleapi.Error{
  9270. Code: res.StatusCode,
  9271. Header: res.Header,
  9272. }
  9273. }
  9274. if err != nil {
  9275. return nil, err
  9276. }
  9277. defer googleapi.CloseBody(res)
  9278. if err := googleapi.CheckResponse(res); err != nil {
  9279. return nil, err
  9280. }
  9281. ret := &Operation{
  9282. ServerResponse: googleapi.ServerResponse{
  9283. Header: res.Header,
  9284. HTTPStatusCode: res.StatusCode,
  9285. },
  9286. }
  9287. target := &ret
  9288. if err := gensupport.DecodeResponse(target, res); err != nil {
  9289. return nil, err
  9290. }
  9291. return ret, nil
  9292. // {
  9293. // "description": "Completes master IP rotation.",
  9294. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation",
  9295. // "httpMethod": "POST",
  9296. // "id": "container.projects.zones.clusters.completeIpRotation",
  9297. // "parameterOrder": [
  9298. // "projectId",
  9299. // "zone",
  9300. // "clusterId"
  9301. // ],
  9302. // "parameters": {
  9303. // "clusterId": {
  9304. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  9305. // "location": "path",
  9306. // "required": true,
  9307. // "type": "string"
  9308. // },
  9309. // "projectId": {
  9310. // "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.",
  9311. // "location": "path",
  9312. // "required": true,
  9313. // "type": "string"
  9314. // },
  9315. // "zone": {
  9316. // "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.",
  9317. // "location": "path",
  9318. // "required": true,
  9319. // "type": "string"
  9320. // }
  9321. // },
  9322. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation",
  9323. // "request": {
  9324. // "$ref": "CompleteIPRotationRequest"
  9325. // },
  9326. // "response": {
  9327. // "$ref": "Operation"
  9328. // },
  9329. // "scopes": [
  9330. // "https://www.googleapis.com/auth/cloud-platform"
  9331. // ]
  9332. // }
  9333. }
  9334. // method id "container.projects.zones.clusters.create":
  9335. type ProjectsZonesClustersCreateCall struct {
  9336. s *Service
  9337. projectId string
  9338. zone string
  9339. createclusterrequest *CreateClusterRequest
  9340. urlParams_ gensupport.URLParams
  9341. ctx_ context.Context
  9342. header_ http.Header
  9343. }
  9344. // Create: Creates a cluster, consisting of the specified number and
  9345. // type of Google
  9346. // Compute Engine instances.
  9347. //
  9348. // By default, the cluster is created in the project's
  9349. // [default
  9350. // network](/compute/docs/networks-and-firewalls#networks).
  9351. //
  9352. // One firewall is added for the cluster. After cluster creation,
  9353. // the cluster creates routes for each node to allow the containers
  9354. // on that node to communicate with all other instances in
  9355. // the
  9356. // cluster.
  9357. //
  9358. // Finally, an entry is added to the project's global metadata
  9359. // indicating
  9360. // which CIDR range is being used by the cluster.
  9361. func (r *ProjectsZonesClustersService) Create(projectId string, zone string, createclusterrequest *CreateClusterRequest) *ProjectsZonesClustersCreateCall {
  9362. c := &ProjectsZonesClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9363. c.projectId = projectId
  9364. c.zone = zone
  9365. c.createclusterrequest = createclusterrequest
  9366. return c
  9367. }
  9368. // Fields allows partial responses to be retrieved. See
  9369. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9370. // for more information.
  9371. func (c *ProjectsZonesClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersCreateCall {
  9372. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9373. return c
  9374. }
  9375. // Context sets the context to be used in this call's Do method. Any
  9376. // pending HTTP request will be aborted if the provided context is
  9377. // canceled.
  9378. func (c *ProjectsZonesClustersCreateCall) Context(ctx context.Context) *ProjectsZonesClustersCreateCall {
  9379. c.ctx_ = ctx
  9380. return c
  9381. }
  9382. // Header returns an http.Header that can be modified by the caller to
  9383. // add HTTP headers to the request.
  9384. func (c *ProjectsZonesClustersCreateCall) Header() http.Header {
  9385. if c.header_ == nil {
  9386. c.header_ = make(http.Header)
  9387. }
  9388. return c.header_
  9389. }
  9390. func (c *ProjectsZonesClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  9391. reqHeaders := make(http.Header)
  9392. for k, v := range c.header_ {
  9393. reqHeaders[k] = v
  9394. }
  9395. reqHeaders.Set("User-Agent", c.s.userAgent())
  9396. var body io.Reader = nil
  9397. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest)
  9398. if err != nil {
  9399. return nil, err
  9400. }
  9401. reqHeaders.Set("Content-Type", "application/json")
  9402. c.urlParams_.Set("alt", alt)
  9403. c.urlParams_.Set("prettyPrint", "false")
  9404. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters")
  9405. urls += "?" + c.urlParams_.Encode()
  9406. req, err := http.NewRequest("POST", urls, body)
  9407. if err != nil {
  9408. return nil, err
  9409. }
  9410. req.Header = reqHeaders
  9411. googleapi.Expand(req.URL, map[string]string{
  9412. "projectId": c.projectId,
  9413. "zone": c.zone,
  9414. })
  9415. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9416. }
  9417. // Do executes the "container.projects.zones.clusters.create" call.
  9418. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9419. // status code is an error. Response headers are in either
  9420. // *Operation.ServerResponse.Header or (if a response was returned at
  9421. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9422. // to check whether the returned error was because
  9423. // http.StatusNotModified was returned.
  9424. func (c *ProjectsZonesClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9425. gensupport.SetOptions(c.urlParams_, opts...)
  9426. res, err := c.doRequest("json")
  9427. if res != nil && res.StatusCode == http.StatusNotModified {
  9428. if res.Body != nil {
  9429. res.Body.Close()
  9430. }
  9431. return nil, &googleapi.Error{
  9432. Code: res.StatusCode,
  9433. Header: res.Header,
  9434. }
  9435. }
  9436. if err != nil {
  9437. return nil, err
  9438. }
  9439. defer googleapi.CloseBody(res)
  9440. if err := googleapi.CheckResponse(res); err != nil {
  9441. return nil, err
  9442. }
  9443. ret := &Operation{
  9444. ServerResponse: googleapi.ServerResponse{
  9445. Header: res.Header,
  9446. HTTPStatusCode: res.StatusCode,
  9447. },
  9448. }
  9449. target := &ret
  9450. if err := gensupport.DecodeResponse(target, res); err != nil {
  9451. return nil, err
  9452. }
  9453. return ret, nil
  9454. // {
  9455. // "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.",
  9456. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters",
  9457. // "httpMethod": "POST",
  9458. // "id": "container.projects.zones.clusters.create",
  9459. // "parameterOrder": [
  9460. // "projectId",
  9461. // "zone"
  9462. // ],
  9463. // "parameters": {
  9464. // "projectId": {
  9465. // "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.",
  9466. // "location": "path",
  9467. // "required": true,
  9468. // "type": "string"
  9469. // },
  9470. // "zone": {
  9471. // "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.",
  9472. // "location": "path",
  9473. // "required": true,
  9474. // "type": "string"
  9475. // }
  9476. // },
  9477. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters",
  9478. // "request": {
  9479. // "$ref": "CreateClusterRequest"
  9480. // },
  9481. // "response": {
  9482. // "$ref": "Operation"
  9483. // },
  9484. // "scopes": [
  9485. // "https://www.googleapis.com/auth/cloud-platform"
  9486. // ]
  9487. // }
  9488. }
  9489. // method id "container.projects.zones.clusters.delete":
  9490. type ProjectsZonesClustersDeleteCall struct {
  9491. s *Service
  9492. projectId string
  9493. zone string
  9494. clusterId string
  9495. urlParams_ gensupport.URLParams
  9496. ctx_ context.Context
  9497. header_ http.Header
  9498. }
  9499. // Delete: Deletes the cluster, including the Kubernetes endpoint and
  9500. // all worker
  9501. // nodes.
  9502. //
  9503. // Firewalls and routes that were configured during cluster creation
  9504. // are also deleted.
  9505. //
  9506. // Other Google Compute Engine resources that might be in use by the
  9507. // cluster
  9508. // (e.g. load balancer resources) will not be deleted if they weren't
  9509. // present
  9510. // at the initial create time.
  9511. func (r *ProjectsZonesClustersService) Delete(projectId string, zone string, clusterId string) *ProjectsZonesClustersDeleteCall {
  9512. c := &ProjectsZonesClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9513. c.projectId = projectId
  9514. c.zone = zone
  9515. c.clusterId = clusterId
  9516. return c
  9517. }
  9518. // Name sets the optional parameter "name": The name (project, location,
  9519. // cluster) of the cluster to delete.
  9520. // Specified in the format 'projects/*/locations/*/clusters/*'.
  9521. func (c *ProjectsZonesClustersDeleteCall) Name(name string) *ProjectsZonesClustersDeleteCall {
  9522. c.urlParams_.Set("name", name)
  9523. return c
  9524. }
  9525. // Fields allows partial responses to be retrieved. See
  9526. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9527. // for more information.
  9528. func (c *ProjectsZonesClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersDeleteCall {
  9529. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9530. return c
  9531. }
  9532. // Context sets the context to be used in this call's Do method. Any
  9533. // pending HTTP request will be aborted if the provided context is
  9534. // canceled.
  9535. func (c *ProjectsZonesClustersDeleteCall) Context(ctx context.Context) *ProjectsZonesClustersDeleteCall {
  9536. c.ctx_ = ctx
  9537. return c
  9538. }
  9539. // Header returns an http.Header that can be modified by the caller to
  9540. // add HTTP headers to the request.
  9541. func (c *ProjectsZonesClustersDeleteCall) Header() http.Header {
  9542. if c.header_ == nil {
  9543. c.header_ = make(http.Header)
  9544. }
  9545. return c.header_
  9546. }
  9547. func (c *ProjectsZonesClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  9548. reqHeaders := make(http.Header)
  9549. for k, v := range c.header_ {
  9550. reqHeaders[k] = v
  9551. }
  9552. reqHeaders.Set("User-Agent", c.s.userAgent())
  9553. var body io.Reader = nil
  9554. c.urlParams_.Set("alt", alt)
  9555. c.urlParams_.Set("prettyPrint", "false")
  9556. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  9557. urls += "?" + c.urlParams_.Encode()
  9558. req, err := http.NewRequest("DELETE", urls, body)
  9559. if err != nil {
  9560. return nil, err
  9561. }
  9562. req.Header = reqHeaders
  9563. googleapi.Expand(req.URL, map[string]string{
  9564. "projectId": c.projectId,
  9565. "zone": c.zone,
  9566. "clusterId": c.clusterId,
  9567. })
  9568. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9569. }
  9570. // Do executes the "container.projects.zones.clusters.delete" call.
  9571. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9572. // status code is an error. Response headers are in either
  9573. // *Operation.ServerResponse.Header or (if a response was returned at
  9574. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9575. // to check whether the returned error was because
  9576. // http.StatusNotModified was returned.
  9577. func (c *ProjectsZonesClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9578. gensupport.SetOptions(c.urlParams_, opts...)
  9579. res, err := c.doRequest("json")
  9580. if res != nil && res.StatusCode == http.StatusNotModified {
  9581. if res.Body != nil {
  9582. res.Body.Close()
  9583. }
  9584. return nil, &googleapi.Error{
  9585. Code: res.StatusCode,
  9586. Header: res.Header,
  9587. }
  9588. }
  9589. if err != nil {
  9590. return nil, err
  9591. }
  9592. defer googleapi.CloseBody(res)
  9593. if err := googleapi.CheckResponse(res); err != nil {
  9594. return nil, err
  9595. }
  9596. ret := &Operation{
  9597. ServerResponse: googleapi.ServerResponse{
  9598. Header: res.Header,
  9599. HTTPStatusCode: res.StatusCode,
  9600. },
  9601. }
  9602. target := &ret
  9603. if err := gensupport.DecodeResponse(target, res); err != nil {
  9604. return nil, err
  9605. }
  9606. return ret, nil
  9607. // {
  9608. // "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.",
  9609. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  9610. // "httpMethod": "DELETE",
  9611. // "id": "container.projects.zones.clusters.delete",
  9612. // "parameterOrder": [
  9613. // "projectId",
  9614. // "zone",
  9615. // "clusterId"
  9616. // ],
  9617. // "parameters": {
  9618. // "clusterId": {
  9619. // "description": "Deprecated. The name of the cluster to delete.\nThis field has been deprecated and replaced by the name field.",
  9620. // "location": "path",
  9621. // "required": true,
  9622. // "type": "string"
  9623. // },
  9624. // "name": {
  9625. // "description": "The name (project, location, cluster) of the cluster to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  9626. // "location": "query",
  9627. // "type": "string"
  9628. // },
  9629. // "projectId": {
  9630. // "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.",
  9631. // "location": "path",
  9632. // "required": true,
  9633. // "type": "string"
  9634. // },
  9635. // "zone": {
  9636. // "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.",
  9637. // "location": "path",
  9638. // "required": true,
  9639. // "type": "string"
  9640. // }
  9641. // },
  9642. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  9643. // "response": {
  9644. // "$ref": "Operation"
  9645. // },
  9646. // "scopes": [
  9647. // "https://www.googleapis.com/auth/cloud-platform"
  9648. // ]
  9649. // }
  9650. }
  9651. // method id "container.projects.zones.clusters.get":
  9652. type ProjectsZonesClustersGetCall struct {
  9653. s *Service
  9654. projectId string
  9655. zone string
  9656. clusterId string
  9657. urlParams_ gensupport.URLParams
  9658. ifNoneMatch_ string
  9659. ctx_ context.Context
  9660. header_ http.Header
  9661. }
  9662. // Get: Gets the details for a specific cluster.
  9663. func (r *ProjectsZonesClustersService) Get(projectId string, zone string, clusterId string) *ProjectsZonesClustersGetCall {
  9664. c := &ProjectsZonesClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9665. c.projectId = projectId
  9666. c.zone = zone
  9667. c.clusterId = clusterId
  9668. return c
  9669. }
  9670. // Name sets the optional parameter "name": The name (project, location,
  9671. // cluster) of the cluster to retrieve.
  9672. // Specified in the format 'projects/*/locations/*/clusters/*'.
  9673. func (c *ProjectsZonesClustersGetCall) Name(name string) *ProjectsZonesClustersGetCall {
  9674. c.urlParams_.Set("name", name)
  9675. return c
  9676. }
  9677. // Fields allows partial responses to be retrieved. See
  9678. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9679. // for more information.
  9680. func (c *ProjectsZonesClustersGetCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersGetCall {
  9681. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9682. return c
  9683. }
  9684. // IfNoneMatch sets the optional parameter which makes the operation
  9685. // fail if the object's ETag matches the given value. This is useful for
  9686. // getting updates only after the object has changed since the last
  9687. // request. Use googleapi.IsNotModified to check whether the response
  9688. // error from Do is the result of In-None-Match.
  9689. func (c *ProjectsZonesClustersGetCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersGetCall {
  9690. c.ifNoneMatch_ = entityTag
  9691. return c
  9692. }
  9693. // Context sets the context to be used in this call's Do method. Any
  9694. // pending HTTP request will be aborted if the provided context is
  9695. // canceled.
  9696. func (c *ProjectsZonesClustersGetCall) Context(ctx context.Context) *ProjectsZonesClustersGetCall {
  9697. c.ctx_ = ctx
  9698. return c
  9699. }
  9700. // Header returns an http.Header that can be modified by the caller to
  9701. // add HTTP headers to the request.
  9702. func (c *ProjectsZonesClustersGetCall) Header() http.Header {
  9703. if c.header_ == nil {
  9704. c.header_ = make(http.Header)
  9705. }
  9706. return c.header_
  9707. }
  9708. func (c *ProjectsZonesClustersGetCall) doRequest(alt string) (*http.Response, error) {
  9709. reqHeaders := make(http.Header)
  9710. for k, v := range c.header_ {
  9711. reqHeaders[k] = v
  9712. }
  9713. reqHeaders.Set("User-Agent", c.s.userAgent())
  9714. if c.ifNoneMatch_ != "" {
  9715. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9716. }
  9717. var body io.Reader = nil
  9718. c.urlParams_.Set("alt", alt)
  9719. c.urlParams_.Set("prettyPrint", "false")
  9720. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  9721. urls += "?" + c.urlParams_.Encode()
  9722. req, err := http.NewRequest("GET", urls, body)
  9723. if err != nil {
  9724. return nil, err
  9725. }
  9726. req.Header = reqHeaders
  9727. googleapi.Expand(req.URL, map[string]string{
  9728. "projectId": c.projectId,
  9729. "zone": c.zone,
  9730. "clusterId": c.clusterId,
  9731. })
  9732. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9733. }
  9734. // Do executes the "container.projects.zones.clusters.get" call.
  9735. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  9736. // code is an error. Response headers are in either
  9737. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  9738. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9739. // check whether the returned error was because http.StatusNotModified
  9740. // was returned.
  9741. func (c *ProjectsZonesClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  9742. gensupport.SetOptions(c.urlParams_, opts...)
  9743. res, err := c.doRequest("json")
  9744. if res != nil && res.StatusCode == http.StatusNotModified {
  9745. if res.Body != nil {
  9746. res.Body.Close()
  9747. }
  9748. return nil, &googleapi.Error{
  9749. Code: res.StatusCode,
  9750. Header: res.Header,
  9751. }
  9752. }
  9753. if err != nil {
  9754. return nil, err
  9755. }
  9756. defer googleapi.CloseBody(res)
  9757. if err := googleapi.CheckResponse(res); err != nil {
  9758. return nil, err
  9759. }
  9760. ret := &Cluster{
  9761. ServerResponse: googleapi.ServerResponse{
  9762. Header: res.Header,
  9763. HTTPStatusCode: res.StatusCode,
  9764. },
  9765. }
  9766. target := &ret
  9767. if err := gensupport.DecodeResponse(target, res); err != nil {
  9768. return nil, err
  9769. }
  9770. return ret, nil
  9771. // {
  9772. // "description": "Gets the details for a specific cluster.",
  9773. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  9774. // "httpMethod": "GET",
  9775. // "id": "container.projects.zones.clusters.get",
  9776. // "parameterOrder": [
  9777. // "projectId",
  9778. // "zone",
  9779. // "clusterId"
  9780. // ],
  9781. // "parameters": {
  9782. // "clusterId": {
  9783. // "description": "Deprecated. The name of the cluster to retrieve.\nThis field has been deprecated and replaced by the name field.",
  9784. // "location": "path",
  9785. // "required": true,
  9786. // "type": "string"
  9787. // },
  9788. // "name": {
  9789. // "description": "The name (project, location, cluster) of the cluster to retrieve.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  9790. // "location": "query",
  9791. // "type": "string"
  9792. // },
  9793. // "projectId": {
  9794. // "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.",
  9795. // "location": "path",
  9796. // "required": true,
  9797. // "type": "string"
  9798. // },
  9799. // "zone": {
  9800. // "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.",
  9801. // "location": "path",
  9802. // "required": true,
  9803. // "type": "string"
  9804. // }
  9805. // },
  9806. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  9807. // "response": {
  9808. // "$ref": "Cluster"
  9809. // },
  9810. // "scopes": [
  9811. // "https://www.googleapis.com/auth/cloud-platform"
  9812. // ]
  9813. // }
  9814. }
  9815. // method id "container.projects.zones.clusters.legacyAbac":
  9816. type ProjectsZonesClustersLegacyAbacCall struct {
  9817. s *Service
  9818. projectId string
  9819. zone string
  9820. clusterId string
  9821. setlegacyabacrequest *SetLegacyAbacRequest
  9822. urlParams_ gensupport.URLParams
  9823. ctx_ context.Context
  9824. header_ http.Header
  9825. }
  9826. // LegacyAbac: Enables or disables the ABAC authorization mechanism on a
  9827. // cluster.
  9828. func (r *ProjectsZonesClustersService) LegacyAbac(projectId string, zone string, clusterId string, setlegacyabacrequest *SetLegacyAbacRequest) *ProjectsZonesClustersLegacyAbacCall {
  9829. c := &ProjectsZonesClustersLegacyAbacCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9830. c.projectId = projectId
  9831. c.zone = zone
  9832. c.clusterId = clusterId
  9833. c.setlegacyabacrequest = setlegacyabacrequest
  9834. return c
  9835. }
  9836. // Fields allows partial responses to be retrieved. See
  9837. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9838. // for more information.
  9839. func (c *ProjectsZonesClustersLegacyAbacCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersLegacyAbacCall {
  9840. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9841. return c
  9842. }
  9843. // Context sets the context to be used in this call's Do method. Any
  9844. // pending HTTP request will be aborted if the provided context is
  9845. // canceled.
  9846. func (c *ProjectsZonesClustersLegacyAbacCall) Context(ctx context.Context) *ProjectsZonesClustersLegacyAbacCall {
  9847. c.ctx_ = ctx
  9848. return c
  9849. }
  9850. // Header returns an http.Header that can be modified by the caller to
  9851. // add HTTP headers to the request.
  9852. func (c *ProjectsZonesClustersLegacyAbacCall) Header() http.Header {
  9853. if c.header_ == nil {
  9854. c.header_ = make(http.Header)
  9855. }
  9856. return c.header_
  9857. }
  9858. func (c *ProjectsZonesClustersLegacyAbacCall) doRequest(alt string) (*http.Response, error) {
  9859. reqHeaders := make(http.Header)
  9860. for k, v := range c.header_ {
  9861. reqHeaders[k] = v
  9862. }
  9863. reqHeaders.Set("User-Agent", c.s.userAgent())
  9864. var body io.Reader = nil
  9865. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlegacyabacrequest)
  9866. if err != nil {
  9867. return nil, err
  9868. }
  9869. reqHeaders.Set("Content-Type", "application/json")
  9870. c.urlParams_.Set("alt", alt)
  9871. c.urlParams_.Set("prettyPrint", "false")
  9872. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac")
  9873. urls += "?" + c.urlParams_.Encode()
  9874. req, err := http.NewRequest("POST", urls, body)
  9875. if err != nil {
  9876. return nil, err
  9877. }
  9878. req.Header = reqHeaders
  9879. googleapi.Expand(req.URL, map[string]string{
  9880. "projectId": c.projectId,
  9881. "zone": c.zone,
  9882. "clusterId": c.clusterId,
  9883. })
  9884. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9885. }
  9886. // Do executes the "container.projects.zones.clusters.legacyAbac" call.
  9887. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9888. // status code is an error. Response headers are in either
  9889. // *Operation.ServerResponse.Header or (if a response was returned at
  9890. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9891. // to check whether the returned error was because
  9892. // http.StatusNotModified was returned.
  9893. func (c *ProjectsZonesClustersLegacyAbacCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9894. gensupport.SetOptions(c.urlParams_, opts...)
  9895. res, err := c.doRequest("json")
  9896. if res != nil && res.StatusCode == http.StatusNotModified {
  9897. if res.Body != nil {
  9898. res.Body.Close()
  9899. }
  9900. return nil, &googleapi.Error{
  9901. Code: res.StatusCode,
  9902. Header: res.Header,
  9903. }
  9904. }
  9905. if err != nil {
  9906. return nil, err
  9907. }
  9908. defer googleapi.CloseBody(res)
  9909. if err := googleapi.CheckResponse(res); err != nil {
  9910. return nil, err
  9911. }
  9912. ret := &Operation{
  9913. ServerResponse: googleapi.ServerResponse{
  9914. Header: res.Header,
  9915. HTTPStatusCode: res.StatusCode,
  9916. },
  9917. }
  9918. target := &ret
  9919. if err := gensupport.DecodeResponse(target, res); err != nil {
  9920. return nil, err
  9921. }
  9922. return ret, nil
  9923. // {
  9924. // "description": "Enables or disables the ABAC authorization mechanism on a cluster.",
  9925. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac",
  9926. // "httpMethod": "POST",
  9927. // "id": "container.projects.zones.clusters.legacyAbac",
  9928. // "parameterOrder": [
  9929. // "projectId",
  9930. // "zone",
  9931. // "clusterId"
  9932. // ],
  9933. // "parameters": {
  9934. // "clusterId": {
  9935. // "description": "Deprecated. The name of the cluster to update.\nThis field has been deprecated and replaced by the name field.",
  9936. // "location": "path",
  9937. // "required": true,
  9938. // "type": "string"
  9939. // },
  9940. // "projectId": {
  9941. // "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.",
  9942. // "location": "path",
  9943. // "required": true,
  9944. // "type": "string"
  9945. // },
  9946. // "zone": {
  9947. // "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.",
  9948. // "location": "path",
  9949. // "required": true,
  9950. // "type": "string"
  9951. // }
  9952. // },
  9953. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac",
  9954. // "request": {
  9955. // "$ref": "SetLegacyAbacRequest"
  9956. // },
  9957. // "response": {
  9958. // "$ref": "Operation"
  9959. // },
  9960. // "scopes": [
  9961. // "https://www.googleapis.com/auth/cloud-platform"
  9962. // ]
  9963. // }
  9964. }
  9965. // method id "container.projects.zones.clusters.list":
  9966. type ProjectsZonesClustersListCall struct {
  9967. s *Service
  9968. projectId string
  9969. zone string
  9970. urlParams_ gensupport.URLParams
  9971. ifNoneMatch_ string
  9972. ctx_ context.Context
  9973. header_ http.Header
  9974. }
  9975. // List: Lists all clusters owned by a project in either the specified
  9976. // zone or all
  9977. // zones.
  9978. func (r *ProjectsZonesClustersService) List(projectId string, zone string) *ProjectsZonesClustersListCall {
  9979. c := &ProjectsZonesClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9980. c.projectId = projectId
  9981. c.zone = zone
  9982. return c
  9983. }
  9984. // Parent sets the optional parameter "parent": The parent (project and
  9985. // location) where the clusters will be listed.
  9986. // Specified in the format 'projects/*/locations/*'.
  9987. // Location "-" matches all zones and all regions.
  9988. func (c *ProjectsZonesClustersListCall) Parent(parent string) *ProjectsZonesClustersListCall {
  9989. c.urlParams_.Set("parent", parent)
  9990. return c
  9991. }
  9992. // Fields allows partial responses to be retrieved. See
  9993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9994. // for more information.
  9995. func (c *ProjectsZonesClustersListCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersListCall {
  9996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9997. return c
  9998. }
  9999. // IfNoneMatch sets the optional parameter which makes the operation
  10000. // fail if the object's ETag matches the given value. This is useful for
  10001. // getting updates only after the object has changed since the last
  10002. // request. Use googleapi.IsNotModified to check whether the response
  10003. // error from Do is the result of In-None-Match.
  10004. func (c *ProjectsZonesClustersListCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersListCall {
  10005. c.ifNoneMatch_ = entityTag
  10006. return c
  10007. }
  10008. // Context sets the context to be used in this call's Do method. Any
  10009. // pending HTTP request will be aborted if the provided context is
  10010. // canceled.
  10011. func (c *ProjectsZonesClustersListCall) Context(ctx context.Context) *ProjectsZonesClustersListCall {
  10012. c.ctx_ = ctx
  10013. return c
  10014. }
  10015. // Header returns an http.Header that can be modified by the caller to
  10016. // add HTTP headers to the request.
  10017. func (c *ProjectsZonesClustersListCall) Header() http.Header {
  10018. if c.header_ == nil {
  10019. c.header_ = make(http.Header)
  10020. }
  10021. return c.header_
  10022. }
  10023. func (c *ProjectsZonesClustersListCall) doRequest(alt string) (*http.Response, error) {
  10024. reqHeaders := make(http.Header)
  10025. for k, v := range c.header_ {
  10026. reqHeaders[k] = v
  10027. }
  10028. reqHeaders.Set("User-Agent", c.s.userAgent())
  10029. if c.ifNoneMatch_ != "" {
  10030. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10031. }
  10032. var body io.Reader = nil
  10033. c.urlParams_.Set("alt", alt)
  10034. c.urlParams_.Set("prettyPrint", "false")
  10035. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters")
  10036. urls += "?" + c.urlParams_.Encode()
  10037. req, err := http.NewRequest("GET", urls, body)
  10038. if err != nil {
  10039. return nil, err
  10040. }
  10041. req.Header = reqHeaders
  10042. googleapi.Expand(req.URL, map[string]string{
  10043. "projectId": c.projectId,
  10044. "zone": c.zone,
  10045. })
  10046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10047. }
  10048. // Do executes the "container.projects.zones.clusters.list" call.
  10049. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  10050. // non-2xx status code is an error. Response headers are in either
  10051. // *ListClustersResponse.ServerResponse.Header or (if a response was
  10052. // returned at all) in error.(*googleapi.Error).Header. Use
  10053. // googleapi.IsNotModified to check whether the returned error was
  10054. // because http.StatusNotModified was returned.
  10055. func (c *ProjectsZonesClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  10056. gensupport.SetOptions(c.urlParams_, opts...)
  10057. res, err := c.doRequest("json")
  10058. if res != nil && res.StatusCode == http.StatusNotModified {
  10059. if res.Body != nil {
  10060. res.Body.Close()
  10061. }
  10062. return nil, &googleapi.Error{
  10063. Code: res.StatusCode,
  10064. Header: res.Header,
  10065. }
  10066. }
  10067. if err != nil {
  10068. return nil, err
  10069. }
  10070. defer googleapi.CloseBody(res)
  10071. if err := googleapi.CheckResponse(res); err != nil {
  10072. return nil, err
  10073. }
  10074. ret := &ListClustersResponse{
  10075. ServerResponse: googleapi.ServerResponse{
  10076. Header: res.Header,
  10077. HTTPStatusCode: res.StatusCode,
  10078. },
  10079. }
  10080. target := &ret
  10081. if err := gensupport.DecodeResponse(target, res); err != nil {
  10082. return nil, err
  10083. }
  10084. return ret, nil
  10085. // {
  10086. // "description": "Lists all clusters owned by a project in either the specified zone or all\nzones.",
  10087. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters",
  10088. // "httpMethod": "GET",
  10089. // "id": "container.projects.zones.clusters.list",
  10090. // "parameterOrder": [
  10091. // "projectId",
  10092. // "zone"
  10093. // ],
  10094. // "parameters": {
  10095. // "parent": {
  10096. // "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.",
  10097. // "location": "query",
  10098. // "type": "string"
  10099. // },
  10100. // "projectId": {
  10101. // "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.",
  10102. // "location": "path",
  10103. // "required": true,
  10104. // "type": "string"
  10105. // },
  10106. // "zone": {
  10107. // "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.",
  10108. // "location": "path",
  10109. // "required": true,
  10110. // "type": "string"
  10111. // }
  10112. // },
  10113. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters",
  10114. // "response": {
  10115. // "$ref": "ListClustersResponse"
  10116. // },
  10117. // "scopes": [
  10118. // "https://www.googleapis.com/auth/cloud-platform"
  10119. // ]
  10120. // }
  10121. }
  10122. // method id "container.projects.zones.clusters.locations":
  10123. type ProjectsZonesClustersLocationsCall struct {
  10124. s *Service
  10125. projectId string
  10126. zone string
  10127. clusterId string
  10128. setlocationsrequest *SetLocationsRequest
  10129. urlParams_ gensupport.URLParams
  10130. ctx_ context.Context
  10131. header_ http.Header
  10132. }
  10133. // Locations: Sets the locations for a specific cluster.
  10134. func (r *ProjectsZonesClustersService) Locations(projectId string, zone string, clusterId string, setlocationsrequest *SetLocationsRequest) *ProjectsZonesClustersLocationsCall {
  10135. c := &ProjectsZonesClustersLocationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10136. c.projectId = projectId
  10137. c.zone = zone
  10138. c.clusterId = clusterId
  10139. c.setlocationsrequest = setlocationsrequest
  10140. return c
  10141. }
  10142. // Fields allows partial responses to be retrieved. See
  10143. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10144. // for more information.
  10145. func (c *ProjectsZonesClustersLocationsCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersLocationsCall {
  10146. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10147. return c
  10148. }
  10149. // Context sets the context to be used in this call's Do method. Any
  10150. // pending HTTP request will be aborted if the provided context is
  10151. // canceled.
  10152. func (c *ProjectsZonesClustersLocationsCall) Context(ctx context.Context) *ProjectsZonesClustersLocationsCall {
  10153. c.ctx_ = ctx
  10154. return c
  10155. }
  10156. // Header returns an http.Header that can be modified by the caller to
  10157. // add HTTP headers to the request.
  10158. func (c *ProjectsZonesClustersLocationsCall) Header() http.Header {
  10159. if c.header_ == nil {
  10160. c.header_ = make(http.Header)
  10161. }
  10162. return c.header_
  10163. }
  10164. func (c *ProjectsZonesClustersLocationsCall) doRequest(alt string) (*http.Response, error) {
  10165. reqHeaders := make(http.Header)
  10166. for k, v := range c.header_ {
  10167. reqHeaders[k] = v
  10168. }
  10169. reqHeaders.Set("User-Agent", c.s.userAgent())
  10170. var body io.Reader = nil
  10171. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlocationsrequest)
  10172. if err != nil {
  10173. return nil, err
  10174. }
  10175. reqHeaders.Set("Content-Type", "application/json")
  10176. c.urlParams_.Set("alt", alt)
  10177. c.urlParams_.Set("prettyPrint", "false")
  10178. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations")
  10179. urls += "?" + c.urlParams_.Encode()
  10180. req, err := http.NewRequest("POST", urls, body)
  10181. if err != nil {
  10182. return nil, err
  10183. }
  10184. req.Header = reqHeaders
  10185. googleapi.Expand(req.URL, map[string]string{
  10186. "projectId": c.projectId,
  10187. "zone": c.zone,
  10188. "clusterId": c.clusterId,
  10189. })
  10190. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10191. }
  10192. // Do executes the "container.projects.zones.clusters.locations" call.
  10193. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10194. // status code is an error. Response headers are in either
  10195. // *Operation.ServerResponse.Header or (if a response was returned at
  10196. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10197. // to check whether the returned error was because
  10198. // http.StatusNotModified was returned.
  10199. func (c *ProjectsZonesClustersLocationsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10200. gensupport.SetOptions(c.urlParams_, opts...)
  10201. res, err := c.doRequest("json")
  10202. if res != nil && res.StatusCode == http.StatusNotModified {
  10203. if res.Body != nil {
  10204. res.Body.Close()
  10205. }
  10206. return nil, &googleapi.Error{
  10207. Code: res.StatusCode,
  10208. Header: res.Header,
  10209. }
  10210. }
  10211. if err != nil {
  10212. return nil, err
  10213. }
  10214. defer googleapi.CloseBody(res)
  10215. if err := googleapi.CheckResponse(res); err != nil {
  10216. return nil, err
  10217. }
  10218. ret := &Operation{
  10219. ServerResponse: googleapi.ServerResponse{
  10220. Header: res.Header,
  10221. HTTPStatusCode: res.StatusCode,
  10222. },
  10223. }
  10224. target := &ret
  10225. if err := gensupport.DecodeResponse(target, res); err != nil {
  10226. return nil, err
  10227. }
  10228. return ret, nil
  10229. // {
  10230. // "description": "Sets the locations for a specific cluster.",
  10231. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations",
  10232. // "httpMethod": "POST",
  10233. // "id": "container.projects.zones.clusters.locations",
  10234. // "parameterOrder": [
  10235. // "projectId",
  10236. // "zone",
  10237. // "clusterId"
  10238. // ],
  10239. // "parameters": {
  10240. // "clusterId": {
  10241. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  10242. // "location": "path",
  10243. // "required": true,
  10244. // "type": "string"
  10245. // },
  10246. // "projectId": {
  10247. // "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.",
  10248. // "location": "path",
  10249. // "required": true,
  10250. // "type": "string"
  10251. // },
  10252. // "zone": {
  10253. // "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.",
  10254. // "location": "path",
  10255. // "required": true,
  10256. // "type": "string"
  10257. // }
  10258. // },
  10259. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations",
  10260. // "request": {
  10261. // "$ref": "SetLocationsRequest"
  10262. // },
  10263. // "response": {
  10264. // "$ref": "Operation"
  10265. // },
  10266. // "scopes": [
  10267. // "https://www.googleapis.com/auth/cloud-platform"
  10268. // ]
  10269. // }
  10270. }
  10271. // method id "container.projects.zones.clusters.logging":
  10272. type ProjectsZonesClustersLoggingCall struct {
  10273. s *Service
  10274. projectId string
  10275. zone string
  10276. clusterId string
  10277. setloggingservicerequest *SetLoggingServiceRequest
  10278. urlParams_ gensupport.URLParams
  10279. ctx_ context.Context
  10280. header_ http.Header
  10281. }
  10282. // Logging: Sets the logging service for a specific cluster.
  10283. func (r *ProjectsZonesClustersService) Logging(projectId string, zone string, clusterId string, setloggingservicerequest *SetLoggingServiceRequest) *ProjectsZonesClustersLoggingCall {
  10284. c := &ProjectsZonesClustersLoggingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10285. c.projectId = projectId
  10286. c.zone = zone
  10287. c.clusterId = clusterId
  10288. c.setloggingservicerequest = setloggingservicerequest
  10289. return c
  10290. }
  10291. // Fields allows partial responses to be retrieved. See
  10292. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10293. // for more information.
  10294. func (c *ProjectsZonesClustersLoggingCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersLoggingCall {
  10295. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10296. return c
  10297. }
  10298. // Context sets the context to be used in this call's Do method. Any
  10299. // pending HTTP request will be aborted if the provided context is
  10300. // canceled.
  10301. func (c *ProjectsZonesClustersLoggingCall) Context(ctx context.Context) *ProjectsZonesClustersLoggingCall {
  10302. c.ctx_ = ctx
  10303. return c
  10304. }
  10305. // Header returns an http.Header that can be modified by the caller to
  10306. // add HTTP headers to the request.
  10307. func (c *ProjectsZonesClustersLoggingCall) Header() http.Header {
  10308. if c.header_ == nil {
  10309. c.header_ = make(http.Header)
  10310. }
  10311. return c.header_
  10312. }
  10313. func (c *ProjectsZonesClustersLoggingCall) doRequest(alt string) (*http.Response, error) {
  10314. reqHeaders := make(http.Header)
  10315. for k, v := range c.header_ {
  10316. reqHeaders[k] = v
  10317. }
  10318. reqHeaders.Set("User-Agent", c.s.userAgent())
  10319. var body io.Reader = nil
  10320. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setloggingservicerequest)
  10321. if err != nil {
  10322. return nil, err
  10323. }
  10324. reqHeaders.Set("Content-Type", "application/json")
  10325. c.urlParams_.Set("alt", alt)
  10326. c.urlParams_.Set("prettyPrint", "false")
  10327. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging")
  10328. urls += "?" + c.urlParams_.Encode()
  10329. req, err := http.NewRequest("POST", urls, body)
  10330. if err != nil {
  10331. return nil, err
  10332. }
  10333. req.Header = reqHeaders
  10334. googleapi.Expand(req.URL, map[string]string{
  10335. "projectId": c.projectId,
  10336. "zone": c.zone,
  10337. "clusterId": c.clusterId,
  10338. })
  10339. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10340. }
  10341. // Do executes the "container.projects.zones.clusters.logging" call.
  10342. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10343. // status code is an error. Response headers are in either
  10344. // *Operation.ServerResponse.Header or (if a response was returned at
  10345. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10346. // to check whether the returned error was because
  10347. // http.StatusNotModified was returned.
  10348. func (c *ProjectsZonesClustersLoggingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10349. gensupport.SetOptions(c.urlParams_, opts...)
  10350. res, err := c.doRequest("json")
  10351. if res != nil && res.StatusCode == http.StatusNotModified {
  10352. if res.Body != nil {
  10353. res.Body.Close()
  10354. }
  10355. return nil, &googleapi.Error{
  10356. Code: res.StatusCode,
  10357. Header: res.Header,
  10358. }
  10359. }
  10360. if err != nil {
  10361. return nil, err
  10362. }
  10363. defer googleapi.CloseBody(res)
  10364. if err := googleapi.CheckResponse(res); err != nil {
  10365. return nil, err
  10366. }
  10367. ret := &Operation{
  10368. ServerResponse: googleapi.ServerResponse{
  10369. Header: res.Header,
  10370. HTTPStatusCode: res.StatusCode,
  10371. },
  10372. }
  10373. target := &ret
  10374. if err := gensupport.DecodeResponse(target, res); err != nil {
  10375. return nil, err
  10376. }
  10377. return ret, nil
  10378. // {
  10379. // "description": "Sets the logging service for a specific cluster.",
  10380. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging",
  10381. // "httpMethod": "POST",
  10382. // "id": "container.projects.zones.clusters.logging",
  10383. // "parameterOrder": [
  10384. // "projectId",
  10385. // "zone",
  10386. // "clusterId"
  10387. // ],
  10388. // "parameters": {
  10389. // "clusterId": {
  10390. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  10391. // "location": "path",
  10392. // "required": true,
  10393. // "type": "string"
  10394. // },
  10395. // "projectId": {
  10396. // "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.",
  10397. // "location": "path",
  10398. // "required": true,
  10399. // "type": "string"
  10400. // },
  10401. // "zone": {
  10402. // "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.",
  10403. // "location": "path",
  10404. // "required": true,
  10405. // "type": "string"
  10406. // }
  10407. // },
  10408. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging",
  10409. // "request": {
  10410. // "$ref": "SetLoggingServiceRequest"
  10411. // },
  10412. // "response": {
  10413. // "$ref": "Operation"
  10414. // },
  10415. // "scopes": [
  10416. // "https://www.googleapis.com/auth/cloud-platform"
  10417. // ]
  10418. // }
  10419. }
  10420. // method id "container.projects.zones.clusters.master":
  10421. type ProjectsZonesClustersMasterCall struct {
  10422. s *Service
  10423. projectId string
  10424. zone string
  10425. clusterId string
  10426. updatemasterrequest *UpdateMasterRequest
  10427. urlParams_ gensupport.URLParams
  10428. ctx_ context.Context
  10429. header_ http.Header
  10430. }
  10431. // Master: Updates the master for a specific cluster.
  10432. func (r *ProjectsZonesClustersService) Master(projectId string, zone string, clusterId string, updatemasterrequest *UpdateMasterRequest) *ProjectsZonesClustersMasterCall {
  10433. c := &ProjectsZonesClustersMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10434. c.projectId = projectId
  10435. c.zone = zone
  10436. c.clusterId = clusterId
  10437. c.updatemasterrequest = updatemasterrequest
  10438. return c
  10439. }
  10440. // Fields allows partial responses to be retrieved. See
  10441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10442. // for more information.
  10443. func (c *ProjectsZonesClustersMasterCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersMasterCall {
  10444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10445. return c
  10446. }
  10447. // Context sets the context to be used in this call's Do method. Any
  10448. // pending HTTP request will be aborted if the provided context is
  10449. // canceled.
  10450. func (c *ProjectsZonesClustersMasterCall) Context(ctx context.Context) *ProjectsZonesClustersMasterCall {
  10451. c.ctx_ = ctx
  10452. return c
  10453. }
  10454. // Header returns an http.Header that can be modified by the caller to
  10455. // add HTTP headers to the request.
  10456. func (c *ProjectsZonesClustersMasterCall) Header() http.Header {
  10457. if c.header_ == nil {
  10458. c.header_ = make(http.Header)
  10459. }
  10460. return c.header_
  10461. }
  10462. func (c *ProjectsZonesClustersMasterCall) doRequest(alt string) (*http.Response, error) {
  10463. reqHeaders := make(http.Header)
  10464. for k, v := range c.header_ {
  10465. reqHeaders[k] = v
  10466. }
  10467. reqHeaders.Set("User-Agent", c.s.userAgent())
  10468. var body io.Reader = nil
  10469. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatemasterrequest)
  10470. if err != nil {
  10471. return nil, err
  10472. }
  10473. reqHeaders.Set("Content-Type", "application/json")
  10474. c.urlParams_.Set("alt", alt)
  10475. c.urlParams_.Set("prettyPrint", "false")
  10476. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master")
  10477. urls += "?" + c.urlParams_.Encode()
  10478. req, err := http.NewRequest("POST", urls, body)
  10479. if err != nil {
  10480. return nil, err
  10481. }
  10482. req.Header = reqHeaders
  10483. googleapi.Expand(req.URL, map[string]string{
  10484. "projectId": c.projectId,
  10485. "zone": c.zone,
  10486. "clusterId": c.clusterId,
  10487. })
  10488. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10489. }
  10490. // Do executes the "container.projects.zones.clusters.master" call.
  10491. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10492. // status code is an error. Response headers are in either
  10493. // *Operation.ServerResponse.Header or (if a response was returned at
  10494. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10495. // to check whether the returned error was because
  10496. // http.StatusNotModified was returned.
  10497. func (c *ProjectsZonesClustersMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10498. gensupport.SetOptions(c.urlParams_, opts...)
  10499. res, err := c.doRequest("json")
  10500. if res != nil && res.StatusCode == http.StatusNotModified {
  10501. if res.Body != nil {
  10502. res.Body.Close()
  10503. }
  10504. return nil, &googleapi.Error{
  10505. Code: res.StatusCode,
  10506. Header: res.Header,
  10507. }
  10508. }
  10509. if err != nil {
  10510. return nil, err
  10511. }
  10512. defer googleapi.CloseBody(res)
  10513. if err := googleapi.CheckResponse(res); err != nil {
  10514. return nil, err
  10515. }
  10516. ret := &Operation{
  10517. ServerResponse: googleapi.ServerResponse{
  10518. Header: res.Header,
  10519. HTTPStatusCode: res.StatusCode,
  10520. },
  10521. }
  10522. target := &ret
  10523. if err := gensupport.DecodeResponse(target, res); err != nil {
  10524. return nil, err
  10525. }
  10526. return ret, nil
  10527. // {
  10528. // "description": "Updates the master for a specific cluster.",
  10529. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master",
  10530. // "httpMethod": "POST",
  10531. // "id": "container.projects.zones.clusters.master",
  10532. // "parameterOrder": [
  10533. // "projectId",
  10534. // "zone",
  10535. // "clusterId"
  10536. // ],
  10537. // "parameters": {
  10538. // "clusterId": {
  10539. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  10540. // "location": "path",
  10541. // "required": true,
  10542. // "type": "string"
  10543. // },
  10544. // "projectId": {
  10545. // "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.",
  10546. // "location": "path",
  10547. // "required": true,
  10548. // "type": "string"
  10549. // },
  10550. // "zone": {
  10551. // "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.",
  10552. // "location": "path",
  10553. // "required": true,
  10554. // "type": "string"
  10555. // }
  10556. // },
  10557. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master",
  10558. // "request": {
  10559. // "$ref": "UpdateMasterRequest"
  10560. // },
  10561. // "response": {
  10562. // "$ref": "Operation"
  10563. // },
  10564. // "scopes": [
  10565. // "https://www.googleapis.com/auth/cloud-platform"
  10566. // ]
  10567. // }
  10568. }
  10569. // method id "container.projects.zones.clusters.monitoring":
  10570. type ProjectsZonesClustersMonitoringCall struct {
  10571. s *Service
  10572. projectId string
  10573. zone string
  10574. clusterId string
  10575. setmonitoringservicerequest *SetMonitoringServiceRequest
  10576. urlParams_ gensupport.URLParams
  10577. ctx_ context.Context
  10578. header_ http.Header
  10579. }
  10580. // Monitoring: Sets the monitoring service for a specific cluster.
  10581. func (r *ProjectsZonesClustersService) Monitoring(projectId string, zone string, clusterId string, setmonitoringservicerequest *SetMonitoringServiceRequest) *ProjectsZonesClustersMonitoringCall {
  10582. c := &ProjectsZonesClustersMonitoringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10583. c.projectId = projectId
  10584. c.zone = zone
  10585. c.clusterId = clusterId
  10586. c.setmonitoringservicerequest = setmonitoringservicerequest
  10587. return c
  10588. }
  10589. // Fields allows partial responses to be retrieved. See
  10590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10591. // for more information.
  10592. func (c *ProjectsZonesClustersMonitoringCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersMonitoringCall {
  10593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10594. return c
  10595. }
  10596. // Context sets the context to be used in this call's Do method. Any
  10597. // pending HTTP request will be aborted if the provided context is
  10598. // canceled.
  10599. func (c *ProjectsZonesClustersMonitoringCall) Context(ctx context.Context) *ProjectsZonesClustersMonitoringCall {
  10600. c.ctx_ = ctx
  10601. return c
  10602. }
  10603. // Header returns an http.Header that can be modified by the caller to
  10604. // add HTTP headers to the request.
  10605. func (c *ProjectsZonesClustersMonitoringCall) Header() http.Header {
  10606. if c.header_ == nil {
  10607. c.header_ = make(http.Header)
  10608. }
  10609. return c.header_
  10610. }
  10611. func (c *ProjectsZonesClustersMonitoringCall) doRequest(alt string) (*http.Response, error) {
  10612. reqHeaders := make(http.Header)
  10613. for k, v := range c.header_ {
  10614. reqHeaders[k] = v
  10615. }
  10616. reqHeaders.Set("User-Agent", c.s.userAgent())
  10617. var body io.Reader = nil
  10618. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmonitoringservicerequest)
  10619. if err != nil {
  10620. return nil, err
  10621. }
  10622. reqHeaders.Set("Content-Type", "application/json")
  10623. c.urlParams_.Set("alt", alt)
  10624. c.urlParams_.Set("prettyPrint", "false")
  10625. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring")
  10626. urls += "?" + c.urlParams_.Encode()
  10627. req, err := http.NewRequest("POST", urls, body)
  10628. if err != nil {
  10629. return nil, err
  10630. }
  10631. req.Header = reqHeaders
  10632. googleapi.Expand(req.URL, map[string]string{
  10633. "projectId": c.projectId,
  10634. "zone": c.zone,
  10635. "clusterId": c.clusterId,
  10636. })
  10637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10638. }
  10639. // Do executes the "container.projects.zones.clusters.monitoring" call.
  10640. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10641. // status code is an error. Response headers are in either
  10642. // *Operation.ServerResponse.Header or (if a response was returned at
  10643. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10644. // to check whether the returned error was because
  10645. // http.StatusNotModified was returned.
  10646. func (c *ProjectsZonesClustersMonitoringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10647. gensupport.SetOptions(c.urlParams_, opts...)
  10648. res, err := c.doRequest("json")
  10649. if res != nil && res.StatusCode == http.StatusNotModified {
  10650. if res.Body != nil {
  10651. res.Body.Close()
  10652. }
  10653. return nil, &googleapi.Error{
  10654. Code: res.StatusCode,
  10655. Header: res.Header,
  10656. }
  10657. }
  10658. if err != nil {
  10659. return nil, err
  10660. }
  10661. defer googleapi.CloseBody(res)
  10662. if err := googleapi.CheckResponse(res); err != nil {
  10663. return nil, err
  10664. }
  10665. ret := &Operation{
  10666. ServerResponse: googleapi.ServerResponse{
  10667. Header: res.Header,
  10668. HTTPStatusCode: res.StatusCode,
  10669. },
  10670. }
  10671. target := &ret
  10672. if err := gensupport.DecodeResponse(target, res); err != nil {
  10673. return nil, err
  10674. }
  10675. return ret, nil
  10676. // {
  10677. // "description": "Sets the monitoring service for a specific cluster.",
  10678. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring",
  10679. // "httpMethod": "POST",
  10680. // "id": "container.projects.zones.clusters.monitoring",
  10681. // "parameterOrder": [
  10682. // "projectId",
  10683. // "zone",
  10684. // "clusterId"
  10685. // ],
  10686. // "parameters": {
  10687. // "clusterId": {
  10688. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  10689. // "location": "path",
  10690. // "required": true,
  10691. // "type": "string"
  10692. // },
  10693. // "projectId": {
  10694. // "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.",
  10695. // "location": "path",
  10696. // "required": true,
  10697. // "type": "string"
  10698. // },
  10699. // "zone": {
  10700. // "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.",
  10701. // "location": "path",
  10702. // "required": true,
  10703. // "type": "string"
  10704. // }
  10705. // },
  10706. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring",
  10707. // "request": {
  10708. // "$ref": "SetMonitoringServiceRequest"
  10709. // },
  10710. // "response": {
  10711. // "$ref": "Operation"
  10712. // },
  10713. // "scopes": [
  10714. // "https://www.googleapis.com/auth/cloud-platform"
  10715. // ]
  10716. // }
  10717. }
  10718. // method id "container.projects.zones.clusters.resourceLabels":
  10719. type ProjectsZonesClustersResourceLabelsCall struct {
  10720. s *Service
  10721. projectId string
  10722. zone string
  10723. clusterId string
  10724. setlabelsrequest *SetLabelsRequest
  10725. urlParams_ gensupport.URLParams
  10726. ctx_ context.Context
  10727. header_ http.Header
  10728. }
  10729. // ResourceLabels: Sets labels on a cluster.
  10730. func (r *ProjectsZonesClustersService) ResourceLabels(projectId string, zone string, clusterId string, setlabelsrequest *SetLabelsRequest) *ProjectsZonesClustersResourceLabelsCall {
  10731. c := &ProjectsZonesClustersResourceLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10732. c.projectId = projectId
  10733. c.zone = zone
  10734. c.clusterId = clusterId
  10735. c.setlabelsrequest = setlabelsrequest
  10736. return c
  10737. }
  10738. // Fields allows partial responses to be retrieved. See
  10739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10740. // for more information.
  10741. func (c *ProjectsZonesClustersResourceLabelsCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersResourceLabelsCall {
  10742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10743. return c
  10744. }
  10745. // Context sets the context to be used in this call's Do method. Any
  10746. // pending HTTP request will be aborted if the provided context is
  10747. // canceled.
  10748. func (c *ProjectsZonesClustersResourceLabelsCall) Context(ctx context.Context) *ProjectsZonesClustersResourceLabelsCall {
  10749. c.ctx_ = ctx
  10750. return c
  10751. }
  10752. // Header returns an http.Header that can be modified by the caller to
  10753. // add HTTP headers to the request.
  10754. func (c *ProjectsZonesClustersResourceLabelsCall) Header() http.Header {
  10755. if c.header_ == nil {
  10756. c.header_ = make(http.Header)
  10757. }
  10758. return c.header_
  10759. }
  10760. func (c *ProjectsZonesClustersResourceLabelsCall) doRequest(alt string) (*http.Response, error) {
  10761. reqHeaders := make(http.Header)
  10762. for k, v := range c.header_ {
  10763. reqHeaders[k] = v
  10764. }
  10765. reqHeaders.Set("User-Agent", c.s.userAgent())
  10766. var body io.Reader = nil
  10767. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlabelsrequest)
  10768. if err != nil {
  10769. return nil, err
  10770. }
  10771. reqHeaders.Set("Content-Type", "application/json")
  10772. c.urlParams_.Set("alt", alt)
  10773. c.urlParams_.Set("prettyPrint", "false")
  10774. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels")
  10775. urls += "?" + c.urlParams_.Encode()
  10776. req, err := http.NewRequest("POST", urls, body)
  10777. if err != nil {
  10778. return nil, err
  10779. }
  10780. req.Header = reqHeaders
  10781. googleapi.Expand(req.URL, map[string]string{
  10782. "projectId": c.projectId,
  10783. "zone": c.zone,
  10784. "clusterId": c.clusterId,
  10785. })
  10786. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10787. }
  10788. // Do executes the "container.projects.zones.clusters.resourceLabels" call.
  10789. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10790. // status code is an error. Response headers are in either
  10791. // *Operation.ServerResponse.Header or (if a response was returned at
  10792. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10793. // to check whether the returned error was because
  10794. // http.StatusNotModified was returned.
  10795. func (c *ProjectsZonesClustersResourceLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10796. gensupport.SetOptions(c.urlParams_, opts...)
  10797. res, err := c.doRequest("json")
  10798. if res != nil && res.StatusCode == http.StatusNotModified {
  10799. if res.Body != nil {
  10800. res.Body.Close()
  10801. }
  10802. return nil, &googleapi.Error{
  10803. Code: res.StatusCode,
  10804. Header: res.Header,
  10805. }
  10806. }
  10807. if err != nil {
  10808. return nil, err
  10809. }
  10810. defer googleapi.CloseBody(res)
  10811. if err := googleapi.CheckResponse(res); err != nil {
  10812. return nil, err
  10813. }
  10814. ret := &Operation{
  10815. ServerResponse: googleapi.ServerResponse{
  10816. Header: res.Header,
  10817. HTTPStatusCode: res.StatusCode,
  10818. },
  10819. }
  10820. target := &ret
  10821. if err := gensupport.DecodeResponse(target, res); err != nil {
  10822. return nil, err
  10823. }
  10824. return ret, nil
  10825. // {
  10826. // "description": "Sets labels on a cluster.",
  10827. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels",
  10828. // "httpMethod": "POST",
  10829. // "id": "container.projects.zones.clusters.resourceLabels",
  10830. // "parameterOrder": [
  10831. // "projectId",
  10832. // "zone",
  10833. // "clusterId"
  10834. // ],
  10835. // "parameters": {
  10836. // "clusterId": {
  10837. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  10838. // "location": "path",
  10839. // "required": true,
  10840. // "type": "string"
  10841. // },
  10842. // "projectId": {
  10843. // "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.",
  10844. // "location": "path",
  10845. // "required": true,
  10846. // "type": "string"
  10847. // },
  10848. // "zone": {
  10849. // "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.",
  10850. // "location": "path",
  10851. // "required": true,
  10852. // "type": "string"
  10853. // }
  10854. // },
  10855. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels",
  10856. // "request": {
  10857. // "$ref": "SetLabelsRequest"
  10858. // },
  10859. // "response": {
  10860. // "$ref": "Operation"
  10861. // },
  10862. // "scopes": [
  10863. // "https://www.googleapis.com/auth/cloud-platform"
  10864. // ]
  10865. // }
  10866. }
  10867. // method id "container.projects.zones.clusters.setMaintenancePolicy":
  10868. type ProjectsZonesClustersSetMaintenancePolicyCall struct {
  10869. s *Service
  10870. projectId string
  10871. zone string
  10872. clusterId string
  10873. setmaintenancepolicyrequest *SetMaintenancePolicyRequest
  10874. urlParams_ gensupport.URLParams
  10875. ctx_ context.Context
  10876. header_ http.Header
  10877. }
  10878. // SetMaintenancePolicy: Sets the maintenance policy for a cluster.
  10879. func (r *ProjectsZonesClustersService) SetMaintenancePolicy(projectId string, zone string, clusterId string, setmaintenancepolicyrequest *SetMaintenancePolicyRequest) *ProjectsZonesClustersSetMaintenancePolicyCall {
  10880. c := &ProjectsZonesClustersSetMaintenancePolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10881. c.projectId = projectId
  10882. c.zone = zone
  10883. c.clusterId = clusterId
  10884. c.setmaintenancepolicyrequest = setmaintenancepolicyrequest
  10885. return c
  10886. }
  10887. // Fields allows partial responses to be retrieved. See
  10888. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10889. // for more information.
  10890. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersSetMaintenancePolicyCall {
  10891. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10892. return c
  10893. }
  10894. // Context sets the context to be used in this call's Do method. Any
  10895. // pending HTTP request will be aborted if the provided context is
  10896. // canceled.
  10897. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Context(ctx context.Context) *ProjectsZonesClustersSetMaintenancePolicyCall {
  10898. c.ctx_ = ctx
  10899. return c
  10900. }
  10901. // Header returns an http.Header that can be modified by the caller to
  10902. // add HTTP headers to the request.
  10903. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Header() http.Header {
  10904. if c.header_ == nil {
  10905. c.header_ = make(http.Header)
  10906. }
  10907. return c.header_
  10908. }
  10909. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) doRequest(alt string) (*http.Response, error) {
  10910. reqHeaders := make(http.Header)
  10911. for k, v := range c.header_ {
  10912. reqHeaders[k] = v
  10913. }
  10914. reqHeaders.Set("User-Agent", c.s.userAgent())
  10915. var body io.Reader = nil
  10916. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmaintenancepolicyrequest)
  10917. if err != nil {
  10918. return nil, err
  10919. }
  10920. reqHeaders.Set("Content-Type", "application/json")
  10921. c.urlParams_.Set("alt", alt)
  10922. c.urlParams_.Set("prettyPrint", "false")
  10923. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy")
  10924. urls += "?" + c.urlParams_.Encode()
  10925. req, err := http.NewRequest("POST", urls, body)
  10926. if err != nil {
  10927. return nil, err
  10928. }
  10929. req.Header = reqHeaders
  10930. googleapi.Expand(req.URL, map[string]string{
  10931. "projectId": c.projectId,
  10932. "zone": c.zone,
  10933. "clusterId": c.clusterId,
  10934. })
  10935. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10936. }
  10937. // Do executes the "container.projects.zones.clusters.setMaintenancePolicy" call.
  10938. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10939. // status code is an error. Response headers are in either
  10940. // *Operation.ServerResponse.Header or (if a response was returned at
  10941. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10942. // to check whether the returned error was because
  10943. // http.StatusNotModified was returned.
  10944. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10945. gensupport.SetOptions(c.urlParams_, opts...)
  10946. res, err := c.doRequest("json")
  10947. if res != nil && res.StatusCode == http.StatusNotModified {
  10948. if res.Body != nil {
  10949. res.Body.Close()
  10950. }
  10951. return nil, &googleapi.Error{
  10952. Code: res.StatusCode,
  10953. Header: res.Header,
  10954. }
  10955. }
  10956. if err != nil {
  10957. return nil, err
  10958. }
  10959. defer googleapi.CloseBody(res)
  10960. if err := googleapi.CheckResponse(res); err != nil {
  10961. return nil, err
  10962. }
  10963. ret := &Operation{
  10964. ServerResponse: googleapi.ServerResponse{
  10965. Header: res.Header,
  10966. HTTPStatusCode: res.StatusCode,
  10967. },
  10968. }
  10969. target := &ret
  10970. if err := gensupport.DecodeResponse(target, res); err != nil {
  10971. return nil, err
  10972. }
  10973. return ret, nil
  10974. // {
  10975. // "description": "Sets the maintenance policy for a cluster.",
  10976. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy",
  10977. // "httpMethod": "POST",
  10978. // "id": "container.projects.zones.clusters.setMaintenancePolicy",
  10979. // "parameterOrder": [
  10980. // "projectId",
  10981. // "zone",
  10982. // "clusterId"
  10983. // ],
  10984. // "parameters": {
  10985. // "clusterId": {
  10986. // "description": "The name of the cluster to update.",
  10987. // "location": "path",
  10988. // "required": true,
  10989. // "type": "string"
  10990. // },
  10991. // "projectId": {
  10992. // "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).",
  10993. // "location": "path",
  10994. // "required": true,
  10995. // "type": "string"
  10996. // },
  10997. // "zone": {
  10998. // "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.",
  10999. // "location": "path",
  11000. // "required": true,
  11001. // "type": "string"
  11002. // }
  11003. // },
  11004. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy",
  11005. // "request": {
  11006. // "$ref": "SetMaintenancePolicyRequest"
  11007. // },
  11008. // "response": {
  11009. // "$ref": "Operation"
  11010. // },
  11011. // "scopes": [
  11012. // "https://www.googleapis.com/auth/cloud-platform"
  11013. // ]
  11014. // }
  11015. }
  11016. // method id "container.projects.zones.clusters.setMasterAuth":
  11017. type ProjectsZonesClustersSetMasterAuthCall struct {
  11018. s *Service
  11019. projectId string
  11020. zone string
  11021. clusterId string
  11022. setmasterauthrequest *SetMasterAuthRequest
  11023. urlParams_ gensupport.URLParams
  11024. ctx_ context.Context
  11025. header_ http.Header
  11026. }
  11027. // SetMasterAuth: Used to set master auth materials. Currently supports
  11028. // :-
  11029. // Changing the admin password for a specific cluster.
  11030. // This can be either via password generation or explicitly set.
  11031. // Modify basic_auth.csv and reset the K8S API server.
  11032. func (r *ProjectsZonesClustersService) SetMasterAuth(projectId string, zone string, clusterId string, setmasterauthrequest *SetMasterAuthRequest) *ProjectsZonesClustersSetMasterAuthCall {
  11033. c := &ProjectsZonesClustersSetMasterAuthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11034. c.projectId = projectId
  11035. c.zone = zone
  11036. c.clusterId = clusterId
  11037. c.setmasterauthrequest = setmasterauthrequest
  11038. return c
  11039. }
  11040. // Fields allows partial responses to be retrieved. See
  11041. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11042. // for more information.
  11043. func (c *ProjectsZonesClustersSetMasterAuthCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersSetMasterAuthCall {
  11044. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11045. return c
  11046. }
  11047. // Context sets the context to be used in this call's Do method. Any
  11048. // pending HTTP request will be aborted if the provided context is
  11049. // canceled.
  11050. func (c *ProjectsZonesClustersSetMasterAuthCall) Context(ctx context.Context) *ProjectsZonesClustersSetMasterAuthCall {
  11051. c.ctx_ = ctx
  11052. return c
  11053. }
  11054. // Header returns an http.Header that can be modified by the caller to
  11055. // add HTTP headers to the request.
  11056. func (c *ProjectsZonesClustersSetMasterAuthCall) Header() http.Header {
  11057. if c.header_ == nil {
  11058. c.header_ = make(http.Header)
  11059. }
  11060. return c.header_
  11061. }
  11062. func (c *ProjectsZonesClustersSetMasterAuthCall) doRequest(alt string) (*http.Response, error) {
  11063. reqHeaders := make(http.Header)
  11064. for k, v := range c.header_ {
  11065. reqHeaders[k] = v
  11066. }
  11067. reqHeaders.Set("User-Agent", c.s.userAgent())
  11068. var body io.Reader = nil
  11069. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmasterauthrequest)
  11070. if err != nil {
  11071. return nil, err
  11072. }
  11073. reqHeaders.Set("Content-Type", "application/json")
  11074. c.urlParams_.Set("alt", alt)
  11075. c.urlParams_.Set("prettyPrint", "false")
  11076. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth")
  11077. urls += "?" + c.urlParams_.Encode()
  11078. req, err := http.NewRequest("POST", urls, body)
  11079. if err != nil {
  11080. return nil, err
  11081. }
  11082. req.Header = reqHeaders
  11083. googleapi.Expand(req.URL, map[string]string{
  11084. "projectId": c.projectId,
  11085. "zone": c.zone,
  11086. "clusterId": c.clusterId,
  11087. })
  11088. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11089. }
  11090. // Do executes the "container.projects.zones.clusters.setMasterAuth" call.
  11091. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11092. // status code is an error. Response headers are in either
  11093. // *Operation.ServerResponse.Header or (if a response was returned at
  11094. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11095. // to check whether the returned error was because
  11096. // http.StatusNotModified was returned.
  11097. func (c *ProjectsZonesClustersSetMasterAuthCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11098. gensupport.SetOptions(c.urlParams_, opts...)
  11099. res, err := c.doRequest("json")
  11100. if res != nil && res.StatusCode == http.StatusNotModified {
  11101. if res.Body != nil {
  11102. res.Body.Close()
  11103. }
  11104. return nil, &googleapi.Error{
  11105. Code: res.StatusCode,
  11106. Header: res.Header,
  11107. }
  11108. }
  11109. if err != nil {
  11110. return nil, err
  11111. }
  11112. defer googleapi.CloseBody(res)
  11113. if err := googleapi.CheckResponse(res); err != nil {
  11114. return nil, err
  11115. }
  11116. ret := &Operation{
  11117. ServerResponse: googleapi.ServerResponse{
  11118. Header: res.Header,
  11119. HTTPStatusCode: res.StatusCode,
  11120. },
  11121. }
  11122. target := &ret
  11123. if err := gensupport.DecodeResponse(target, res); err != nil {
  11124. return nil, err
  11125. }
  11126. return ret, nil
  11127. // {
  11128. // "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.",
  11129. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth",
  11130. // "httpMethod": "POST",
  11131. // "id": "container.projects.zones.clusters.setMasterAuth",
  11132. // "parameterOrder": [
  11133. // "projectId",
  11134. // "zone",
  11135. // "clusterId"
  11136. // ],
  11137. // "parameters": {
  11138. // "clusterId": {
  11139. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  11140. // "location": "path",
  11141. // "required": true,
  11142. // "type": "string"
  11143. // },
  11144. // "projectId": {
  11145. // "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.",
  11146. // "location": "path",
  11147. // "required": true,
  11148. // "type": "string"
  11149. // },
  11150. // "zone": {
  11151. // "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.",
  11152. // "location": "path",
  11153. // "required": true,
  11154. // "type": "string"
  11155. // }
  11156. // },
  11157. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth",
  11158. // "request": {
  11159. // "$ref": "SetMasterAuthRequest"
  11160. // },
  11161. // "response": {
  11162. // "$ref": "Operation"
  11163. // },
  11164. // "scopes": [
  11165. // "https://www.googleapis.com/auth/cloud-platform"
  11166. // ]
  11167. // }
  11168. }
  11169. // method id "container.projects.zones.clusters.setNetworkPolicy":
  11170. type ProjectsZonesClustersSetNetworkPolicyCall struct {
  11171. s *Service
  11172. projectId string
  11173. zone string
  11174. clusterId string
  11175. setnetworkpolicyrequest *SetNetworkPolicyRequest
  11176. urlParams_ gensupport.URLParams
  11177. ctx_ context.Context
  11178. header_ http.Header
  11179. }
  11180. // SetNetworkPolicy: Enables/Disables Network Policy for a cluster.
  11181. func (r *ProjectsZonesClustersService) SetNetworkPolicy(projectId string, zone string, clusterId string, setnetworkpolicyrequest *SetNetworkPolicyRequest) *ProjectsZonesClustersSetNetworkPolicyCall {
  11182. c := &ProjectsZonesClustersSetNetworkPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11183. c.projectId = projectId
  11184. c.zone = zone
  11185. c.clusterId = clusterId
  11186. c.setnetworkpolicyrequest = setnetworkpolicyrequest
  11187. return c
  11188. }
  11189. // Fields allows partial responses to be retrieved. See
  11190. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11191. // for more information.
  11192. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersSetNetworkPolicyCall {
  11193. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11194. return c
  11195. }
  11196. // Context sets the context to be used in this call's Do method. Any
  11197. // pending HTTP request will be aborted if the provided context is
  11198. // canceled.
  11199. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Context(ctx context.Context) *ProjectsZonesClustersSetNetworkPolicyCall {
  11200. c.ctx_ = ctx
  11201. return c
  11202. }
  11203. // Header returns an http.Header that can be modified by the caller to
  11204. // add HTTP headers to the request.
  11205. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Header() http.Header {
  11206. if c.header_ == nil {
  11207. c.header_ = make(http.Header)
  11208. }
  11209. return c.header_
  11210. }
  11211. func (c *ProjectsZonesClustersSetNetworkPolicyCall) doRequest(alt string) (*http.Response, error) {
  11212. reqHeaders := make(http.Header)
  11213. for k, v := range c.header_ {
  11214. reqHeaders[k] = v
  11215. }
  11216. reqHeaders.Set("User-Agent", c.s.userAgent())
  11217. var body io.Reader = nil
  11218. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnetworkpolicyrequest)
  11219. if err != nil {
  11220. return nil, err
  11221. }
  11222. reqHeaders.Set("Content-Type", "application/json")
  11223. c.urlParams_.Set("alt", alt)
  11224. c.urlParams_.Set("prettyPrint", "false")
  11225. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy")
  11226. urls += "?" + c.urlParams_.Encode()
  11227. req, err := http.NewRequest("POST", urls, body)
  11228. if err != nil {
  11229. return nil, err
  11230. }
  11231. req.Header = reqHeaders
  11232. googleapi.Expand(req.URL, map[string]string{
  11233. "projectId": c.projectId,
  11234. "zone": c.zone,
  11235. "clusterId": c.clusterId,
  11236. })
  11237. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11238. }
  11239. // Do executes the "container.projects.zones.clusters.setNetworkPolicy" call.
  11240. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11241. // status code is an error. Response headers are in either
  11242. // *Operation.ServerResponse.Header or (if a response was returned at
  11243. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11244. // to check whether the returned error was because
  11245. // http.StatusNotModified was returned.
  11246. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11247. gensupport.SetOptions(c.urlParams_, opts...)
  11248. res, err := c.doRequest("json")
  11249. if res != nil && res.StatusCode == http.StatusNotModified {
  11250. if res.Body != nil {
  11251. res.Body.Close()
  11252. }
  11253. return nil, &googleapi.Error{
  11254. Code: res.StatusCode,
  11255. Header: res.Header,
  11256. }
  11257. }
  11258. if err != nil {
  11259. return nil, err
  11260. }
  11261. defer googleapi.CloseBody(res)
  11262. if err := googleapi.CheckResponse(res); err != nil {
  11263. return nil, err
  11264. }
  11265. ret := &Operation{
  11266. ServerResponse: googleapi.ServerResponse{
  11267. Header: res.Header,
  11268. HTTPStatusCode: res.StatusCode,
  11269. },
  11270. }
  11271. target := &ret
  11272. if err := gensupport.DecodeResponse(target, res); err != nil {
  11273. return nil, err
  11274. }
  11275. return ret, nil
  11276. // {
  11277. // "description": "Enables/Disables Network Policy for a cluster.",
  11278. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy",
  11279. // "httpMethod": "POST",
  11280. // "id": "container.projects.zones.clusters.setNetworkPolicy",
  11281. // "parameterOrder": [
  11282. // "projectId",
  11283. // "zone",
  11284. // "clusterId"
  11285. // ],
  11286. // "parameters": {
  11287. // "clusterId": {
  11288. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  11289. // "location": "path",
  11290. // "required": true,
  11291. // "type": "string"
  11292. // },
  11293. // "projectId": {
  11294. // "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.",
  11295. // "location": "path",
  11296. // "required": true,
  11297. // "type": "string"
  11298. // },
  11299. // "zone": {
  11300. // "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.",
  11301. // "location": "path",
  11302. // "required": true,
  11303. // "type": "string"
  11304. // }
  11305. // },
  11306. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy",
  11307. // "request": {
  11308. // "$ref": "SetNetworkPolicyRequest"
  11309. // },
  11310. // "response": {
  11311. // "$ref": "Operation"
  11312. // },
  11313. // "scopes": [
  11314. // "https://www.googleapis.com/auth/cloud-platform"
  11315. // ]
  11316. // }
  11317. }
  11318. // method id "container.projects.zones.clusters.startIpRotation":
  11319. type ProjectsZonesClustersStartIpRotationCall struct {
  11320. s *Service
  11321. projectId string
  11322. zone string
  11323. clusterId string
  11324. startiprotationrequest *StartIPRotationRequest
  11325. urlParams_ gensupport.URLParams
  11326. ctx_ context.Context
  11327. header_ http.Header
  11328. }
  11329. // StartIpRotation: Start master IP rotation.
  11330. func (r *ProjectsZonesClustersService) StartIpRotation(projectId string, zone string, clusterId string, startiprotationrequest *StartIPRotationRequest) *ProjectsZonesClustersStartIpRotationCall {
  11331. c := &ProjectsZonesClustersStartIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11332. c.projectId = projectId
  11333. c.zone = zone
  11334. c.clusterId = clusterId
  11335. c.startiprotationrequest = startiprotationrequest
  11336. return c
  11337. }
  11338. // Fields allows partial responses to be retrieved. See
  11339. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11340. // for more information.
  11341. func (c *ProjectsZonesClustersStartIpRotationCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersStartIpRotationCall {
  11342. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11343. return c
  11344. }
  11345. // Context sets the context to be used in this call's Do method. Any
  11346. // pending HTTP request will be aborted if the provided context is
  11347. // canceled.
  11348. func (c *ProjectsZonesClustersStartIpRotationCall) Context(ctx context.Context) *ProjectsZonesClustersStartIpRotationCall {
  11349. c.ctx_ = ctx
  11350. return c
  11351. }
  11352. // Header returns an http.Header that can be modified by the caller to
  11353. // add HTTP headers to the request.
  11354. func (c *ProjectsZonesClustersStartIpRotationCall) Header() http.Header {
  11355. if c.header_ == nil {
  11356. c.header_ = make(http.Header)
  11357. }
  11358. return c.header_
  11359. }
  11360. func (c *ProjectsZonesClustersStartIpRotationCall) doRequest(alt string) (*http.Response, error) {
  11361. reqHeaders := make(http.Header)
  11362. for k, v := range c.header_ {
  11363. reqHeaders[k] = v
  11364. }
  11365. reqHeaders.Set("User-Agent", c.s.userAgent())
  11366. var body io.Reader = nil
  11367. body, err := googleapi.WithoutDataWrapper.JSONReader(c.startiprotationrequest)
  11368. if err != nil {
  11369. return nil, err
  11370. }
  11371. reqHeaders.Set("Content-Type", "application/json")
  11372. c.urlParams_.Set("alt", alt)
  11373. c.urlParams_.Set("prettyPrint", "false")
  11374. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation")
  11375. urls += "?" + c.urlParams_.Encode()
  11376. req, err := http.NewRequest("POST", urls, body)
  11377. if err != nil {
  11378. return nil, err
  11379. }
  11380. req.Header = reqHeaders
  11381. googleapi.Expand(req.URL, map[string]string{
  11382. "projectId": c.projectId,
  11383. "zone": c.zone,
  11384. "clusterId": c.clusterId,
  11385. })
  11386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11387. }
  11388. // Do executes the "container.projects.zones.clusters.startIpRotation" call.
  11389. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11390. // status code is an error. Response headers are in either
  11391. // *Operation.ServerResponse.Header or (if a response was returned at
  11392. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11393. // to check whether the returned error was because
  11394. // http.StatusNotModified was returned.
  11395. func (c *ProjectsZonesClustersStartIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11396. gensupport.SetOptions(c.urlParams_, opts...)
  11397. res, err := c.doRequest("json")
  11398. if res != nil && res.StatusCode == http.StatusNotModified {
  11399. if res.Body != nil {
  11400. res.Body.Close()
  11401. }
  11402. return nil, &googleapi.Error{
  11403. Code: res.StatusCode,
  11404. Header: res.Header,
  11405. }
  11406. }
  11407. if err != nil {
  11408. return nil, err
  11409. }
  11410. defer googleapi.CloseBody(res)
  11411. if err := googleapi.CheckResponse(res); err != nil {
  11412. return nil, err
  11413. }
  11414. ret := &Operation{
  11415. ServerResponse: googleapi.ServerResponse{
  11416. Header: res.Header,
  11417. HTTPStatusCode: res.StatusCode,
  11418. },
  11419. }
  11420. target := &ret
  11421. if err := gensupport.DecodeResponse(target, res); err != nil {
  11422. return nil, err
  11423. }
  11424. return ret, nil
  11425. // {
  11426. // "description": "Start master IP rotation.",
  11427. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation",
  11428. // "httpMethod": "POST",
  11429. // "id": "container.projects.zones.clusters.startIpRotation",
  11430. // "parameterOrder": [
  11431. // "projectId",
  11432. // "zone",
  11433. // "clusterId"
  11434. // ],
  11435. // "parameters": {
  11436. // "clusterId": {
  11437. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  11438. // "location": "path",
  11439. // "required": true,
  11440. // "type": "string"
  11441. // },
  11442. // "projectId": {
  11443. // "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.",
  11444. // "location": "path",
  11445. // "required": true,
  11446. // "type": "string"
  11447. // },
  11448. // "zone": {
  11449. // "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.",
  11450. // "location": "path",
  11451. // "required": true,
  11452. // "type": "string"
  11453. // }
  11454. // },
  11455. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation",
  11456. // "request": {
  11457. // "$ref": "StartIPRotationRequest"
  11458. // },
  11459. // "response": {
  11460. // "$ref": "Operation"
  11461. // },
  11462. // "scopes": [
  11463. // "https://www.googleapis.com/auth/cloud-platform"
  11464. // ]
  11465. // }
  11466. }
  11467. // method id "container.projects.zones.clusters.update":
  11468. type ProjectsZonesClustersUpdateCall struct {
  11469. s *Service
  11470. projectId string
  11471. zone string
  11472. clusterId string
  11473. updateclusterrequest *UpdateClusterRequest
  11474. urlParams_ gensupport.URLParams
  11475. ctx_ context.Context
  11476. header_ http.Header
  11477. }
  11478. // Update: Updates the settings for a specific cluster.
  11479. func (r *ProjectsZonesClustersService) Update(projectId string, zone string, clusterId string, updateclusterrequest *UpdateClusterRequest) *ProjectsZonesClustersUpdateCall {
  11480. c := &ProjectsZonesClustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11481. c.projectId = projectId
  11482. c.zone = zone
  11483. c.clusterId = clusterId
  11484. c.updateclusterrequest = updateclusterrequest
  11485. return c
  11486. }
  11487. // Fields allows partial responses to be retrieved. See
  11488. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11489. // for more information.
  11490. func (c *ProjectsZonesClustersUpdateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersUpdateCall {
  11491. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11492. return c
  11493. }
  11494. // Context sets the context to be used in this call's Do method. Any
  11495. // pending HTTP request will be aborted if the provided context is
  11496. // canceled.
  11497. func (c *ProjectsZonesClustersUpdateCall) Context(ctx context.Context) *ProjectsZonesClustersUpdateCall {
  11498. c.ctx_ = ctx
  11499. return c
  11500. }
  11501. // Header returns an http.Header that can be modified by the caller to
  11502. // add HTTP headers to the request.
  11503. func (c *ProjectsZonesClustersUpdateCall) Header() http.Header {
  11504. if c.header_ == nil {
  11505. c.header_ = make(http.Header)
  11506. }
  11507. return c.header_
  11508. }
  11509. func (c *ProjectsZonesClustersUpdateCall) doRequest(alt string) (*http.Response, error) {
  11510. reqHeaders := make(http.Header)
  11511. for k, v := range c.header_ {
  11512. reqHeaders[k] = v
  11513. }
  11514. reqHeaders.Set("User-Agent", c.s.userAgent())
  11515. var body io.Reader = nil
  11516. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest)
  11517. if err != nil {
  11518. return nil, err
  11519. }
  11520. reqHeaders.Set("Content-Type", "application/json")
  11521. c.urlParams_.Set("alt", alt)
  11522. c.urlParams_.Set("prettyPrint", "false")
  11523. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  11524. urls += "?" + c.urlParams_.Encode()
  11525. req, err := http.NewRequest("PUT", urls, body)
  11526. if err != nil {
  11527. return nil, err
  11528. }
  11529. req.Header = reqHeaders
  11530. googleapi.Expand(req.URL, map[string]string{
  11531. "projectId": c.projectId,
  11532. "zone": c.zone,
  11533. "clusterId": c.clusterId,
  11534. })
  11535. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11536. }
  11537. // Do executes the "container.projects.zones.clusters.update" call.
  11538. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11539. // status code is an error. Response headers are in either
  11540. // *Operation.ServerResponse.Header or (if a response was returned at
  11541. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11542. // to check whether the returned error was because
  11543. // http.StatusNotModified was returned.
  11544. func (c *ProjectsZonesClustersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11545. gensupport.SetOptions(c.urlParams_, opts...)
  11546. res, err := c.doRequest("json")
  11547. if res != nil && res.StatusCode == http.StatusNotModified {
  11548. if res.Body != nil {
  11549. res.Body.Close()
  11550. }
  11551. return nil, &googleapi.Error{
  11552. Code: res.StatusCode,
  11553. Header: res.Header,
  11554. }
  11555. }
  11556. if err != nil {
  11557. return nil, err
  11558. }
  11559. defer googleapi.CloseBody(res)
  11560. if err := googleapi.CheckResponse(res); err != nil {
  11561. return nil, err
  11562. }
  11563. ret := &Operation{
  11564. ServerResponse: googleapi.ServerResponse{
  11565. Header: res.Header,
  11566. HTTPStatusCode: res.StatusCode,
  11567. },
  11568. }
  11569. target := &ret
  11570. if err := gensupport.DecodeResponse(target, res); err != nil {
  11571. return nil, err
  11572. }
  11573. return ret, nil
  11574. // {
  11575. // "description": "Updates the settings for a specific cluster.",
  11576. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  11577. // "httpMethod": "PUT",
  11578. // "id": "container.projects.zones.clusters.update",
  11579. // "parameterOrder": [
  11580. // "projectId",
  11581. // "zone",
  11582. // "clusterId"
  11583. // ],
  11584. // "parameters": {
  11585. // "clusterId": {
  11586. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  11587. // "location": "path",
  11588. // "required": true,
  11589. // "type": "string"
  11590. // },
  11591. // "projectId": {
  11592. // "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.",
  11593. // "location": "path",
  11594. // "required": true,
  11595. // "type": "string"
  11596. // },
  11597. // "zone": {
  11598. // "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.",
  11599. // "location": "path",
  11600. // "required": true,
  11601. // "type": "string"
  11602. // }
  11603. // },
  11604. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  11605. // "request": {
  11606. // "$ref": "UpdateClusterRequest"
  11607. // },
  11608. // "response": {
  11609. // "$ref": "Operation"
  11610. // },
  11611. // "scopes": [
  11612. // "https://www.googleapis.com/auth/cloud-platform"
  11613. // ]
  11614. // }
  11615. }
  11616. // method id "container.projects.zones.clusters.nodePools.autoscaling":
  11617. type ProjectsZonesClustersNodePoolsAutoscalingCall struct {
  11618. s *Service
  11619. projectId string
  11620. zone string
  11621. clusterId string
  11622. nodePoolId string
  11623. setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest
  11624. urlParams_ gensupport.URLParams
  11625. ctx_ context.Context
  11626. header_ http.Header
  11627. }
  11628. // Autoscaling: Sets the autoscaling settings of a specific node pool.
  11629. func (r *ProjectsZonesClustersNodePoolsService) Autoscaling(projectId string, zone string, clusterId string, nodePoolId string, setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest) *ProjectsZonesClustersNodePoolsAutoscalingCall {
  11630. c := &ProjectsZonesClustersNodePoolsAutoscalingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11631. c.projectId = projectId
  11632. c.zone = zone
  11633. c.clusterId = clusterId
  11634. c.nodePoolId = nodePoolId
  11635. c.setnodepoolautoscalingrequest = setnodepoolautoscalingrequest
  11636. return c
  11637. }
  11638. // Fields allows partial responses to be retrieved. See
  11639. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11640. // for more information.
  11641. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsAutoscalingCall {
  11642. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11643. return c
  11644. }
  11645. // Context sets the context to be used in this call's Do method. Any
  11646. // pending HTTP request will be aborted if the provided context is
  11647. // canceled.
  11648. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsAutoscalingCall {
  11649. c.ctx_ = ctx
  11650. return c
  11651. }
  11652. // Header returns an http.Header that can be modified by the caller to
  11653. // add HTTP headers to the request.
  11654. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Header() http.Header {
  11655. if c.header_ == nil {
  11656. c.header_ = make(http.Header)
  11657. }
  11658. return c.header_
  11659. }
  11660. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) doRequest(alt string) (*http.Response, error) {
  11661. reqHeaders := make(http.Header)
  11662. for k, v := range c.header_ {
  11663. reqHeaders[k] = v
  11664. }
  11665. reqHeaders.Set("User-Agent", c.s.userAgent())
  11666. var body io.Reader = nil
  11667. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolautoscalingrequest)
  11668. if err != nil {
  11669. return nil, err
  11670. }
  11671. reqHeaders.Set("Content-Type", "application/json")
  11672. c.urlParams_.Set("alt", alt)
  11673. c.urlParams_.Set("prettyPrint", "false")
  11674. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling")
  11675. urls += "?" + c.urlParams_.Encode()
  11676. req, err := http.NewRequest("POST", urls, body)
  11677. if err != nil {
  11678. return nil, err
  11679. }
  11680. req.Header = reqHeaders
  11681. googleapi.Expand(req.URL, map[string]string{
  11682. "projectId": c.projectId,
  11683. "zone": c.zone,
  11684. "clusterId": c.clusterId,
  11685. "nodePoolId": c.nodePoolId,
  11686. })
  11687. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11688. }
  11689. // Do executes the "container.projects.zones.clusters.nodePools.autoscaling" call.
  11690. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11691. // status code is an error. Response headers are in either
  11692. // *Operation.ServerResponse.Header or (if a response was returned at
  11693. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11694. // to check whether the returned error was because
  11695. // http.StatusNotModified was returned.
  11696. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11697. gensupport.SetOptions(c.urlParams_, opts...)
  11698. res, err := c.doRequest("json")
  11699. if res != nil && res.StatusCode == http.StatusNotModified {
  11700. if res.Body != nil {
  11701. res.Body.Close()
  11702. }
  11703. return nil, &googleapi.Error{
  11704. Code: res.StatusCode,
  11705. Header: res.Header,
  11706. }
  11707. }
  11708. if err != nil {
  11709. return nil, err
  11710. }
  11711. defer googleapi.CloseBody(res)
  11712. if err := googleapi.CheckResponse(res); err != nil {
  11713. return nil, err
  11714. }
  11715. ret := &Operation{
  11716. ServerResponse: googleapi.ServerResponse{
  11717. Header: res.Header,
  11718. HTTPStatusCode: res.StatusCode,
  11719. },
  11720. }
  11721. target := &ret
  11722. if err := gensupport.DecodeResponse(target, res); err != nil {
  11723. return nil, err
  11724. }
  11725. return ret, nil
  11726. // {
  11727. // "description": "Sets the autoscaling settings of a specific node pool.",
  11728. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling",
  11729. // "httpMethod": "POST",
  11730. // "id": "container.projects.zones.clusters.nodePools.autoscaling",
  11731. // "parameterOrder": [
  11732. // "projectId",
  11733. // "zone",
  11734. // "clusterId",
  11735. // "nodePoolId"
  11736. // ],
  11737. // "parameters": {
  11738. // "clusterId": {
  11739. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  11740. // "location": "path",
  11741. // "required": true,
  11742. // "type": "string"
  11743. // },
  11744. // "nodePoolId": {
  11745. // "description": "Deprecated. The name of the node pool to upgrade.\nThis field has been deprecated and replaced by the name field.",
  11746. // "location": "path",
  11747. // "required": true,
  11748. // "type": "string"
  11749. // },
  11750. // "projectId": {
  11751. // "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.",
  11752. // "location": "path",
  11753. // "required": true,
  11754. // "type": "string"
  11755. // },
  11756. // "zone": {
  11757. // "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.",
  11758. // "location": "path",
  11759. // "required": true,
  11760. // "type": "string"
  11761. // }
  11762. // },
  11763. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling",
  11764. // "request": {
  11765. // "$ref": "SetNodePoolAutoscalingRequest"
  11766. // },
  11767. // "response": {
  11768. // "$ref": "Operation"
  11769. // },
  11770. // "scopes": [
  11771. // "https://www.googleapis.com/auth/cloud-platform"
  11772. // ]
  11773. // }
  11774. }
  11775. // method id "container.projects.zones.clusters.nodePools.create":
  11776. type ProjectsZonesClustersNodePoolsCreateCall struct {
  11777. s *Service
  11778. projectId string
  11779. zone string
  11780. clusterId string
  11781. createnodepoolrequest *CreateNodePoolRequest
  11782. urlParams_ gensupport.URLParams
  11783. ctx_ context.Context
  11784. header_ http.Header
  11785. }
  11786. // Create: Creates a node pool for a cluster.
  11787. func (r *ProjectsZonesClustersNodePoolsService) Create(projectId string, zone string, clusterId string, createnodepoolrequest *CreateNodePoolRequest) *ProjectsZonesClustersNodePoolsCreateCall {
  11788. c := &ProjectsZonesClustersNodePoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11789. c.projectId = projectId
  11790. c.zone = zone
  11791. c.clusterId = clusterId
  11792. c.createnodepoolrequest = createnodepoolrequest
  11793. return c
  11794. }
  11795. // Fields allows partial responses to be retrieved. See
  11796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11797. // for more information.
  11798. func (c *ProjectsZonesClustersNodePoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsCreateCall {
  11799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11800. return c
  11801. }
  11802. // Context sets the context to be used in this call's Do method. Any
  11803. // pending HTTP request will be aborted if the provided context is
  11804. // canceled.
  11805. func (c *ProjectsZonesClustersNodePoolsCreateCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsCreateCall {
  11806. c.ctx_ = ctx
  11807. return c
  11808. }
  11809. // Header returns an http.Header that can be modified by the caller to
  11810. // add HTTP headers to the request.
  11811. func (c *ProjectsZonesClustersNodePoolsCreateCall) Header() http.Header {
  11812. if c.header_ == nil {
  11813. c.header_ = make(http.Header)
  11814. }
  11815. return c.header_
  11816. }
  11817. func (c *ProjectsZonesClustersNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) {
  11818. reqHeaders := make(http.Header)
  11819. for k, v := range c.header_ {
  11820. reqHeaders[k] = v
  11821. }
  11822. reqHeaders.Set("User-Agent", c.s.userAgent())
  11823. var body io.Reader = nil
  11824. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createnodepoolrequest)
  11825. if err != nil {
  11826. return nil, err
  11827. }
  11828. reqHeaders.Set("Content-Type", "application/json")
  11829. c.urlParams_.Set("alt", alt)
  11830. c.urlParams_.Set("prettyPrint", "false")
  11831. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools")
  11832. urls += "?" + c.urlParams_.Encode()
  11833. req, err := http.NewRequest("POST", urls, body)
  11834. if err != nil {
  11835. return nil, err
  11836. }
  11837. req.Header = reqHeaders
  11838. googleapi.Expand(req.URL, map[string]string{
  11839. "projectId": c.projectId,
  11840. "zone": c.zone,
  11841. "clusterId": c.clusterId,
  11842. })
  11843. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11844. }
  11845. // Do executes the "container.projects.zones.clusters.nodePools.create" call.
  11846. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11847. // status code is an error. Response headers are in either
  11848. // *Operation.ServerResponse.Header or (if a response was returned at
  11849. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11850. // to check whether the returned error was because
  11851. // http.StatusNotModified was returned.
  11852. func (c *ProjectsZonesClustersNodePoolsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11853. gensupport.SetOptions(c.urlParams_, opts...)
  11854. res, err := c.doRequest("json")
  11855. if res != nil && res.StatusCode == http.StatusNotModified {
  11856. if res.Body != nil {
  11857. res.Body.Close()
  11858. }
  11859. return nil, &googleapi.Error{
  11860. Code: res.StatusCode,
  11861. Header: res.Header,
  11862. }
  11863. }
  11864. if err != nil {
  11865. return nil, err
  11866. }
  11867. defer googleapi.CloseBody(res)
  11868. if err := googleapi.CheckResponse(res); err != nil {
  11869. return nil, err
  11870. }
  11871. ret := &Operation{
  11872. ServerResponse: googleapi.ServerResponse{
  11873. Header: res.Header,
  11874. HTTPStatusCode: res.StatusCode,
  11875. },
  11876. }
  11877. target := &ret
  11878. if err := gensupport.DecodeResponse(target, res); err != nil {
  11879. return nil, err
  11880. }
  11881. return ret, nil
  11882. // {
  11883. // "description": "Creates a node pool for a cluster.",
  11884. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  11885. // "httpMethod": "POST",
  11886. // "id": "container.projects.zones.clusters.nodePools.create",
  11887. // "parameterOrder": [
  11888. // "projectId",
  11889. // "zone",
  11890. // "clusterId"
  11891. // ],
  11892. // "parameters": {
  11893. // "clusterId": {
  11894. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the parent field.",
  11895. // "location": "path",
  11896. // "required": true,
  11897. // "type": "string"
  11898. // },
  11899. // "projectId": {
  11900. // "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.",
  11901. // "location": "path",
  11902. // "required": true,
  11903. // "type": "string"
  11904. // },
  11905. // "zone": {
  11906. // "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.",
  11907. // "location": "path",
  11908. // "required": true,
  11909. // "type": "string"
  11910. // }
  11911. // },
  11912. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  11913. // "request": {
  11914. // "$ref": "CreateNodePoolRequest"
  11915. // },
  11916. // "response": {
  11917. // "$ref": "Operation"
  11918. // },
  11919. // "scopes": [
  11920. // "https://www.googleapis.com/auth/cloud-platform"
  11921. // ]
  11922. // }
  11923. }
  11924. // method id "container.projects.zones.clusters.nodePools.delete":
  11925. type ProjectsZonesClustersNodePoolsDeleteCall struct {
  11926. s *Service
  11927. projectId string
  11928. zone string
  11929. clusterId string
  11930. nodePoolId string
  11931. urlParams_ gensupport.URLParams
  11932. ctx_ context.Context
  11933. header_ http.Header
  11934. }
  11935. // Delete: Deletes a node pool from a cluster.
  11936. func (r *ProjectsZonesClustersNodePoolsService) Delete(projectId string, zone string, clusterId string, nodePoolId string) *ProjectsZonesClustersNodePoolsDeleteCall {
  11937. c := &ProjectsZonesClustersNodePoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11938. c.projectId = projectId
  11939. c.zone = zone
  11940. c.clusterId = clusterId
  11941. c.nodePoolId = nodePoolId
  11942. return c
  11943. }
  11944. // Name sets the optional parameter "name": The name (project, location,
  11945. // cluster, node pool id) of the node pool to
  11946. // delete. Specified in the
  11947. // format
  11948. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  11949. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Name(name string) *ProjectsZonesClustersNodePoolsDeleteCall {
  11950. c.urlParams_.Set("name", name)
  11951. return c
  11952. }
  11953. // Fields allows partial responses to be retrieved. See
  11954. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11955. // for more information.
  11956. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsDeleteCall {
  11957. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11958. return c
  11959. }
  11960. // Context sets the context to be used in this call's Do method. Any
  11961. // pending HTTP request will be aborted if the provided context is
  11962. // canceled.
  11963. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsDeleteCall {
  11964. c.ctx_ = ctx
  11965. return c
  11966. }
  11967. // Header returns an http.Header that can be modified by the caller to
  11968. // add HTTP headers to the request.
  11969. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Header() http.Header {
  11970. if c.header_ == nil {
  11971. c.header_ = make(http.Header)
  11972. }
  11973. return c.header_
  11974. }
  11975. func (c *ProjectsZonesClustersNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  11976. reqHeaders := make(http.Header)
  11977. for k, v := range c.header_ {
  11978. reqHeaders[k] = v
  11979. }
  11980. reqHeaders.Set("User-Agent", c.s.userAgent())
  11981. var body io.Reader = nil
  11982. c.urlParams_.Set("alt", alt)
  11983. c.urlParams_.Set("prettyPrint", "false")
  11984. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}")
  11985. urls += "?" + c.urlParams_.Encode()
  11986. req, err := http.NewRequest("DELETE", urls, body)
  11987. if err != nil {
  11988. return nil, err
  11989. }
  11990. req.Header = reqHeaders
  11991. googleapi.Expand(req.URL, map[string]string{
  11992. "projectId": c.projectId,
  11993. "zone": c.zone,
  11994. "clusterId": c.clusterId,
  11995. "nodePoolId": c.nodePoolId,
  11996. })
  11997. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11998. }
  11999. // Do executes the "container.projects.zones.clusters.nodePools.delete" call.
  12000. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12001. // status code is an error. Response headers are in either
  12002. // *Operation.ServerResponse.Header or (if a response was returned at
  12003. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12004. // to check whether the returned error was because
  12005. // http.StatusNotModified was returned.
  12006. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12007. gensupport.SetOptions(c.urlParams_, opts...)
  12008. res, err := c.doRequest("json")
  12009. if res != nil && res.StatusCode == http.StatusNotModified {
  12010. if res.Body != nil {
  12011. res.Body.Close()
  12012. }
  12013. return nil, &googleapi.Error{
  12014. Code: res.StatusCode,
  12015. Header: res.Header,
  12016. }
  12017. }
  12018. if err != nil {
  12019. return nil, err
  12020. }
  12021. defer googleapi.CloseBody(res)
  12022. if err := googleapi.CheckResponse(res); err != nil {
  12023. return nil, err
  12024. }
  12025. ret := &Operation{
  12026. ServerResponse: googleapi.ServerResponse{
  12027. Header: res.Header,
  12028. HTTPStatusCode: res.StatusCode,
  12029. },
  12030. }
  12031. target := &ret
  12032. if err := gensupport.DecodeResponse(target, res); err != nil {
  12033. return nil, err
  12034. }
  12035. return ret, nil
  12036. // {
  12037. // "description": "Deletes a node pool from a cluster.",
  12038. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  12039. // "httpMethod": "DELETE",
  12040. // "id": "container.projects.zones.clusters.nodePools.delete",
  12041. // "parameterOrder": [
  12042. // "projectId",
  12043. // "zone",
  12044. // "clusterId",
  12045. // "nodePoolId"
  12046. // ],
  12047. // "parameters": {
  12048. // "clusterId": {
  12049. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  12050. // "location": "path",
  12051. // "required": true,
  12052. // "type": "string"
  12053. // },
  12054. // "name": {
  12055. // "description": "The name (project, location, cluster, node pool id) of the node pool to\ndelete. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  12056. // "location": "query",
  12057. // "type": "string"
  12058. // },
  12059. // "nodePoolId": {
  12060. // "description": "Deprecated. The name of the node pool to delete.\nThis field has been deprecated and replaced by the name field.",
  12061. // "location": "path",
  12062. // "required": true,
  12063. // "type": "string"
  12064. // },
  12065. // "projectId": {
  12066. // "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.",
  12067. // "location": "path",
  12068. // "required": true,
  12069. // "type": "string"
  12070. // },
  12071. // "zone": {
  12072. // "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.",
  12073. // "location": "path",
  12074. // "required": true,
  12075. // "type": "string"
  12076. // }
  12077. // },
  12078. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  12079. // "response": {
  12080. // "$ref": "Operation"
  12081. // },
  12082. // "scopes": [
  12083. // "https://www.googleapis.com/auth/cloud-platform"
  12084. // ]
  12085. // }
  12086. }
  12087. // method id "container.projects.zones.clusters.nodePools.get":
  12088. type ProjectsZonesClustersNodePoolsGetCall struct {
  12089. s *Service
  12090. projectId string
  12091. zone string
  12092. clusterId string
  12093. nodePoolId string
  12094. urlParams_ gensupport.URLParams
  12095. ifNoneMatch_ string
  12096. ctx_ context.Context
  12097. header_ http.Header
  12098. }
  12099. // Get: Retrieves the node pool requested.
  12100. func (r *ProjectsZonesClustersNodePoolsService) Get(projectId string, zone string, clusterId string, nodePoolId string) *ProjectsZonesClustersNodePoolsGetCall {
  12101. c := &ProjectsZonesClustersNodePoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12102. c.projectId = projectId
  12103. c.zone = zone
  12104. c.clusterId = clusterId
  12105. c.nodePoolId = nodePoolId
  12106. return c
  12107. }
  12108. // Name sets the optional parameter "name": The name (project, location,
  12109. // cluster, node pool id) of the node pool to
  12110. // get. Specified in the
  12111. // format
  12112. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  12113. func (c *ProjectsZonesClustersNodePoolsGetCall) Name(name string) *ProjectsZonesClustersNodePoolsGetCall {
  12114. c.urlParams_.Set("name", name)
  12115. return c
  12116. }
  12117. // Fields allows partial responses to be retrieved. See
  12118. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12119. // for more information.
  12120. func (c *ProjectsZonesClustersNodePoolsGetCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsGetCall {
  12121. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12122. return c
  12123. }
  12124. // IfNoneMatch sets the optional parameter which makes the operation
  12125. // fail if the object's ETag matches the given value. This is useful for
  12126. // getting updates only after the object has changed since the last
  12127. // request. Use googleapi.IsNotModified to check whether the response
  12128. // error from Do is the result of In-None-Match.
  12129. func (c *ProjectsZonesClustersNodePoolsGetCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersNodePoolsGetCall {
  12130. c.ifNoneMatch_ = entityTag
  12131. return c
  12132. }
  12133. // Context sets the context to be used in this call's Do method. Any
  12134. // pending HTTP request will be aborted if the provided context is
  12135. // canceled.
  12136. func (c *ProjectsZonesClustersNodePoolsGetCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsGetCall {
  12137. c.ctx_ = ctx
  12138. return c
  12139. }
  12140. // Header returns an http.Header that can be modified by the caller to
  12141. // add HTTP headers to the request.
  12142. func (c *ProjectsZonesClustersNodePoolsGetCall) Header() http.Header {
  12143. if c.header_ == nil {
  12144. c.header_ = make(http.Header)
  12145. }
  12146. return c.header_
  12147. }
  12148. func (c *ProjectsZonesClustersNodePoolsGetCall) doRequest(alt string) (*http.Response, error) {
  12149. reqHeaders := make(http.Header)
  12150. for k, v := range c.header_ {
  12151. reqHeaders[k] = v
  12152. }
  12153. reqHeaders.Set("User-Agent", c.s.userAgent())
  12154. if c.ifNoneMatch_ != "" {
  12155. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12156. }
  12157. var body io.Reader = nil
  12158. c.urlParams_.Set("alt", alt)
  12159. c.urlParams_.Set("prettyPrint", "false")
  12160. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}")
  12161. urls += "?" + c.urlParams_.Encode()
  12162. req, err := http.NewRequest("GET", urls, body)
  12163. if err != nil {
  12164. return nil, err
  12165. }
  12166. req.Header = reqHeaders
  12167. googleapi.Expand(req.URL, map[string]string{
  12168. "projectId": c.projectId,
  12169. "zone": c.zone,
  12170. "clusterId": c.clusterId,
  12171. "nodePoolId": c.nodePoolId,
  12172. })
  12173. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12174. }
  12175. // Do executes the "container.projects.zones.clusters.nodePools.get" call.
  12176. // Exactly one of *NodePool or error will be non-nil. Any non-2xx status
  12177. // code is an error. Response headers are in either
  12178. // *NodePool.ServerResponse.Header or (if a response was returned at
  12179. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12180. // to check whether the returned error was because
  12181. // http.StatusNotModified was returned.
  12182. func (c *ProjectsZonesClustersNodePoolsGetCall) Do(opts ...googleapi.CallOption) (*NodePool, error) {
  12183. gensupport.SetOptions(c.urlParams_, opts...)
  12184. res, err := c.doRequest("json")
  12185. if res != nil && res.StatusCode == http.StatusNotModified {
  12186. if res.Body != nil {
  12187. res.Body.Close()
  12188. }
  12189. return nil, &googleapi.Error{
  12190. Code: res.StatusCode,
  12191. Header: res.Header,
  12192. }
  12193. }
  12194. if err != nil {
  12195. return nil, err
  12196. }
  12197. defer googleapi.CloseBody(res)
  12198. if err := googleapi.CheckResponse(res); err != nil {
  12199. return nil, err
  12200. }
  12201. ret := &NodePool{
  12202. ServerResponse: googleapi.ServerResponse{
  12203. Header: res.Header,
  12204. HTTPStatusCode: res.StatusCode,
  12205. },
  12206. }
  12207. target := &ret
  12208. if err := gensupport.DecodeResponse(target, res); err != nil {
  12209. return nil, err
  12210. }
  12211. return ret, nil
  12212. // {
  12213. // "description": "Retrieves the node pool requested.",
  12214. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  12215. // "httpMethod": "GET",
  12216. // "id": "container.projects.zones.clusters.nodePools.get",
  12217. // "parameterOrder": [
  12218. // "projectId",
  12219. // "zone",
  12220. // "clusterId",
  12221. // "nodePoolId"
  12222. // ],
  12223. // "parameters": {
  12224. // "clusterId": {
  12225. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  12226. // "location": "path",
  12227. // "required": true,
  12228. // "type": "string"
  12229. // },
  12230. // "name": {
  12231. // "description": "The name (project, location, cluster, node pool id) of the node pool to\nget. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  12232. // "location": "query",
  12233. // "type": "string"
  12234. // },
  12235. // "nodePoolId": {
  12236. // "description": "Deprecated. The name of the node pool.\nThis field has been deprecated and replaced by the name field.",
  12237. // "location": "path",
  12238. // "required": true,
  12239. // "type": "string"
  12240. // },
  12241. // "projectId": {
  12242. // "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.",
  12243. // "location": "path",
  12244. // "required": true,
  12245. // "type": "string"
  12246. // },
  12247. // "zone": {
  12248. // "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.",
  12249. // "location": "path",
  12250. // "required": true,
  12251. // "type": "string"
  12252. // }
  12253. // },
  12254. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  12255. // "response": {
  12256. // "$ref": "NodePool"
  12257. // },
  12258. // "scopes": [
  12259. // "https://www.googleapis.com/auth/cloud-platform"
  12260. // ]
  12261. // }
  12262. }
  12263. // method id "container.projects.zones.clusters.nodePools.list":
  12264. type ProjectsZonesClustersNodePoolsListCall struct {
  12265. s *Service
  12266. projectId string
  12267. zone string
  12268. clusterId string
  12269. urlParams_ gensupport.URLParams
  12270. ifNoneMatch_ string
  12271. ctx_ context.Context
  12272. header_ http.Header
  12273. }
  12274. // List: Lists the node pools for a cluster.
  12275. func (r *ProjectsZonesClustersNodePoolsService) List(projectId string, zone string, clusterId string) *ProjectsZonesClustersNodePoolsListCall {
  12276. c := &ProjectsZonesClustersNodePoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12277. c.projectId = projectId
  12278. c.zone = zone
  12279. c.clusterId = clusterId
  12280. return c
  12281. }
  12282. // Parent sets the optional parameter "parent": The parent (project,
  12283. // location, cluster id) where the node pools will be
  12284. // listed. Specified in the format 'projects/*/locations/*/clusters/*'.
  12285. func (c *ProjectsZonesClustersNodePoolsListCall) Parent(parent string) *ProjectsZonesClustersNodePoolsListCall {
  12286. c.urlParams_.Set("parent", parent)
  12287. return c
  12288. }
  12289. // Fields allows partial responses to be retrieved. See
  12290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12291. // for more information.
  12292. func (c *ProjectsZonesClustersNodePoolsListCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsListCall {
  12293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12294. return c
  12295. }
  12296. // IfNoneMatch sets the optional parameter which makes the operation
  12297. // fail if the object's ETag matches the given value. This is useful for
  12298. // getting updates only after the object has changed since the last
  12299. // request. Use googleapi.IsNotModified to check whether the response
  12300. // error from Do is the result of In-None-Match.
  12301. func (c *ProjectsZonesClustersNodePoolsListCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersNodePoolsListCall {
  12302. c.ifNoneMatch_ = entityTag
  12303. return c
  12304. }
  12305. // Context sets the context to be used in this call's Do method. Any
  12306. // pending HTTP request will be aborted if the provided context is
  12307. // canceled.
  12308. func (c *ProjectsZonesClustersNodePoolsListCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsListCall {
  12309. c.ctx_ = ctx
  12310. return c
  12311. }
  12312. // Header returns an http.Header that can be modified by the caller to
  12313. // add HTTP headers to the request.
  12314. func (c *ProjectsZonesClustersNodePoolsListCall) Header() http.Header {
  12315. if c.header_ == nil {
  12316. c.header_ = make(http.Header)
  12317. }
  12318. return c.header_
  12319. }
  12320. func (c *ProjectsZonesClustersNodePoolsListCall) doRequest(alt string) (*http.Response, error) {
  12321. reqHeaders := make(http.Header)
  12322. for k, v := range c.header_ {
  12323. reqHeaders[k] = v
  12324. }
  12325. reqHeaders.Set("User-Agent", c.s.userAgent())
  12326. if c.ifNoneMatch_ != "" {
  12327. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12328. }
  12329. var body io.Reader = nil
  12330. c.urlParams_.Set("alt", alt)
  12331. c.urlParams_.Set("prettyPrint", "false")
  12332. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools")
  12333. urls += "?" + c.urlParams_.Encode()
  12334. req, err := http.NewRequest("GET", urls, body)
  12335. if err != nil {
  12336. return nil, err
  12337. }
  12338. req.Header = reqHeaders
  12339. googleapi.Expand(req.URL, map[string]string{
  12340. "projectId": c.projectId,
  12341. "zone": c.zone,
  12342. "clusterId": c.clusterId,
  12343. })
  12344. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12345. }
  12346. // Do executes the "container.projects.zones.clusters.nodePools.list" call.
  12347. // Exactly one of *ListNodePoolsResponse or error will be non-nil. Any
  12348. // non-2xx status code is an error. Response headers are in either
  12349. // *ListNodePoolsResponse.ServerResponse.Header or (if a response was
  12350. // returned at all) in error.(*googleapi.Error).Header. Use
  12351. // googleapi.IsNotModified to check whether the returned error was
  12352. // because http.StatusNotModified was returned.
  12353. func (c *ProjectsZonesClustersNodePoolsListCall) Do(opts ...googleapi.CallOption) (*ListNodePoolsResponse, error) {
  12354. gensupport.SetOptions(c.urlParams_, opts...)
  12355. res, err := c.doRequest("json")
  12356. if res != nil && res.StatusCode == http.StatusNotModified {
  12357. if res.Body != nil {
  12358. res.Body.Close()
  12359. }
  12360. return nil, &googleapi.Error{
  12361. Code: res.StatusCode,
  12362. Header: res.Header,
  12363. }
  12364. }
  12365. if err != nil {
  12366. return nil, err
  12367. }
  12368. defer googleapi.CloseBody(res)
  12369. if err := googleapi.CheckResponse(res); err != nil {
  12370. return nil, err
  12371. }
  12372. ret := &ListNodePoolsResponse{
  12373. ServerResponse: googleapi.ServerResponse{
  12374. Header: res.Header,
  12375. HTTPStatusCode: res.StatusCode,
  12376. },
  12377. }
  12378. target := &ret
  12379. if err := gensupport.DecodeResponse(target, res); err != nil {
  12380. return nil, err
  12381. }
  12382. return ret, nil
  12383. // {
  12384. // "description": "Lists the node pools for a cluster.",
  12385. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  12386. // "httpMethod": "GET",
  12387. // "id": "container.projects.zones.clusters.nodePools.list",
  12388. // "parameterOrder": [
  12389. // "projectId",
  12390. // "zone",
  12391. // "clusterId"
  12392. // ],
  12393. // "parameters": {
  12394. // "clusterId": {
  12395. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the parent field.",
  12396. // "location": "path",
  12397. // "required": true,
  12398. // "type": "string"
  12399. // },
  12400. // "parent": {
  12401. // "description": "The parent (project, location, cluster id) where the node pools will be\nlisted. Specified in the format 'projects/*/locations/*/clusters/*'.",
  12402. // "location": "query",
  12403. // "type": "string"
  12404. // },
  12405. // "projectId": {
  12406. // "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.",
  12407. // "location": "path",
  12408. // "required": true,
  12409. // "type": "string"
  12410. // },
  12411. // "zone": {
  12412. // "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.",
  12413. // "location": "path",
  12414. // "required": true,
  12415. // "type": "string"
  12416. // }
  12417. // },
  12418. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  12419. // "response": {
  12420. // "$ref": "ListNodePoolsResponse"
  12421. // },
  12422. // "scopes": [
  12423. // "https://www.googleapis.com/auth/cloud-platform"
  12424. // ]
  12425. // }
  12426. }
  12427. // method id "container.projects.zones.clusters.nodePools.rollback":
  12428. type ProjectsZonesClustersNodePoolsRollbackCall struct {
  12429. s *Service
  12430. projectId string
  12431. zone string
  12432. clusterId string
  12433. nodePoolId string
  12434. rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest
  12435. urlParams_ gensupport.URLParams
  12436. ctx_ context.Context
  12437. header_ http.Header
  12438. }
  12439. // Rollback: Roll back the previously Aborted or Failed NodePool
  12440. // upgrade.
  12441. // This will be an no-op if the last upgrade successfully completed.
  12442. func (r *ProjectsZonesClustersNodePoolsService) Rollback(projectId string, zone string, clusterId string, nodePoolId string, rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest) *ProjectsZonesClustersNodePoolsRollbackCall {
  12443. c := &ProjectsZonesClustersNodePoolsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12444. c.projectId = projectId
  12445. c.zone = zone
  12446. c.clusterId = clusterId
  12447. c.nodePoolId = nodePoolId
  12448. c.rollbacknodepoolupgraderequest = rollbacknodepoolupgraderequest
  12449. return c
  12450. }
  12451. // Fields allows partial responses to be retrieved. See
  12452. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12453. // for more information.
  12454. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsRollbackCall {
  12455. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12456. return c
  12457. }
  12458. // Context sets the context to be used in this call's Do method. Any
  12459. // pending HTTP request will be aborted if the provided context is
  12460. // canceled.
  12461. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsRollbackCall {
  12462. c.ctx_ = ctx
  12463. return c
  12464. }
  12465. // Header returns an http.Header that can be modified by the caller to
  12466. // add HTTP headers to the request.
  12467. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Header() http.Header {
  12468. if c.header_ == nil {
  12469. c.header_ = make(http.Header)
  12470. }
  12471. return c.header_
  12472. }
  12473. func (c *ProjectsZonesClustersNodePoolsRollbackCall) doRequest(alt string) (*http.Response, error) {
  12474. reqHeaders := make(http.Header)
  12475. for k, v := range c.header_ {
  12476. reqHeaders[k] = v
  12477. }
  12478. reqHeaders.Set("User-Agent", c.s.userAgent())
  12479. var body io.Reader = nil
  12480. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbacknodepoolupgraderequest)
  12481. if err != nil {
  12482. return nil, err
  12483. }
  12484. reqHeaders.Set("Content-Type", "application/json")
  12485. c.urlParams_.Set("alt", alt)
  12486. c.urlParams_.Set("prettyPrint", "false")
  12487. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback")
  12488. urls += "?" + c.urlParams_.Encode()
  12489. req, err := http.NewRequest("POST", urls, body)
  12490. if err != nil {
  12491. return nil, err
  12492. }
  12493. req.Header = reqHeaders
  12494. googleapi.Expand(req.URL, map[string]string{
  12495. "projectId": c.projectId,
  12496. "zone": c.zone,
  12497. "clusterId": c.clusterId,
  12498. "nodePoolId": c.nodePoolId,
  12499. })
  12500. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12501. }
  12502. // Do executes the "container.projects.zones.clusters.nodePools.rollback" call.
  12503. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12504. // status code is an error. Response headers are in either
  12505. // *Operation.ServerResponse.Header or (if a response was returned at
  12506. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12507. // to check whether the returned error was because
  12508. // http.StatusNotModified was returned.
  12509. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12510. gensupport.SetOptions(c.urlParams_, opts...)
  12511. res, err := c.doRequest("json")
  12512. if res != nil && res.StatusCode == http.StatusNotModified {
  12513. if res.Body != nil {
  12514. res.Body.Close()
  12515. }
  12516. return nil, &googleapi.Error{
  12517. Code: res.StatusCode,
  12518. Header: res.Header,
  12519. }
  12520. }
  12521. if err != nil {
  12522. return nil, err
  12523. }
  12524. defer googleapi.CloseBody(res)
  12525. if err := googleapi.CheckResponse(res); err != nil {
  12526. return nil, err
  12527. }
  12528. ret := &Operation{
  12529. ServerResponse: googleapi.ServerResponse{
  12530. Header: res.Header,
  12531. HTTPStatusCode: res.StatusCode,
  12532. },
  12533. }
  12534. target := &ret
  12535. if err := gensupport.DecodeResponse(target, res); err != nil {
  12536. return nil, err
  12537. }
  12538. return ret, nil
  12539. // {
  12540. // "description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed.",
  12541. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback",
  12542. // "httpMethod": "POST",
  12543. // "id": "container.projects.zones.clusters.nodePools.rollback",
  12544. // "parameterOrder": [
  12545. // "projectId",
  12546. // "zone",
  12547. // "clusterId",
  12548. // "nodePoolId"
  12549. // ],
  12550. // "parameters": {
  12551. // "clusterId": {
  12552. // "description": "Deprecated. The name of the cluster to rollback.\nThis field has been deprecated and replaced by the name field.",
  12553. // "location": "path",
  12554. // "required": true,
  12555. // "type": "string"
  12556. // },
  12557. // "nodePoolId": {
  12558. // "description": "Deprecated. The name of the node pool to rollback.\nThis field has been deprecated and replaced by the name field.",
  12559. // "location": "path",
  12560. // "required": true,
  12561. // "type": "string"
  12562. // },
  12563. // "projectId": {
  12564. // "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.",
  12565. // "location": "path",
  12566. // "required": true,
  12567. // "type": "string"
  12568. // },
  12569. // "zone": {
  12570. // "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.",
  12571. // "location": "path",
  12572. // "required": true,
  12573. // "type": "string"
  12574. // }
  12575. // },
  12576. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback",
  12577. // "request": {
  12578. // "$ref": "RollbackNodePoolUpgradeRequest"
  12579. // },
  12580. // "response": {
  12581. // "$ref": "Operation"
  12582. // },
  12583. // "scopes": [
  12584. // "https://www.googleapis.com/auth/cloud-platform"
  12585. // ]
  12586. // }
  12587. }
  12588. // method id "container.projects.zones.clusters.nodePools.setManagement":
  12589. type ProjectsZonesClustersNodePoolsSetManagementCall struct {
  12590. s *Service
  12591. projectId string
  12592. zone string
  12593. clusterId string
  12594. nodePoolId string
  12595. setnodepoolmanagementrequest *SetNodePoolManagementRequest
  12596. urlParams_ gensupport.URLParams
  12597. ctx_ context.Context
  12598. header_ http.Header
  12599. }
  12600. // SetManagement: Sets the NodeManagement options for a node pool.
  12601. func (r *ProjectsZonesClustersNodePoolsService) SetManagement(projectId string, zone string, clusterId string, nodePoolId string, setnodepoolmanagementrequest *SetNodePoolManagementRequest) *ProjectsZonesClustersNodePoolsSetManagementCall {
  12602. c := &ProjectsZonesClustersNodePoolsSetManagementCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12603. c.projectId = projectId
  12604. c.zone = zone
  12605. c.clusterId = clusterId
  12606. c.nodePoolId = nodePoolId
  12607. c.setnodepoolmanagementrequest = setnodepoolmanagementrequest
  12608. return c
  12609. }
  12610. // Fields allows partial responses to be retrieved. See
  12611. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12612. // for more information.
  12613. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsSetManagementCall {
  12614. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12615. return c
  12616. }
  12617. // Context sets the context to be used in this call's Do method. Any
  12618. // pending HTTP request will be aborted if the provided context is
  12619. // canceled.
  12620. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsSetManagementCall {
  12621. c.ctx_ = ctx
  12622. return c
  12623. }
  12624. // Header returns an http.Header that can be modified by the caller to
  12625. // add HTTP headers to the request.
  12626. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Header() http.Header {
  12627. if c.header_ == nil {
  12628. c.header_ = make(http.Header)
  12629. }
  12630. return c.header_
  12631. }
  12632. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) doRequest(alt string) (*http.Response, error) {
  12633. reqHeaders := make(http.Header)
  12634. for k, v := range c.header_ {
  12635. reqHeaders[k] = v
  12636. }
  12637. reqHeaders.Set("User-Agent", c.s.userAgent())
  12638. var body io.Reader = nil
  12639. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolmanagementrequest)
  12640. if err != nil {
  12641. return nil, err
  12642. }
  12643. reqHeaders.Set("Content-Type", "application/json")
  12644. c.urlParams_.Set("alt", alt)
  12645. c.urlParams_.Set("prettyPrint", "false")
  12646. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement")
  12647. urls += "?" + c.urlParams_.Encode()
  12648. req, err := http.NewRequest("POST", urls, body)
  12649. if err != nil {
  12650. return nil, err
  12651. }
  12652. req.Header = reqHeaders
  12653. googleapi.Expand(req.URL, map[string]string{
  12654. "projectId": c.projectId,
  12655. "zone": c.zone,
  12656. "clusterId": c.clusterId,
  12657. "nodePoolId": c.nodePoolId,
  12658. })
  12659. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12660. }
  12661. // Do executes the "container.projects.zones.clusters.nodePools.setManagement" call.
  12662. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12663. // status code is an error. Response headers are in either
  12664. // *Operation.ServerResponse.Header or (if a response was returned at
  12665. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12666. // to check whether the returned error was because
  12667. // http.StatusNotModified was returned.
  12668. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12669. gensupport.SetOptions(c.urlParams_, opts...)
  12670. res, err := c.doRequest("json")
  12671. if res != nil && res.StatusCode == http.StatusNotModified {
  12672. if res.Body != nil {
  12673. res.Body.Close()
  12674. }
  12675. return nil, &googleapi.Error{
  12676. Code: res.StatusCode,
  12677. Header: res.Header,
  12678. }
  12679. }
  12680. if err != nil {
  12681. return nil, err
  12682. }
  12683. defer googleapi.CloseBody(res)
  12684. if err := googleapi.CheckResponse(res); err != nil {
  12685. return nil, err
  12686. }
  12687. ret := &Operation{
  12688. ServerResponse: googleapi.ServerResponse{
  12689. Header: res.Header,
  12690. HTTPStatusCode: res.StatusCode,
  12691. },
  12692. }
  12693. target := &ret
  12694. if err := gensupport.DecodeResponse(target, res); err != nil {
  12695. return nil, err
  12696. }
  12697. return ret, nil
  12698. // {
  12699. // "description": "Sets the NodeManagement options for a node pool.",
  12700. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement",
  12701. // "httpMethod": "POST",
  12702. // "id": "container.projects.zones.clusters.nodePools.setManagement",
  12703. // "parameterOrder": [
  12704. // "projectId",
  12705. // "zone",
  12706. // "clusterId",
  12707. // "nodePoolId"
  12708. // ],
  12709. // "parameters": {
  12710. // "clusterId": {
  12711. // "description": "Deprecated. The name of the cluster to update.\nThis field has been deprecated and replaced by the name field.",
  12712. // "location": "path",
  12713. // "required": true,
  12714. // "type": "string"
  12715. // },
  12716. // "nodePoolId": {
  12717. // "description": "Deprecated. The name of the node pool to update.\nThis field has been deprecated and replaced by the name field.",
  12718. // "location": "path",
  12719. // "required": true,
  12720. // "type": "string"
  12721. // },
  12722. // "projectId": {
  12723. // "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.",
  12724. // "location": "path",
  12725. // "required": true,
  12726. // "type": "string"
  12727. // },
  12728. // "zone": {
  12729. // "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.",
  12730. // "location": "path",
  12731. // "required": true,
  12732. // "type": "string"
  12733. // }
  12734. // },
  12735. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement",
  12736. // "request": {
  12737. // "$ref": "SetNodePoolManagementRequest"
  12738. // },
  12739. // "response": {
  12740. // "$ref": "Operation"
  12741. // },
  12742. // "scopes": [
  12743. // "https://www.googleapis.com/auth/cloud-platform"
  12744. // ]
  12745. // }
  12746. }
  12747. // method id "container.projects.zones.clusters.nodePools.setSize":
  12748. type ProjectsZonesClustersNodePoolsSetSizeCall struct {
  12749. s *Service
  12750. projectId string
  12751. zone string
  12752. clusterId string
  12753. nodePoolId string
  12754. setnodepoolsizerequest *SetNodePoolSizeRequest
  12755. urlParams_ gensupport.URLParams
  12756. ctx_ context.Context
  12757. header_ http.Header
  12758. }
  12759. // SetSize: Sets the size for a specific node pool.
  12760. func (r *ProjectsZonesClustersNodePoolsService) SetSize(projectId string, zone string, clusterId string, nodePoolId string, setnodepoolsizerequest *SetNodePoolSizeRequest) *ProjectsZonesClustersNodePoolsSetSizeCall {
  12761. c := &ProjectsZonesClustersNodePoolsSetSizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12762. c.projectId = projectId
  12763. c.zone = zone
  12764. c.clusterId = clusterId
  12765. c.nodePoolId = nodePoolId
  12766. c.setnodepoolsizerequest = setnodepoolsizerequest
  12767. return c
  12768. }
  12769. // Fields allows partial responses to be retrieved. See
  12770. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12771. // for more information.
  12772. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsSetSizeCall {
  12773. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12774. return c
  12775. }
  12776. // Context sets the context to be used in this call's Do method. Any
  12777. // pending HTTP request will be aborted if the provided context is
  12778. // canceled.
  12779. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsSetSizeCall {
  12780. c.ctx_ = ctx
  12781. return c
  12782. }
  12783. // Header returns an http.Header that can be modified by the caller to
  12784. // add HTTP headers to the request.
  12785. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Header() http.Header {
  12786. if c.header_ == nil {
  12787. c.header_ = make(http.Header)
  12788. }
  12789. return c.header_
  12790. }
  12791. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) doRequest(alt string) (*http.Response, error) {
  12792. reqHeaders := make(http.Header)
  12793. for k, v := range c.header_ {
  12794. reqHeaders[k] = v
  12795. }
  12796. reqHeaders.Set("User-Agent", c.s.userAgent())
  12797. var body io.Reader = nil
  12798. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolsizerequest)
  12799. if err != nil {
  12800. return nil, err
  12801. }
  12802. reqHeaders.Set("Content-Type", "application/json")
  12803. c.urlParams_.Set("alt", alt)
  12804. c.urlParams_.Set("prettyPrint", "false")
  12805. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize")
  12806. urls += "?" + c.urlParams_.Encode()
  12807. req, err := http.NewRequest("POST", urls, body)
  12808. if err != nil {
  12809. return nil, err
  12810. }
  12811. req.Header = reqHeaders
  12812. googleapi.Expand(req.URL, map[string]string{
  12813. "projectId": c.projectId,
  12814. "zone": c.zone,
  12815. "clusterId": c.clusterId,
  12816. "nodePoolId": c.nodePoolId,
  12817. })
  12818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12819. }
  12820. // Do executes the "container.projects.zones.clusters.nodePools.setSize" call.
  12821. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12822. // status code is an error. Response headers are in either
  12823. // *Operation.ServerResponse.Header or (if a response was returned at
  12824. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12825. // to check whether the returned error was because
  12826. // http.StatusNotModified was returned.
  12827. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12828. gensupport.SetOptions(c.urlParams_, opts...)
  12829. res, err := c.doRequest("json")
  12830. if res != nil && res.StatusCode == http.StatusNotModified {
  12831. if res.Body != nil {
  12832. res.Body.Close()
  12833. }
  12834. return nil, &googleapi.Error{
  12835. Code: res.StatusCode,
  12836. Header: res.Header,
  12837. }
  12838. }
  12839. if err != nil {
  12840. return nil, err
  12841. }
  12842. defer googleapi.CloseBody(res)
  12843. if err := googleapi.CheckResponse(res); err != nil {
  12844. return nil, err
  12845. }
  12846. ret := &Operation{
  12847. ServerResponse: googleapi.ServerResponse{
  12848. Header: res.Header,
  12849. HTTPStatusCode: res.StatusCode,
  12850. },
  12851. }
  12852. target := &ret
  12853. if err := gensupport.DecodeResponse(target, res); err != nil {
  12854. return nil, err
  12855. }
  12856. return ret, nil
  12857. // {
  12858. // "description": "Sets the size for a specific node pool.",
  12859. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize",
  12860. // "httpMethod": "POST",
  12861. // "id": "container.projects.zones.clusters.nodePools.setSize",
  12862. // "parameterOrder": [
  12863. // "projectId",
  12864. // "zone",
  12865. // "clusterId",
  12866. // "nodePoolId"
  12867. // ],
  12868. // "parameters": {
  12869. // "clusterId": {
  12870. // "description": "Deprecated. The name of the cluster to update.\nThis field has been deprecated and replaced by the name field.",
  12871. // "location": "path",
  12872. // "required": true,
  12873. // "type": "string"
  12874. // },
  12875. // "nodePoolId": {
  12876. // "description": "Deprecated. The name of the node pool to update.\nThis field has been deprecated and replaced by the name field.",
  12877. // "location": "path",
  12878. // "required": true,
  12879. // "type": "string"
  12880. // },
  12881. // "projectId": {
  12882. // "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.",
  12883. // "location": "path",
  12884. // "required": true,
  12885. // "type": "string"
  12886. // },
  12887. // "zone": {
  12888. // "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.",
  12889. // "location": "path",
  12890. // "required": true,
  12891. // "type": "string"
  12892. // }
  12893. // },
  12894. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize",
  12895. // "request": {
  12896. // "$ref": "SetNodePoolSizeRequest"
  12897. // },
  12898. // "response": {
  12899. // "$ref": "Operation"
  12900. // },
  12901. // "scopes": [
  12902. // "https://www.googleapis.com/auth/cloud-platform"
  12903. // ]
  12904. // }
  12905. }
  12906. // method id "container.projects.zones.clusters.nodePools.update":
  12907. type ProjectsZonesClustersNodePoolsUpdateCall struct {
  12908. s *Service
  12909. projectId string
  12910. zone string
  12911. clusterId string
  12912. nodePoolId string
  12913. updatenodepoolrequest *UpdateNodePoolRequest
  12914. urlParams_ gensupport.URLParams
  12915. ctx_ context.Context
  12916. header_ http.Header
  12917. }
  12918. // Update: Updates the version and/or image type of a specific node
  12919. // pool.
  12920. func (r *ProjectsZonesClustersNodePoolsService) Update(projectId string, zone string, clusterId string, nodePoolId string, updatenodepoolrequest *UpdateNodePoolRequest) *ProjectsZonesClustersNodePoolsUpdateCall {
  12921. c := &ProjectsZonesClustersNodePoolsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12922. c.projectId = projectId
  12923. c.zone = zone
  12924. c.clusterId = clusterId
  12925. c.nodePoolId = nodePoolId
  12926. c.updatenodepoolrequest = updatenodepoolrequest
  12927. return c
  12928. }
  12929. // Fields allows partial responses to be retrieved. See
  12930. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12931. // for more information.
  12932. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsUpdateCall {
  12933. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12934. return c
  12935. }
  12936. // Context sets the context to be used in this call's Do method. Any
  12937. // pending HTTP request will be aborted if the provided context is
  12938. // canceled.
  12939. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsUpdateCall {
  12940. c.ctx_ = ctx
  12941. return c
  12942. }
  12943. // Header returns an http.Header that can be modified by the caller to
  12944. // add HTTP headers to the request.
  12945. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Header() http.Header {
  12946. if c.header_ == nil {
  12947. c.header_ = make(http.Header)
  12948. }
  12949. return c.header_
  12950. }
  12951. func (c *ProjectsZonesClustersNodePoolsUpdateCall) doRequest(alt string) (*http.Response, error) {
  12952. reqHeaders := make(http.Header)
  12953. for k, v := range c.header_ {
  12954. reqHeaders[k] = v
  12955. }
  12956. reqHeaders.Set("User-Agent", c.s.userAgent())
  12957. var body io.Reader = nil
  12958. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatenodepoolrequest)
  12959. if err != nil {
  12960. return nil, err
  12961. }
  12962. reqHeaders.Set("Content-Type", "application/json")
  12963. c.urlParams_.Set("alt", alt)
  12964. c.urlParams_.Set("prettyPrint", "false")
  12965. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update")
  12966. urls += "?" + c.urlParams_.Encode()
  12967. req, err := http.NewRequest("POST", urls, body)
  12968. if err != nil {
  12969. return nil, err
  12970. }
  12971. req.Header = reqHeaders
  12972. googleapi.Expand(req.URL, map[string]string{
  12973. "projectId": c.projectId,
  12974. "zone": c.zone,
  12975. "clusterId": c.clusterId,
  12976. "nodePoolId": c.nodePoolId,
  12977. })
  12978. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12979. }
  12980. // Do executes the "container.projects.zones.clusters.nodePools.update" call.
  12981. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12982. // status code is an error. Response headers are in either
  12983. // *Operation.ServerResponse.Header or (if a response was returned at
  12984. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12985. // to check whether the returned error was because
  12986. // http.StatusNotModified was returned.
  12987. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12988. gensupport.SetOptions(c.urlParams_, opts...)
  12989. res, err := c.doRequest("json")
  12990. if res != nil && res.StatusCode == http.StatusNotModified {
  12991. if res.Body != nil {
  12992. res.Body.Close()
  12993. }
  12994. return nil, &googleapi.Error{
  12995. Code: res.StatusCode,
  12996. Header: res.Header,
  12997. }
  12998. }
  12999. if err != nil {
  13000. return nil, err
  13001. }
  13002. defer googleapi.CloseBody(res)
  13003. if err := googleapi.CheckResponse(res); err != nil {
  13004. return nil, err
  13005. }
  13006. ret := &Operation{
  13007. ServerResponse: googleapi.ServerResponse{
  13008. Header: res.Header,
  13009. HTTPStatusCode: res.StatusCode,
  13010. },
  13011. }
  13012. target := &ret
  13013. if err := gensupport.DecodeResponse(target, res); err != nil {
  13014. return nil, err
  13015. }
  13016. return ret, nil
  13017. // {
  13018. // "description": "Updates the version and/or image type of a specific node pool.",
  13019. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update",
  13020. // "httpMethod": "POST",
  13021. // "id": "container.projects.zones.clusters.nodePools.update",
  13022. // "parameterOrder": [
  13023. // "projectId",
  13024. // "zone",
  13025. // "clusterId",
  13026. // "nodePoolId"
  13027. // ],
  13028. // "parameters": {
  13029. // "clusterId": {
  13030. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  13031. // "location": "path",
  13032. // "required": true,
  13033. // "type": "string"
  13034. // },
  13035. // "nodePoolId": {
  13036. // "description": "Deprecated. The name of the node pool to upgrade.\nThis field has been deprecated and replaced by the name field.",
  13037. // "location": "path",
  13038. // "required": true,
  13039. // "type": "string"
  13040. // },
  13041. // "projectId": {
  13042. // "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.",
  13043. // "location": "path",
  13044. // "required": true,
  13045. // "type": "string"
  13046. // },
  13047. // "zone": {
  13048. // "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.",
  13049. // "location": "path",
  13050. // "required": true,
  13051. // "type": "string"
  13052. // }
  13053. // },
  13054. // "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update",
  13055. // "request": {
  13056. // "$ref": "UpdateNodePoolRequest"
  13057. // },
  13058. // "response": {
  13059. // "$ref": "Operation"
  13060. // },
  13061. // "scopes": [
  13062. // "https://www.googleapis.com/auth/cloud-platform"
  13063. // ]
  13064. // }
  13065. }
  13066. // method id "container.projects.zones.operations.cancel":
  13067. type ProjectsZonesOperationsCancelCall struct {
  13068. s *Service
  13069. projectId string
  13070. zone string
  13071. operationId string
  13072. canceloperationrequest *CancelOperationRequest
  13073. urlParams_ gensupport.URLParams
  13074. ctx_ context.Context
  13075. header_ http.Header
  13076. }
  13077. // Cancel: Cancels the specified operation.
  13078. func (r *ProjectsZonesOperationsService) Cancel(projectId string, zone string, operationId string, canceloperationrequest *CancelOperationRequest) *ProjectsZonesOperationsCancelCall {
  13079. c := &ProjectsZonesOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13080. c.projectId = projectId
  13081. c.zone = zone
  13082. c.operationId = operationId
  13083. c.canceloperationrequest = canceloperationrequest
  13084. return c
  13085. }
  13086. // Fields allows partial responses to be retrieved. See
  13087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13088. // for more information.
  13089. func (c *ProjectsZonesOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsCancelCall {
  13090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13091. return c
  13092. }
  13093. // Context sets the context to be used in this call's Do method. Any
  13094. // pending HTTP request will be aborted if the provided context is
  13095. // canceled.
  13096. func (c *ProjectsZonesOperationsCancelCall) Context(ctx context.Context) *ProjectsZonesOperationsCancelCall {
  13097. c.ctx_ = ctx
  13098. return c
  13099. }
  13100. // Header returns an http.Header that can be modified by the caller to
  13101. // add HTTP headers to the request.
  13102. func (c *ProjectsZonesOperationsCancelCall) Header() http.Header {
  13103. if c.header_ == nil {
  13104. c.header_ = make(http.Header)
  13105. }
  13106. return c.header_
  13107. }
  13108. func (c *ProjectsZonesOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  13109. reqHeaders := make(http.Header)
  13110. for k, v := range c.header_ {
  13111. reqHeaders[k] = v
  13112. }
  13113. reqHeaders.Set("User-Agent", c.s.userAgent())
  13114. var body io.Reader = nil
  13115. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  13116. if err != nil {
  13117. return nil, err
  13118. }
  13119. reqHeaders.Set("Content-Type", "application/json")
  13120. c.urlParams_.Set("alt", alt)
  13121. c.urlParams_.Set("prettyPrint", "false")
  13122. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel")
  13123. urls += "?" + c.urlParams_.Encode()
  13124. req, err := http.NewRequest("POST", urls, body)
  13125. if err != nil {
  13126. return nil, err
  13127. }
  13128. req.Header = reqHeaders
  13129. googleapi.Expand(req.URL, map[string]string{
  13130. "projectId": c.projectId,
  13131. "zone": c.zone,
  13132. "operationId": c.operationId,
  13133. })
  13134. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13135. }
  13136. // Do executes the "container.projects.zones.operations.cancel" call.
  13137. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  13138. // code is an error. Response headers are in either
  13139. // *Empty.ServerResponse.Header or (if a response was returned at all)
  13140. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13141. // check whether the returned error was because http.StatusNotModified
  13142. // was returned.
  13143. func (c *ProjectsZonesOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  13144. gensupport.SetOptions(c.urlParams_, opts...)
  13145. res, err := c.doRequest("json")
  13146. if res != nil && res.StatusCode == http.StatusNotModified {
  13147. if res.Body != nil {
  13148. res.Body.Close()
  13149. }
  13150. return nil, &googleapi.Error{
  13151. Code: res.StatusCode,
  13152. Header: res.Header,
  13153. }
  13154. }
  13155. if err != nil {
  13156. return nil, err
  13157. }
  13158. defer googleapi.CloseBody(res)
  13159. if err := googleapi.CheckResponse(res); err != nil {
  13160. return nil, err
  13161. }
  13162. ret := &Empty{
  13163. ServerResponse: googleapi.ServerResponse{
  13164. Header: res.Header,
  13165. HTTPStatusCode: res.StatusCode,
  13166. },
  13167. }
  13168. target := &ret
  13169. if err := gensupport.DecodeResponse(target, res); err != nil {
  13170. return nil, err
  13171. }
  13172. return ret, nil
  13173. // {
  13174. // "description": "Cancels the specified operation.",
  13175. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel",
  13176. // "httpMethod": "POST",
  13177. // "id": "container.projects.zones.operations.cancel",
  13178. // "parameterOrder": [
  13179. // "projectId",
  13180. // "zone",
  13181. // "operationId"
  13182. // ],
  13183. // "parameters": {
  13184. // "operationId": {
  13185. // "description": "Deprecated. The server-assigned `name` of the operation.\nThis field has been deprecated and replaced by the name field.",
  13186. // "location": "path",
  13187. // "required": true,
  13188. // "type": "string"
  13189. // },
  13190. // "projectId": {
  13191. // "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.",
  13192. // "location": "path",
  13193. // "required": true,
  13194. // "type": "string"
  13195. // },
  13196. // "zone": {
  13197. // "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.",
  13198. // "location": "path",
  13199. // "required": true,
  13200. // "type": "string"
  13201. // }
  13202. // },
  13203. // "path": "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel",
  13204. // "request": {
  13205. // "$ref": "CancelOperationRequest"
  13206. // },
  13207. // "response": {
  13208. // "$ref": "Empty"
  13209. // },
  13210. // "scopes": [
  13211. // "https://www.googleapis.com/auth/cloud-platform"
  13212. // ]
  13213. // }
  13214. }
  13215. // method id "container.projects.zones.operations.get":
  13216. type ProjectsZonesOperationsGetCall struct {
  13217. s *Service
  13218. projectId string
  13219. zone string
  13220. operationId string
  13221. urlParams_ gensupport.URLParams
  13222. ifNoneMatch_ string
  13223. ctx_ context.Context
  13224. header_ http.Header
  13225. }
  13226. // Get: Gets the specified operation.
  13227. func (r *ProjectsZonesOperationsService) Get(projectId string, zone string, operationId string) *ProjectsZonesOperationsGetCall {
  13228. c := &ProjectsZonesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13229. c.projectId = projectId
  13230. c.zone = zone
  13231. c.operationId = operationId
  13232. return c
  13233. }
  13234. // Name sets the optional parameter "name": The name (project, location,
  13235. // operation id) of the operation to get.
  13236. // Specified in the format 'projects/*/locations/*/operations/*'.
  13237. func (c *ProjectsZonesOperationsGetCall) Name(name string) *ProjectsZonesOperationsGetCall {
  13238. c.urlParams_.Set("name", name)
  13239. return c
  13240. }
  13241. // Fields allows partial responses to be retrieved. See
  13242. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13243. // for more information.
  13244. func (c *ProjectsZonesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsGetCall {
  13245. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13246. return c
  13247. }
  13248. // IfNoneMatch sets the optional parameter which makes the operation
  13249. // fail if the object's ETag matches the given value. This is useful for
  13250. // getting updates only after the object has changed since the last
  13251. // request. Use googleapi.IsNotModified to check whether the response
  13252. // error from Do is the result of In-None-Match.
  13253. func (c *ProjectsZonesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsZonesOperationsGetCall {
  13254. c.ifNoneMatch_ = entityTag
  13255. return c
  13256. }
  13257. // Context sets the context to be used in this call's Do method. Any
  13258. // pending HTTP request will be aborted if the provided context is
  13259. // canceled.
  13260. func (c *ProjectsZonesOperationsGetCall) Context(ctx context.Context) *ProjectsZonesOperationsGetCall {
  13261. c.ctx_ = ctx
  13262. return c
  13263. }
  13264. // Header returns an http.Header that can be modified by the caller to
  13265. // add HTTP headers to the request.
  13266. func (c *ProjectsZonesOperationsGetCall) Header() http.Header {
  13267. if c.header_ == nil {
  13268. c.header_ = make(http.Header)
  13269. }
  13270. return c.header_
  13271. }
  13272. func (c *ProjectsZonesOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  13273. reqHeaders := make(http.Header)
  13274. for k, v := range c.header_ {
  13275. reqHeaders[k] = v
  13276. }
  13277. reqHeaders.Set("User-Agent", c.s.userAgent())
  13278. if c.ifNoneMatch_ != "" {
  13279. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13280. }
  13281. var body io.Reader = nil
  13282. c.urlParams_.Set("alt", alt)
  13283. c.urlParams_.Set("prettyPrint", "false")
  13284. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}")
  13285. urls += "?" + c.urlParams_.Encode()
  13286. req, err := http.NewRequest("GET", urls, body)
  13287. if err != nil {
  13288. return nil, err
  13289. }
  13290. req.Header = reqHeaders
  13291. googleapi.Expand(req.URL, map[string]string{
  13292. "projectId": c.projectId,
  13293. "zone": c.zone,
  13294. "operationId": c.operationId,
  13295. })
  13296. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13297. }
  13298. // Do executes the "container.projects.zones.operations.get" call.
  13299. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  13300. // status code is an error. Response headers are in either
  13301. // *Operation.ServerResponse.Header or (if a response was returned at
  13302. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13303. // to check whether the returned error was because
  13304. // http.StatusNotModified was returned.
  13305. func (c *ProjectsZonesOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  13306. gensupport.SetOptions(c.urlParams_, opts...)
  13307. res, err := c.doRequest("json")
  13308. if res != nil && res.StatusCode == http.StatusNotModified {
  13309. if res.Body != nil {
  13310. res.Body.Close()
  13311. }
  13312. return nil, &googleapi.Error{
  13313. Code: res.StatusCode,
  13314. Header: res.Header,
  13315. }
  13316. }
  13317. if err != nil {
  13318. return nil, err
  13319. }
  13320. defer googleapi.CloseBody(res)
  13321. if err := googleapi.CheckResponse(res); err != nil {
  13322. return nil, err
  13323. }
  13324. ret := &Operation{
  13325. ServerResponse: googleapi.ServerResponse{
  13326. Header: res.Header,
  13327. HTTPStatusCode: res.StatusCode,
  13328. },
  13329. }
  13330. target := &ret
  13331. if err := gensupport.DecodeResponse(target, res); err != nil {
  13332. return nil, err
  13333. }
  13334. return ret, nil
  13335. // {
  13336. // "description": "Gets the specified operation.",
  13337. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}",
  13338. // "httpMethod": "GET",
  13339. // "id": "container.projects.zones.operations.get",
  13340. // "parameterOrder": [
  13341. // "projectId",
  13342. // "zone",
  13343. // "operationId"
  13344. // ],
  13345. // "parameters": {
  13346. // "name": {
  13347. // "description": "The name (project, location, operation id) of the operation to get.\nSpecified in the format 'projects/*/locations/*/operations/*'.",
  13348. // "location": "query",
  13349. // "type": "string"
  13350. // },
  13351. // "operationId": {
  13352. // "description": "Deprecated. The server-assigned `name` of the operation.\nThis field has been deprecated and replaced by the name field.",
  13353. // "location": "path",
  13354. // "required": true,
  13355. // "type": "string"
  13356. // },
  13357. // "projectId": {
  13358. // "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.",
  13359. // "location": "path",
  13360. // "required": true,
  13361. // "type": "string"
  13362. // },
  13363. // "zone": {
  13364. // "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.",
  13365. // "location": "path",
  13366. // "required": true,
  13367. // "type": "string"
  13368. // }
  13369. // },
  13370. // "path": "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}",
  13371. // "response": {
  13372. // "$ref": "Operation"
  13373. // },
  13374. // "scopes": [
  13375. // "https://www.googleapis.com/auth/cloud-platform"
  13376. // ]
  13377. // }
  13378. }
  13379. // method id "container.projects.zones.operations.list":
  13380. type ProjectsZonesOperationsListCall struct {
  13381. s *Service
  13382. projectId string
  13383. zone string
  13384. urlParams_ gensupport.URLParams
  13385. ifNoneMatch_ string
  13386. ctx_ context.Context
  13387. header_ http.Header
  13388. }
  13389. // List: Lists all operations in a project in a specific zone or all
  13390. // zones.
  13391. func (r *ProjectsZonesOperationsService) List(projectId string, zone string) *ProjectsZonesOperationsListCall {
  13392. c := &ProjectsZonesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13393. c.projectId = projectId
  13394. c.zone = zone
  13395. return c
  13396. }
  13397. // Parent sets the optional parameter "parent": The parent (project and
  13398. // location) where the operations will be listed.
  13399. // Specified in the format 'projects/*/locations/*'.
  13400. // Location "-" matches all zones and all regions.
  13401. func (c *ProjectsZonesOperationsListCall) Parent(parent string) *ProjectsZonesOperationsListCall {
  13402. c.urlParams_.Set("parent", parent)
  13403. return c
  13404. }
  13405. // Fields allows partial responses to be retrieved. See
  13406. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13407. // for more information.
  13408. func (c *ProjectsZonesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsListCall {
  13409. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13410. return c
  13411. }
  13412. // IfNoneMatch sets the optional parameter which makes the operation
  13413. // fail if the object's ETag matches the given value. This is useful for
  13414. // getting updates only after the object has changed since the last
  13415. // request. Use googleapi.IsNotModified to check whether the response
  13416. // error from Do is the result of In-None-Match.
  13417. func (c *ProjectsZonesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsZonesOperationsListCall {
  13418. c.ifNoneMatch_ = entityTag
  13419. return c
  13420. }
  13421. // Context sets the context to be used in this call's Do method. Any
  13422. // pending HTTP request will be aborted if the provided context is
  13423. // canceled.
  13424. func (c *ProjectsZonesOperationsListCall) Context(ctx context.Context) *ProjectsZonesOperationsListCall {
  13425. c.ctx_ = ctx
  13426. return c
  13427. }
  13428. // Header returns an http.Header that can be modified by the caller to
  13429. // add HTTP headers to the request.
  13430. func (c *ProjectsZonesOperationsListCall) Header() http.Header {
  13431. if c.header_ == nil {
  13432. c.header_ = make(http.Header)
  13433. }
  13434. return c.header_
  13435. }
  13436. func (c *ProjectsZonesOperationsListCall) doRequest(alt string) (*http.Response, error) {
  13437. reqHeaders := make(http.Header)
  13438. for k, v := range c.header_ {
  13439. reqHeaders[k] = v
  13440. }
  13441. reqHeaders.Set("User-Agent", c.s.userAgent())
  13442. if c.ifNoneMatch_ != "" {
  13443. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13444. }
  13445. var body io.Reader = nil
  13446. c.urlParams_.Set("alt", alt)
  13447. c.urlParams_.Set("prettyPrint", "false")
  13448. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/operations")
  13449. urls += "?" + c.urlParams_.Encode()
  13450. req, err := http.NewRequest("GET", urls, body)
  13451. if err != nil {
  13452. return nil, err
  13453. }
  13454. req.Header = reqHeaders
  13455. googleapi.Expand(req.URL, map[string]string{
  13456. "projectId": c.projectId,
  13457. "zone": c.zone,
  13458. })
  13459. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13460. }
  13461. // Do executes the "container.projects.zones.operations.list" call.
  13462. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  13463. // non-2xx status code is an error. Response headers are in either
  13464. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  13465. // returned at all) in error.(*googleapi.Error).Header. Use
  13466. // googleapi.IsNotModified to check whether the returned error was
  13467. // because http.StatusNotModified was returned.
  13468. func (c *ProjectsZonesOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  13469. gensupport.SetOptions(c.urlParams_, opts...)
  13470. res, err := c.doRequest("json")
  13471. if res != nil && res.StatusCode == http.StatusNotModified {
  13472. if res.Body != nil {
  13473. res.Body.Close()
  13474. }
  13475. return nil, &googleapi.Error{
  13476. Code: res.StatusCode,
  13477. Header: res.Header,
  13478. }
  13479. }
  13480. if err != nil {
  13481. return nil, err
  13482. }
  13483. defer googleapi.CloseBody(res)
  13484. if err := googleapi.CheckResponse(res); err != nil {
  13485. return nil, err
  13486. }
  13487. ret := &ListOperationsResponse{
  13488. ServerResponse: googleapi.ServerResponse{
  13489. Header: res.Header,
  13490. HTTPStatusCode: res.StatusCode,
  13491. },
  13492. }
  13493. target := &ret
  13494. if err := gensupport.DecodeResponse(target, res); err != nil {
  13495. return nil, err
  13496. }
  13497. return ret, nil
  13498. // {
  13499. // "description": "Lists all operations in a project in a specific zone or all zones.",
  13500. // "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/operations",
  13501. // "httpMethod": "GET",
  13502. // "id": "container.projects.zones.operations.list",
  13503. // "parameterOrder": [
  13504. // "projectId",
  13505. // "zone"
  13506. // ],
  13507. // "parameters": {
  13508. // "parent": {
  13509. // "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.",
  13510. // "location": "query",
  13511. // "type": "string"
  13512. // },
  13513. // "projectId": {
  13514. // "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.",
  13515. // "location": "path",
  13516. // "required": true,
  13517. // "type": "string"
  13518. // },
  13519. // "zone": {
  13520. // "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.",
  13521. // "location": "path",
  13522. // "required": true,
  13523. // "type": "string"
  13524. // }
  13525. // },
  13526. // "path": "v1beta1/projects/{projectId}/zones/{zone}/operations",
  13527. // "response": {
  13528. // "$ref": "ListOperationsResponse"
  13529. // },
  13530. // "scopes": [
  13531. // "https://www.googleapis.com/auth/cloud-platform"
  13532. // ]
  13533. // }
  13534. }