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.
 
 
 

105631 lines
4.0 MiB

  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 compute provides access to the Compute Engine API.
  6. //
  7. // For product documentation, see: https://developers.google.com/compute/docs/reference/latest/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/compute/v1"
  14. // ...
  15. // ctx := context.Background()
  16. // computeService, err := compute.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. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // computeService, err := compute.NewService(ctx, option.WithScopes(compute.DevstorageReadWriteScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // computeService, err := compute.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // computeService, err := compute.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package compute // import "google.golang.org/api/compute/v1"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "compute:v1"
  71. const apiName = "compute"
  72. const apiVersion = "v1"
  73. const basePath = "https://www.googleapis.com/compute/v1/projects/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // View and manage your data across Google Cloud Platform services
  77. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  78. // View and manage your Google Compute Engine resources
  79. ComputeScope = "https://www.googleapis.com/auth/compute"
  80. // View your Google Compute Engine resources
  81. ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly"
  82. // Manage your data and permissions in Google Cloud Storage
  83. DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
  84. // View your data in Google Cloud Storage
  85. DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
  86. // Manage your data in Google Cloud Storage
  87. DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
  88. )
  89. // NewService creates a new Service.
  90. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  91. scopesOption := option.WithScopes(
  92. "https://www.googleapis.com/auth/cloud-platform",
  93. "https://www.googleapis.com/auth/compute",
  94. "https://www.googleapis.com/auth/compute.readonly",
  95. "https://www.googleapis.com/auth/devstorage.full_control",
  96. "https://www.googleapis.com/auth/devstorage.read_only",
  97. "https://www.googleapis.com/auth/devstorage.read_write",
  98. )
  99. // NOTE: prepend, so we don't override user-specified scopes.
  100. opts = append([]option.ClientOption{scopesOption}, opts...)
  101. client, endpoint, err := htransport.NewClient(ctx, opts...)
  102. if err != nil {
  103. return nil, err
  104. }
  105. s, err := New(client)
  106. if err != nil {
  107. return nil, err
  108. }
  109. if endpoint != "" {
  110. s.BasePath = endpoint
  111. }
  112. return s, nil
  113. }
  114. // New creates a new Service. It uses the provided http.Client for requests.
  115. //
  116. // Deprecated: please use NewService instead.
  117. // To provide a custom HTTP client, use option.WithHTTPClient.
  118. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  119. func New(client *http.Client) (*Service, error) {
  120. if client == nil {
  121. return nil, errors.New("client is nil")
  122. }
  123. s := &Service{client: client, BasePath: basePath}
  124. s.AcceleratorTypes = NewAcceleratorTypesService(s)
  125. s.Addresses = NewAddressesService(s)
  126. s.Autoscalers = NewAutoscalersService(s)
  127. s.BackendBuckets = NewBackendBucketsService(s)
  128. s.BackendServices = NewBackendServicesService(s)
  129. s.DiskTypes = NewDiskTypesService(s)
  130. s.Disks = NewDisksService(s)
  131. s.Firewalls = NewFirewallsService(s)
  132. s.ForwardingRules = NewForwardingRulesService(s)
  133. s.GlobalAddresses = NewGlobalAddressesService(s)
  134. s.GlobalForwardingRules = NewGlobalForwardingRulesService(s)
  135. s.GlobalOperations = NewGlobalOperationsService(s)
  136. s.HealthChecks = NewHealthChecksService(s)
  137. s.HttpHealthChecks = NewHttpHealthChecksService(s)
  138. s.HttpsHealthChecks = NewHttpsHealthChecksService(s)
  139. s.Images = NewImagesService(s)
  140. s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
  141. s.InstanceGroups = NewInstanceGroupsService(s)
  142. s.InstanceTemplates = NewInstanceTemplatesService(s)
  143. s.Instances = NewInstancesService(s)
  144. s.InterconnectAttachments = NewInterconnectAttachmentsService(s)
  145. s.InterconnectLocations = NewInterconnectLocationsService(s)
  146. s.Interconnects = NewInterconnectsService(s)
  147. s.LicenseCodes = NewLicenseCodesService(s)
  148. s.Licenses = NewLicensesService(s)
  149. s.MachineTypes = NewMachineTypesService(s)
  150. s.Networks = NewNetworksService(s)
  151. s.NodeGroups = NewNodeGroupsService(s)
  152. s.NodeTemplates = NewNodeTemplatesService(s)
  153. s.NodeTypes = NewNodeTypesService(s)
  154. s.Projects = NewProjectsService(s)
  155. s.RegionAutoscalers = NewRegionAutoscalersService(s)
  156. s.RegionBackendServices = NewRegionBackendServicesService(s)
  157. s.RegionCommitments = NewRegionCommitmentsService(s)
  158. s.RegionDiskTypes = NewRegionDiskTypesService(s)
  159. s.RegionDisks = NewRegionDisksService(s)
  160. s.RegionInstanceGroupManagers = NewRegionInstanceGroupManagersService(s)
  161. s.RegionInstanceGroups = NewRegionInstanceGroupsService(s)
  162. s.RegionOperations = NewRegionOperationsService(s)
  163. s.Regions = NewRegionsService(s)
  164. s.Routers = NewRoutersService(s)
  165. s.Routes = NewRoutesService(s)
  166. s.SecurityPolicies = NewSecurityPoliciesService(s)
  167. s.Snapshots = NewSnapshotsService(s)
  168. s.SslCertificates = NewSslCertificatesService(s)
  169. s.SslPolicies = NewSslPoliciesService(s)
  170. s.Subnetworks = NewSubnetworksService(s)
  171. s.TargetHttpProxies = NewTargetHttpProxiesService(s)
  172. s.TargetHttpsProxies = NewTargetHttpsProxiesService(s)
  173. s.TargetInstances = NewTargetInstancesService(s)
  174. s.TargetPools = NewTargetPoolsService(s)
  175. s.TargetSslProxies = NewTargetSslProxiesService(s)
  176. s.TargetTcpProxies = NewTargetTcpProxiesService(s)
  177. s.TargetVpnGateways = NewTargetVpnGatewaysService(s)
  178. s.UrlMaps = NewUrlMapsService(s)
  179. s.VpnTunnels = NewVpnTunnelsService(s)
  180. s.ZoneOperations = NewZoneOperationsService(s)
  181. s.Zones = NewZonesService(s)
  182. return s, nil
  183. }
  184. type Service struct {
  185. client *http.Client
  186. BasePath string // API endpoint base URL
  187. UserAgent string // optional additional User-Agent fragment
  188. AcceleratorTypes *AcceleratorTypesService
  189. Addresses *AddressesService
  190. Autoscalers *AutoscalersService
  191. BackendBuckets *BackendBucketsService
  192. BackendServices *BackendServicesService
  193. DiskTypes *DiskTypesService
  194. Disks *DisksService
  195. Firewalls *FirewallsService
  196. ForwardingRules *ForwardingRulesService
  197. GlobalAddresses *GlobalAddressesService
  198. GlobalForwardingRules *GlobalForwardingRulesService
  199. GlobalOperations *GlobalOperationsService
  200. HealthChecks *HealthChecksService
  201. HttpHealthChecks *HttpHealthChecksService
  202. HttpsHealthChecks *HttpsHealthChecksService
  203. Images *ImagesService
  204. InstanceGroupManagers *InstanceGroupManagersService
  205. InstanceGroups *InstanceGroupsService
  206. InstanceTemplates *InstanceTemplatesService
  207. Instances *InstancesService
  208. InterconnectAttachments *InterconnectAttachmentsService
  209. InterconnectLocations *InterconnectLocationsService
  210. Interconnects *InterconnectsService
  211. LicenseCodes *LicenseCodesService
  212. Licenses *LicensesService
  213. MachineTypes *MachineTypesService
  214. Networks *NetworksService
  215. NodeGroups *NodeGroupsService
  216. NodeTemplates *NodeTemplatesService
  217. NodeTypes *NodeTypesService
  218. Projects *ProjectsService
  219. RegionAutoscalers *RegionAutoscalersService
  220. RegionBackendServices *RegionBackendServicesService
  221. RegionCommitments *RegionCommitmentsService
  222. RegionDiskTypes *RegionDiskTypesService
  223. RegionDisks *RegionDisksService
  224. RegionInstanceGroupManagers *RegionInstanceGroupManagersService
  225. RegionInstanceGroups *RegionInstanceGroupsService
  226. RegionOperations *RegionOperationsService
  227. Regions *RegionsService
  228. Routers *RoutersService
  229. Routes *RoutesService
  230. SecurityPolicies *SecurityPoliciesService
  231. Snapshots *SnapshotsService
  232. SslCertificates *SslCertificatesService
  233. SslPolicies *SslPoliciesService
  234. Subnetworks *SubnetworksService
  235. TargetHttpProxies *TargetHttpProxiesService
  236. TargetHttpsProxies *TargetHttpsProxiesService
  237. TargetInstances *TargetInstancesService
  238. TargetPools *TargetPoolsService
  239. TargetSslProxies *TargetSslProxiesService
  240. TargetTcpProxies *TargetTcpProxiesService
  241. TargetVpnGateways *TargetVpnGatewaysService
  242. UrlMaps *UrlMapsService
  243. VpnTunnels *VpnTunnelsService
  244. ZoneOperations *ZoneOperationsService
  245. Zones *ZonesService
  246. }
  247. func (s *Service) userAgent() string {
  248. if s.UserAgent == "" {
  249. return googleapi.UserAgent
  250. }
  251. return googleapi.UserAgent + " " + s.UserAgent
  252. }
  253. func NewAcceleratorTypesService(s *Service) *AcceleratorTypesService {
  254. rs := &AcceleratorTypesService{s: s}
  255. return rs
  256. }
  257. type AcceleratorTypesService struct {
  258. s *Service
  259. }
  260. func NewAddressesService(s *Service) *AddressesService {
  261. rs := &AddressesService{s: s}
  262. return rs
  263. }
  264. type AddressesService struct {
  265. s *Service
  266. }
  267. func NewAutoscalersService(s *Service) *AutoscalersService {
  268. rs := &AutoscalersService{s: s}
  269. return rs
  270. }
  271. type AutoscalersService struct {
  272. s *Service
  273. }
  274. func NewBackendBucketsService(s *Service) *BackendBucketsService {
  275. rs := &BackendBucketsService{s: s}
  276. return rs
  277. }
  278. type BackendBucketsService struct {
  279. s *Service
  280. }
  281. func NewBackendServicesService(s *Service) *BackendServicesService {
  282. rs := &BackendServicesService{s: s}
  283. return rs
  284. }
  285. type BackendServicesService struct {
  286. s *Service
  287. }
  288. func NewDiskTypesService(s *Service) *DiskTypesService {
  289. rs := &DiskTypesService{s: s}
  290. return rs
  291. }
  292. type DiskTypesService struct {
  293. s *Service
  294. }
  295. func NewDisksService(s *Service) *DisksService {
  296. rs := &DisksService{s: s}
  297. return rs
  298. }
  299. type DisksService struct {
  300. s *Service
  301. }
  302. func NewFirewallsService(s *Service) *FirewallsService {
  303. rs := &FirewallsService{s: s}
  304. return rs
  305. }
  306. type FirewallsService struct {
  307. s *Service
  308. }
  309. func NewForwardingRulesService(s *Service) *ForwardingRulesService {
  310. rs := &ForwardingRulesService{s: s}
  311. return rs
  312. }
  313. type ForwardingRulesService struct {
  314. s *Service
  315. }
  316. func NewGlobalAddressesService(s *Service) *GlobalAddressesService {
  317. rs := &GlobalAddressesService{s: s}
  318. return rs
  319. }
  320. type GlobalAddressesService struct {
  321. s *Service
  322. }
  323. func NewGlobalForwardingRulesService(s *Service) *GlobalForwardingRulesService {
  324. rs := &GlobalForwardingRulesService{s: s}
  325. return rs
  326. }
  327. type GlobalForwardingRulesService struct {
  328. s *Service
  329. }
  330. func NewGlobalOperationsService(s *Service) *GlobalOperationsService {
  331. rs := &GlobalOperationsService{s: s}
  332. return rs
  333. }
  334. type GlobalOperationsService struct {
  335. s *Service
  336. }
  337. func NewHealthChecksService(s *Service) *HealthChecksService {
  338. rs := &HealthChecksService{s: s}
  339. return rs
  340. }
  341. type HealthChecksService struct {
  342. s *Service
  343. }
  344. func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService {
  345. rs := &HttpHealthChecksService{s: s}
  346. return rs
  347. }
  348. type HttpHealthChecksService struct {
  349. s *Service
  350. }
  351. func NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService {
  352. rs := &HttpsHealthChecksService{s: s}
  353. return rs
  354. }
  355. type HttpsHealthChecksService struct {
  356. s *Service
  357. }
  358. func NewImagesService(s *Service) *ImagesService {
  359. rs := &ImagesService{s: s}
  360. return rs
  361. }
  362. type ImagesService struct {
  363. s *Service
  364. }
  365. func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
  366. rs := &InstanceGroupManagersService{s: s}
  367. return rs
  368. }
  369. type InstanceGroupManagersService struct {
  370. s *Service
  371. }
  372. func NewInstanceGroupsService(s *Service) *InstanceGroupsService {
  373. rs := &InstanceGroupsService{s: s}
  374. return rs
  375. }
  376. type InstanceGroupsService struct {
  377. s *Service
  378. }
  379. func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService {
  380. rs := &InstanceTemplatesService{s: s}
  381. return rs
  382. }
  383. type InstanceTemplatesService struct {
  384. s *Service
  385. }
  386. func NewInstancesService(s *Service) *InstancesService {
  387. rs := &InstancesService{s: s}
  388. return rs
  389. }
  390. type InstancesService struct {
  391. s *Service
  392. }
  393. func NewInterconnectAttachmentsService(s *Service) *InterconnectAttachmentsService {
  394. rs := &InterconnectAttachmentsService{s: s}
  395. return rs
  396. }
  397. type InterconnectAttachmentsService struct {
  398. s *Service
  399. }
  400. func NewInterconnectLocationsService(s *Service) *InterconnectLocationsService {
  401. rs := &InterconnectLocationsService{s: s}
  402. return rs
  403. }
  404. type InterconnectLocationsService struct {
  405. s *Service
  406. }
  407. func NewInterconnectsService(s *Service) *InterconnectsService {
  408. rs := &InterconnectsService{s: s}
  409. return rs
  410. }
  411. type InterconnectsService struct {
  412. s *Service
  413. }
  414. func NewLicenseCodesService(s *Service) *LicenseCodesService {
  415. rs := &LicenseCodesService{s: s}
  416. return rs
  417. }
  418. type LicenseCodesService struct {
  419. s *Service
  420. }
  421. func NewLicensesService(s *Service) *LicensesService {
  422. rs := &LicensesService{s: s}
  423. return rs
  424. }
  425. type LicensesService struct {
  426. s *Service
  427. }
  428. func NewMachineTypesService(s *Service) *MachineTypesService {
  429. rs := &MachineTypesService{s: s}
  430. return rs
  431. }
  432. type MachineTypesService struct {
  433. s *Service
  434. }
  435. func NewNetworksService(s *Service) *NetworksService {
  436. rs := &NetworksService{s: s}
  437. return rs
  438. }
  439. type NetworksService struct {
  440. s *Service
  441. }
  442. func NewNodeGroupsService(s *Service) *NodeGroupsService {
  443. rs := &NodeGroupsService{s: s}
  444. return rs
  445. }
  446. type NodeGroupsService struct {
  447. s *Service
  448. }
  449. func NewNodeTemplatesService(s *Service) *NodeTemplatesService {
  450. rs := &NodeTemplatesService{s: s}
  451. return rs
  452. }
  453. type NodeTemplatesService struct {
  454. s *Service
  455. }
  456. func NewNodeTypesService(s *Service) *NodeTypesService {
  457. rs := &NodeTypesService{s: s}
  458. return rs
  459. }
  460. type NodeTypesService struct {
  461. s *Service
  462. }
  463. func NewProjectsService(s *Service) *ProjectsService {
  464. rs := &ProjectsService{s: s}
  465. return rs
  466. }
  467. type ProjectsService struct {
  468. s *Service
  469. }
  470. func NewRegionAutoscalersService(s *Service) *RegionAutoscalersService {
  471. rs := &RegionAutoscalersService{s: s}
  472. return rs
  473. }
  474. type RegionAutoscalersService struct {
  475. s *Service
  476. }
  477. func NewRegionBackendServicesService(s *Service) *RegionBackendServicesService {
  478. rs := &RegionBackendServicesService{s: s}
  479. return rs
  480. }
  481. type RegionBackendServicesService struct {
  482. s *Service
  483. }
  484. func NewRegionCommitmentsService(s *Service) *RegionCommitmentsService {
  485. rs := &RegionCommitmentsService{s: s}
  486. return rs
  487. }
  488. type RegionCommitmentsService struct {
  489. s *Service
  490. }
  491. func NewRegionDiskTypesService(s *Service) *RegionDiskTypesService {
  492. rs := &RegionDiskTypesService{s: s}
  493. return rs
  494. }
  495. type RegionDiskTypesService struct {
  496. s *Service
  497. }
  498. func NewRegionDisksService(s *Service) *RegionDisksService {
  499. rs := &RegionDisksService{s: s}
  500. return rs
  501. }
  502. type RegionDisksService struct {
  503. s *Service
  504. }
  505. func NewRegionInstanceGroupManagersService(s *Service) *RegionInstanceGroupManagersService {
  506. rs := &RegionInstanceGroupManagersService{s: s}
  507. return rs
  508. }
  509. type RegionInstanceGroupManagersService struct {
  510. s *Service
  511. }
  512. func NewRegionInstanceGroupsService(s *Service) *RegionInstanceGroupsService {
  513. rs := &RegionInstanceGroupsService{s: s}
  514. return rs
  515. }
  516. type RegionInstanceGroupsService struct {
  517. s *Service
  518. }
  519. func NewRegionOperationsService(s *Service) *RegionOperationsService {
  520. rs := &RegionOperationsService{s: s}
  521. return rs
  522. }
  523. type RegionOperationsService struct {
  524. s *Service
  525. }
  526. func NewRegionsService(s *Service) *RegionsService {
  527. rs := &RegionsService{s: s}
  528. return rs
  529. }
  530. type RegionsService struct {
  531. s *Service
  532. }
  533. func NewRoutersService(s *Service) *RoutersService {
  534. rs := &RoutersService{s: s}
  535. return rs
  536. }
  537. type RoutersService struct {
  538. s *Service
  539. }
  540. func NewRoutesService(s *Service) *RoutesService {
  541. rs := &RoutesService{s: s}
  542. return rs
  543. }
  544. type RoutesService struct {
  545. s *Service
  546. }
  547. func NewSecurityPoliciesService(s *Service) *SecurityPoliciesService {
  548. rs := &SecurityPoliciesService{s: s}
  549. return rs
  550. }
  551. type SecurityPoliciesService struct {
  552. s *Service
  553. }
  554. func NewSnapshotsService(s *Service) *SnapshotsService {
  555. rs := &SnapshotsService{s: s}
  556. return rs
  557. }
  558. type SnapshotsService struct {
  559. s *Service
  560. }
  561. func NewSslCertificatesService(s *Service) *SslCertificatesService {
  562. rs := &SslCertificatesService{s: s}
  563. return rs
  564. }
  565. type SslCertificatesService struct {
  566. s *Service
  567. }
  568. func NewSslPoliciesService(s *Service) *SslPoliciesService {
  569. rs := &SslPoliciesService{s: s}
  570. return rs
  571. }
  572. type SslPoliciesService struct {
  573. s *Service
  574. }
  575. func NewSubnetworksService(s *Service) *SubnetworksService {
  576. rs := &SubnetworksService{s: s}
  577. return rs
  578. }
  579. type SubnetworksService struct {
  580. s *Service
  581. }
  582. func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService {
  583. rs := &TargetHttpProxiesService{s: s}
  584. return rs
  585. }
  586. type TargetHttpProxiesService struct {
  587. s *Service
  588. }
  589. func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService {
  590. rs := &TargetHttpsProxiesService{s: s}
  591. return rs
  592. }
  593. type TargetHttpsProxiesService struct {
  594. s *Service
  595. }
  596. func NewTargetInstancesService(s *Service) *TargetInstancesService {
  597. rs := &TargetInstancesService{s: s}
  598. return rs
  599. }
  600. type TargetInstancesService struct {
  601. s *Service
  602. }
  603. func NewTargetPoolsService(s *Service) *TargetPoolsService {
  604. rs := &TargetPoolsService{s: s}
  605. return rs
  606. }
  607. type TargetPoolsService struct {
  608. s *Service
  609. }
  610. func NewTargetSslProxiesService(s *Service) *TargetSslProxiesService {
  611. rs := &TargetSslProxiesService{s: s}
  612. return rs
  613. }
  614. type TargetSslProxiesService struct {
  615. s *Service
  616. }
  617. func NewTargetTcpProxiesService(s *Service) *TargetTcpProxiesService {
  618. rs := &TargetTcpProxiesService{s: s}
  619. return rs
  620. }
  621. type TargetTcpProxiesService struct {
  622. s *Service
  623. }
  624. func NewTargetVpnGatewaysService(s *Service) *TargetVpnGatewaysService {
  625. rs := &TargetVpnGatewaysService{s: s}
  626. return rs
  627. }
  628. type TargetVpnGatewaysService struct {
  629. s *Service
  630. }
  631. func NewUrlMapsService(s *Service) *UrlMapsService {
  632. rs := &UrlMapsService{s: s}
  633. return rs
  634. }
  635. type UrlMapsService struct {
  636. s *Service
  637. }
  638. func NewVpnTunnelsService(s *Service) *VpnTunnelsService {
  639. rs := &VpnTunnelsService{s: s}
  640. return rs
  641. }
  642. type VpnTunnelsService struct {
  643. s *Service
  644. }
  645. func NewZoneOperationsService(s *Service) *ZoneOperationsService {
  646. rs := &ZoneOperationsService{s: s}
  647. return rs
  648. }
  649. type ZoneOperationsService struct {
  650. s *Service
  651. }
  652. func NewZonesService(s *Service) *ZonesService {
  653. rs := &ZonesService{s: s}
  654. return rs
  655. }
  656. type ZonesService struct {
  657. s *Service
  658. }
  659. // AcceleratorConfig: A specification of the type and number of
  660. // accelerator cards attached to the instance.
  661. type AcceleratorConfig struct {
  662. // AcceleratorCount: The number of the guest accelerator cards exposed
  663. // to this instance.
  664. AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
  665. // AcceleratorType: Full or partial URL of the accelerator type resource
  666. // to attach to this instance. For example:
  667. // projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-
  668. // p100 If you are creating an instance template, specify only the
  669. // accelerator name. See GPUs on Compute Engine for a full list of
  670. // accelerator types.
  671. AcceleratorType string `json:"acceleratorType,omitempty"`
  672. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  673. // unconditionally include in API requests. By default, fields with
  674. // empty values are omitted from API requests. However, any non-pointer,
  675. // non-interface field appearing in ForceSendFields will be sent to the
  676. // server regardless of whether the field is empty or not. This may be
  677. // used to include empty fields in Patch requests.
  678. ForceSendFields []string `json:"-"`
  679. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  680. // include in API requests with the JSON null value. By default, fields
  681. // with empty values are omitted from API requests. However, any field
  682. // with an empty value appearing in NullFields will be sent to the
  683. // server as null. It is an error if a field in this list has a
  684. // non-empty value. This may be used to include null fields in Patch
  685. // requests.
  686. NullFields []string `json:"-"`
  687. }
  688. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  689. type NoMethod AcceleratorConfig
  690. raw := NoMethod(*s)
  691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  692. }
  693. // AcceleratorType: An Accelerator Type resource. (== resource_for
  694. // beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)
  695. type AcceleratorType struct {
  696. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  697. // format.
  698. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  699. // Deprecated: [Output Only] The deprecation status associated with this
  700. // accelerator type.
  701. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  702. // Description: [Output Only] An optional textual description of the
  703. // resource.
  704. Description string `json:"description,omitempty"`
  705. // Id: [Output Only] The unique identifier for the resource. This
  706. // identifier is defined by the server.
  707. Id uint64 `json:"id,omitempty,string"`
  708. // Kind: [Output Only] The type of the resource. Always
  709. // compute#acceleratorType for accelerator types.
  710. Kind string `json:"kind,omitempty"`
  711. // MaximumCardsPerInstance: [Output Only] Maximum accelerator cards
  712. // allowed per instance.
  713. MaximumCardsPerInstance int64 `json:"maximumCardsPerInstance,omitempty"`
  714. // Name: [Output Only] Name of the resource.
  715. Name string `json:"name,omitempty"`
  716. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  717. // resource.
  718. SelfLink string `json:"selfLink,omitempty"`
  719. // Zone: [Output Only] The name of the zone where the accelerator type
  720. // resides, such as us-central1-a. You must specify this field as part
  721. // of the HTTP request URL. It is not settable as a field in the request
  722. // body.
  723. Zone string `json:"zone,omitempty"`
  724. // ServerResponse contains the HTTP response code and headers from the
  725. // server.
  726. googleapi.ServerResponse `json:"-"`
  727. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  728. // to unconditionally include in API requests. By default, fields with
  729. // empty values are omitted from API requests. However, any non-pointer,
  730. // non-interface field appearing in ForceSendFields will be sent to the
  731. // server regardless of whether the field is empty or not. This may be
  732. // used to include empty fields in Patch requests.
  733. ForceSendFields []string `json:"-"`
  734. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  735. // include in API requests with the JSON null value. By default, fields
  736. // with empty values are omitted from API requests. However, any field
  737. // with an empty value appearing in NullFields will be sent to the
  738. // server as null. It is an error if a field in this list has a
  739. // non-empty value. This may be used to include null fields in Patch
  740. // requests.
  741. NullFields []string `json:"-"`
  742. }
  743. func (s *AcceleratorType) MarshalJSON() ([]byte, error) {
  744. type NoMethod AcceleratorType
  745. raw := NoMethod(*s)
  746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  747. }
  748. type AcceleratorTypeAggregatedList struct {
  749. // Id: [Output Only] Unique identifier for the resource; defined by the
  750. // server.
  751. Id string `json:"id,omitempty"`
  752. // Items: A list of AcceleratorTypesScopedList resources.
  753. Items map[string]AcceleratorTypesScopedList `json:"items,omitempty"`
  754. // Kind: [Output Only] Type of resource. Always
  755. // compute#acceleratorTypeAggregatedList for aggregated lists of
  756. // accelerator types.
  757. Kind string `json:"kind,omitempty"`
  758. // NextPageToken: [Output Only] This token allows you to get the next
  759. // page of results for list requests. If the number of results is larger
  760. // than maxResults, use the nextPageToken as a value for the query
  761. // parameter pageToken in the next list request. Subsequent list
  762. // requests will have their own nextPageToken to continue paging through
  763. // the results.
  764. NextPageToken string `json:"nextPageToken,omitempty"`
  765. // SelfLink: [Output Only] Server-defined URL for this resource.
  766. SelfLink string `json:"selfLink,omitempty"`
  767. // Warning: [Output Only] Informational warning message.
  768. Warning *AcceleratorTypeAggregatedListWarning `json:"warning,omitempty"`
  769. // ServerResponse contains the HTTP response code and headers from the
  770. // server.
  771. googleapi.ServerResponse `json:"-"`
  772. // ForceSendFields is a list of field names (e.g. "Id") to
  773. // unconditionally include in API requests. By default, fields with
  774. // empty values are omitted from API requests. However, any non-pointer,
  775. // non-interface field appearing in ForceSendFields will be sent to the
  776. // server regardless of whether the field is empty or not. This may be
  777. // used to include empty fields in Patch requests.
  778. ForceSendFields []string `json:"-"`
  779. // NullFields is a list of field names (e.g. "Id") to include in API
  780. // requests with the JSON null value. By default, fields with empty
  781. // values are omitted from API requests. However, any field with an
  782. // empty value appearing in NullFields will be sent to the server as
  783. // null. It is an error if a field in this list has a non-empty value.
  784. // This may be used to include null fields in Patch requests.
  785. NullFields []string `json:"-"`
  786. }
  787. func (s *AcceleratorTypeAggregatedList) MarshalJSON() ([]byte, error) {
  788. type NoMethod AcceleratorTypeAggregatedList
  789. raw := NoMethod(*s)
  790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  791. }
  792. // AcceleratorTypeAggregatedListWarning: [Output Only] Informational
  793. // warning message.
  794. type AcceleratorTypeAggregatedListWarning struct {
  795. // Code: [Output Only] A warning code, if applicable. For example,
  796. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  797. // the response.
  798. //
  799. // Possible values:
  800. // "CLEANUP_FAILED"
  801. // "DEPRECATED_RESOURCE_USED"
  802. // "DEPRECATED_TYPE_USED"
  803. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  804. // "EXPERIMENTAL_TYPE_USED"
  805. // "EXTERNAL_API_WARNING"
  806. // "FIELD_VALUE_OVERRIDEN"
  807. // "INJECTED_KERNELS_DEPRECATED"
  808. // "MISSING_TYPE_DEPENDENCY"
  809. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  810. // "NEXT_HOP_CANNOT_IP_FORWARD"
  811. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  812. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  813. // "NEXT_HOP_NOT_RUNNING"
  814. // "NOT_CRITICAL_ERROR"
  815. // "NO_RESULTS_ON_PAGE"
  816. // "REQUIRED_TOS_AGREEMENT"
  817. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  818. // "RESOURCE_NOT_DELETED"
  819. // "SCHEMA_VALIDATION_IGNORED"
  820. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  821. // "UNDECLARED_PROPERTIES"
  822. // "UNREACHABLE"
  823. Code string `json:"code,omitempty"`
  824. // Data: [Output Only] Metadata about this warning in key: value format.
  825. // For example:
  826. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  827. Data []*AcceleratorTypeAggregatedListWarningData `json:"data,omitempty"`
  828. // Message: [Output Only] A human-readable description of the warning
  829. // code.
  830. Message string `json:"message,omitempty"`
  831. // ForceSendFields is a list of field names (e.g. "Code") to
  832. // unconditionally include in API requests. By default, fields with
  833. // empty values are omitted from API requests. However, any non-pointer,
  834. // non-interface field appearing in ForceSendFields will be sent to the
  835. // server regardless of whether the field is empty or not. This may be
  836. // used to include empty fields in Patch requests.
  837. ForceSendFields []string `json:"-"`
  838. // NullFields is a list of field names (e.g. "Code") to include in API
  839. // requests with the JSON null value. By default, fields with empty
  840. // values are omitted from API requests. However, any field with an
  841. // empty value appearing in NullFields will be sent to the server as
  842. // null. It is an error if a field in this list has a non-empty value.
  843. // This may be used to include null fields in Patch requests.
  844. NullFields []string `json:"-"`
  845. }
  846. func (s *AcceleratorTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  847. type NoMethod AcceleratorTypeAggregatedListWarning
  848. raw := NoMethod(*s)
  849. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  850. }
  851. type AcceleratorTypeAggregatedListWarningData struct {
  852. // Key: [Output Only] A key that provides more detail on the warning
  853. // being returned. For example, for warnings where there are no results
  854. // in a list request for a particular zone, this key might be scope and
  855. // the key value might be the zone name. Other examples might be a key
  856. // indicating a deprecated resource and a suggested replacement, or a
  857. // warning about invalid network settings (for example, if an instance
  858. // attempts to perform IP forwarding but is not enabled for IP
  859. // forwarding).
  860. Key string `json:"key,omitempty"`
  861. // Value: [Output Only] A warning data value corresponding to the key.
  862. Value string `json:"value,omitempty"`
  863. // ForceSendFields is a list of field names (e.g. "Key") to
  864. // unconditionally include in API requests. By default, fields with
  865. // empty values are omitted from API requests. However, any non-pointer,
  866. // non-interface field appearing in ForceSendFields will be sent to the
  867. // server regardless of whether the field is empty or not. This may be
  868. // used to include empty fields in Patch requests.
  869. ForceSendFields []string `json:"-"`
  870. // NullFields is a list of field names (e.g. "Key") to include in API
  871. // requests with the JSON null value. By default, fields with empty
  872. // values are omitted from API requests. However, any field with an
  873. // empty value appearing in NullFields will be sent to the server as
  874. // null. It is an error if a field in this list has a non-empty value.
  875. // This may be used to include null fields in Patch requests.
  876. NullFields []string `json:"-"`
  877. }
  878. func (s *AcceleratorTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  879. type NoMethod AcceleratorTypeAggregatedListWarningData
  880. raw := NoMethod(*s)
  881. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  882. }
  883. // AcceleratorTypeList: Contains a list of accelerator types.
  884. type AcceleratorTypeList struct {
  885. // Id: [Output Only] Unique identifier for the resource; defined by the
  886. // server.
  887. Id string `json:"id,omitempty"`
  888. // Items: A list of AcceleratorType resources.
  889. Items []*AcceleratorType `json:"items,omitempty"`
  890. // Kind: [Output Only] Type of resource. Always
  891. // compute#acceleratorTypeList for lists of accelerator types.
  892. Kind string `json:"kind,omitempty"`
  893. // NextPageToken: [Output Only] This token allows you to get the next
  894. // page of results for list requests. If the number of results is larger
  895. // than maxResults, use the nextPageToken as a value for the query
  896. // parameter pageToken in the next list request. Subsequent list
  897. // requests will have their own nextPageToken to continue paging through
  898. // the results.
  899. NextPageToken string `json:"nextPageToken,omitempty"`
  900. // SelfLink: [Output Only] Server-defined URL for this resource.
  901. SelfLink string `json:"selfLink,omitempty"`
  902. // Warning: [Output Only] Informational warning message.
  903. Warning *AcceleratorTypeListWarning `json:"warning,omitempty"`
  904. // ServerResponse contains the HTTP response code and headers from the
  905. // server.
  906. googleapi.ServerResponse `json:"-"`
  907. // ForceSendFields is a list of field names (e.g. "Id") to
  908. // unconditionally include in API requests. By default, fields with
  909. // empty values are omitted from API requests. However, any non-pointer,
  910. // non-interface field appearing in ForceSendFields will be sent to the
  911. // server regardless of whether the field is empty or not. This may be
  912. // used to include empty fields in Patch requests.
  913. ForceSendFields []string `json:"-"`
  914. // NullFields is a list of field names (e.g. "Id") to include in API
  915. // requests with the JSON null value. By default, fields with empty
  916. // values are omitted from API requests. However, any field with an
  917. // empty value appearing in NullFields will be sent to the server as
  918. // null. It is an error if a field in this list has a non-empty value.
  919. // This may be used to include null fields in Patch requests.
  920. NullFields []string `json:"-"`
  921. }
  922. func (s *AcceleratorTypeList) MarshalJSON() ([]byte, error) {
  923. type NoMethod AcceleratorTypeList
  924. raw := NoMethod(*s)
  925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  926. }
  927. // AcceleratorTypeListWarning: [Output Only] Informational warning
  928. // message.
  929. type AcceleratorTypeListWarning struct {
  930. // Code: [Output Only] A warning code, if applicable. For example,
  931. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  932. // the response.
  933. //
  934. // Possible values:
  935. // "CLEANUP_FAILED"
  936. // "DEPRECATED_RESOURCE_USED"
  937. // "DEPRECATED_TYPE_USED"
  938. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  939. // "EXPERIMENTAL_TYPE_USED"
  940. // "EXTERNAL_API_WARNING"
  941. // "FIELD_VALUE_OVERRIDEN"
  942. // "INJECTED_KERNELS_DEPRECATED"
  943. // "MISSING_TYPE_DEPENDENCY"
  944. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  945. // "NEXT_HOP_CANNOT_IP_FORWARD"
  946. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  947. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  948. // "NEXT_HOP_NOT_RUNNING"
  949. // "NOT_CRITICAL_ERROR"
  950. // "NO_RESULTS_ON_PAGE"
  951. // "REQUIRED_TOS_AGREEMENT"
  952. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  953. // "RESOURCE_NOT_DELETED"
  954. // "SCHEMA_VALIDATION_IGNORED"
  955. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  956. // "UNDECLARED_PROPERTIES"
  957. // "UNREACHABLE"
  958. Code string `json:"code,omitempty"`
  959. // Data: [Output Only] Metadata about this warning in key: value format.
  960. // For example:
  961. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  962. Data []*AcceleratorTypeListWarningData `json:"data,omitempty"`
  963. // Message: [Output Only] A human-readable description of the warning
  964. // code.
  965. Message string `json:"message,omitempty"`
  966. // ForceSendFields is a list of field names (e.g. "Code") to
  967. // unconditionally include in API requests. By default, fields with
  968. // empty values are omitted from API requests. However, any non-pointer,
  969. // non-interface field appearing in ForceSendFields will be sent to the
  970. // server regardless of whether the field is empty or not. This may be
  971. // used to include empty fields in Patch requests.
  972. ForceSendFields []string `json:"-"`
  973. // NullFields is a list of field names (e.g. "Code") to include in API
  974. // requests with the JSON null value. By default, fields with empty
  975. // values are omitted from API requests. However, any field with an
  976. // empty value appearing in NullFields will be sent to the server as
  977. // null. It is an error if a field in this list has a non-empty value.
  978. // This may be used to include null fields in Patch requests.
  979. NullFields []string `json:"-"`
  980. }
  981. func (s *AcceleratorTypeListWarning) MarshalJSON() ([]byte, error) {
  982. type NoMethod AcceleratorTypeListWarning
  983. raw := NoMethod(*s)
  984. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  985. }
  986. type AcceleratorTypeListWarningData struct {
  987. // Key: [Output Only] A key that provides more detail on the warning
  988. // being returned. For example, for warnings where there are no results
  989. // in a list request for a particular zone, this key might be scope and
  990. // the key value might be the zone name. Other examples might be a key
  991. // indicating a deprecated resource and a suggested replacement, or a
  992. // warning about invalid network settings (for example, if an instance
  993. // attempts to perform IP forwarding but is not enabled for IP
  994. // forwarding).
  995. Key string `json:"key,omitempty"`
  996. // Value: [Output Only] A warning data value corresponding to the key.
  997. Value string `json:"value,omitempty"`
  998. // ForceSendFields is a list of field names (e.g. "Key") to
  999. // unconditionally include in API requests. By default, fields with
  1000. // empty values are omitted from API requests. However, any non-pointer,
  1001. // non-interface field appearing in ForceSendFields will be sent to the
  1002. // server regardless of whether the field is empty or not. This may be
  1003. // used to include empty fields in Patch requests.
  1004. ForceSendFields []string `json:"-"`
  1005. // NullFields is a list of field names (e.g. "Key") to include in API
  1006. // requests with the JSON null value. By default, fields with empty
  1007. // values are omitted from API requests. However, any field with an
  1008. // empty value appearing in NullFields will be sent to the server as
  1009. // null. It is an error if a field in this list has a non-empty value.
  1010. // This may be used to include null fields in Patch requests.
  1011. NullFields []string `json:"-"`
  1012. }
  1013. func (s *AcceleratorTypeListWarningData) MarshalJSON() ([]byte, error) {
  1014. type NoMethod AcceleratorTypeListWarningData
  1015. raw := NoMethod(*s)
  1016. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1017. }
  1018. type AcceleratorTypesScopedList struct {
  1019. // AcceleratorTypes: [Output Only] A list of accelerator types contained
  1020. // in this scope.
  1021. AcceleratorTypes []*AcceleratorType `json:"acceleratorTypes,omitempty"`
  1022. // Warning: [Output Only] An informational warning that appears when the
  1023. // accelerator types list is empty.
  1024. Warning *AcceleratorTypesScopedListWarning `json:"warning,omitempty"`
  1025. // ForceSendFields is a list of field names (e.g. "AcceleratorTypes") to
  1026. // unconditionally include in API requests. By default, fields with
  1027. // empty values are omitted from API requests. However, any non-pointer,
  1028. // non-interface field appearing in ForceSendFields will be sent to the
  1029. // server regardless of whether the field is empty or not. This may be
  1030. // used to include empty fields in Patch requests.
  1031. ForceSendFields []string `json:"-"`
  1032. // NullFields is a list of field names (e.g. "AcceleratorTypes") to
  1033. // include in API requests with the JSON null value. By default, fields
  1034. // with empty values are omitted from API requests. However, any field
  1035. // with an empty value appearing in NullFields will be sent to the
  1036. // server as null. It is an error if a field in this list has a
  1037. // non-empty value. This may be used to include null fields in Patch
  1038. // requests.
  1039. NullFields []string `json:"-"`
  1040. }
  1041. func (s *AcceleratorTypesScopedList) MarshalJSON() ([]byte, error) {
  1042. type NoMethod AcceleratorTypesScopedList
  1043. raw := NoMethod(*s)
  1044. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1045. }
  1046. // AcceleratorTypesScopedListWarning: [Output Only] An informational
  1047. // warning that appears when the accelerator types list is empty.
  1048. type AcceleratorTypesScopedListWarning struct {
  1049. // Code: [Output Only] A warning code, if applicable. For example,
  1050. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1051. // the response.
  1052. //
  1053. // Possible values:
  1054. // "CLEANUP_FAILED"
  1055. // "DEPRECATED_RESOURCE_USED"
  1056. // "DEPRECATED_TYPE_USED"
  1057. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1058. // "EXPERIMENTAL_TYPE_USED"
  1059. // "EXTERNAL_API_WARNING"
  1060. // "FIELD_VALUE_OVERRIDEN"
  1061. // "INJECTED_KERNELS_DEPRECATED"
  1062. // "MISSING_TYPE_DEPENDENCY"
  1063. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1064. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1065. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1066. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1067. // "NEXT_HOP_NOT_RUNNING"
  1068. // "NOT_CRITICAL_ERROR"
  1069. // "NO_RESULTS_ON_PAGE"
  1070. // "REQUIRED_TOS_AGREEMENT"
  1071. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1072. // "RESOURCE_NOT_DELETED"
  1073. // "SCHEMA_VALIDATION_IGNORED"
  1074. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1075. // "UNDECLARED_PROPERTIES"
  1076. // "UNREACHABLE"
  1077. Code string `json:"code,omitempty"`
  1078. // Data: [Output Only] Metadata about this warning in key: value format.
  1079. // For example:
  1080. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1081. Data []*AcceleratorTypesScopedListWarningData `json:"data,omitempty"`
  1082. // Message: [Output Only] A human-readable description of the warning
  1083. // code.
  1084. Message string `json:"message,omitempty"`
  1085. // ForceSendFields is a list of field names (e.g. "Code") to
  1086. // unconditionally include in API requests. By default, fields with
  1087. // empty values are omitted from API requests. However, any non-pointer,
  1088. // non-interface field appearing in ForceSendFields will be sent to the
  1089. // server regardless of whether the field is empty or not. This may be
  1090. // used to include empty fields in Patch requests.
  1091. ForceSendFields []string `json:"-"`
  1092. // NullFields is a list of field names (e.g. "Code") to include in API
  1093. // requests with the JSON null value. By default, fields with empty
  1094. // values are omitted from API requests. However, any field with an
  1095. // empty value appearing in NullFields will be sent to the server as
  1096. // null. It is an error if a field in this list has a non-empty value.
  1097. // This may be used to include null fields in Patch requests.
  1098. NullFields []string `json:"-"`
  1099. }
  1100. func (s *AcceleratorTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  1101. type NoMethod AcceleratorTypesScopedListWarning
  1102. raw := NoMethod(*s)
  1103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1104. }
  1105. type AcceleratorTypesScopedListWarningData struct {
  1106. // Key: [Output Only] A key that provides more detail on the warning
  1107. // being returned. For example, for warnings where there are no results
  1108. // in a list request for a particular zone, this key might be scope and
  1109. // the key value might be the zone name. Other examples might be a key
  1110. // indicating a deprecated resource and a suggested replacement, or a
  1111. // warning about invalid network settings (for example, if an instance
  1112. // attempts to perform IP forwarding but is not enabled for IP
  1113. // forwarding).
  1114. Key string `json:"key,omitempty"`
  1115. // Value: [Output Only] A warning data value corresponding to the key.
  1116. Value string `json:"value,omitempty"`
  1117. // ForceSendFields is a list of field names (e.g. "Key") to
  1118. // unconditionally include in API requests. By default, fields with
  1119. // empty values are omitted from API requests. However, any non-pointer,
  1120. // non-interface field appearing in ForceSendFields will be sent to the
  1121. // server regardless of whether the field is empty or not. This may be
  1122. // used to include empty fields in Patch requests.
  1123. ForceSendFields []string `json:"-"`
  1124. // NullFields is a list of field names (e.g. "Key") to include in API
  1125. // requests with the JSON null value. By default, fields with empty
  1126. // values are omitted from API requests. However, any field with an
  1127. // empty value appearing in NullFields will be sent to the server as
  1128. // null. It is an error if a field in this list has a non-empty value.
  1129. // This may be used to include null fields in Patch requests.
  1130. NullFields []string `json:"-"`
  1131. }
  1132. func (s *AcceleratorTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1133. type NoMethod AcceleratorTypesScopedListWarningData
  1134. raw := NoMethod(*s)
  1135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1136. }
  1137. // AccessConfig: An access configuration attached to an instance's
  1138. // network interface. Only one access config per instance is supported.
  1139. type AccessConfig struct {
  1140. // Kind: [Output Only] Type of the resource. Always compute#accessConfig
  1141. // for access configs.
  1142. Kind string `json:"kind,omitempty"`
  1143. // Name: The name of this access configuration. The default and
  1144. // recommended name is External NAT but you can use any arbitrary string
  1145. // you would like. For example, My external IP or Network Access.
  1146. Name string `json:"name,omitempty"`
  1147. // NatIP: An external IP address associated with this instance. Specify
  1148. // an unused static external IP address available to the project or
  1149. // leave this field undefined to use an IP from a shared ephemeral IP
  1150. // address pool. If you specify a static external IP address, it must
  1151. // live in the same region as the zone of the instance.
  1152. NatIP string `json:"natIP,omitempty"`
  1153. // NetworkTier: This signifies the networking tier used for configuring
  1154. // this access configuration and can only take the following values:
  1155. // PREMIUM, STANDARD.
  1156. //
  1157. // If an AccessConfig is specified without a valid external IP address,
  1158. // an ephemeral IP will be created with this networkTier.
  1159. //
  1160. // If an AccessConfig with a valid external IP address is specified, it
  1161. // must match that of the networkTier associated with the Address
  1162. // resource owning that IP.
  1163. //
  1164. // Possible values:
  1165. // "PREMIUM"
  1166. // "STANDARD"
  1167. NetworkTier string `json:"networkTier,omitempty"`
  1168. // PublicPtrDomainName: The DNS domain name for the public PTR record.
  1169. // This field can only be set when the set_public_ptr field is enabled.
  1170. PublicPtrDomainName string `json:"publicPtrDomainName,omitempty"`
  1171. // SetPublicPtr: Specifies whether a public DNS ?PTR? record should be
  1172. // created to map the external IP address of the instance to a DNS
  1173. // domain name.
  1174. SetPublicPtr bool `json:"setPublicPtr,omitempty"`
  1175. // Type: The type of configuration. The default and only option is
  1176. // ONE_TO_ONE_NAT.
  1177. //
  1178. // Possible values:
  1179. // "ONE_TO_ONE_NAT" (default)
  1180. Type string `json:"type,omitempty"`
  1181. // ForceSendFields is a list of field names (e.g. "Kind") to
  1182. // unconditionally include in API requests. By default, fields with
  1183. // empty values are omitted from API requests. However, any non-pointer,
  1184. // non-interface field appearing in ForceSendFields will be sent to the
  1185. // server regardless of whether the field is empty or not. This may be
  1186. // used to include empty fields in Patch requests.
  1187. ForceSendFields []string `json:"-"`
  1188. // NullFields is a list of field names (e.g. "Kind") to include in API
  1189. // requests with the JSON null value. By default, fields with empty
  1190. // values are omitted from API requests. However, any field with an
  1191. // empty value appearing in NullFields will be sent to the server as
  1192. // null. It is an error if a field in this list has a non-empty value.
  1193. // This may be used to include null fields in Patch requests.
  1194. NullFields []string `json:"-"`
  1195. }
  1196. func (s *AccessConfig) MarshalJSON() ([]byte, error) {
  1197. type NoMethod AccessConfig
  1198. raw := NoMethod(*s)
  1199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1200. }
  1201. // Address: A reserved address resource. (== resource_for beta.addresses
  1202. // ==) (== resource_for v1.addresses ==) (== resource_for
  1203. // beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)
  1204. type Address struct {
  1205. // Address: The static IP address represented by this resource.
  1206. Address string `json:"address,omitempty"`
  1207. // AddressType: The type of address to reserve, either INTERNAL or
  1208. // EXTERNAL. If unspecified, defaults to EXTERNAL.
  1209. //
  1210. // Possible values:
  1211. // "EXTERNAL"
  1212. // "INTERNAL"
  1213. // "UNSPECIFIED_TYPE"
  1214. AddressType string `json:"addressType,omitempty"`
  1215. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1216. // format.
  1217. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1218. // Description: An optional description of this resource. Provide this
  1219. // property when you create the resource.
  1220. Description string `json:"description,omitempty"`
  1221. // Id: [Output Only] The unique identifier for the resource. This
  1222. // identifier is defined by the server.
  1223. Id uint64 `json:"id,omitempty,string"`
  1224. // IpVersion: The IP Version that will be used by this address. Valid
  1225. // options are IPV4 or IPV6. This can only be specified for a global
  1226. // address.
  1227. //
  1228. // Possible values:
  1229. // "IPV4"
  1230. // "IPV6"
  1231. // "UNSPECIFIED_VERSION"
  1232. IpVersion string `json:"ipVersion,omitempty"`
  1233. // Kind: [Output Only] Type of the resource. Always compute#address for
  1234. // addresses.
  1235. Kind string `json:"kind,omitempty"`
  1236. // Name: Name of the resource. Provided by the client when the resource
  1237. // is created. The name must be 1-63 characters long, and comply with
  1238. // RFC1035. Specifically, the name must be 1-63 characters long and
  1239. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  1240. // the first character must be a lowercase letter, and all following
  1241. // characters must be a dash, lowercase letter, or digit, except the
  1242. // last character, which cannot be a dash.
  1243. Name string `json:"name,omitempty"`
  1244. // Network: The URL of the network in which to reserve the address. This
  1245. // field can only be used with INTERNAL type with VPC_PEERING purpose.
  1246. Network string `json:"network,omitempty"`
  1247. // NetworkTier: This signifies the networking tier used for configuring
  1248. // this Address and can only take the following values: PREMIUM,
  1249. // STANDARD. Global forwarding rules can only be Premium Tier. Regional
  1250. // forwarding rules can be either Premium or Standard Tier. Standard
  1251. // Tier addresses applied to regional forwarding rules can be used with
  1252. // any external load balancer. Regional forwarding rules in Premium Tier
  1253. // can only be used with a Network load balancer.
  1254. //
  1255. // If this field is not specified, it is assumed to be PREMIUM.
  1256. //
  1257. // Possible values:
  1258. // "PREMIUM"
  1259. // "STANDARD"
  1260. NetworkTier string `json:"networkTier,omitempty"`
  1261. // PrefixLength: The prefix length if the resource reprensents an IP
  1262. // range.
  1263. PrefixLength int64 `json:"prefixLength,omitempty"`
  1264. // Purpose: The purpose of resource, only used with INTERNAL type.
  1265. //
  1266. // Possible values:
  1267. // "DNS_RESOLVER"
  1268. // "GCE_ENDPOINT"
  1269. // "NAT_AUTO"
  1270. // "VPC_PEERING"
  1271. Purpose string `json:"purpose,omitempty"`
  1272. // Region: [Output Only] URL of the region where the regional address
  1273. // resides. This field is not applicable to global addresses. You must
  1274. // specify this field as part of the HTTP request URL. You cannot set
  1275. // this field in the request body.
  1276. Region string `json:"region,omitempty"`
  1277. // SelfLink: [Output Only] Server-defined URL for the resource.
  1278. SelfLink string `json:"selfLink,omitempty"`
  1279. // Status: [Output Only] The status of the address, which can be one of
  1280. // RESERVING, RESERVED, or IN_USE. An address that is RESERVING is
  1281. // currently in the process of being reserved. A RESERVED address is
  1282. // currently reserved and available to use. An IN_USE address is
  1283. // currently being used by another resource and is not available.
  1284. //
  1285. // Possible values:
  1286. // "IN_USE"
  1287. // "RESERVED"
  1288. // "RESERVING"
  1289. Status string `json:"status,omitempty"`
  1290. // Subnetwork: The URL of the subnetwork in which to reserve the
  1291. // address. If an IP address is specified, it must be within the
  1292. // subnetwork's IP range. This field can only be used with INTERNAL type
  1293. // with GCE_ENDPOINT/DNS_RESOLVER purposes.
  1294. Subnetwork string `json:"subnetwork,omitempty"`
  1295. // Users: [Output Only] The URLs of the resources that are using this
  1296. // address.
  1297. Users []string `json:"users,omitempty"`
  1298. // ServerResponse contains the HTTP response code and headers from the
  1299. // server.
  1300. googleapi.ServerResponse `json:"-"`
  1301. // ForceSendFields is a list of field names (e.g. "Address") to
  1302. // unconditionally include in API requests. By default, fields with
  1303. // empty values are omitted from API requests. However, any non-pointer,
  1304. // non-interface field appearing in ForceSendFields will be sent to the
  1305. // server regardless of whether the field is empty or not. This may be
  1306. // used to include empty fields in Patch requests.
  1307. ForceSendFields []string `json:"-"`
  1308. // NullFields is a list of field names (e.g. "Address") to include in
  1309. // API requests with the JSON null value. By default, fields with empty
  1310. // values are omitted from API requests. However, any field with an
  1311. // empty value appearing in NullFields will be sent to the server as
  1312. // null. It is an error if a field in this list has a non-empty value.
  1313. // This may be used to include null fields in Patch requests.
  1314. NullFields []string `json:"-"`
  1315. }
  1316. func (s *Address) MarshalJSON() ([]byte, error) {
  1317. type NoMethod Address
  1318. raw := NoMethod(*s)
  1319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1320. }
  1321. type AddressAggregatedList struct {
  1322. // Id: [Output Only] Unique identifier for the resource; defined by the
  1323. // server.
  1324. Id string `json:"id,omitempty"`
  1325. // Items: A list of AddressesScopedList resources.
  1326. Items map[string]AddressesScopedList `json:"items,omitempty"`
  1327. // Kind: [Output Only] Type of resource. Always
  1328. // compute#addressAggregatedList for aggregated lists of addresses.
  1329. Kind string `json:"kind,omitempty"`
  1330. // NextPageToken: [Output Only] This token allows you to get the next
  1331. // page of results for list requests. If the number of results is larger
  1332. // than maxResults, use the nextPageToken as a value for the query
  1333. // parameter pageToken in the next list request. Subsequent list
  1334. // requests will have their own nextPageToken to continue paging through
  1335. // the results.
  1336. NextPageToken string `json:"nextPageToken,omitempty"`
  1337. // SelfLink: [Output Only] Server-defined URL for this resource.
  1338. SelfLink string `json:"selfLink,omitempty"`
  1339. // Warning: [Output Only] Informational warning message.
  1340. Warning *AddressAggregatedListWarning `json:"warning,omitempty"`
  1341. // ServerResponse contains the HTTP response code and headers from the
  1342. // server.
  1343. googleapi.ServerResponse `json:"-"`
  1344. // ForceSendFields is a list of field names (e.g. "Id") to
  1345. // unconditionally include in API requests. By default, fields with
  1346. // empty values are omitted from API requests. However, any non-pointer,
  1347. // non-interface field appearing in ForceSendFields will be sent to the
  1348. // server regardless of whether the field is empty or not. This may be
  1349. // used to include empty fields in Patch requests.
  1350. ForceSendFields []string `json:"-"`
  1351. // NullFields is a list of field names (e.g. "Id") to include in API
  1352. // requests with the JSON null value. By default, fields with empty
  1353. // values are omitted from API requests. However, any field with an
  1354. // empty value appearing in NullFields will be sent to the server as
  1355. // null. It is an error if a field in this list has a non-empty value.
  1356. // This may be used to include null fields in Patch requests.
  1357. NullFields []string `json:"-"`
  1358. }
  1359. func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) {
  1360. type NoMethod AddressAggregatedList
  1361. raw := NoMethod(*s)
  1362. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1363. }
  1364. // AddressAggregatedListWarning: [Output Only] Informational warning
  1365. // message.
  1366. type AddressAggregatedListWarning struct {
  1367. // Code: [Output Only] A warning code, if applicable. For example,
  1368. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1369. // the response.
  1370. //
  1371. // Possible values:
  1372. // "CLEANUP_FAILED"
  1373. // "DEPRECATED_RESOURCE_USED"
  1374. // "DEPRECATED_TYPE_USED"
  1375. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1376. // "EXPERIMENTAL_TYPE_USED"
  1377. // "EXTERNAL_API_WARNING"
  1378. // "FIELD_VALUE_OVERRIDEN"
  1379. // "INJECTED_KERNELS_DEPRECATED"
  1380. // "MISSING_TYPE_DEPENDENCY"
  1381. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1382. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1383. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1384. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1385. // "NEXT_HOP_NOT_RUNNING"
  1386. // "NOT_CRITICAL_ERROR"
  1387. // "NO_RESULTS_ON_PAGE"
  1388. // "REQUIRED_TOS_AGREEMENT"
  1389. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1390. // "RESOURCE_NOT_DELETED"
  1391. // "SCHEMA_VALIDATION_IGNORED"
  1392. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1393. // "UNDECLARED_PROPERTIES"
  1394. // "UNREACHABLE"
  1395. Code string `json:"code,omitempty"`
  1396. // Data: [Output Only] Metadata about this warning in key: value format.
  1397. // For example:
  1398. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1399. Data []*AddressAggregatedListWarningData `json:"data,omitempty"`
  1400. // Message: [Output Only] A human-readable description of the warning
  1401. // code.
  1402. Message string `json:"message,omitempty"`
  1403. // ForceSendFields is a list of field names (e.g. "Code") to
  1404. // unconditionally include in API requests. By default, fields with
  1405. // empty values are omitted from API requests. However, any non-pointer,
  1406. // non-interface field appearing in ForceSendFields will be sent to the
  1407. // server regardless of whether the field is empty or not. This may be
  1408. // used to include empty fields in Patch requests.
  1409. ForceSendFields []string `json:"-"`
  1410. // NullFields is a list of field names (e.g. "Code") to include in API
  1411. // requests with the JSON null value. By default, fields with empty
  1412. // values are omitted from API requests. However, any field with an
  1413. // empty value appearing in NullFields will be sent to the server as
  1414. // null. It is an error if a field in this list has a non-empty value.
  1415. // This may be used to include null fields in Patch requests.
  1416. NullFields []string `json:"-"`
  1417. }
  1418. func (s *AddressAggregatedListWarning) MarshalJSON() ([]byte, error) {
  1419. type NoMethod AddressAggregatedListWarning
  1420. raw := NoMethod(*s)
  1421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1422. }
  1423. type AddressAggregatedListWarningData struct {
  1424. // Key: [Output Only] A key that provides more detail on the warning
  1425. // being returned. For example, for warnings where there are no results
  1426. // in a list request for a particular zone, this key might be scope and
  1427. // the key value might be the zone name. Other examples might be a key
  1428. // indicating a deprecated resource and a suggested replacement, or a
  1429. // warning about invalid network settings (for example, if an instance
  1430. // attempts to perform IP forwarding but is not enabled for IP
  1431. // forwarding).
  1432. Key string `json:"key,omitempty"`
  1433. // Value: [Output Only] A warning data value corresponding to the key.
  1434. Value string `json:"value,omitempty"`
  1435. // ForceSendFields is a list of field names (e.g. "Key") to
  1436. // unconditionally include in API requests. By default, fields with
  1437. // empty values are omitted from API requests. However, any non-pointer,
  1438. // non-interface field appearing in ForceSendFields will be sent to the
  1439. // server regardless of whether the field is empty or not. This may be
  1440. // used to include empty fields in Patch requests.
  1441. ForceSendFields []string `json:"-"`
  1442. // NullFields is a list of field names (e.g. "Key") to include in API
  1443. // requests with the JSON null value. By default, fields with empty
  1444. // values are omitted from API requests. However, any field with an
  1445. // empty value appearing in NullFields will be sent to the server as
  1446. // null. It is an error if a field in this list has a non-empty value.
  1447. // This may be used to include null fields in Patch requests.
  1448. NullFields []string `json:"-"`
  1449. }
  1450. func (s *AddressAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  1451. type NoMethod AddressAggregatedListWarningData
  1452. raw := NoMethod(*s)
  1453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1454. }
  1455. // AddressList: Contains a list of addresses.
  1456. type AddressList struct {
  1457. // Id: [Output Only] Unique identifier for the resource; defined by the
  1458. // server.
  1459. Id string `json:"id,omitempty"`
  1460. // Items: A list of Address resources.
  1461. Items []*Address `json:"items,omitempty"`
  1462. // Kind: [Output Only] Type of resource. Always compute#addressList for
  1463. // lists of addresses.
  1464. Kind string `json:"kind,omitempty"`
  1465. // NextPageToken: [Output Only] This token allows you to get the next
  1466. // page of results for list requests. If the number of results is larger
  1467. // than maxResults, use the nextPageToken as a value for the query
  1468. // parameter pageToken in the next list request. Subsequent list
  1469. // requests will have their own nextPageToken to continue paging through
  1470. // the results.
  1471. NextPageToken string `json:"nextPageToken,omitempty"`
  1472. // SelfLink: [Output Only] Server-defined URL for this resource.
  1473. SelfLink string `json:"selfLink,omitempty"`
  1474. // Warning: [Output Only] Informational warning message.
  1475. Warning *AddressListWarning `json:"warning,omitempty"`
  1476. // ServerResponse contains the HTTP response code and headers from the
  1477. // server.
  1478. googleapi.ServerResponse `json:"-"`
  1479. // ForceSendFields is a list of field names (e.g. "Id") to
  1480. // unconditionally include in API requests. By default, fields with
  1481. // empty values are omitted from API requests. However, any non-pointer,
  1482. // non-interface field appearing in ForceSendFields will be sent to the
  1483. // server regardless of whether the field is empty or not. This may be
  1484. // used to include empty fields in Patch requests.
  1485. ForceSendFields []string `json:"-"`
  1486. // NullFields is a list of field names (e.g. "Id") to include in API
  1487. // requests with the JSON null value. By default, fields with empty
  1488. // values are omitted from API requests. However, any field with an
  1489. // empty value appearing in NullFields will be sent to the server as
  1490. // null. It is an error if a field in this list has a non-empty value.
  1491. // This may be used to include null fields in Patch requests.
  1492. NullFields []string `json:"-"`
  1493. }
  1494. func (s *AddressList) MarshalJSON() ([]byte, error) {
  1495. type NoMethod AddressList
  1496. raw := NoMethod(*s)
  1497. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1498. }
  1499. // AddressListWarning: [Output Only] Informational warning message.
  1500. type AddressListWarning struct {
  1501. // Code: [Output Only] A warning code, if applicable. For example,
  1502. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1503. // the response.
  1504. //
  1505. // Possible values:
  1506. // "CLEANUP_FAILED"
  1507. // "DEPRECATED_RESOURCE_USED"
  1508. // "DEPRECATED_TYPE_USED"
  1509. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1510. // "EXPERIMENTAL_TYPE_USED"
  1511. // "EXTERNAL_API_WARNING"
  1512. // "FIELD_VALUE_OVERRIDEN"
  1513. // "INJECTED_KERNELS_DEPRECATED"
  1514. // "MISSING_TYPE_DEPENDENCY"
  1515. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1516. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1517. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1518. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1519. // "NEXT_HOP_NOT_RUNNING"
  1520. // "NOT_CRITICAL_ERROR"
  1521. // "NO_RESULTS_ON_PAGE"
  1522. // "REQUIRED_TOS_AGREEMENT"
  1523. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1524. // "RESOURCE_NOT_DELETED"
  1525. // "SCHEMA_VALIDATION_IGNORED"
  1526. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1527. // "UNDECLARED_PROPERTIES"
  1528. // "UNREACHABLE"
  1529. Code string `json:"code,omitempty"`
  1530. // Data: [Output Only] Metadata about this warning in key: value format.
  1531. // For example:
  1532. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1533. Data []*AddressListWarningData `json:"data,omitempty"`
  1534. // Message: [Output Only] A human-readable description of the warning
  1535. // code.
  1536. Message string `json:"message,omitempty"`
  1537. // ForceSendFields is a list of field names (e.g. "Code") to
  1538. // unconditionally include in API requests. By default, fields with
  1539. // empty values are omitted from API requests. However, any non-pointer,
  1540. // non-interface field appearing in ForceSendFields will be sent to the
  1541. // server regardless of whether the field is empty or not. This may be
  1542. // used to include empty fields in Patch requests.
  1543. ForceSendFields []string `json:"-"`
  1544. // NullFields is a list of field names (e.g. "Code") to include in API
  1545. // requests with the JSON null value. By default, fields with empty
  1546. // values are omitted from API requests. However, any field with an
  1547. // empty value appearing in NullFields will be sent to the server as
  1548. // null. It is an error if a field in this list has a non-empty value.
  1549. // This may be used to include null fields in Patch requests.
  1550. NullFields []string `json:"-"`
  1551. }
  1552. func (s *AddressListWarning) MarshalJSON() ([]byte, error) {
  1553. type NoMethod AddressListWarning
  1554. raw := NoMethod(*s)
  1555. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1556. }
  1557. type AddressListWarningData struct {
  1558. // Key: [Output Only] A key that provides more detail on the warning
  1559. // being returned. For example, for warnings where there are no results
  1560. // in a list request for a particular zone, this key might be scope and
  1561. // the key value might be the zone name. Other examples might be a key
  1562. // indicating a deprecated resource and a suggested replacement, or a
  1563. // warning about invalid network settings (for example, if an instance
  1564. // attempts to perform IP forwarding but is not enabled for IP
  1565. // forwarding).
  1566. Key string `json:"key,omitempty"`
  1567. // Value: [Output Only] A warning data value corresponding to the key.
  1568. Value string `json:"value,omitempty"`
  1569. // ForceSendFields is a list of field names (e.g. "Key") to
  1570. // unconditionally include in API requests. By default, fields with
  1571. // empty values are omitted from API requests. However, any non-pointer,
  1572. // non-interface field appearing in ForceSendFields will be sent to the
  1573. // server regardless of whether the field is empty or not. This may be
  1574. // used to include empty fields in Patch requests.
  1575. ForceSendFields []string `json:"-"`
  1576. // NullFields is a list of field names (e.g. "Key") to include in API
  1577. // requests with the JSON null value. By default, fields with empty
  1578. // values are omitted from API requests. However, any field with an
  1579. // empty value appearing in NullFields will be sent to the server as
  1580. // null. It is an error if a field in this list has a non-empty value.
  1581. // This may be used to include null fields in Patch requests.
  1582. NullFields []string `json:"-"`
  1583. }
  1584. func (s *AddressListWarningData) MarshalJSON() ([]byte, error) {
  1585. type NoMethod AddressListWarningData
  1586. raw := NoMethod(*s)
  1587. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1588. }
  1589. type AddressesScopedList struct {
  1590. // Addresses: [Output Only] A list of addresses contained in this scope.
  1591. Addresses []*Address `json:"addresses,omitempty"`
  1592. // Warning: [Output Only] Informational warning which replaces the list
  1593. // of addresses when the list is empty.
  1594. Warning *AddressesScopedListWarning `json:"warning,omitempty"`
  1595. // ForceSendFields is a list of field names (e.g. "Addresses") to
  1596. // unconditionally include in API requests. By default, fields with
  1597. // empty values are omitted from API requests. However, any non-pointer,
  1598. // non-interface field appearing in ForceSendFields will be sent to the
  1599. // server regardless of whether the field is empty or not. This may be
  1600. // used to include empty fields in Patch requests.
  1601. ForceSendFields []string `json:"-"`
  1602. // NullFields is a list of field names (e.g. "Addresses") to include in
  1603. // API requests with the JSON null value. By default, fields with empty
  1604. // values are omitted from API requests. However, any field with an
  1605. // empty value appearing in NullFields will be sent to the server as
  1606. // null. It is an error if a field in this list has a non-empty value.
  1607. // This may be used to include null fields in Patch requests.
  1608. NullFields []string `json:"-"`
  1609. }
  1610. func (s *AddressesScopedList) MarshalJSON() ([]byte, error) {
  1611. type NoMethod AddressesScopedList
  1612. raw := NoMethod(*s)
  1613. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1614. }
  1615. // AddressesScopedListWarning: [Output Only] Informational warning which
  1616. // replaces the list of addresses when the list is empty.
  1617. type AddressesScopedListWarning struct {
  1618. // Code: [Output Only] A warning code, if applicable. For example,
  1619. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1620. // the response.
  1621. //
  1622. // Possible values:
  1623. // "CLEANUP_FAILED"
  1624. // "DEPRECATED_RESOURCE_USED"
  1625. // "DEPRECATED_TYPE_USED"
  1626. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1627. // "EXPERIMENTAL_TYPE_USED"
  1628. // "EXTERNAL_API_WARNING"
  1629. // "FIELD_VALUE_OVERRIDEN"
  1630. // "INJECTED_KERNELS_DEPRECATED"
  1631. // "MISSING_TYPE_DEPENDENCY"
  1632. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1633. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1634. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1635. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1636. // "NEXT_HOP_NOT_RUNNING"
  1637. // "NOT_CRITICAL_ERROR"
  1638. // "NO_RESULTS_ON_PAGE"
  1639. // "REQUIRED_TOS_AGREEMENT"
  1640. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1641. // "RESOURCE_NOT_DELETED"
  1642. // "SCHEMA_VALIDATION_IGNORED"
  1643. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1644. // "UNDECLARED_PROPERTIES"
  1645. // "UNREACHABLE"
  1646. Code string `json:"code,omitempty"`
  1647. // Data: [Output Only] Metadata about this warning in key: value format.
  1648. // For example:
  1649. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1650. Data []*AddressesScopedListWarningData `json:"data,omitempty"`
  1651. // Message: [Output Only] A human-readable description of the warning
  1652. // code.
  1653. Message string `json:"message,omitempty"`
  1654. // ForceSendFields is a list of field names (e.g. "Code") to
  1655. // unconditionally include in API requests. By default, fields with
  1656. // empty values are omitted from API requests. However, any non-pointer,
  1657. // non-interface field appearing in ForceSendFields will be sent to the
  1658. // server regardless of whether the field is empty or not. This may be
  1659. // used to include empty fields in Patch requests.
  1660. ForceSendFields []string `json:"-"`
  1661. // NullFields is a list of field names (e.g. "Code") to include in API
  1662. // requests with the JSON null value. By default, fields with empty
  1663. // values are omitted from API requests. However, any field with an
  1664. // empty value appearing in NullFields will be sent to the server as
  1665. // null. It is an error if a field in this list has a non-empty value.
  1666. // This may be used to include null fields in Patch requests.
  1667. NullFields []string `json:"-"`
  1668. }
  1669. func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) {
  1670. type NoMethod AddressesScopedListWarning
  1671. raw := NoMethod(*s)
  1672. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1673. }
  1674. type AddressesScopedListWarningData struct {
  1675. // Key: [Output Only] A key that provides more detail on the warning
  1676. // being returned. For example, for warnings where there are no results
  1677. // in a list request for a particular zone, this key might be scope and
  1678. // the key value might be the zone name. Other examples might be a key
  1679. // indicating a deprecated resource and a suggested replacement, or a
  1680. // warning about invalid network settings (for example, if an instance
  1681. // attempts to perform IP forwarding but is not enabled for IP
  1682. // forwarding).
  1683. Key string `json:"key,omitempty"`
  1684. // Value: [Output Only] A warning data value corresponding to the key.
  1685. Value string `json:"value,omitempty"`
  1686. // ForceSendFields is a list of field names (e.g. "Key") to
  1687. // unconditionally include in API requests. By default, fields with
  1688. // empty values are omitted from API requests. However, any non-pointer,
  1689. // non-interface field appearing in ForceSendFields will be sent to the
  1690. // server regardless of whether the field is empty or not. This may be
  1691. // used to include empty fields in Patch requests.
  1692. ForceSendFields []string `json:"-"`
  1693. // NullFields is a list of field names (e.g. "Key") to include in API
  1694. // requests with the JSON null value. By default, fields with empty
  1695. // values are omitted from API requests. However, any field with an
  1696. // empty value appearing in NullFields will be sent to the server as
  1697. // null. It is an error if a field in this list has a non-empty value.
  1698. // This may be used to include null fields in Patch requests.
  1699. NullFields []string `json:"-"`
  1700. }
  1701. func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1702. type NoMethod AddressesScopedListWarningData
  1703. raw := NoMethod(*s)
  1704. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1705. }
  1706. // AliasIpRange: An alias IP range attached to an instance's network
  1707. // interface.
  1708. type AliasIpRange struct {
  1709. // IpCidrRange: The IP CIDR range represented by this alias IP range.
  1710. // This IP CIDR range must belong to the specified subnetwork and cannot
  1711. // contain IP addresses reserved by system or used by other network
  1712. // interfaces. This range may be a single IP address (e.g. 10.2.3.4), a
  1713. // netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
  1714. IpCidrRange string `json:"ipCidrRange,omitempty"`
  1715. // SubnetworkRangeName: Optional subnetwork secondary range name
  1716. // specifying the secondary range from which to allocate the IP CIDR
  1717. // range for this alias IP range. If left unspecified, the primary range
  1718. // of the subnetwork will be used.
  1719. SubnetworkRangeName string `json:"subnetworkRangeName,omitempty"`
  1720. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  1721. // unconditionally include in API requests. By default, fields with
  1722. // empty values are omitted from API requests. However, any non-pointer,
  1723. // non-interface field appearing in ForceSendFields will be sent to the
  1724. // server regardless of whether the field is empty or not. This may be
  1725. // used to include empty fields in Patch requests.
  1726. ForceSendFields []string `json:"-"`
  1727. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  1728. // in API requests with the JSON null value. By default, fields with
  1729. // empty values are omitted from API requests. However, any field with
  1730. // an empty value appearing in NullFields will be sent to the server as
  1731. // null. It is an error if a field in this list has a non-empty value.
  1732. // This may be used to include null fields in Patch requests.
  1733. NullFields []string `json:"-"`
  1734. }
  1735. func (s *AliasIpRange) MarshalJSON() ([]byte, error) {
  1736. type NoMethod AliasIpRange
  1737. raw := NoMethod(*s)
  1738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1739. }
  1740. // AttachedDisk: An instance-attached disk resource.
  1741. type AttachedDisk struct {
  1742. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  1743. // instance is deleted (but not when the disk is detached from the
  1744. // instance).
  1745. AutoDelete bool `json:"autoDelete,omitempty"`
  1746. // Boot: Indicates that this is a boot disk. The virtual machine will
  1747. // use the first partition of the disk for its root filesystem.
  1748. Boot bool `json:"boot,omitempty"`
  1749. // DeviceName: Specifies a unique device name of your choice that is
  1750. // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
  1751. // system running within the instance. This name can be used to
  1752. // reference the device for mounting, resizing, and so on, from within
  1753. // the instance.
  1754. //
  1755. // If not specified, the server chooses a default device name to apply
  1756. // to this disk, in the form persistent-disk-x, where x is a number
  1757. // assigned by Google Compute Engine. This field is only applicable for
  1758. // persistent disks.
  1759. DeviceName string `json:"deviceName,omitempty"`
  1760. // DiskEncryptionKey: Encrypts or decrypts a disk using a
  1761. // customer-supplied encryption key.
  1762. //
  1763. // If you are creating a new disk, this field encrypts the new disk
  1764. // using an encryption key that you provide. If you are attaching an
  1765. // existing disk that is already encrypted, this field decrypts the disk
  1766. // using the customer-supplied encryption key.
  1767. //
  1768. // If you encrypt a disk using a customer-supplied key, you must provide
  1769. // the same key again when you attempt to use this resource at a later
  1770. // time. For example, you must provide the key when you create a
  1771. // snapshot or an image from the disk or when you attach the disk to a
  1772. // virtual machine instance.
  1773. //
  1774. // If you do not provide an encryption key, then the disk will be
  1775. // encrypted using an automatically generated key and you do not need to
  1776. // provide a key to use the disk later.
  1777. //
  1778. // Instance templates do not store customer-supplied encryption keys, so
  1779. // you cannot use your own keys to encrypt disks in a managed instance
  1780. // group.
  1781. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  1782. // GuestOsFeatures: A list of features to enable on the guest operating
  1783. // system. Applicable only for bootable images. Read Enabling guest
  1784. // operating system features to see a list of available options.
  1785. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  1786. // Index: [Output Only] A zero-based index to this disk, where 0 is
  1787. // reserved for the boot disk. If you have many disks attached to an
  1788. // instance, each disk would have a unique index number.
  1789. Index int64 `json:"index,omitempty"`
  1790. // InitializeParams: [Input Only] Specifies the parameters for a new
  1791. // disk that will be created alongside the new instance. Use
  1792. // initialization parameters to create boot disks or local SSDs attached
  1793. // to the new instance.
  1794. //
  1795. // This property is mutually exclusive with the source property; you can
  1796. // only define one or the other, but not both.
  1797. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  1798. // Interface: Specifies the disk interface to use for attaching this
  1799. // disk, which is either SCSI or NVME. The default is SCSI. Persistent
  1800. // disks must always use SCSI and the request will fail if you attempt
  1801. // to attach a persistent disk in any other format than SCSI. Local SSDs
  1802. // can use either NVME or SCSI. For performance characteristics of SCSI
  1803. // over NVMe, see Local SSD performance.
  1804. //
  1805. // Possible values:
  1806. // "NVME"
  1807. // "SCSI"
  1808. Interface string `json:"interface,omitempty"`
  1809. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  1810. // for attached disks.
  1811. Kind string `json:"kind,omitempty"`
  1812. // Licenses: [Output Only] Any valid publicly visible licenses.
  1813. Licenses []string `json:"licenses,omitempty"`
  1814. // Mode: The mode in which to attach this disk, either READ_WRITE or
  1815. // READ_ONLY. If not specified, the default is to attach the disk in
  1816. // READ_WRITE mode.
  1817. //
  1818. // Possible values:
  1819. // "READ_ONLY"
  1820. // "READ_WRITE"
  1821. Mode string `json:"mode,omitempty"`
  1822. // Source: Specifies a valid partial or full URL to an existing
  1823. // Persistent Disk resource. When creating a new instance, one of
  1824. // initializeParams.sourceImage or disks.source is required except for
  1825. // local SSD.
  1826. //
  1827. // If desired, you can also attach existing non-root persistent disks
  1828. // using this property. This field is only applicable for persistent
  1829. // disks.
  1830. //
  1831. // Note that for InstanceTemplate, specify the disk name, not the URL
  1832. // for the disk.
  1833. Source string `json:"source,omitempty"`
  1834. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  1835. // If not specified, the default is PERSISTENT.
  1836. //
  1837. // Possible values:
  1838. // "PERSISTENT"
  1839. // "SCRATCH"
  1840. Type string `json:"type,omitempty"`
  1841. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  1842. // unconditionally include in API requests. By default, fields with
  1843. // empty values are omitted from API requests. However, any non-pointer,
  1844. // non-interface field appearing in ForceSendFields will be sent to the
  1845. // server regardless of whether the field is empty or not. This may be
  1846. // used to include empty fields in Patch requests.
  1847. ForceSendFields []string `json:"-"`
  1848. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  1849. // API requests with the JSON null value. By default, fields with empty
  1850. // values are omitted from API requests. However, any field with an
  1851. // empty value appearing in NullFields will be sent to the server as
  1852. // null. It is an error if a field in this list has a non-empty value.
  1853. // This may be used to include null fields in Patch requests.
  1854. NullFields []string `json:"-"`
  1855. }
  1856. func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
  1857. type NoMethod AttachedDisk
  1858. raw := NoMethod(*s)
  1859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1860. }
  1861. // AttachedDiskInitializeParams: [Input Only] Specifies the parameters
  1862. // for a new disk that will be created alongside the new instance. Use
  1863. // initialization parameters to create boot disks or local SSDs attached
  1864. // to the new instance.
  1865. //
  1866. // This property is mutually exclusive with the source property; you can
  1867. // only define one or the other, but not both.
  1868. type AttachedDiskInitializeParams struct {
  1869. // Description: An optional description. Provide this property when
  1870. // creating the disk.
  1871. Description string `json:"description,omitempty"`
  1872. // DiskName: Specifies the disk name. If not specified, the default is
  1873. // to use the name of the instance. If the disk with the instance name
  1874. // exists already in the given zone/region, a new name will be
  1875. // automatically generated.
  1876. DiskName string `json:"diskName,omitempty"`
  1877. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  1878. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  1879. // DiskType: Specifies the disk type to use to create the instance. If
  1880. // not specified, the default is pd-standard, specified using the full
  1881. // URL. For
  1882. // example:
  1883. // https://www.googleapis.com/compute/v1/projects/project/zones/
  1884. // zone/diskTypes/pd-standard
  1885. //
  1886. //
  1887. // Other values include pd-ssd and local-ssd. If you define this field,
  1888. // you can provide either the full or partial URL. For example, the
  1889. // following are valid values:
  1890. // -
  1891. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
  1892. // - projects/project/zones/zone/diskTypes/diskType
  1893. // - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this
  1894. // is the name of the disk type, not URL.
  1895. DiskType string `json:"diskType,omitempty"`
  1896. // Labels: Labels to apply to this disk. These can be later modified by
  1897. // the disks.setLabels method. This field is only applicable for
  1898. // persistent disks.
  1899. Labels map[string]string `json:"labels,omitempty"`
  1900. // SourceImage: The source image to create this disk. When creating a
  1901. // new instance, one of initializeParams.sourceImage or disks.source is
  1902. // required except for local SSD.
  1903. //
  1904. // To create a disk with one of the public operating system images,
  1905. // specify the image by its family name. For example, specify
  1906. // family/debian-9 to use the latest Debian 9
  1907. // image:
  1908. // projects/debian-cloud/global/images/family/debian-9
  1909. //
  1910. //
  1911. // Alternati
  1912. // vely, use a specific version of a public operating system
  1913. // image:
  1914. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  1915. //
  1916. //
  1917. //
  1918. // To create a disk with a custom image that you created, specify the
  1919. // image name in the following
  1920. // format:
  1921. // global/images/my-custom-image
  1922. //
  1923. //
  1924. // You can also specify a custom image by its image family, which
  1925. // returns the latest version of the image in that family. Replace the
  1926. // image name with
  1927. // family/family-name:
  1928. // global/images/family/my-image-family
  1929. //
  1930. //
  1931. // If the source image is deleted later, this field will not be set.
  1932. SourceImage string `json:"sourceImage,omitempty"`
  1933. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  1934. // source image. Required if the source image is protected by a
  1935. // customer-supplied encryption key.
  1936. //
  1937. // Instance templates do not store customer-supplied encryption keys, so
  1938. // you cannot create disks for instances in a managed instance group if
  1939. // the source images are encrypted with your own keys.
  1940. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  1941. // ForceSendFields is a list of field names (e.g. "Description") to
  1942. // unconditionally include in API requests. By default, fields with
  1943. // empty values are omitted from API requests. However, any non-pointer,
  1944. // non-interface field appearing in ForceSendFields will be sent to the
  1945. // server regardless of whether the field is empty or not. This may be
  1946. // used to include empty fields in Patch requests.
  1947. ForceSendFields []string `json:"-"`
  1948. // NullFields is a list of field names (e.g. "Description") to include
  1949. // in API requests with the JSON null value. By default, fields with
  1950. // empty values are omitted from API requests. However, any field with
  1951. // an empty value appearing in NullFields will be sent to the server as
  1952. // null. It is an error if a field in this list has a non-empty value.
  1953. // This may be used to include null fields in Patch requests.
  1954. NullFields []string `json:"-"`
  1955. }
  1956. func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
  1957. type NoMethod AttachedDiskInitializeParams
  1958. raw := NoMethod(*s)
  1959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1960. }
  1961. // AuditConfig: Specifies the audit configuration for a service. The
  1962. // configuration determines which permission types are logged, and what
  1963. // identities, if any, are exempted from logging. An AuditConfig must
  1964. // have one or more AuditLogConfigs.
  1965. //
  1966. // If there are AuditConfigs for both `allServices` and a specific
  1967. // service, the union of the two AuditConfigs is used for that service:
  1968. // the log_types specified in each AuditConfig are enabled, and the
  1969. // exempted_members in each AuditLogConfig are exempted.
  1970. //
  1971. // Example Policy with multiple AuditConfigs:
  1972. //
  1973. // { "audit_configs": [ { "service": "allServices" "audit_log_configs":
  1974. // [ { "log_type": "DATA_READ", "exempted_members": [
  1975. // "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, {
  1976. // "log_type": "ADMIN_READ", } ] }, { "service":
  1977. // "fooservice.googleapis.com" "audit_log_configs": [ { "log_type":
  1978. // "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [
  1979. // "user:bar@gmail.com" ] } ] } ] }
  1980. //
  1981. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  1982. // ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ
  1983. // logging, and bar@gmail.com from DATA_WRITE logging.
  1984. type AuditConfig struct {
  1985. // AuditLogConfigs: The configuration for logging of each type of
  1986. // permission.
  1987. AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
  1988. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  1989. // Service: Specifies a service that will be enabled for audit logging.
  1990. // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
  1991. // `allServices` is a special value that covers all services.
  1992. Service string `json:"service,omitempty"`
  1993. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  1994. // unconditionally include in API requests. By default, fields with
  1995. // empty values are omitted from API requests. However, any non-pointer,
  1996. // non-interface field appearing in ForceSendFields will be sent to the
  1997. // server regardless of whether the field is empty or not. This may be
  1998. // used to include empty fields in Patch requests.
  1999. ForceSendFields []string `json:"-"`
  2000. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  2001. // include in API requests with the JSON null value. By default, fields
  2002. // with empty values are omitted from API requests. However, any field
  2003. // with an empty value appearing in NullFields will be sent to the
  2004. // server as null. It is an error if a field in this list has a
  2005. // non-empty value. This may be used to include null fields in Patch
  2006. // requests.
  2007. NullFields []string `json:"-"`
  2008. }
  2009. func (s *AuditConfig) MarshalJSON() ([]byte, error) {
  2010. type NoMethod AuditConfig
  2011. raw := NoMethod(*s)
  2012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2013. }
  2014. // AuditLogConfig: Provides the configuration for logging a type of
  2015. // permissions. Example:
  2016. //
  2017. // { "audit_log_configs": [ { "log_type": "DATA_READ",
  2018. // "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type":
  2019. // "DATA_WRITE", } ] }
  2020. //
  2021. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
  2022. // foo@gmail.com from DATA_READ logging.
  2023. type AuditLogConfig struct {
  2024. // ExemptedMembers: Specifies the identities that do not cause logging
  2025. // for this type of permission. Follows the same format of
  2026. // [Binding.members][].
  2027. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2028. // LogType: The log type that this config enables.
  2029. //
  2030. // Possible values:
  2031. // "ADMIN_READ"
  2032. // "DATA_READ"
  2033. // "DATA_WRITE"
  2034. // "LOG_TYPE_UNSPECIFIED"
  2035. LogType string `json:"logType,omitempty"`
  2036. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  2037. // unconditionally include in API requests. By default, fields with
  2038. // empty values are omitted from API requests. However, any non-pointer,
  2039. // non-interface field appearing in ForceSendFields will be sent to the
  2040. // server regardless of whether the field is empty or not. This may be
  2041. // used to include empty fields in Patch requests.
  2042. ForceSendFields []string `json:"-"`
  2043. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  2044. // include in API requests with the JSON null value. By default, fields
  2045. // with empty values are omitted from API requests. However, any field
  2046. // with an empty value appearing in NullFields will be sent to the
  2047. // server as null. It is an error if a field in this list has a
  2048. // non-empty value. This may be used to include null fields in Patch
  2049. // requests.
  2050. NullFields []string `json:"-"`
  2051. }
  2052. func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
  2053. type NoMethod AuditLogConfig
  2054. raw := NoMethod(*s)
  2055. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2056. }
  2057. // AuthorizationLoggingOptions: Authorization-related information used
  2058. // by Cloud Audit Logging.
  2059. type AuthorizationLoggingOptions struct {
  2060. // PermissionType: The type of the permission that was checked.
  2061. //
  2062. // Possible values:
  2063. // "ADMIN_READ"
  2064. // "ADMIN_WRITE"
  2065. // "DATA_READ"
  2066. // "DATA_WRITE"
  2067. // "PERMISSION_TYPE_UNSPECIFIED"
  2068. PermissionType string `json:"permissionType,omitempty"`
  2069. // ForceSendFields is a list of field names (e.g. "PermissionType") to
  2070. // unconditionally include in API requests. By default, fields with
  2071. // empty values are omitted from API requests. However, any non-pointer,
  2072. // non-interface field appearing in ForceSendFields will be sent to the
  2073. // server regardless of whether the field is empty or not. This may be
  2074. // used to include empty fields in Patch requests.
  2075. ForceSendFields []string `json:"-"`
  2076. // NullFields is a list of field names (e.g. "PermissionType") to
  2077. // include in API requests with the JSON null value. By default, fields
  2078. // with empty values are omitted from API requests. However, any field
  2079. // with an empty value appearing in NullFields will be sent to the
  2080. // server as null. It is an error if a field in this list has a
  2081. // non-empty value. This may be used to include null fields in Patch
  2082. // requests.
  2083. NullFields []string `json:"-"`
  2084. }
  2085. func (s *AuthorizationLoggingOptions) MarshalJSON() ([]byte, error) {
  2086. type NoMethod AuthorizationLoggingOptions
  2087. raw := NoMethod(*s)
  2088. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2089. }
  2090. // Autoscaler: Represents an Autoscaler resource. Autoscalers allow you
  2091. // to automatically scale virtual machine instances in managed instance
  2092. // groups according to an autoscaling policy that you define. For more
  2093. // information, read Autoscaling Groups of Instances. (== resource_for
  2094. // beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
  2095. // resource_for beta.regionAutoscalers ==) (== resource_for
  2096. // v1.regionAutoscalers ==)
  2097. type Autoscaler struct {
  2098. // AutoscalingPolicy: The configuration parameters for the autoscaling
  2099. // algorithm. You can define one or more of the policies for an
  2100. // autoscaler: cpuUtilization, customMetricUtilizations, and
  2101. // loadBalancingUtilization.
  2102. //
  2103. // If none of these are specified, the default will be to autoscale
  2104. // based on cpuUtilization to 0.6 or 60%.
  2105. AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  2106. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2107. // format.
  2108. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2109. // Description: An optional description of this resource. Provide this
  2110. // property when you create the resource.
  2111. Description string `json:"description,omitempty"`
  2112. // Id: [Output Only] The unique identifier for the resource. This
  2113. // identifier is defined by the server.
  2114. Id uint64 `json:"id,omitempty,string"`
  2115. // Kind: [Output Only] Type of the resource. Always compute#autoscaler
  2116. // for autoscalers.
  2117. Kind string `json:"kind,omitempty"`
  2118. // Name: Name of the resource. Provided by the client when the resource
  2119. // is created. The name must be 1-63 characters long, and comply with
  2120. // RFC1035. Specifically, the name must be 1-63 characters long and
  2121. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  2122. // the first character must be a lowercase letter, and all following
  2123. // characters must be a dash, lowercase letter, or digit, except the
  2124. // last character, which cannot be a dash.
  2125. Name string `json:"name,omitempty"`
  2126. // Region: [Output Only] URL of the region where the instance group
  2127. // resides (for autoscalers living in regional scope).
  2128. Region string `json:"region,omitempty"`
  2129. // SelfLink: [Output Only] Server-defined URL for the resource.
  2130. SelfLink string `json:"selfLink,omitempty"`
  2131. // Status: [Output Only] The status of the autoscaler configuration.
  2132. //
  2133. // Possible values:
  2134. // "ACTIVE"
  2135. // "DELETING"
  2136. // "ERROR"
  2137. // "PENDING"
  2138. Status string `json:"status,omitempty"`
  2139. // StatusDetails: [Output Only] Human-readable details about the current
  2140. // state of the autoscaler. Read the documentation for Commonly returned
  2141. // status messages for examples of status messages you might encounter.
  2142. StatusDetails []*AutoscalerStatusDetails `json:"statusDetails,omitempty"`
  2143. // Target: URL of the managed instance group that this autoscaler will
  2144. // scale.
  2145. Target string `json:"target,omitempty"`
  2146. // Zone: [Output Only] URL of the zone where the instance group resides
  2147. // (for autoscalers living in zonal scope).
  2148. Zone string `json:"zone,omitempty"`
  2149. // ServerResponse contains the HTTP response code and headers from the
  2150. // server.
  2151. googleapi.ServerResponse `json:"-"`
  2152. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  2153. // to unconditionally include in API requests. By default, fields with
  2154. // empty values are omitted from API requests. However, any non-pointer,
  2155. // non-interface field appearing in ForceSendFields will be sent to the
  2156. // server regardless of whether the field is empty or not. This may be
  2157. // used to include empty fields in Patch requests.
  2158. ForceSendFields []string `json:"-"`
  2159. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  2160. // include in API requests with the JSON null value. By default, fields
  2161. // with empty values are omitted from API requests. However, any field
  2162. // with an empty value appearing in NullFields will be sent to the
  2163. // server as null. It is an error if a field in this list has a
  2164. // non-empty value. This may be used to include null fields in Patch
  2165. // requests.
  2166. NullFields []string `json:"-"`
  2167. }
  2168. func (s *Autoscaler) MarshalJSON() ([]byte, error) {
  2169. type NoMethod Autoscaler
  2170. raw := NoMethod(*s)
  2171. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2172. }
  2173. type AutoscalerAggregatedList struct {
  2174. // Id: [Output Only] Unique identifier for the resource; defined by the
  2175. // server.
  2176. Id string `json:"id,omitempty"`
  2177. // Items: A list of AutoscalersScopedList resources.
  2178. Items map[string]AutoscalersScopedList `json:"items,omitempty"`
  2179. // Kind: [Output Only] Type of resource. Always
  2180. // compute#autoscalerAggregatedList for aggregated lists of autoscalers.
  2181. Kind string `json:"kind,omitempty"`
  2182. // NextPageToken: [Output Only] This token allows you to get the next
  2183. // page of results for list requests. If the number of results is larger
  2184. // than maxResults, use the nextPageToken as a value for the query
  2185. // parameter pageToken in the next list request. Subsequent list
  2186. // requests will have their own nextPageToken to continue paging through
  2187. // the results.
  2188. NextPageToken string `json:"nextPageToken,omitempty"`
  2189. // SelfLink: [Output Only] Server-defined URL for this resource.
  2190. SelfLink string `json:"selfLink,omitempty"`
  2191. // Warning: [Output Only] Informational warning message.
  2192. Warning *AutoscalerAggregatedListWarning `json:"warning,omitempty"`
  2193. // ServerResponse contains the HTTP response code and headers from the
  2194. // server.
  2195. googleapi.ServerResponse `json:"-"`
  2196. // ForceSendFields is a list of field names (e.g. "Id") to
  2197. // unconditionally include in API requests. By default, fields with
  2198. // empty values are omitted from API requests. However, any non-pointer,
  2199. // non-interface field appearing in ForceSendFields will be sent to the
  2200. // server regardless of whether the field is empty or not. This may be
  2201. // used to include empty fields in Patch requests.
  2202. ForceSendFields []string `json:"-"`
  2203. // NullFields is a list of field names (e.g. "Id") to include in API
  2204. // requests with the JSON null value. By default, fields with empty
  2205. // values are omitted from API requests. However, any field with an
  2206. // empty value appearing in NullFields will be sent to the server as
  2207. // null. It is an error if a field in this list has a non-empty value.
  2208. // This may be used to include null fields in Patch requests.
  2209. NullFields []string `json:"-"`
  2210. }
  2211. func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
  2212. type NoMethod AutoscalerAggregatedList
  2213. raw := NoMethod(*s)
  2214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2215. }
  2216. // AutoscalerAggregatedListWarning: [Output Only] Informational warning
  2217. // message.
  2218. type AutoscalerAggregatedListWarning struct {
  2219. // Code: [Output Only] A warning code, if applicable. For example,
  2220. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2221. // the response.
  2222. //
  2223. // Possible values:
  2224. // "CLEANUP_FAILED"
  2225. // "DEPRECATED_RESOURCE_USED"
  2226. // "DEPRECATED_TYPE_USED"
  2227. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2228. // "EXPERIMENTAL_TYPE_USED"
  2229. // "EXTERNAL_API_WARNING"
  2230. // "FIELD_VALUE_OVERRIDEN"
  2231. // "INJECTED_KERNELS_DEPRECATED"
  2232. // "MISSING_TYPE_DEPENDENCY"
  2233. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2234. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2235. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2236. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2237. // "NEXT_HOP_NOT_RUNNING"
  2238. // "NOT_CRITICAL_ERROR"
  2239. // "NO_RESULTS_ON_PAGE"
  2240. // "REQUIRED_TOS_AGREEMENT"
  2241. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2242. // "RESOURCE_NOT_DELETED"
  2243. // "SCHEMA_VALIDATION_IGNORED"
  2244. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2245. // "UNDECLARED_PROPERTIES"
  2246. // "UNREACHABLE"
  2247. Code string `json:"code,omitempty"`
  2248. // Data: [Output Only] Metadata about this warning in key: value format.
  2249. // For example:
  2250. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2251. Data []*AutoscalerAggregatedListWarningData `json:"data,omitempty"`
  2252. // Message: [Output Only] A human-readable description of the warning
  2253. // code.
  2254. Message string `json:"message,omitempty"`
  2255. // ForceSendFields is a list of field names (e.g. "Code") to
  2256. // unconditionally include in API requests. By default, fields with
  2257. // empty values are omitted from API requests. However, any non-pointer,
  2258. // non-interface field appearing in ForceSendFields will be sent to the
  2259. // server regardless of whether the field is empty or not. This may be
  2260. // used to include empty fields in Patch requests.
  2261. ForceSendFields []string `json:"-"`
  2262. // NullFields is a list of field names (e.g. "Code") to include in API
  2263. // requests with the JSON null value. By default, fields with empty
  2264. // values are omitted from API requests. However, any field with an
  2265. // empty value appearing in NullFields will be sent to the server as
  2266. // null. It is an error if a field in this list has a non-empty value.
  2267. // This may be used to include null fields in Patch requests.
  2268. NullFields []string `json:"-"`
  2269. }
  2270. func (s *AutoscalerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  2271. type NoMethod AutoscalerAggregatedListWarning
  2272. raw := NoMethod(*s)
  2273. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2274. }
  2275. type AutoscalerAggregatedListWarningData struct {
  2276. // Key: [Output Only] A key that provides more detail on the warning
  2277. // being returned. For example, for warnings where there are no results
  2278. // in a list request for a particular zone, this key might be scope and
  2279. // the key value might be the zone name. Other examples might be a key
  2280. // indicating a deprecated resource and a suggested replacement, or a
  2281. // warning about invalid network settings (for example, if an instance
  2282. // attempts to perform IP forwarding but is not enabled for IP
  2283. // forwarding).
  2284. Key string `json:"key,omitempty"`
  2285. // Value: [Output Only] A warning data value corresponding to the key.
  2286. Value string `json:"value,omitempty"`
  2287. // ForceSendFields is a list of field names (e.g. "Key") to
  2288. // unconditionally include in API requests. By default, fields with
  2289. // empty values are omitted from API requests. However, any non-pointer,
  2290. // non-interface field appearing in ForceSendFields will be sent to the
  2291. // server regardless of whether the field is empty or not. This may be
  2292. // used to include empty fields in Patch requests.
  2293. ForceSendFields []string `json:"-"`
  2294. // NullFields is a list of field names (e.g. "Key") to include in API
  2295. // requests with the JSON null value. By default, fields with empty
  2296. // values are omitted from API requests. However, any field with an
  2297. // empty value appearing in NullFields will be sent to the server as
  2298. // null. It is an error if a field in this list has a non-empty value.
  2299. // This may be used to include null fields in Patch requests.
  2300. NullFields []string `json:"-"`
  2301. }
  2302. func (s *AutoscalerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  2303. type NoMethod AutoscalerAggregatedListWarningData
  2304. raw := NoMethod(*s)
  2305. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2306. }
  2307. // AutoscalerList: Contains a list of Autoscaler resources.
  2308. type AutoscalerList struct {
  2309. // Id: [Output Only] Unique identifier for the resource; defined by the
  2310. // server.
  2311. Id string `json:"id,omitempty"`
  2312. // Items: A list of Autoscaler resources.
  2313. Items []*Autoscaler `json:"items,omitempty"`
  2314. // Kind: [Output Only] Type of resource. Always compute#autoscalerList
  2315. // for lists of autoscalers.
  2316. Kind string `json:"kind,omitempty"`
  2317. // NextPageToken: [Output Only] This token allows you to get the next
  2318. // page of results for list requests. If the number of results is larger
  2319. // than maxResults, use the nextPageToken as a value for the query
  2320. // parameter pageToken in the next list request. Subsequent list
  2321. // requests will have their own nextPageToken to continue paging through
  2322. // the results.
  2323. NextPageToken string `json:"nextPageToken,omitempty"`
  2324. // SelfLink: [Output Only] Server-defined URL for this resource.
  2325. SelfLink string `json:"selfLink,omitempty"`
  2326. // Warning: [Output Only] Informational warning message.
  2327. Warning *AutoscalerListWarning `json:"warning,omitempty"`
  2328. // ServerResponse contains the HTTP response code and headers from the
  2329. // server.
  2330. googleapi.ServerResponse `json:"-"`
  2331. // ForceSendFields is a list of field names (e.g. "Id") to
  2332. // unconditionally include in API requests. By default, fields with
  2333. // empty values are omitted from API requests. However, any non-pointer,
  2334. // non-interface field appearing in ForceSendFields will be sent to the
  2335. // server regardless of whether the field is empty or not. This may be
  2336. // used to include empty fields in Patch requests.
  2337. ForceSendFields []string `json:"-"`
  2338. // NullFields is a list of field names (e.g. "Id") to include in API
  2339. // requests with the JSON null value. By default, fields with empty
  2340. // values are omitted from API requests. However, any field with an
  2341. // empty value appearing in NullFields will be sent to the server as
  2342. // null. It is an error if a field in this list has a non-empty value.
  2343. // This may be used to include null fields in Patch requests.
  2344. NullFields []string `json:"-"`
  2345. }
  2346. func (s *AutoscalerList) MarshalJSON() ([]byte, error) {
  2347. type NoMethod AutoscalerList
  2348. raw := NoMethod(*s)
  2349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2350. }
  2351. // AutoscalerListWarning: [Output Only] Informational warning message.
  2352. type AutoscalerListWarning struct {
  2353. // Code: [Output Only] A warning code, if applicable. For example,
  2354. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2355. // the response.
  2356. //
  2357. // Possible values:
  2358. // "CLEANUP_FAILED"
  2359. // "DEPRECATED_RESOURCE_USED"
  2360. // "DEPRECATED_TYPE_USED"
  2361. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2362. // "EXPERIMENTAL_TYPE_USED"
  2363. // "EXTERNAL_API_WARNING"
  2364. // "FIELD_VALUE_OVERRIDEN"
  2365. // "INJECTED_KERNELS_DEPRECATED"
  2366. // "MISSING_TYPE_DEPENDENCY"
  2367. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2368. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2369. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2370. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2371. // "NEXT_HOP_NOT_RUNNING"
  2372. // "NOT_CRITICAL_ERROR"
  2373. // "NO_RESULTS_ON_PAGE"
  2374. // "REQUIRED_TOS_AGREEMENT"
  2375. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2376. // "RESOURCE_NOT_DELETED"
  2377. // "SCHEMA_VALIDATION_IGNORED"
  2378. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2379. // "UNDECLARED_PROPERTIES"
  2380. // "UNREACHABLE"
  2381. Code string `json:"code,omitempty"`
  2382. // Data: [Output Only] Metadata about this warning in key: value format.
  2383. // For example:
  2384. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2385. Data []*AutoscalerListWarningData `json:"data,omitempty"`
  2386. // Message: [Output Only] A human-readable description of the warning
  2387. // code.
  2388. Message string `json:"message,omitempty"`
  2389. // ForceSendFields is a list of field names (e.g. "Code") to
  2390. // unconditionally include in API requests. By default, fields with
  2391. // empty values are omitted from API requests. However, any non-pointer,
  2392. // non-interface field appearing in ForceSendFields will be sent to the
  2393. // server regardless of whether the field is empty or not. This may be
  2394. // used to include empty fields in Patch requests.
  2395. ForceSendFields []string `json:"-"`
  2396. // NullFields is a list of field names (e.g. "Code") to include in API
  2397. // requests with the JSON null value. By default, fields with empty
  2398. // values are omitted from API requests. However, any field with an
  2399. // empty value appearing in NullFields will be sent to the server as
  2400. // null. It is an error if a field in this list has a non-empty value.
  2401. // This may be used to include null fields in Patch requests.
  2402. NullFields []string `json:"-"`
  2403. }
  2404. func (s *AutoscalerListWarning) MarshalJSON() ([]byte, error) {
  2405. type NoMethod AutoscalerListWarning
  2406. raw := NoMethod(*s)
  2407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2408. }
  2409. type AutoscalerListWarningData struct {
  2410. // Key: [Output Only] A key that provides more detail on the warning
  2411. // being returned. For example, for warnings where there are no results
  2412. // in a list request for a particular zone, this key might be scope and
  2413. // the key value might be the zone name. Other examples might be a key
  2414. // indicating a deprecated resource and a suggested replacement, or a
  2415. // warning about invalid network settings (for example, if an instance
  2416. // attempts to perform IP forwarding but is not enabled for IP
  2417. // forwarding).
  2418. Key string `json:"key,omitempty"`
  2419. // Value: [Output Only] A warning data value corresponding to the key.
  2420. Value string `json:"value,omitempty"`
  2421. // ForceSendFields is a list of field names (e.g. "Key") to
  2422. // unconditionally include in API requests. By default, fields with
  2423. // empty values are omitted from API requests. However, any non-pointer,
  2424. // non-interface field appearing in ForceSendFields will be sent to the
  2425. // server regardless of whether the field is empty or not. This may be
  2426. // used to include empty fields in Patch requests.
  2427. ForceSendFields []string `json:"-"`
  2428. // NullFields is a list of field names (e.g. "Key") to include in API
  2429. // requests with the JSON null value. By default, fields with empty
  2430. // values are omitted from API requests. However, any field with an
  2431. // empty value appearing in NullFields will be sent to the server as
  2432. // null. It is an error if a field in this list has a non-empty value.
  2433. // This may be used to include null fields in Patch requests.
  2434. NullFields []string `json:"-"`
  2435. }
  2436. func (s *AutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  2437. type NoMethod AutoscalerListWarningData
  2438. raw := NoMethod(*s)
  2439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2440. }
  2441. type AutoscalerStatusDetails struct {
  2442. // Message: The status message.
  2443. Message string `json:"message,omitempty"`
  2444. // Type: The type of error returned.
  2445. //
  2446. // Possible values:
  2447. // "ALL_INSTANCES_UNHEALTHY"
  2448. // "BACKEND_SERVICE_DOES_NOT_EXIST"
  2449. // "CAPPED_AT_MAX_NUM_REPLICAS"
  2450. // "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE"
  2451. // "CUSTOM_METRIC_INVALID"
  2452. // "MIN_EQUALS_MAX"
  2453. // "MISSING_CUSTOM_METRIC_DATA_POINTS"
  2454. // "MISSING_LOAD_BALANCING_DATA_POINTS"
  2455. // "MORE_THAN_ONE_BACKEND_SERVICE"
  2456. // "NOT_ENOUGH_QUOTA_AVAILABLE"
  2457. // "REGION_RESOURCE_STOCKOUT"
  2458. // "SCALING_TARGET_DOES_NOT_EXIST"
  2459. // "UNKNOWN"
  2460. // "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION"
  2461. // "ZONE_RESOURCE_STOCKOUT"
  2462. Type string `json:"type,omitempty"`
  2463. // ForceSendFields is a list of field names (e.g. "Message") to
  2464. // unconditionally include in API requests. By default, fields with
  2465. // empty values are omitted from API requests. However, any non-pointer,
  2466. // non-interface field appearing in ForceSendFields will be sent to the
  2467. // server regardless of whether the field is empty or not. This may be
  2468. // used to include empty fields in Patch requests.
  2469. ForceSendFields []string `json:"-"`
  2470. // NullFields is a list of field names (e.g. "Message") to include in
  2471. // API requests with the JSON null value. By default, fields with empty
  2472. // values are omitted from API requests. However, any field with an
  2473. // empty value appearing in NullFields will be sent to the server as
  2474. // null. It is an error if a field in this list has a non-empty value.
  2475. // This may be used to include null fields in Patch requests.
  2476. NullFields []string `json:"-"`
  2477. }
  2478. func (s *AutoscalerStatusDetails) MarshalJSON() ([]byte, error) {
  2479. type NoMethod AutoscalerStatusDetails
  2480. raw := NoMethod(*s)
  2481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2482. }
  2483. type AutoscalersScopedList struct {
  2484. // Autoscalers: [Output Only] A list of autoscalers contained in this
  2485. // scope.
  2486. Autoscalers []*Autoscaler `json:"autoscalers,omitempty"`
  2487. // Warning: [Output Only] Informational warning which replaces the list
  2488. // of autoscalers when the list is empty.
  2489. Warning *AutoscalersScopedListWarning `json:"warning,omitempty"`
  2490. // ForceSendFields is a list of field names (e.g. "Autoscalers") to
  2491. // unconditionally include in API requests. By default, fields with
  2492. // empty values are omitted from API requests. However, any non-pointer,
  2493. // non-interface field appearing in ForceSendFields will be sent to the
  2494. // server regardless of whether the field is empty or not. This may be
  2495. // used to include empty fields in Patch requests.
  2496. ForceSendFields []string `json:"-"`
  2497. // NullFields is a list of field names (e.g. "Autoscalers") to include
  2498. // in API requests with the JSON null value. By default, fields with
  2499. // empty values are omitted from API requests. However, any field with
  2500. // an empty value appearing in NullFields will be sent to the server as
  2501. // null. It is an error if a field in this list has a non-empty value.
  2502. // This may be used to include null fields in Patch requests.
  2503. NullFields []string `json:"-"`
  2504. }
  2505. func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) {
  2506. type NoMethod AutoscalersScopedList
  2507. raw := NoMethod(*s)
  2508. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2509. }
  2510. // AutoscalersScopedListWarning: [Output Only] Informational warning
  2511. // which replaces the list of autoscalers when the list is empty.
  2512. type AutoscalersScopedListWarning struct {
  2513. // Code: [Output Only] A warning code, if applicable. For example,
  2514. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2515. // the response.
  2516. //
  2517. // Possible values:
  2518. // "CLEANUP_FAILED"
  2519. // "DEPRECATED_RESOURCE_USED"
  2520. // "DEPRECATED_TYPE_USED"
  2521. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2522. // "EXPERIMENTAL_TYPE_USED"
  2523. // "EXTERNAL_API_WARNING"
  2524. // "FIELD_VALUE_OVERRIDEN"
  2525. // "INJECTED_KERNELS_DEPRECATED"
  2526. // "MISSING_TYPE_DEPENDENCY"
  2527. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2528. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2529. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2530. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2531. // "NEXT_HOP_NOT_RUNNING"
  2532. // "NOT_CRITICAL_ERROR"
  2533. // "NO_RESULTS_ON_PAGE"
  2534. // "REQUIRED_TOS_AGREEMENT"
  2535. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2536. // "RESOURCE_NOT_DELETED"
  2537. // "SCHEMA_VALIDATION_IGNORED"
  2538. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2539. // "UNDECLARED_PROPERTIES"
  2540. // "UNREACHABLE"
  2541. Code string `json:"code,omitempty"`
  2542. // Data: [Output Only] Metadata about this warning in key: value format.
  2543. // For example:
  2544. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2545. Data []*AutoscalersScopedListWarningData `json:"data,omitempty"`
  2546. // Message: [Output Only] A human-readable description of the warning
  2547. // code.
  2548. Message string `json:"message,omitempty"`
  2549. // ForceSendFields is a list of field names (e.g. "Code") to
  2550. // unconditionally include in API requests. By default, fields with
  2551. // empty values are omitted from API requests. However, any non-pointer,
  2552. // non-interface field appearing in ForceSendFields will be sent to the
  2553. // server regardless of whether the field is empty or not. This may be
  2554. // used to include empty fields in Patch requests.
  2555. ForceSendFields []string `json:"-"`
  2556. // NullFields is a list of field names (e.g. "Code") to include in API
  2557. // requests with the JSON null value. By default, fields with empty
  2558. // values are omitted from API requests. However, any field with an
  2559. // empty value appearing in NullFields will be sent to the server as
  2560. // null. It is an error if a field in this list has a non-empty value.
  2561. // This may be used to include null fields in Patch requests.
  2562. NullFields []string `json:"-"`
  2563. }
  2564. func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
  2565. type NoMethod AutoscalersScopedListWarning
  2566. raw := NoMethod(*s)
  2567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2568. }
  2569. type AutoscalersScopedListWarningData struct {
  2570. // Key: [Output Only] A key that provides more detail on the warning
  2571. // being returned. For example, for warnings where there are no results
  2572. // in a list request for a particular zone, this key might be scope and
  2573. // the key value might be the zone name. Other examples might be a key
  2574. // indicating a deprecated resource and a suggested replacement, or a
  2575. // warning about invalid network settings (for example, if an instance
  2576. // attempts to perform IP forwarding but is not enabled for IP
  2577. // forwarding).
  2578. Key string `json:"key,omitempty"`
  2579. // Value: [Output Only] A warning data value corresponding to the key.
  2580. Value string `json:"value,omitempty"`
  2581. // ForceSendFields is a list of field names (e.g. "Key") to
  2582. // unconditionally include in API requests. By default, fields with
  2583. // empty values are omitted from API requests. However, any non-pointer,
  2584. // non-interface field appearing in ForceSendFields will be sent to the
  2585. // server regardless of whether the field is empty or not. This may be
  2586. // used to include empty fields in Patch requests.
  2587. ForceSendFields []string `json:"-"`
  2588. // NullFields is a list of field names (e.g. "Key") to include in API
  2589. // requests with the JSON null value. By default, fields with empty
  2590. // values are omitted from API requests. However, any field with an
  2591. // empty value appearing in NullFields will be sent to the server as
  2592. // null. It is an error if a field in this list has a non-empty value.
  2593. // This may be used to include null fields in Patch requests.
  2594. NullFields []string `json:"-"`
  2595. }
  2596. func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
  2597. type NoMethod AutoscalersScopedListWarningData
  2598. raw := NoMethod(*s)
  2599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2600. }
  2601. // AutoscalingPolicy: Cloud Autoscaler policy.
  2602. type AutoscalingPolicy struct {
  2603. // CoolDownPeriodSec: The number of seconds that the autoscaler should
  2604. // wait before it starts collecting information from a new instance.
  2605. // This prevents the autoscaler from collecting information when the
  2606. // instance is initializing, during which the collected usage would not
  2607. // be reliable. The default time autoscaler waits is 60
  2608. // seconds.
  2609. //
  2610. // Virtual machine initialization times might vary because of numerous
  2611. // factors. We recommend that you test how long an instance may take to
  2612. // initialize. To do this, create an instance and time the startup
  2613. // process.
  2614. CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"`
  2615. // CpuUtilization: Defines the CPU utilization policy that allows the
  2616. // autoscaler to scale based on the average CPU utilization of a managed
  2617. // instance group.
  2618. CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"`
  2619. // CustomMetricUtilizations: Configuration parameters of autoscaling
  2620. // based on a custom metric.
  2621. CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"`
  2622. // LoadBalancingUtilization: Configuration parameters of autoscaling
  2623. // based on load balancer.
  2624. LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"`
  2625. // MaxNumReplicas: The maximum number of instances that the autoscaler
  2626. // can scale up to. This is required when creating or updating an
  2627. // autoscaler. The maximum number of replicas should not be lower than
  2628. // minimal number of replicas.
  2629. MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"`
  2630. // MinNumReplicas: The minimum number of replicas that the autoscaler
  2631. // can scale down to. This cannot be less than 0. If not provided,
  2632. // autoscaler will choose a default value depending on maximum number of
  2633. // instances allowed.
  2634. MinNumReplicas int64 `json:"minNumReplicas,omitempty"`
  2635. // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec")
  2636. // to unconditionally include in API requests. By default, fields with
  2637. // empty values are omitted from API requests. However, any non-pointer,
  2638. // non-interface field appearing in ForceSendFields will be sent to the
  2639. // server regardless of whether the field is empty or not. This may be
  2640. // used to include empty fields in Patch requests.
  2641. ForceSendFields []string `json:"-"`
  2642. // NullFields is a list of field names (e.g. "CoolDownPeriodSec") to
  2643. // include in API requests with the JSON null value. By default, fields
  2644. // with empty values are omitted from API requests. However, any field
  2645. // with an empty value appearing in NullFields will be sent to the
  2646. // server as null. It is an error if a field in this list has a
  2647. // non-empty value. This may be used to include null fields in Patch
  2648. // requests.
  2649. NullFields []string `json:"-"`
  2650. }
  2651. func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
  2652. type NoMethod AutoscalingPolicy
  2653. raw := NoMethod(*s)
  2654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2655. }
  2656. // AutoscalingPolicyCpuUtilization: CPU utilization policy.
  2657. type AutoscalingPolicyCpuUtilization struct {
  2658. // UtilizationTarget: The target CPU utilization that the autoscaler
  2659. // should maintain. Must be a float value in the range (0, 1]. If not
  2660. // specified, the default is 0.6.
  2661. //
  2662. // If the CPU level is below the target utilization, the autoscaler
  2663. // scales down the number of instances until it reaches the minimum
  2664. // number of instances you specified or until the average CPU of your
  2665. // instances reaches the target utilization.
  2666. //
  2667. // If the average CPU is above the target utilization, the autoscaler
  2668. // scales up until it reaches the maximum number of instances you
  2669. // specified or until the average utilization reaches the target
  2670. // utilization.
  2671. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2672. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  2673. // to unconditionally include in API requests. By default, fields with
  2674. // empty values are omitted from API requests. However, any non-pointer,
  2675. // non-interface field appearing in ForceSendFields will be sent to the
  2676. // server regardless of whether the field is empty or not. This may be
  2677. // used to include empty fields in Patch requests.
  2678. ForceSendFields []string `json:"-"`
  2679. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  2680. // include in API requests with the JSON null value. By default, fields
  2681. // with empty values are omitted from API requests. However, any field
  2682. // with an empty value appearing in NullFields will be sent to the
  2683. // server as null. It is an error if a field in this list has a
  2684. // non-empty value. This may be used to include null fields in Patch
  2685. // requests.
  2686. NullFields []string `json:"-"`
  2687. }
  2688. func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
  2689. type NoMethod AutoscalingPolicyCpuUtilization
  2690. raw := NoMethod(*s)
  2691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2692. }
  2693. func (s *AutoscalingPolicyCpuUtilization) UnmarshalJSON(data []byte) error {
  2694. type NoMethod AutoscalingPolicyCpuUtilization
  2695. var s1 struct {
  2696. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2697. *NoMethod
  2698. }
  2699. s1.NoMethod = (*NoMethod)(s)
  2700. if err := json.Unmarshal(data, &s1); err != nil {
  2701. return err
  2702. }
  2703. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2704. return nil
  2705. }
  2706. // AutoscalingPolicyCustomMetricUtilization: Custom utilization metric
  2707. // policy.
  2708. type AutoscalingPolicyCustomMetricUtilization struct {
  2709. // Metric: The identifier (type) of the Stackdriver Monitoring metric.
  2710. // The metric cannot have negative values.
  2711. //
  2712. // The metric must have a value type of INT64 or DOUBLE.
  2713. Metric string `json:"metric,omitempty"`
  2714. // UtilizationTarget: The target value of the metric that autoscaler
  2715. // should maintain. This must be a positive value. A utilization metric
  2716. // scales number of virtual machines handling requests to increase or
  2717. // decrease proportionally to the metric.
  2718. //
  2719. // For example, a good metric to use as a utilization_target is
  2720. // compute.googleapis.com/instance/network/received_bytes_count. The
  2721. // autoscaler will work to keep this value constant for each of the
  2722. // instances.
  2723. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2724. // UtilizationTargetType: Defines how target utilization value is
  2725. // expressed for a Stackdriver Monitoring metric. Either GAUGE,
  2726. // DELTA_PER_SECOND, or DELTA_PER_MINUTE.
  2727. //
  2728. // Possible values:
  2729. // "DELTA_PER_MINUTE"
  2730. // "DELTA_PER_SECOND"
  2731. // "GAUGE"
  2732. UtilizationTargetType string `json:"utilizationTargetType,omitempty"`
  2733. // ForceSendFields is a list of field names (e.g. "Metric") to
  2734. // unconditionally include in API requests. By default, fields with
  2735. // empty values are omitted from API requests. However, any non-pointer,
  2736. // non-interface field appearing in ForceSendFields will be sent to the
  2737. // server regardless of whether the field is empty or not. This may be
  2738. // used to include empty fields in Patch requests.
  2739. ForceSendFields []string `json:"-"`
  2740. // NullFields is a list of field names (e.g. "Metric") to include in API
  2741. // requests with the JSON null value. By default, fields with empty
  2742. // values are omitted from API requests. However, any field with an
  2743. // empty value appearing in NullFields will be sent to the server as
  2744. // null. It is an error if a field in this list has a non-empty value.
  2745. // This may be used to include null fields in Patch requests.
  2746. NullFields []string `json:"-"`
  2747. }
  2748. func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
  2749. type NoMethod AutoscalingPolicyCustomMetricUtilization
  2750. raw := NoMethod(*s)
  2751. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2752. }
  2753. func (s *AutoscalingPolicyCustomMetricUtilization) UnmarshalJSON(data []byte) error {
  2754. type NoMethod AutoscalingPolicyCustomMetricUtilization
  2755. var s1 struct {
  2756. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2757. *NoMethod
  2758. }
  2759. s1.NoMethod = (*NoMethod)(s)
  2760. if err := json.Unmarshal(data, &s1); err != nil {
  2761. return err
  2762. }
  2763. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2764. return nil
  2765. }
  2766. // AutoscalingPolicyLoadBalancingUtilization: Configuration parameters
  2767. // of autoscaling based on load balancing.
  2768. type AutoscalingPolicyLoadBalancingUtilization struct {
  2769. // UtilizationTarget: Fraction of backend capacity utilization (set in
  2770. // HTTP(S) load balancing configuration) that autoscaler should
  2771. // maintain. Must be a positive float value. If not defined, the default
  2772. // is 0.8.
  2773. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2774. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  2775. // to unconditionally include in API requests. By default, fields with
  2776. // empty values are omitted from API requests. However, any non-pointer,
  2777. // non-interface field appearing in ForceSendFields will be sent to the
  2778. // server regardless of whether the field is empty or not. This may be
  2779. // used to include empty fields in Patch requests.
  2780. ForceSendFields []string `json:"-"`
  2781. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  2782. // include in API requests with the JSON null value. By default, fields
  2783. // with empty values are omitted from API requests. However, any field
  2784. // with an empty value appearing in NullFields will be sent to the
  2785. // server as null. It is an error if a field in this list has a
  2786. // non-empty value. This may be used to include null fields in Patch
  2787. // requests.
  2788. NullFields []string `json:"-"`
  2789. }
  2790. func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
  2791. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  2792. raw := NoMethod(*s)
  2793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2794. }
  2795. func (s *AutoscalingPolicyLoadBalancingUtilization) UnmarshalJSON(data []byte) error {
  2796. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  2797. var s1 struct {
  2798. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2799. *NoMethod
  2800. }
  2801. s1.NoMethod = (*NoMethod)(s)
  2802. if err := json.Unmarshal(data, &s1); err != nil {
  2803. return err
  2804. }
  2805. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2806. return nil
  2807. }
  2808. // Backend: Message containing information of one individual backend.
  2809. type Backend struct {
  2810. // BalancingMode: Specifies the balancing mode for this backend. For
  2811. // global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION.
  2812. // Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for
  2813. // TCP/SSL).
  2814. //
  2815. // For Internal Load Balancing, the default and only supported mode is
  2816. // CONNECTION.
  2817. //
  2818. // Possible values:
  2819. // "CONNECTION"
  2820. // "RATE"
  2821. // "UTILIZATION"
  2822. BalancingMode string `json:"balancingMode,omitempty"`
  2823. // CapacityScaler: A multiplier applied to the group's maximum servicing
  2824. // capacity (based on UTILIZATION, RATE or CONNECTION). Default value is
  2825. // 1, which means the group will serve up to 100% of its configured
  2826. // capacity (depending on balancingMode). A setting of 0 means the group
  2827. // is completely drained, offering 0% of its available Capacity. Valid
  2828. // range is [0.0,1.0].
  2829. //
  2830. // This cannot be used for internal load balancing.
  2831. CapacityScaler float64 `json:"capacityScaler,omitempty"`
  2832. // Description: An optional description of this resource. Provide this
  2833. // property when you create the resource.
  2834. Description string `json:"description,omitempty"`
  2835. // Group: The fully-qualified URL of an Instance Group or Network
  2836. // Endpoint Group resource. In case of instance group this defines the
  2837. // list of instances that serve traffic. Member virtual machine
  2838. // instances from each instance group must live in the same zone as the
  2839. // instance group itself. No two backends in a backend service are
  2840. // allowed to use same Instance Group resource.
  2841. //
  2842. // For Network Endpoint Groups this defines list of endpoints. All
  2843. // endpoints of Network Endpoint Group must be hosted on instances
  2844. // located in the same zone as the Network Endpoint Group.
  2845. //
  2846. // Backend service can not contain mix of Instance Group and Network
  2847. // Endpoint Group backends.
  2848. //
  2849. // Note that you must specify an Instance Group or Network Endpoint
  2850. // Group resource using the fully-qualified URL, rather than a partial
  2851. // URL.
  2852. //
  2853. // When the BackendService has load balancing scheme INTERNAL, the
  2854. // instance group must be within the same region as the BackendService.
  2855. // Network Endpoint Groups are not supported for INTERNAL load balancing
  2856. // scheme.
  2857. Group string `json:"group,omitempty"`
  2858. // MaxConnections: The max number of simultaneous connections for the
  2859. // group. Can be used with either CONNECTION or UTILIZATION balancing
  2860. // modes. For CONNECTION mode, either maxConnections or
  2861. // maxConnectionsPerInstance must be set.
  2862. //
  2863. // This cannot be used for internal load balancing.
  2864. MaxConnections int64 `json:"maxConnections,omitempty"`
  2865. // MaxConnectionsPerInstance: The max number of simultaneous connections
  2866. // that a single backend instance can handle. This is used to calculate
  2867. // the capacity of the group. Can be used in either CONNECTION or
  2868. // UTILIZATION balancing modes. For CONNECTION mode, either
  2869. // maxConnections or maxConnectionsPerInstance must be set.
  2870. //
  2871. // This cannot be used for internal load balancing.
  2872. MaxConnectionsPerInstance int64 `json:"maxConnectionsPerInstance,omitempty"`
  2873. // MaxRate: The max requests per second (RPS) of the group. Can be used
  2874. // with either RATE or UTILIZATION balancing modes, but required if RATE
  2875. // mode. For RATE mode, either maxRate or maxRatePerInstance must be
  2876. // set.
  2877. //
  2878. // This cannot be used for internal load balancing.
  2879. MaxRate int64 `json:"maxRate,omitempty"`
  2880. // MaxRatePerInstance: The max requests per second (RPS) that a single
  2881. // backend instance can handle. This is used to calculate the capacity
  2882. // of the group. Can be used in either balancing mode. For RATE mode,
  2883. // either maxRate or maxRatePerInstance must be set.
  2884. //
  2885. // This cannot be used for internal load balancing.
  2886. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"`
  2887. // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio
  2888. // defines the CPU utilization target for the group. The default is 0.8.
  2889. // Valid range is [0.0, 1.0].
  2890. //
  2891. // This cannot be used for internal load balancing.
  2892. MaxUtilization float64 `json:"maxUtilization,omitempty"`
  2893. // ForceSendFields is a list of field names (e.g. "BalancingMode") to
  2894. // unconditionally include in API requests. By default, fields with
  2895. // empty values are omitted from API requests. However, any non-pointer,
  2896. // non-interface field appearing in ForceSendFields will be sent to the
  2897. // server regardless of whether the field is empty or not. This may be
  2898. // used to include empty fields in Patch requests.
  2899. ForceSendFields []string `json:"-"`
  2900. // NullFields is a list of field names (e.g. "BalancingMode") to include
  2901. // in API requests with the JSON null value. By default, fields with
  2902. // empty values are omitted from API requests. However, any field with
  2903. // an empty value appearing in NullFields will be sent to the server as
  2904. // null. It is an error if a field in this list has a non-empty value.
  2905. // This may be used to include null fields in Patch requests.
  2906. NullFields []string `json:"-"`
  2907. }
  2908. func (s *Backend) MarshalJSON() ([]byte, error) {
  2909. type NoMethod Backend
  2910. raw := NoMethod(*s)
  2911. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2912. }
  2913. func (s *Backend) UnmarshalJSON(data []byte) error {
  2914. type NoMethod Backend
  2915. var s1 struct {
  2916. CapacityScaler gensupport.JSONFloat64 `json:"capacityScaler"`
  2917. MaxRatePerInstance gensupport.JSONFloat64 `json:"maxRatePerInstance"`
  2918. MaxUtilization gensupport.JSONFloat64 `json:"maxUtilization"`
  2919. *NoMethod
  2920. }
  2921. s1.NoMethod = (*NoMethod)(s)
  2922. if err := json.Unmarshal(data, &s1); err != nil {
  2923. return err
  2924. }
  2925. s.CapacityScaler = float64(s1.CapacityScaler)
  2926. s.MaxRatePerInstance = float64(s1.MaxRatePerInstance)
  2927. s.MaxUtilization = float64(s1.MaxUtilization)
  2928. return nil
  2929. }
  2930. // BackendBucket: A BackendBucket resource. This resource defines a
  2931. // Cloud Storage bucket.
  2932. type BackendBucket struct {
  2933. // BucketName: Cloud Storage bucket name.
  2934. BucketName string `json:"bucketName,omitempty"`
  2935. // CdnPolicy: Cloud CDN configuration for this BackendBucket.
  2936. CdnPolicy *BackendBucketCdnPolicy `json:"cdnPolicy,omitempty"`
  2937. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2938. // format.
  2939. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2940. // Description: An optional textual description of the resource;
  2941. // provided by the client when the resource is created.
  2942. Description string `json:"description,omitempty"`
  2943. // EnableCdn: If true, enable Cloud CDN for this BackendBucket.
  2944. EnableCdn bool `json:"enableCdn,omitempty"`
  2945. // Id: [Output Only] Unique identifier for the resource; defined by the
  2946. // server.
  2947. Id uint64 `json:"id,omitempty,string"`
  2948. // Kind: Type of the resource.
  2949. Kind string `json:"kind,omitempty"`
  2950. // Name: Name of the resource. Provided by the client when the resource
  2951. // is created. The name must be 1-63 characters long, and comply with
  2952. // RFC1035. Specifically, the name must be 1-63 characters long and
  2953. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  2954. // the first character must be a lowercase letter, and all following
  2955. // characters must be a dash, lowercase letter, or digit, except the
  2956. // last character, which cannot be a dash.
  2957. Name string `json:"name,omitempty"`
  2958. // SelfLink: [Output Only] Server-defined URL for the resource.
  2959. SelfLink string `json:"selfLink,omitempty"`
  2960. // ServerResponse contains the HTTP response code and headers from the
  2961. // server.
  2962. googleapi.ServerResponse `json:"-"`
  2963. // ForceSendFields is a list of field names (e.g. "BucketName") to
  2964. // unconditionally include in API requests. By default, fields with
  2965. // empty values are omitted from API requests. However, any non-pointer,
  2966. // non-interface field appearing in ForceSendFields will be sent to the
  2967. // server regardless of whether the field is empty or not. This may be
  2968. // used to include empty fields in Patch requests.
  2969. ForceSendFields []string `json:"-"`
  2970. // NullFields is a list of field names (e.g. "BucketName") to include in
  2971. // API requests with the JSON null value. By default, fields with empty
  2972. // values are omitted from API requests. However, any field with an
  2973. // empty value appearing in NullFields will be sent to the server as
  2974. // null. It is an error if a field in this list has a non-empty value.
  2975. // This may be used to include null fields in Patch requests.
  2976. NullFields []string `json:"-"`
  2977. }
  2978. func (s *BackendBucket) MarshalJSON() ([]byte, error) {
  2979. type NoMethod BackendBucket
  2980. raw := NoMethod(*s)
  2981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2982. }
  2983. // BackendBucketCdnPolicy: Message containing Cloud CDN configuration
  2984. // for a backend bucket.
  2985. type BackendBucketCdnPolicy struct {
  2986. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  2987. // signed URL request will be considered fresh. After this time period,
  2988. // the response will be revalidated before being served. Defaults to 1hr
  2989. // (3600s). When serving responses to signed URL requests, Cloud CDN
  2990. // will internally behave as though all responses from this backend had
  2991. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  2992. // existing Cache-Control header. The actual headers served in responses
  2993. // will not be altered.
  2994. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  2995. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  2996. // request URLs.
  2997. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  2998. // ForceSendFields is a list of field names (e.g.
  2999. // "SignedUrlCacheMaxAgeSec") to unconditionally include in API
  3000. // requests. By default, fields with empty values are omitted from API
  3001. // requests. However, any non-pointer, non-interface field appearing in
  3002. // ForceSendFields will be sent to the server regardless of whether the
  3003. // field is empty or not. This may be used to include empty fields in
  3004. // Patch requests.
  3005. ForceSendFields []string `json:"-"`
  3006. // NullFields is a list of field names (e.g. "SignedUrlCacheMaxAgeSec")
  3007. // to include in API requests with the JSON null value. By default,
  3008. // fields with empty values are omitted from API requests. However, any
  3009. // field with an empty value appearing in NullFields will be sent to the
  3010. // server as null. It is an error if a field in this list has a
  3011. // non-empty value. This may be used to include null fields in Patch
  3012. // requests.
  3013. NullFields []string `json:"-"`
  3014. }
  3015. func (s *BackendBucketCdnPolicy) MarshalJSON() ([]byte, error) {
  3016. type NoMethod BackendBucketCdnPolicy
  3017. raw := NoMethod(*s)
  3018. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3019. }
  3020. // BackendBucketList: Contains a list of BackendBucket resources.
  3021. type BackendBucketList struct {
  3022. // Id: [Output Only] Unique identifier for the resource; defined by the
  3023. // server.
  3024. Id string `json:"id,omitempty"`
  3025. // Items: A list of BackendBucket resources.
  3026. Items []*BackendBucket `json:"items,omitempty"`
  3027. // Kind: Type of resource.
  3028. Kind string `json:"kind,omitempty"`
  3029. // NextPageToken: [Output Only] This token allows you to get the next
  3030. // page of results for list requests. If the number of results is larger
  3031. // than maxResults, use the nextPageToken as a value for the query
  3032. // parameter pageToken in the next list request. Subsequent list
  3033. // requests will have their own nextPageToken to continue paging through
  3034. // the results.
  3035. NextPageToken string `json:"nextPageToken,omitempty"`
  3036. // SelfLink: [Output Only] Server-defined URL for this resource.
  3037. SelfLink string `json:"selfLink,omitempty"`
  3038. // Warning: [Output Only] Informational warning message.
  3039. Warning *BackendBucketListWarning `json:"warning,omitempty"`
  3040. // ServerResponse contains the HTTP response code and headers from the
  3041. // server.
  3042. googleapi.ServerResponse `json:"-"`
  3043. // ForceSendFields is a list of field names (e.g. "Id") to
  3044. // unconditionally include in API requests. By default, fields with
  3045. // empty values are omitted from API requests. However, any non-pointer,
  3046. // non-interface field appearing in ForceSendFields will be sent to the
  3047. // server regardless of whether the field is empty or not. This may be
  3048. // used to include empty fields in Patch requests.
  3049. ForceSendFields []string `json:"-"`
  3050. // NullFields is a list of field names (e.g. "Id") to include in API
  3051. // requests with the JSON null value. By default, fields with empty
  3052. // values are omitted from API requests. However, any field with an
  3053. // empty value appearing in NullFields will be sent to the server as
  3054. // null. It is an error if a field in this list has a non-empty value.
  3055. // This may be used to include null fields in Patch requests.
  3056. NullFields []string `json:"-"`
  3057. }
  3058. func (s *BackendBucketList) MarshalJSON() ([]byte, error) {
  3059. type NoMethod BackendBucketList
  3060. raw := NoMethod(*s)
  3061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3062. }
  3063. // BackendBucketListWarning: [Output Only] Informational warning
  3064. // message.
  3065. type BackendBucketListWarning struct {
  3066. // Code: [Output Only] A warning code, if applicable. For example,
  3067. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3068. // the response.
  3069. //
  3070. // Possible values:
  3071. // "CLEANUP_FAILED"
  3072. // "DEPRECATED_RESOURCE_USED"
  3073. // "DEPRECATED_TYPE_USED"
  3074. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3075. // "EXPERIMENTAL_TYPE_USED"
  3076. // "EXTERNAL_API_WARNING"
  3077. // "FIELD_VALUE_OVERRIDEN"
  3078. // "INJECTED_KERNELS_DEPRECATED"
  3079. // "MISSING_TYPE_DEPENDENCY"
  3080. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3081. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3082. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3083. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3084. // "NEXT_HOP_NOT_RUNNING"
  3085. // "NOT_CRITICAL_ERROR"
  3086. // "NO_RESULTS_ON_PAGE"
  3087. // "REQUIRED_TOS_AGREEMENT"
  3088. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3089. // "RESOURCE_NOT_DELETED"
  3090. // "SCHEMA_VALIDATION_IGNORED"
  3091. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3092. // "UNDECLARED_PROPERTIES"
  3093. // "UNREACHABLE"
  3094. Code string `json:"code,omitempty"`
  3095. // Data: [Output Only] Metadata about this warning in key: value format.
  3096. // For example:
  3097. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3098. Data []*BackendBucketListWarningData `json:"data,omitempty"`
  3099. // Message: [Output Only] A human-readable description of the warning
  3100. // code.
  3101. Message string `json:"message,omitempty"`
  3102. // ForceSendFields is a list of field names (e.g. "Code") to
  3103. // unconditionally include in API requests. By default, fields with
  3104. // empty values are omitted from API requests. However, any non-pointer,
  3105. // non-interface field appearing in ForceSendFields will be sent to the
  3106. // server regardless of whether the field is empty or not. This may be
  3107. // used to include empty fields in Patch requests.
  3108. ForceSendFields []string `json:"-"`
  3109. // NullFields is a list of field names (e.g. "Code") to include in API
  3110. // requests with the JSON null value. By default, fields with empty
  3111. // values are omitted from API requests. However, any field with an
  3112. // empty value appearing in NullFields will be sent to the server as
  3113. // null. It is an error if a field in this list has a non-empty value.
  3114. // This may be used to include null fields in Patch requests.
  3115. NullFields []string `json:"-"`
  3116. }
  3117. func (s *BackendBucketListWarning) MarshalJSON() ([]byte, error) {
  3118. type NoMethod BackendBucketListWarning
  3119. raw := NoMethod(*s)
  3120. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3121. }
  3122. type BackendBucketListWarningData struct {
  3123. // Key: [Output Only] A key that provides more detail on the warning
  3124. // being returned. For example, for warnings where there are no results
  3125. // in a list request for a particular zone, this key might be scope and
  3126. // the key value might be the zone name. Other examples might be a key
  3127. // indicating a deprecated resource and a suggested replacement, or a
  3128. // warning about invalid network settings (for example, if an instance
  3129. // attempts to perform IP forwarding but is not enabled for IP
  3130. // forwarding).
  3131. Key string `json:"key,omitempty"`
  3132. // Value: [Output Only] A warning data value corresponding to the key.
  3133. Value string `json:"value,omitempty"`
  3134. // ForceSendFields is a list of field names (e.g. "Key") to
  3135. // unconditionally include in API requests. By default, fields with
  3136. // empty values are omitted from API requests. However, any non-pointer,
  3137. // non-interface field appearing in ForceSendFields will be sent to the
  3138. // server regardless of whether the field is empty or not. This may be
  3139. // used to include empty fields in Patch requests.
  3140. ForceSendFields []string `json:"-"`
  3141. // NullFields is a list of field names (e.g. "Key") to include in API
  3142. // requests with the JSON null value. By default, fields with empty
  3143. // values are omitted from API requests. However, any field with an
  3144. // empty value appearing in NullFields will be sent to the server as
  3145. // null. It is an error if a field in this list has a non-empty value.
  3146. // This may be used to include null fields in Patch requests.
  3147. NullFields []string `json:"-"`
  3148. }
  3149. func (s *BackendBucketListWarningData) MarshalJSON() ([]byte, error) {
  3150. type NoMethod BackendBucketListWarningData
  3151. raw := NoMethod(*s)
  3152. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3153. }
  3154. // BackendService: A BackendService resource. This resource defines a
  3155. // group of backend virtual machines and their serving capacity. (==
  3156. // resource_for v1.backendService ==) (== resource_for
  3157. // beta.backendService ==)
  3158. type BackendService struct {
  3159. // AffinityCookieTtlSec: Lifetime of cookies in seconds if
  3160. // session_affinity is GENERATED_COOKIE. If set to 0, the cookie is
  3161. // non-persistent and lasts only until the end of the browser session
  3162. // (or equivalent). The maximum allowed value for TTL is one day.
  3163. //
  3164. // When the load balancing scheme is INTERNAL, this field is not used.
  3165. AffinityCookieTtlSec int64 `json:"affinityCookieTtlSec,omitempty"`
  3166. // Backends: The list of backends that serve this BackendService.
  3167. Backends []*Backend `json:"backends,omitempty"`
  3168. // CdnPolicy: Cloud CDN configuration for this BackendService.
  3169. CdnPolicy *BackendServiceCdnPolicy `json:"cdnPolicy,omitempty"`
  3170. ConnectionDraining *ConnectionDraining `json:"connectionDraining,omitempty"`
  3171. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3172. // format.
  3173. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3174. // CustomRequestHeaders: Headers that the HTTP/S load balancer should
  3175. // add to proxied requests.
  3176. CustomRequestHeaders []string `json:"customRequestHeaders,omitempty"`
  3177. // Description: An optional description of this resource. Provide this
  3178. // property when you create the resource.
  3179. Description string `json:"description,omitempty"`
  3180. // EnableCDN: If true, enable Cloud CDN for this BackendService.
  3181. //
  3182. // When the load balancing scheme is INTERNAL, this field is not used.
  3183. EnableCDN bool `json:"enableCDN,omitempty"`
  3184. // Fingerprint: Fingerprint of this resource. A hash of the contents
  3185. // stored in this object. This field is used in optimistic locking. This
  3186. // field will be ignored when inserting a BackendService. An up-to-date
  3187. // fingerprint must be provided in order to update the BackendService,
  3188. // otherwise the request will fail with error 412 conditionNotMet.
  3189. //
  3190. // To see the latest fingerprint, make a get() request to retrieve a
  3191. // BackendService.
  3192. Fingerprint string `json:"fingerprint,omitempty"`
  3193. // HealthChecks: The list of URLs to the HttpHealthCheck or
  3194. // HttpsHealthCheck resource for health checking this BackendService.
  3195. // Currently at most one health check can be specified, and a health
  3196. // check is required for Compute Engine backend services. A health check
  3197. // must not be specified for App Engine backend and Cloud Function
  3198. // backend.
  3199. //
  3200. // For internal load balancing, a URL to a HealthCheck resource must be
  3201. // specified instead.
  3202. HealthChecks []string `json:"healthChecks,omitempty"`
  3203. Iap *BackendServiceIAP `json:"iap,omitempty"`
  3204. // Id: [Output Only] The unique identifier for the resource. This
  3205. // identifier is defined by the server.
  3206. Id uint64 `json:"id,omitempty,string"`
  3207. // Kind: [Output Only] Type of resource. Always compute#backendService
  3208. // for backend services.
  3209. Kind string `json:"kind,omitempty"`
  3210. // LoadBalancingScheme: Indicates whether the backend service will be
  3211. // used with internal or external load balancing. A backend service
  3212. // created for one type of load balancing cannot be used with the other.
  3213. // Possible values are INTERNAL and EXTERNAL.
  3214. //
  3215. // Possible values:
  3216. // "EXTERNAL"
  3217. // "INTERNAL"
  3218. // "INVALID_LOAD_BALANCING_SCHEME"
  3219. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  3220. // Name: Name of the resource. Provided by the client when the resource
  3221. // is created. The name must be 1-63 characters long, and comply with
  3222. // RFC1035. Specifically, the name must be 1-63 characters long and
  3223. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3224. // the first character must be a lowercase letter, and all following
  3225. // characters must be a dash, lowercase letter, or digit, except the
  3226. // last character, which cannot be a dash.
  3227. Name string `json:"name,omitempty"`
  3228. // Port: Deprecated in favor of portName. The TCP port to connect on the
  3229. // backend. The default value is 80.
  3230. //
  3231. // This cannot be used for internal load balancing.
  3232. Port int64 `json:"port,omitempty"`
  3233. // PortName: Name of backend port. The same name should appear in the
  3234. // instance groups referenced by this service. Required when the load
  3235. // balancing scheme is EXTERNAL.
  3236. //
  3237. // When the load balancing scheme is INTERNAL, this field is not used.
  3238. PortName string `json:"portName,omitempty"`
  3239. // Protocol: The protocol this BackendService uses to communicate with
  3240. // backends.
  3241. //
  3242. // Possible values are HTTP, HTTPS, TCP, and SSL. The default is
  3243. // HTTP.
  3244. //
  3245. // For internal load balancing, the possible values are TCP and UDP, and
  3246. // the default is TCP.
  3247. //
  3248. // Possible values:
  3249. // "HTTP"
  3250. // "HTTP2"
  3251. // "HTTPS"
  3252. // "SSL"
  3253. // "TCP"
  3254. // "UDP"
  3255. Protocol string `json:"protocol,omitempty"`
  3256. // Region: [Output Only] URL of the region where the regional backend
  3257. // service resides. This field is not applicable to global backend
  3258. // services. You must specify this field as part of the HTTP request
  3259. // URL. It is not settable as a field in the request body.
  3260. Region string `json:"region,omitempty"`
  3261. // SecurityPolicy: [Output Only] The resource URL for the security
  3262. // policy associated with this backend service.
  3263. SecurityPolicy string `json:"securityPolicy,omitempty"`
  3264. // SelfLink: [Output Only] Server-defined URL for the resource.
  3265. SelfLink string `json:"selfLink,omitempty"`
  3266. // SessionAffinity: Type of session affinity to use. The default is
  3267. // NONE.
  3268. //
  3269. // When the load balancing scheme is EXTERNAL, can be NONE, CLIENT_IP,
  3270. // or GENERATED_COOKIE.
  3271. //
  3272. // When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP,
  3273. // CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO.
  3274. //
  3275. // When the protocol is UDP, this field is not used.
  3276. //
  3277. // Possible values:
  3278. // "CLIENT_IP"
  3279. // "CLIENT_IP_PORT_PROTO"
  3280. // "CLIENT_IP_PROTO"
  3281. // "GENERATED_COOKIE"
  3282. // "NONE"
  3283. SessionAffinity string `json:"sessionAffinity,omitempty"`
  3284. // TimeoutSec: How many seconds to wait for the backend before
  3285. // considering it a failed request. Default is 30 seconds.
  3286. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  3287. // ServerResponse contains the HTTP response code and headers from the
  3288. // server.
  3289. googleapi.ServerResponse `json:"-"`
  3290. // ForceSendFields is a list of field names (e.g.
  3291. // "AffinityCookieTtlSec") to unconditionally include in API requests.
  3292. // By default, fields with empty values are omitted from API requests.
  3293. // However, any non-pointer, non-interface field appearing in
  3294. // ForceSendFields will be sent to the server regardless of whether the
  3295. // field is empty or not. This may be used to include empty fields in
  3296. // Patch requests.
  3297. ForceSendFields []string `json:"-"`
  3298. // NullFields is a list of field names (e.g. "AffinityCookieTtlSec") to
  3299. // include in API requests with the JSON null value. By default, fields
  3300. // with empty values are omitted from API requests. However, any field
  3301. // with an empty value appearing in NullFields will be sent to the
  3302. // server as null. It is an error if a field in this list has a
  3303. // non-empty value. This may be used to include null fields in Patch
  3304. // requests.
  3305. NullFields []string `json:"-"`
  3306. }
  3307. func (s *BackendService) MarshalJSON() ([]byte, error) {
  3308. type NoMethod BackendService
  3309. raw := NoMethod(*s)
  3310. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3311. }
  3312. // BackendServiceAggregatedList: Contains a list of
  3313. // BackendServicesScopedList.
  3314. type BackendServiceAggregatedList struct {
  3315. // Id: [Output Only] Unique identifier for the resource; defined by the
  3316. // server.
  3317. Id string `json:"id,omitempty"`
  3318. // Items: A list of BackendServicesScopedList resources.
  3319. Items map[string]BackendServicesScopedList `json:"items,omitempty"`
  3320. // Kind: Type of resource.
  3321. Kind string `json:"kind,omitempty"`
  3322. // NextPageToken: [Output Only] This token allows you to get the next
  3323. // page of results for list requests. If the number of results is larger
  3324. // than maxResults, use the nextPageToken as a value for the query
  3325. // parameter pageToken in the next list request. Subsequent list
  3326. // requests will have their own nextPageToken to continue paging through
  3327. // the results.
  3328. NextPageToken string `json:"nextPageToken,omitempty"`
  3329. // SelfLink: [Output Only] Server-defined URL for this resource.
  3330. SelfLink string `json:"selfLink,omitempty"`
  3331. // Warning: [Output Only] Informational warning message.
  3332. Warning *BackendServiceAggregatedListWarning `json:"warning,omitempty"`
  3333. // ServerResponse contains the HTTP response code and headers from the
  3334. // server.
  3335. googleapi.ServerResponse `json:"-"`
  3336. // ForceSendFields is a list of field names (e.g. "Id") to
  3337. // unconditionally include in API requests. By default, fields with
  3338. // empty values are omitted from API requests. However, any non-pointer,
  3339. // non-interface field appearing in ForceSendFields will be sent to the
  3340. // server regardless of whether the field is empty or not. This may be
  3341. // used to include empty fields in Patch requests.
  3342. ForceSendFields []string `json:"-"`
  3343. // NullFields is a list of field names (e.g. "Id") to include in API
  3344. // requests with the JSON null value. By default, fields with empty
  3345. // values are omitted from API requests. However, any field with an
  3346. // empty value appearing in NullFields will be sent to the server as
  3347. // null. It is an error if a field in this list has a non-empty value.
  3348. // This may be used to include null fields in Patch requests.
  3349. NullFields []string `json:"-"`
  3350. }
  3351. func (s *BackendServiceAggregatedList) MarshalJSON() ([]byte, error) {
  3352. type NoMethod BackendServiceAggregatedList
  3353. raw := NoMethod(*s)
  3354. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3355. }
  3356. // BackendServiceAggregatedListWarning: [Output Only] Informational
  3357. // warning message.
  3358. type BackendServiceAggregatedListWarning struct {
  3359. // Code: [Output Only] A warning code, if applicable. For example,
  3360. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3361. // the response.
  3362. //
  3363. // Possible values:
  3364. // "CLEANUP_FAILED"
  3365. // "DEPRECATED_RESOURCE_USED"
  3366. // "DEPRECATED_TYPE_USED"
  3367. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3368. // "EXPERIMENTAL_TYPE_USED"
  3369. // "EXTERNAL_API_WARNING"
  3370. // "FIELD_VALUE_OVERRIDEN"
  3371. // "INJECTED_KERNELS_DEPRECATED"
  3372. // "MISSING_TYPE_DEPENDENCY"
  3373. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3374. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3375. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3376. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3377. // "NEXT_HOP_NOT_RUNNING"
  3378. // "NOT_CRITICAL_ERROR"
  3379. // "NO_RESULTS_ON_PAGE"
  3380. // "REQUIRED_TOS_AGREEMENT"
  3381. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3382. // "RESOURCE_NOT_DELETED"
  3383. // "SCHEMA_VALIDATION_IGNORED"
  3384. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3385. // "UNDECLARED_PROPERTIES"
  3386. // "UNREACHABLE"
  3387. Code string `json:"code,omitempty"`
  3388. // Data: [Output Only] Metadata about this warning in key: value format.
  3389. // For example:
  3390. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3391. Data []*BackendServiceAggregatedListWarningData `json:"data,omitempty"`
  3392. // Message: [Output Only] A human-readable description of the warning
  3393. // code.
  3394. Message string `json:"message,omitempty"`
  3395. // ForceSendFields is a list of field names (e.g. "Code") to
  3396. // unconditionally include in API requests. By default, fields with
  3397. // empty values are omitted from API requests. However, any non-pointer,
  3398. // non-interface field appearing in ForceSendFields will be sent to the
  3399. // server regardless of whether the field is empty or not. This may be
  3400. // used to include empty fields in Patch requests.
  3401. ForceSendFields []string `json:"-"`
  3402. // NullFields is a list of field names (e.g. "Code") to include in API
  3403. // requests with the JSON null value. By default, fields with empty
  3404. // values are omitted from API requests. However, any field with an
  3405. // empty value appearing in NullFields will be sent to the server as
  3406. // null. It is an error if a field in this list has a non-empty value.
  3407. // This may be used to include null fields in Patch requests.
  3408. NullFields []string `json:"-"`
  3409. }
  3410. func (s *BackendServiceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  3411. type NoMethod BackendServiceAggregatedListWarning
  3412. raw := NoMethod(*s)
  3413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3414. }
  3415. type BackendServiceAggregatedListWarningData struct {
  3416. // Key: [Output Only] A key that provides more detail on the warning
  3417. // being returned. For example, for warnings where there are no results
  3418. // in a list request for a particular zone, this key might be scope and
  3419. // the key value might be the zone name. Other examples might be a key
  3420. // indicating a deprecated resource and a suggested replacement, or a
  3421. // warning about invalid network settings (for example, if an instance
  3422. // attempts to perform IP forwarding but is not enabled for IP
  3423. // forwarding).
  3424. Key string `json:"key,omitempty"`
  3425. // Value: [Output Only] A warning data value corresponding to the key.
  3426. Value string `json:"value,omitempty"`
  3427. // ForceSendFields is a list of field names (e.g. "Key") to
  3428. // unconditionally include in API requests. By default, fields with
  3429. // empty values are omitted from API requests. However, any non-pointer,
  3430. // non-interface field appearing in ForceSendFields will be sent to the
  3431. // server regardless of whether the field is empty or not. This may be
  3432. // used to include empty fields in Patch requests.
  3433. ForceSendFields []string `json:"-"`
  3434. // NullFields is a list of field names (e.g. "Key") to include in API
  3435. // requests with the JSON null value. By default, fields with empty
  3436. // values are omitted from API requests. However, any field with an
  3437. // empty value appearing in NullFields will be sent to the server as
  3438. // null. It is an error if a field in this list has a non-empty value.
  3439. // This may be used to include null fields in Patch requests.
  3440. NullFields []string `json:"-"`
  3441. }
  3442. func (s *BackendServiceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  3443. type NoMethod BackendServiceAggregatedListWarningData
  3444. raw := NoMethod(*s)
  3445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3446. }
  3447. // BackendServiceCdnPolicy: Message containing Cloud CDN configuration
  3448. // for a backend service.
  3449. type BackendServiceCdnPolicy struct {
  3450. // CacheKeyPolicy: The CacheKeyPolicy for this CdnPolicy.
  3451. CacheKeyPolicy *CacheKeyPolicy `json:"cacheKeyPolicy,omitempty"`
  3452. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  3453. // signed URL request will be considered fresh. After this time period,
  3454. // the response will be revalidated before being served. Defaults to 1hr
  3455. // (3600s). When serving responses to signed URL requests, Cloud CDN
  3456. // will internally behave as though all responses from this backend had
  3457. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  3458. // existing Cache-Control header. The actual headers served in responses
  3459. // will not be altered.
  3460. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  3461. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  3462. // request URLs.
  3463. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  3464. // ForceSendFields is a list of field names (e.g. "CacheKeyPolicy") to
  3465. // unconditionally include in API requests. By default, fields with
  3466. // empty values are omitted from API requests. However, any non-pointer,
  3467. // non-interface field appearing in ForceSendFields will be sent to the
  3468. // server regardless of whether the field is empty or not. This may be
  3469. // used to include empty fields in Patch requests.
  3470. ForceSendFields []string `json:"-"`
  3471. // NullFields is a list of field names (e.g. "CacheKeyPolicy") to
  3472. // include in API requests with the JSON null value. By default, fields
  3473. // with empty values are omitted from API requests. However, any field
  3474. // with an empty value appearing in NullFields will be sent to the
  3475. // server as null. It is an error if a field in this list has a
  3476. // non-empty value. This may be used to include null fields in Patch
  3477. // requests.
  3478. NullFields []string `json:"-"`
  3479. }
  3480. func (s *BackendServiceCdnPolicy) MarshalJSON() ([]byte, error) {
  3481. type NoMethod BackendServiceCdnPolicy
  3482. raw := NoMethod(*s)
  3483. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3484. }
  3485. type BackendServiceGroupHealth struct {
  3486. // HealthStatus: Health state of the backend instances or endpoints in
  3487. // requested instance or network endpoint group, determined based on
  3488. // configured health checks.
  3489. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  3490. // Kind: [Output Only] Type of resource. Always
  3491. // compute#backendServiceGroupHealth for the health of backend services.
  3492. Kind string `json:"kind,omitempty"`
  3493. // ServerResponse contains the HTTP response code and headers from the
  3494. // server.
  3495. googleapi.ServerResponse `json:"-"`
  3496. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  3497. // unconditionally include in API requests. By default, fields with
  3498. // empty values are omitted from API requests. However, any non-pointer,
  3499. // non-interface field appearing in ForceSendFields will be sent to the
  3500. // server regardless of whether the field is empty or not. This may be
  3501. // used to include empty fields in Patch requests.
  3502. ForceSendFields []string `json:"-"`
  3503. // NullFields is a list of field names (e.g. "HealthStatus") to include
  3504. // in API requests with the JSON null value. By default, fields with
  3505. // empty values are omitted from API requests. However, any field with
  3506. // an empty value appearing in NullFields will be sent to the server as
  3507. // null. It is an error if a field in this list has a non-empty value.
  3508. // This may be used to include null fields in Patch requests.
  3509. NullFields []string `json:"-"`
  3510. }
  3511. func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
  3512. type NoMethod BackendServiceGroupHealth
  3513. raw := NoMethod(*s)
  3514. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3515. }
  3516. // BackendServiceIAP: Identity-Aware Proxy
  3517. type BackendServiceIAP struct {
  3518. Enabled bool `json:"enabled,omitempty"`
  3519. Oauth2ClientId string `json:"oauth2ClientId,omitempty"`
  3520. Oauth2ClientSecret string `json:"oauth2ClientSecret,omitempty"`
  3521. // Oauth2ClientSecretSha256: [Output Only] SHA256 hash value for the
  3522. // field oauth2_client_secret above.
  3523. Oauth2ClientSecretSha256 string `json:"oauth2ClientSecretSha256,omitempty"`
  3524. // ForceSendFields is a list of field names (e.g. "Enabled") to
  3525. // unconditionally include in API requests. By default, fields with
  3526. // empty values are omitted from API requests. However, any non-pointer,
  3527. // non-interface field appearing in ForceSendFields will be sent to the
  3528. // server regardless of whether the field is empty or not. This may be
  3529. // used to include empty fields in Patch requests.
  3530. ForceSendFields []string `json:"-"`
  3531. // NullFields is a list of field names (e.g. "Enabled") to include in
  3532. // API requests with the JSON null value. By default, fields with empty
  3533. // values are omitted from API requests. However, any field with an
  3534. // empty value appearing in NullFields will be sent to the server as
  3535. // null. It is an error if a field in this list has a non-empty value.
  3536. // This may be used to include null fields in Patch requests.
  3537. NullFields []string `json:"-"`
  3538. }
  3539. func (s *BackendServiceIAP) MarshalJSON() ([]byte, error) {
  3540. type NoMethod BackendServiceIAP
  3541. raw := NoMethod(*s)
  3542. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3543. }
  3544. // BackendServiceList: Contains a list of BackendService resources.
  3545. type BackendServiceList struct {
  3546. // Id: [Output Only] Unique identifier for the resource; defined by the
  3547. // server.
  3548. Id string `json:"id,omitempty"`
  3549. // Items: A list of BackendService resources.
  3550. Items []*BackendService `json:"items,omitempty"`
  3551. // Kind: [Output Only] Type of resource. Always
  3552. // compute#backendServiceList for lists of backend services.
  3553. Kind string `json:"kind,omitempty"`
  3554. // NextPageToken: [Output Only] This token allows you to get the next
  3555. // page of results for list requests. If the number of results is larger
  3556. // than maxResults, use the nextPageToken as a value for the query
  3557. // parameter pageToken in the next list request. Subsequent list
  3558. // requests will have their own nextPageToken to continue paging through
  3559. // the results.
  3560. NextPageToken string `json:"nextPageToken,omitempty"`
  3561. // SelfLink: [Output Only] Server-defined URL for this resource.
  3562. SelfLink string `json:"selfLink,omitempty"`
  3563. // Warning: [Output Only] Informational warning message.
  3564. Warning *BackendServiceListWarning `json:"warning,omitempty"`
  3565. // ServerResponse contains the HTTP response code and headers from the
  3566. // server.
  3567. googleapi.ServerResponse `json:"-"`
  3568. // ForceSendFields is a list of field names (e.g. "Id") to
  3569. // unconditionally include in API requests. By default, fields with
  3570. // empty values are omitted from API requests. However, any non-pointer,
  3571. // non-interface field appearing in ForceSendFields will be sent to the
  3572. // server regardless of whether the field is empty or not. This may be
  3573. // used to include empty fields in Patch requests.
  3574. ForceSendFields []string `json:"-"`
  3575. // NullFields is a list of field names (e.g. "Id") to include in API
  3576. // requests with the JSON null value. By default, fields with empty
  3577. // values are omitted from API requests. However, any field with an
  3578. // empty value appearing in NullFields will be sent to the server as
  3579. // null. It is an error if a field in this list has a non-empty value.
  3580. // This may be used to include null fields in Patch requests.
  3581. NullFields []string `json:"-"`
  3582. }
  3583. func (s *BackendServiceList) MarshalJSON() ([]byte, error) {
  3584. type NoMethod BackendServiceList
  3585. raw := NoMethod(*s)
  3586. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3587. }
  3588. // BackendServiceListWarning: [Output Only] Informational warning
  3589. // message.
  3590. type BackendServiceListWarning struct {
  3591. // Code: [Output Only] A warning code, if applicable. For example,
  3592. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3593. // the response.
  3594. //
  3595. // Possible values:
  3596. // "CLEANUP_FAILED"
  3597. // "DEPRECATED_RESOURCE_USED"
  3598. // "DEPRECATED_TYPE_USED"
  3599. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3600. // "EXPERIMENTAL_TYPE_USED"
  3601. // "EXTERNAL_API_WARNING"
  3602. // "FIELD_VALUE_OVERRIDEN"
  3603. // "INJECTED_KERNELS_DEPRECATED"
  3604. // "MISSING_TYPE_DEPENDENCY"
  3605. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3606. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3607. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3608. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3609. // "NEXT_HOP_NOT_RUNNING"
  3610. // "NOT_CRITICAL_ERROR"
  3611. // "NO_RESULTS_ON_PAGE"
  3612. // "REQUIRED_TOS_AGREEMENT"
  3613. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3614. // "RESOURCE_NOT_DELETED"
  3615. // "SCHEMA_VALIDATION_IGNORED"
  3616. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3617. // "UNDECLARED_PROPERTIES"
  3618. // "UNREACHABLE"
  3619. Code string `json:"code,omitempty"`
  3620. // Data: [Output Only] Metadata about this warning in key: value format.
  3621. // For example:
  3622. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3623. Data []*BackendServiceListWarningData `json:"data,omitempty"`
  3624. // Message: [Output Only] A human-readable description of the warning
  3625. // code.
  3626. Message string `json:"message,omitempty"`
  3627. // ForceSendFields is a list of field names (e.g. "Code") to
  3628. // unconditionally include in API requests. By default, fields with
  3629. // empty values are omitted from API requests. However, any non-pointer,
  3630. // non-interface field appearing in ForceSendFields will be sent to the
  3631. // server regardless of whether the field is empty or not. This may be
  3632. // used to include empty fields in Patch requests.
  3633. ForceSendFields []string `json:"-"`
  3634. // NullFields is a list of field names (e.g. "Code") to include in API
  3635. // requests with the JSON null value. By default, fields with empty
  3636. // values are omitted from API requests. However, any field with an
  3637. // empty value appearing in NullFields will be sent to the server as
  3638. // null. It is an error if a field in this list has a non-empty value.
  3639. // This may be used to include null fields in Patch requests.
  3640. NullFields []string `json:"-"`
  3641. }
  3642. func (s *BackendServiceListWarning) MarshalJSON() ([]byte, error) {
  3643. type NoMethod BackendServiceListWarning
  3644. raw := NoMethod(*s)
  3645. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3646. }
  3647. type BackendServiceListWarningData struct {
  3648. // Key: [Output Only] A key that provides more detail on the warning
  3649. // being returned. For example, for warnings where there are no results
  3650. // in a list request for a particular zone, this key might be scope and
  3651. // the key value might be the zone name. Other examples might be a key
  3652. // indicating a deprecated resource and a suggested replacement, or a
  3653. // warning about invalid network settings (for example, if an instance
  3654. // attempts to perform IP forwarding but is not enabled for IP
  3655. // forwarding).
  3656. Key string `json:"key,omitempty"`
  3657. // Value: [Output Only] A warning data value corresponding to the key.
  3658. Value string `json:"value,omitempty"`
  3659. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") to include in API
  3667. // 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 *BackendServiceListWarningData) MarshalJSON() ([]byte, error) {
  3675. type NoMethod BackendServiceListWarningData
  3676. raw := NoMethod(*s)
  3677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3678. }
  3679. type BackendServicesScopedList struct {
  3680. // BackendServices: A list of BackendServices contained in this scope.
  3681. BackendServices []*BackendService `json:"backendServices,omitempty"`
  3682. // Warning: Informational warning which replaces the list of backend
  3683. // services when the list is empty.
  3684. Warning *BackendServicesScopedListWarning `json:"warning,omitempty"`
  3685. // ForceSendFields is a list of field names (e.g. "BackendServices") to
  3686. // unconditionally include in API requests. By default, fields with
  3687. // empty values are omitted from API requests. However, any non-pointer,
  3688. // non-interface field appearing in ForceSendFields will be sent to the
  3689. // server regardless of whether the field is empty or not. This may be
  3690. // used to include empty fields in Patch requests.
  3691. ForceSendFields []string `json:"-"`
  3692. // NullFields is a list of field names (e.g. "BackendServices") to
  3693. // include in API requests with the JSON null value. By default, fields
  3694. // with empty values are omitted from API requests. However, any field
  3695. // with an empty value appearing in NullFields will be sent to the
  3696. // server as null. It is an error if a field in this list has a
  3697. // non-empty value. This may be used to include null fields in Patch
  3698. // requests.
  3699. NullFields []string `json:"-"`
  3700. }
  3701. func (s *BackendServicesScopedList) MarshalJSON() ([]byte, error) {
  3702. type NoMethod BackendServicesScopedList
  3703. raw := NoMethod(*s)
  3704. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3705. }
  3706. // BackendServicesScopedListWarning: Informational warning which
  3707. // replaces the list of backend services when the list is empty.
  3708. type BackendServicesScopedListWarning struct {
  3709. // Code: [Output Only] A warning code, if applicable. For example,
  3710. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3711. // the response.
  3712. //
  3713. // Possible values:
  3714. // "CLEANUP_FAILED"
  3715. // "DEPRECATED_RESOURCE_USED"
  3716. // "DEPRECATED_TYPE_USED"
  3717. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3718. // "EXPERIMENTAL_TYPE_USED"
  3719. // "EXTERNAL_API_WARNING"
  3720. // "FIELD_VALUE_OVERRIDEN"
  3721. // "INJECTED_KERNELS_DEPRECATED"
  3722. // "MISSING_TYPE_DEPENDENCY"
  3723. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3724. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3725. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3726. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3727. // "NEXT_HOP_NOT_RUNNING"
  3728. // "NOT_CRITICAL_ERROR"
  3729. // "NO_RESULTS_ON_PAGE"
  3730. // "REQUIRED_TOS_AGREEMENT"
  3731. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3732. // "RESOURCE_NOT_DELETED"
  3733. // "SCHEMA_VALIDATION_IGNORED"
  3734. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3735. // "UNDECLARED_PROPERTIES"
  3736. // "UNREACHABLE"
  3737. Code string `json:"code,omitempty"`
  3738. // Data: [Output Only] Metadata about this warning in key: value format.
  3739. // For example:
  3740. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3741. Data []*BackendServicesScopedListWarningData `json:"data,omitempty"`
  3742. // Message: [Output Only] A human-readable description of the warning
  3743. // code.
  3744. Message string `json:"message,omitempty"`
  3745. // ForceSendFields is a list of field names (e.g. "Code") to
  3746. // unconditionally include in API requests. By default, fields with
  3747. // empty values are omitted from API requests. However, any non-pointer,
  3748. // non-interface field appearing in ForceSendFields will be sent to the
  3749. // server regardless of whether the field is empty or not. This may be
  3750. // used to include empty fields in Patch requests.
  3751. ForceSendFields []string `json:"-"`
  3752. // NullFields is a list of field names (e.g. "Code") to include in API
  3753. // requests with the JSON null value. By default, fields with empty
  3754. // values are omitted from API requests. However, any field with an
  3755. // empty value appearing in NullFields will be sent to the server as
  3756. // null. It is an error if a field in this list has a non-empty value.
  3757. // This may be used to include null fields in Patch requests.
  3758. NullFields []string `json:"-"`
  3759. }
  3760. func (s *BackendServicesScopedListWarning) MarshalJSON() ([]byte, error) {
  3761. type NoMethod BackendServicesScopedListWarning
  3762. raw := NoMethod(*s)
  3763. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3764. }
  3765. type BackendServicesScopedListWarningData struct {
  3766. // Key: [Output Only] A key that provides more detail on the warning
  3767. // being returned. For example, for warnings where there are no results
  3768. // in a list request for a particular zone, this key might be scope and
  3769. // the key value might be the zone name. Other examples might be a key
  3770. // indicating a deprecated resource and a suggested replacement, or a
  3771. // warning about invalid network settings (for example, if an instance
  3772. // attempts to perform IP forwarding but is not enabled for IP
  3773. // forwarding).
  3774. Key string `json:"key,omitempty"`
  3775. // Value: [Output Only] A warning data value corresponding to the key.
  3776. Value string `json:"value,omitempty"`
  3777. // ForceSendFields is a list of field names (e.g. "Key") to
  3778. // unconditionally include in API requests. By default, fields with
  3779. // empty values are omitted from API requests. However, any non-pointer,
  3780. // non-interface field appearing in ForceSendFields will be sent to the
  3781. // server regardless of whether the field is empty or not. This may be
  3782. // used to include empty fields in Patch requests.
  3783. ForceSendFields []string `json:"-"`
  3784. // NullFields is a list of field names (e.g. "Key") to include in API
  3785. // requests with the JSON null value. By default, fields with empty
  3786. // values are omitted from API requests. However, any field with an
  3787. // empty value appearing in NullFields will be sent to the server as
  3788. // null. It is an error if a field in this list has a non-empty value.
  3789. // This may be used to include null fields in Patch requests.
  3790. NullFields []string `json:"-"`
  3791. }
  3792. func (s *BackendServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
  3793. type NoMethod BackendServicesScopedListWarningData
  3794. raw := NoMethod(*s)
  3795. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3796. }
  3797. // Binding: Associates `members` with a `role`.
  3798. type Binding struct {
  3799. // Condition: Unimplemented. The condition that is associated with this
  3800. // binding. NOTE: an unsatisfied condition will not allow user access
  3801. // via current binding. Different bindings, including their conditions,
  3802. // are examined independently.
  3803. Condition *Expr `json:"condition,omitempty"`
  3804. // Members: Specifies the identities requesting access for a Cloud
  3805. // Platform resource. `members` can have the following values:
  3806. //
  3807. // * `allUsers`: A special identifier that represents anyone who is on
  3808. // the internet; with or without a Google account.
  3809. //
  3810. // * `allAuthenticatedUsers`: A special identifier that represents
  3811. // anyone who is authenticated with a Google account or a service
  3812. // account.
  3813. //
  3814. // * `user:{emailid}`: An email address that represents a specific
  3815. // Google account. For example, `alice@gmail.com` .
  3816. //
  3817. //
  3818. //
  3819. // * `serviceAccount:{emailid}`: An email address that represents a
  3820. // service account. For example,
  3821. // `my-other-app@appspot.gserviceaccount.com`.
  3822. //
  3823. // * `group:{emailid}`: An email address that represents a Google group.
  3824. // For example, `admins@example.com`.
  3825. //
  3826. //
  3827. //
  3828. // * `domain:{domain}`: The G Suite domain (primary) that represents all
  3829. // the users of that domain. For example, `google.com` or `example.com`.
  3830. Members []string `json:"members,omitempty"`
  3831. // Role: Role that is assigned to `members`. For example,
  3832. // `roles/viewer`, `roles/editor`, or `roles/owner`.
  3833. Role string `json:"role,omitempty"`
  3834. // ForceSendFields is a list of field names (e.g. "Condition") to
  3835. // unconditionally include in API requests. By default, fields with
  3836. // empty values are omitted from API requests. However, any non-pointer,
  3837. // non-interface field appearing in ForceSendFields will be sent to the
  3838. // server regardless of whether the field is empty or not. This may be
  3839. // used to include empty fields in Patch requests.
  3840. ForceSendFields []string `json:"-"`
  3841. // NullFields is a list of field names (e.g. "Condition") to include in
  3842. // API requests with the JSON null value. By default, fields with empty
  3843. // values are omitted from API requests. However, any field with an
  3844. // empty value appearing in NullFields will be sent to the server as
  3845. // null. It is an error if a field in this list has a non-empty value.
  3846. // This may be used to include null fields in Patch requests.
  3847. NullFields []string `json:"-"`
  3848. }
  3849. func (s *Binding) MarshalJSON() ([]byte, error) {
  3850. type NoMethod Binding
  3851. raw := NoMethod(*s)
  3852. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3853. }
  3854. type CacheInvalidationRule struct {
  3855. // Host: If set, this invalidation rule will only apply to requests with
  3856. // a Host header matching host.
  3857. Host string `json:"host,omitempty"`
  3858. Path string `json:"path,omitempty"`
  3859. // ForceSendFields is a list of field names (e.g. "Host") to
  3860. // unconditionally include in API requests. By default, fields with
  3861. // empty values are omitted from API requests. However, any non-pointer,
  3862. // non-interface field appearing in ForceSendFields will be sent to the
  3863. // server regardless of whether the field is empty or not. This may be
  3864. // used to include empty fields in Patch requests.
  3865. ForceSendFields []string `json:"-"`
  3866. // NullFields is a list of field names (e.g. "Host") to include in API
  3867. // requests with the JSON null value. By default, fields with empty
  3868. // values are omitted from API requests. However, any field with an
  3869. // empty value appearing in NullFields will be sent to the server as
  3870. // null. It is an error if a field in this list has a non-empty value.
  3871. // This may be used to include null fields in Patch requests.
  3872. NullFields []string `json:"-"`
  3873. }
  3874. func (s *CacheInvalidationRule) MarshalJSON() ([]byte, error) {
  3875. type NoMethod CacheInvalidationRule
  3876. raw := NoMethod(*s)
  3877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3878. }
  3879. // CacheKeyPolicy: Message containing what to include in the cache key
  3880. // for a request for Cloud CDN.
  3881. type CacheKeyPolicy struct {
  3882. // IncludeHost: If true, requests to different hosts will be cached
  3883. // separately.
  3884. IncludeHost bool `json:"includeHost,omitempty"`
  3885. // IncludeProtocol: If true, http and https requests will be cached
  3886. // separately.
  3887. IncludeProtocol bool `json:"includeProtocol,omitempty"`
  3888. // IncludeQueryString: If true, include query string parameters in the
  3889. // cache key according to query_string_whitelist and
  3890. // query_string_blacklist. If neither is set, the entire query string
  3891. // will be included. If false, the query string will be excluded from
  3892. // the cache key entirely.
  3893. IncludeQueryString bool `json:"includeQueryString,omitempty"`
  3894. // QueryStringBlacklist: Names of query string parameters to exclude in
  3895. // cache keys. All other parameters will be included. Either specify
  3896. // query_string_whitelist or query_string_blacklist, not both. '&' and
  3897. // '=' will be percent encoded and not treated as delimiters.
  3898. QueryStringBlacklist []string `json:"queryStringBlacklist,omitempty"`
  3899. // QueryStringWhitelist: Names of query string parameters to include in
  3900. // cache keys. All other parameters will be excluded. Either specify
  3901. // query_string_whitelist or query_string_blacklist, not both. '&' and
  3902. // '=' will be percent encoded and not treated as delimiters.
  3903. QueryStringWhitelist []string `json:"queryStringWhitelist,omitempty"`
  3904. // ForceSendFields is a list of field names (e.g. "IncludeHost") to
  3905. // unconditionally include in API requests. By default, fields with
  3906. // empty values are omitted from API requests. However, any non-pointer,
  3907. // non-interface field appearing in ForceSendFields will be sent to the
  3908. // server regardless of whether the field is empty or not. This may be
  3909. // used to include empty fields in Patch requests.
  3910. ForceSendFields []string `json:"-"`
  3911. // NullFields is a list of field names (e.g. "IncludeHost") to include
  3912. // in API requests with the JSON null value. By default, fields with
  3913. // empty values are omitted from API requests. However, any field with
  3914. // an empty value appearing in NullFields will be sent to the server as
  3915. // null. It is an error if a field in this list has a non-empty value.
  3916. // This may be used to include null fields in Patch requests.
  3917. NullFields []string `json:"-"`
  3918. }
  3919. func (s *CacheKeyPolicy) MarshalJSON() ([]byte, error) {
  3920. type NoMethod CacheKeyPolicy
  3921. raw := NoMethod(*s)
  3922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3923. }
  3924. // Commitment: Represents a Commitment resource. Creating a Commitment
  3925. // resource means that you are purchasing a committed use contract with
  3926. // an explicit start and end time. You can create commitments based on
  3927. // vCPUs and memory usage and receive discounted rates. For full
  3928. // details, read Signing Up for Committed Use Discounts.
  3929. //
  3930. // Committed use discounts are subject to Google Cloud Platform's
  3931. // Service Specific Terms. By purchasing a committed use discount, you
  3932. // agree to these terms. Committed use discounts will not renew, so you
  3933. // must purchase a new commitment to continue receiving discounts. (==
  3934. // resource_for beta.commitments ==) (== resource_for v1.commitments ==)
  3935. type Commitment struct {
  3936. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3937. // format.
  3938. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3939. // Description: An optional description of this resource. Provide this
  3940. // property when you create the resource.
  3941. Description string `json:"description,omitempty"`
  3942. // EndTimestamp: [Output Only] Commitment end time in RFC3339 text
  3943. // format.
  3944. EndTimestamp string `json:"endTimestamp,omitempty"`
  3945. // Id: [Output Only] The unique identifier for the resource. This
  3946. // identifier is defined by the server.
  3947. Id uint64 `json:"id,omitempty,string"`
  3948. // Kind: [Output Only] Type of the resource. Always compute#commitment
  3949. // for commitments.
  3950. Kind string `json:"kind,omitempty"`
  3951. // Name: Name of the resource. Provided by the client when the resource
  3952. // is created. The name must be 1-63 characters long, and comply with
  3953. // RFC1035. Specifically, the name must be 1-63 characters long and
  3954. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3955. // the first character must be a lowercase letter, and all following
  3956. // characters must be a dash, lowercase letter, or digit, except the
  3957. // last character, which cannot be a dash.
  3958. Name string `json:"name,omitempty"`
  3959. // Plan: The plan for this commitment, which determines duration and
  3960. // discount rate. The currently supported plans are TWELVE_MONTH (1
  3961. // year), and THIRTY_SIX_MONTH (3 years).
  3962. //
  3963. // Possible values:
  3964. // "INVALID"
  3965. // "THIRTY_SIX_MONTH"
  3966. // "TWELVE_MONTH"
  3967. Plan string `json:"plan,omitempty"`
  3968. // Region: [Output Only] URL of the region where this commitment may be
  3969. // used.
  3970. Region string `json:"region,omitempty"`
  3971. // Resources: A list of commitment amounts for particular resources.
  3972. // Note that VCPU and MEMORY resource commitments must occur together.
  3973. Resources []*ResourceCommitment `json:"resources,omitempty"`
  3974. // SelfLink: [Output Only] Server-defined URL for the resource.
  3975. SelfLink string `json:"selfLink,omitempty"`
  3976. // StartTimestamp: [Output Only] Commitment start time in RFC3339 text
  3977. // format.
  3978. StartTimestamp string `json:"startTimestamp,omitempty"`
  3979. // Status: [Output Only] Status of the commitment with regards to
  3980. // eventual expiration (each commitment has an end date defined). One of
  3981. // the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
  3982. //
  3983. // Possible values:
  3984. // "ACTIVE"
  3985. // "CREATING"
  3986. // "EXPIRED"
  3987. // "NOT_YET_ACTIVE"
  3988. Status string `json:"status,omitempty"`
  3989. // StatusMessage: [Output Only] An optional, human-readable explanation
  3990. // of the status.
  3991. StatusMessage string `json:"statusMessage,omitempty"`
  3992. // ServerResponse contains the HTTP response code and headers from the
  3993. // server.
  3994. googleapi.ServerResponse `json:"-"`
  3995. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  3996. // to unconditionally include in API requests. By default, fields with
  3997. // empty values are omitted from API requests. However, any non-pointer,
  3998. // non-interface field appearing in ForceSendFields will be sent to the
  3999. // server regardless of whether the field is empty or not. This may be
  4000. // used to include empty fields in Patch requests.
  4001. ForceSendFields []string `json:"-"`
  4002. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  4003. // include in API requests with the JSON null value. By default, fields
  4004. // with empty values are omitted from API requests. However, any field
  4005. // with an empty value appearing in NullFields will be sent to the
  4006. // server as null. It is an error if a field in this list has a
  4007. // non-empty value. This may be used to include null fields in Patch
  4008. // requests.
  4009. NullFields []string `json:"-"`
  4010. }
  4011. func (s *Commitment) MarshalJSON() ([]byte, error) {
  4012. type NoMethod Commitment
  4013. raw := NoMethod(*s)
  4014. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4015. }
  4016. type CommitmentAggregatedList struct {
  4017. // Id: [Output Only] Unique identifier for the resource; defined by the
  4018. // server.
  4019. Id string `json:"id,omitempty"`
  4020. // Items: A list of CommitmentsScopedList resources.
  4021. Items map[string]CommitmentsScopedList `json:"items,omitempty"`
  4022. // Kind: [Output Only] Type of resource. Always
  4023. // compute#commitmentAggregatedList for aggregated lists of commitments.
  4024. Kind string `json:"kind,omitempty"`
  4025. // NextPageToken: [Output Only] This token allows you to get the next
  4026. // page of results for list requests. If the number of results is larger
  4027. // than maxResults, use the nextPageToken as a value for the query
  4028. // parameter pageToken in the next list request. Subsequent list
  4029. // requests will have their own nextPageToken to continue paging through
  4030. // the results.
  4031. NextPageToken string `json:"nextPageToken,omitempty"`
  4032. // SelfLink: [Output Only] Server-defined URL for this resource.
  4033. SelfLink string `json:"selfLink,omitempty"`
  4034. // Warning: [Output Only] Informational warning message.
  4035. Warning *CommitmentAggregatedListWarning `json:"warning,omitempty"`
  4036. // ServerResponse contains the HTTP response code and headers from the
  4037. // server.
  4038. googleapi.ServerResponse `json:"-"`
  4039. // ForceSendFields is a list of field names (e.g. "Id") to
  4040. // unconditionally include in API requests. By default, fields with
  4041. // empty values are omitted from API requests. However, any non-pointer,
  4042. // non-interface field appearing in ForceSendFields will be sent to the
  4043. // server regardless of whether the field is empty or not. This may be
  4044. // used to include empty fields in Patch requests.
  4045. ForceSendFields []string `json:"-"`
  4046. // NullFields is a list of field names (e.g. "Id") to include in API
  4047. // requests with the JSON null value. By default, fields with empty
  4048. // values are omitted from API requests. However, any field with an
  4049. // empty value appearing in NullFields will be sent to the server as
  4050. // null. It is an error if a field in this list has a non-empty value.
  4051. // This may be used to include null fields in Patch requests.
  4052. NullFields []string `json:"-"`
  4053. }
  4054. func (s *CommitmentAggregatedList) MarshalJSON() ([]byte, error) {
  4055. type NoMethod CommitmentAggregatedList
  4056. raw := NoMethod(*s)
  4057. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4058. }
  4059. // CommitmentAggregatedListWarning: [Output Only] Informational warning
  4060. // message.
  4061. type CommitmentAggregatedListWarning struct {
  4062. // Code: [Output Only] A warning code, if applicable. For example,
  4063. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4064. // the response.
  4065. //
  4066. // Possible values:
  4067. // "CLEANUP_FAILED"
  4068. // "DEPRECATED_RESOURCE_USED"
  4069. // "DEPRECATED_TYPE_USED"
  4070. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4071. // "EXPERIMENTAL_TYPE_USED"
  4072. // "EXTERNAL_API_WARNING"
  4073. // "FIELD_VALUE_OVERRIDEN"
  4074. // "INJECTED_KERNELS_DEPRECATED"
  4075. // "MISSING_TYPE_DEPENDENCY"
  4076. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4077. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4078. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4079. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4080. // "NEXT_HOP_NOT_RUNNING"
  4081. // "NOT_CRITICAL_ERROR"
  4082. // "NO_RESULTS_ON_PAGE"
  4083. // "REQUIRED_TOS_AGREEMENT"
  4084. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4085. // "RESOURCE_NOT_DELETED"
  4086. // "SCHEMA_VALIDATION_IGNORED"
  4087. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4088. // "UNDECLARED_PROPERTIES"
  4089. // "UNREACHABLE"
  4090. Code string `json:"code,omitempty"`
  4091. // Data: [Output Only] Metadata about this warning in key: value format.
  4092. // For example:
  4093. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4094. Data []*CommitmentAggregatedListWarningData `json:"data,omitempty"`
  4095. // Message: [Output Only] A human-readable description of the warning
  4096. // code.
  4097. Message string `json:"message,omitempty"`
  4098. // ForceSendFields is a list of field names (e.g. "Code") to
  4099. // unconditionally include in API requests. By default, fields with
  4100. // empty values are omitted from API requests. However, any non-pointer,
  4101. // non-interface field appearing in ForceSendFields will be sent to the
  4102. // server regardless of whether the field is empty or not. This may be
  4103. // used to include empty fields in Patch requests.
  4104. ForceSendFields []string `json:"-"`
  4105. // NullFields is a list of field names (e.g. "Code") to include in API
  4106. // requests with the JSON null value. By default, fields with empty
  4107. // values are omitted from API requests. However, any field with an
  4108. // empty value appearing in NullFields will be sent to the server as
  4109. // null. It is an error if a field in this list has a non-empty value.
  4110. // This may be used to include null fields in Patch requests.
  4111. NullFields []string `json:"-"`
  4112. }
  4113. func (s *CommitmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4114. type NoMethod CommitmentAggregatedListWarning
  4115. raw := NoMethod(*s)
  4116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4117. }
  4118. type CommitmentAggregatedListWarningData struct {
  4119. // Key: [Output Only] A key that provides more detail on the warning
  4120. // being returned. For example, for warnings where there are no results
  4121. // in a list request for a particular zone, this key might be scope and
  4122. // the key value might be the zone name. Other examples might be a key
  4123. // indicating a deprecated resource and a suggested replacement, or a
  4124. // warning about invalid network settings (for example, if an instance
  4125. // attempts to perform IP forwarding but is not enabled for IP
  4126. // forwarding).
  4127. Key string `json:"key,omitempty"`
  4128. // Value: [Output Only] A warning data value corresponding to the key.
  4129. Value string `json:"value,omitempty"`
  4130. // ForceSendFields is a list of field names (e.g. "Key") to
  4131. // unconditionally include in API requests. By default, fields with
  4132. // empty values are omitted from API requests. However, any non-pointer,
  4133. // non-interface field appearing in ForceSendFields will be sent to the
  4134. // server regardless of whether the field is empty or not. This may be
  4135. // used to include empty fields in Patch requests.
  4136. ForceSendFields []string `json:"-"`
  4137. // NullFields is a list of field names (e.g. "Key") to include in API
  4138. // requests with the JSON null value. By default, fields with empty
  4139. // values are omitted from API requests. However, any field with an
  4140. // empty value appearing in NullFields will be sent to the server as
  4141. // null. It is an error if a field in this list has a non-empty value.
  4142. // This may be used to include null fields in Patch requests.
  4143. NullFields []string `json:"-"`
  4144. }
  4145. func (s *CommitmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4146. type NoMethod CommitmentAggregatedListWarningData
  4147. raw := NoMethod(*s)
  4148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4149. }
  4150. // CommitmentList: Contains a list of Commitment resources.
  4151. type CommitmentList struct {
  4152. // Id: [Output Only] Unique identifier for the resource; defined by the
  4153. // server.
  4154. Id string `json:"id,omitempty"`
  4155. // Items: A list of Commitment resources.
  4156. Items []*Commitment `json:"items,omitempty"`
  4157. // Kind: [Output Only] Type of resource. Always compute#commitmentList
  4158. // for lists of commitments.
  4159. Kind string `json:"kind,omitempty"`
  4160. // NextPageToken: [Output Only] This token allows you to get the next
  4161. // page of results for list requests. If the number of results is larger
  4162. // than maxResults, use the nextPageToken as a value for the query
  4163. // parameter pageToken in the next list request. Subsequent list
  4164. // requests will have their own nextPageToken to continue paging through
  4165. // the results.
  4166. NextPageToken string `json:"nextPageToken,omitempty"`
  4167. // SelfLink: [Output Only] Server-defined URL for this resource.
  4168. SelfLink string `json:"selfLink,omitempty"`
  4169. // Warning: [Output Only] Informational warning message.
  4170. Warning *CommitmentListWarning `json:"warning,omitempty"`
  4171. // ServerResponse contains the HTTP response code and headers from the
  4172. // server.
  4173. googleapi.ServerResponse `json:"-"`
  4174. // ForceSendFields is a list of field names (e.g. "Id") to
  4175. // unconditionally include in API requests. By default, fields with
  4176. // empty values are omitted from API requests. However, any non-pointer,
  4177. // non-interface field appearing in ForceSendFields will be sent to the
  4178. // server regardless of whether the field is empty or not. This may be
  4179. // used to include empty fields in Patch requests.
  4180. ForceSendFields []string `json:"-"`
  4181. // NullFields is a list of field names (e.g. "Id") to include in API
  4182. // requests with the JSON null value. By default, fields with empty
  4183. // values are omitted from API requests. However, any field with an
  4184. // empty value appearing in NullFields will be sent to the server as
  4185. // null. It is an error if a field in this list has a non-empty value.
  4186. // This may be used to include null fields in Patch requests.
  4187. NullFields []string `json:"-"`
  4188. }
  4189. func (s *CommitmentList) MarshalJSON() ([]byte, error) {
  4190. type NoMethod CommitmentList
  4191. raw := NoMethod(*s)
  4192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4193. }
  4194. // CommitmentListWarning: [Output Only] Informational warning message.
  4195. type CommitmentListWarning struct {
  4196. // Code: [Output Only] A warning code, if applicable. For example,
  4197. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4198. // the response.
  4199. //
  4200. // Possible values:
  4201. // "CLEANUP_FAILED"
  4202. // "DEPRECATED_RESOURCE_USED"
  4203. // "DEPRECATED_TYPE_USED"
  4204. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4205. // "EXPERIMENTAL_TYPE_USED"
  4206. // "EXTERNAL_API_WARNING"
  4207. // "FIELD_VALUE_OVERRIDEN"
  4208. // "INJECTED_KERNELS_DEPRECATED"
  4209. // "MISSING_TYPE_DEPENDENCY"
  4210. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4211. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4212. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4213. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4214. // "NEXT_HOP_NOT_RUNNING"
  4215. // "NOT_CRITICAL_ERROR"
  4216. // "NO_RESULTS_ON_PAGE"
  4217. // "REQUIRED_TOS_AGREEMENT"
  4218. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4219. // "RESOURCE_NOT_DELETED"
  4220. // "SCHEMA_VALIDATION_IGNORED"
  4221. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4222. // "UNDECLARED_PROPERTIES"
  4223. // "UNREACHABLE"
  4224. Code string `json:"code,omitempty"`
  4225. // Data: [Output Only] Metadata about this warning in key: value format.
  4226. // For example:
  4227. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4228. Data []*CommitmentListWarningData `json:"data,omitempty"`
  4229. // Message: [Output Only] A human-readable description of the warning
  4230. // code.
  4231. Message string `json:"message,omitempty"`
  4232. // ForceSendFields is a list of field names (e.g. "Code") to
  4233. // unconditionally include in API requests. By default, fields with
  4234. // empty values are omitted from API requests. However, any non-pointer,
  4235. // non-interface field appearing in ForceSendFields will be sent to the
  4236. // server regardless of whether the field is empty or not. This may be
  4237. // used to include empty fields in Patch requests.
  4238. ForceSendFields []string `json:"-"`
  4239. // NullFields is a list of field names (e.g. "Code") to include in API
  4240. // requests with the JSON null value. By default, fields with empty
  4241. // values are omitted from API requests. However, any field with an
  4242. // empty value appearing in NullFields will be sent to the server as
  4243. // null. It is an error if a field in this list has a non-empty value.
  4244. // This may be used to include null fields in Patch requests.
  4245. NullFields []string `json:"-"`
  4246. }
  4247. func (s *CommitmentListWarning) MarshalJSON() ([]byte, error) {
  4248. type NoMethod CommitmentListWarning
  4249. raw := NoMethod(*s)
  4250. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4251. }
  4252. type CommitmentListWarningData struct {
  4253. // Key: [Output Only] A key that provides more detail on the warning
  4254. // being returned. For example, for warnings where there are no results
  4255. // in a list request for a particular zone, this key might be scope and
  4256. // the key value might be the zone name. Other examples might be a key
  4257. // indicating a deprecated resource and a suggested replacement, or a
  4258. // warning about invalid network settings (for example, if an instance
  4259. // attempts to perform IP forwarding but is not enabled for IP
  4260. // forwarding).
  4261. Key string `json:"key,omitempty"`
  4262. // Value: [Output Only] A warning data value corresponding to the key.
  4263. Value string `json:"value,omitempty"`
  4264. // ForceSendFields is a list of field names (e.g. "Key") to
  4265. // unconditionally include in API requests. By default, fields with
  4266. // empty values are omitted from API requests. However, any non-pointer,
  4267. // non-interface field appearing in ForceSendFields will be sent to the
  4268. // server regardless of whether the field is empty or not. This may be
  4269. // used to include empty fields in Patch requests.
  4270. ForceSendFields []string `json:"-"`
  4271. // NullFields is a list of field names (e.g. "Key") to include in API
  4272. // requests with the JSON null value. By default, fields with empty
  4273. // values are omitted from API requests. However, any field with an
  4274. // empty value appearing in NullFields will be sent to the server as
  4275. // null. It is an error if a field in this list has a non-empty value.
  4276. // This may be used to include null fields in Patch requests.
  4277. NullFields []string `json:"-"`
  4278. }
  4279. func (s *CommitmentListWarningData) MarshalJSON() ([]byte, error) {
  4280. type NoMethod CommitmentListWarningData
  4281. raw := NoMethod(*s)
  4282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4283. }
  4284. type CommitmentsScopedList struct {
  4285. // Commitments: [Output Only] A list of commitments contained in this
  4286. // scope.
  4287. Commitments []*Commitment `json:"commitments,omitempty"`
  4288. // Warning: [Output Only] Informational warning which replaces the list
  4289. // of commitments when the list is empty.
  4290. Warning *CommitmentsScopedListWarning `json:"warning,omitempty"`
  4291. // ForceSendFields is a list of field names (e.g. "Commitments") to
  4292. // unconditionally include in API requests. By default, fields with
  4293. // empty values are omitted from API requests. However, any non-pointer,
  4294. // non-interface field appearing in ForceSendFields will be sent to the
  4295. // server regardless of whether the field is empty or not. This may be
  4296. // used to include empty fields in Patch requests.
  4297. ForceSendFields []string `json:"-"`
  4298. // NullFields is a list of field names (e.g. "Commitments") to include
  4299. // in API requests with the JSON null value. By default, fields with
  4300. // empty values are omitted from API requests. However, any field with
  4301. // an empty value appearing in NullFields will be sent to the server as
  4302. // null. It is an error if a field in this list has a non-empty value.
  4303. // This may be used to include null fields in Patch requests.
  4304. NullFields []string `json:"-"`
  4305. }
  4306. func (s *CommitmentsScopedList) MarshalJSON() ([]byte, error) {
  4307. type NoMethod CommitmentsScopedList
  4308. raw := NoMethod(*s)
  4309. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4310. }
  4311. // CommitmentsScopedListWarning: [Output Only] Informational warning
  4312. // which replaces the list of commitments when the list is empty.
  4313. type CommitmentsScopedListWarning struct {
  4314. // Code: [Output Only] A warning code, if applicable. For example,
  4315. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4316. // the response.
  4317. //
  4318. // Possible values:
  4319. // "CLEANUP_FAILED"
  4320. // "DEPRECATED_RESOURCE_USED"
  4321. // "DEPRECATED_TYPE_USED"
  4322. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4323. // "EXPERIMENTAL_TYPE_USED"
  4324. // "EXTERNAL_API_WARNING"
  4325. // "FIELD_VALUE_OVERRIDEN"
  4326. // "INJECTED_KERNELS_DEPRECATED"
  4327. // "MISSING_TYPE_DEPENDENCY"
  4328. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4329. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4330. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4331. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4332. // "NEXT_HOP_NOT_RUNNING"
  4333. // "NOT_CRITICAL_ERROR"
  4334. // "NO_RESULTS_ON_PAGE"
  4335. // "REQUIRED_TOS_AGREEMENT"
  4336. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4337. // "RESOURCE_NOT_DELETED"
  4338. // "SCHEMA_VALIDATION_IGNORED"
  4339. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4340. // "UNDECLARED_PROPERTIES"
  4341. // "UNREACHABLE"
  4342. Code string `json:"code,omitempty"`
  4343. // Data: [Output Only] Metadata about this warning in key: value format.
  4344. // For example:
  4345. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4346. Data []*CommitmentsScopedListWarningData `json:"data,omitempty"`
  4347. // Message: [Output Only] A human-readable description of the warning
  4348. // code.
  4349. Message string `json:"message,omitempty"`
  4350. // ForceSendFields is a list of field names (e.g. "Code") to
  4351. // unconditionally include in API requests. By default, fields with
  4352. // empty values are omitted from API requests. However, any non-pointer,
  4353. // non-interface field appearing in ForceSendFields will be sent to the
  4354. // server regardless of whether the field is empty or not. This may be
  4355. // used to include empty fields in Patch requests.
  4356. ForceSendFields []string `json:"-"`
  4357. // NullFields is a list of field names (e.g. "Code") to include in API
  4358. // requests with the JSON null value. By default, fields with empty
  4359. // values are omitted from API requests. However, any field with an
  4360. // empty value appearing in NullFields will be sent to the server as
  4361. // null. It is an error if a field in this list has a non-empty value.
  4362. // This may be used to include null fields in Patch requests.
  4363. NullFields []string `json:"-"`
  4364. }
  4365. func (s *CommitmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  4366. type NoMethod CommitmentsScopedListWarning
  4367. raw := NoMethod(*s)
  4368. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4369. }
  4370. type CommitmentsScopedListWarningData struct {
  4371. // Key: [Output Only] A key that provides more detail on the warning
  4372. // being returned. For example, for warnings where there are no results
  4373. // in a list request for a particular zone, this key might be scope and
  4374. // the key value might be the zone name. Other examples might be a key
  4375. // indicating a deprecated resource and a suggested replacement, or a
  4376. // warning about invalid network settings (for example, if an instance
  4377. // attempts to perform IP forwarding but is not enabled for IP
  4378. // forwarding).
  4379. Key string `json:"key,omitempty"`
  4380. // Value: [Output Only] A warning data value corresponding to the key.
  4381. Value string `json:"value,omitempty"`
  4382. // ForceSendFields is a list of field names (e.g. "Key") to
  4383. // unconditionally include in API requests. By default, fields with
  4384. // empty values are omitted from API requests. However, any non-pointer,
  4385. // non-interface field appearing in ForceSendFields will be sent to the
  4386. // server regardless of whether the field is empty or not. This may be
  4387. // used to include empty fields in Patch requests.
  4388. ForceSendFields []string `json:"-"`
  4389. // NullFields is a list of field names (e.g. "Key") to include in API
  4390. // requests with the JSON null value. By default, fields with empty
  4391. // values are omitted from API requests. However, any field with an
  4392. // empty value appearing in NullFields will be sent to the server as
  4393. // null. It is an error if a field in this list has a non-empty value.
  4394. // This may be used to include null fields in Patch requests.
  4395. NullFields []string `json:"-"`
  4396. }
  4397. func (s *CommitmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  4398. type NoMethod CommitmentsScopedListWarningData
  4399. raw := NoMethod(*s)
  4400. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4401. }
  4402. // Condition: A condition to be met.
  4403. type Condition struct {
  4404. // Iam: Trusted attributes supplied by the IAM system.
  4405. //
  4406. // Possible values:
  4407. // "APPROVER"
  4408. // "ATTRIBUTION"
  4409. // "AUTHORITY"
  4410. // "CREDENTIALS_TYPE"
  4411. // "JUSTIFICATION_TYPE"
  4412. // "NO_ATTR"
  4413. // "SECURITY_REALM"
  4414. Iam string `json:"iam,omitempty"`
  4415. // Op: An operator to apply the subject with.
  4416. //
  4417. // Possible values:
  4418. // "DISCHARGED"
  4419. // "EQUALS"
  4420. // "IN"
  4421. // "NOT_EQUALS"
  4422. // "NOT_IN"
  4423. // "NO_OP"
  4424. Op string `json:"op,omitempty"`
  4425. // Svc: Trusted attributes discharged by the service.
  4426. Svc string `json:"svc,omitempty"`
  4427. // Sys: Trusted attributes supplied by any service that owns resources
  4428. // and uses the IAM system for access control.
  4429. //
  4430. // Possible values:
  4431. // "IP"
  4432. // "NAME"
  4433. // "NO_ATTR"
  4434. // "REGION"
  4435. // "SERVICE"
  4436. Sys string `json:"sys,omitempty"`
  4437. // Values: The objects of the condition.
  4438. Values []string `json:"values,omitempty"`
  4439. // ForceSendFields is a list of field names (e.g. "Iam") to
  4440. // unconditionally include in API requests. By default, fields with
  4441. // empty values are omitted from API requests. However, any non-pointer,
  4442. // non-interface field appearing in ForceSendFields will be sent to the
  4443. // server regardless of whether the field is empty or not. This may be
  4444. // used to include empty fields in Patch requests.
  4445. ForceSendFields []string `json:"-"`
  4446. // NullFields is a list of field names (e.g. "Iam") to include in API
  4447. // requests with the JSON null value. By default, fields with empty
  4448. // values are omitted from API requests. However, any field with an
  4449. // empty value appearing in NullFields will be sent to the server as
  4450. // null. It is an error if a field in this list has a non-empty value.
  4451. // This may be used to include null fields in Patch requests.
  4452. NullFields []string `json:"-"`
  4453. }
  4454. func (s *Condition) MarshalJSON() ([]byte, error) {
  4455. type NoMethod Condition
  4456. raw := NoMethod(*s)
  4457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4458. }
  4459. // ConnectionDraining: Message containing connection draining
  4460. // configuration.
  4461. type ConnectionDraining struct {
  4462. // DrainingTimeoutSec: Time for which instance will be drained (not
  4463. // accept new connections, but still work to finish started).
  4464. DrainingTimeoutSec int64 `json:"drainingTimeoutSec,omitempty"`
  4465. // ForceSendFields is a list of field names (e.g. "DrainingTimeoutSec")
  4466. // to unconditionally include in API requests. By default, fields with
  4467. // empty values are omitted from API requests. However, any non-pointer,
  4468. // non-interface field appearing in ForceSendFields will be sent to the
  4469. // server regardless of whether the field is empty or not. This may be
  4470. // used to include empty fields in Patch requests.
  4471. ForceSendFields []string `json:"-"`
  4472. // NullFields is a list of field names (e.g. "DrainingTimeoutSec") to
  4473. // include in API requests with the JSON null value. By default, fields
  4474. // with empty values are omitted from API requests. However, any field
  4475. // with an empty value appearing in NullFields will be sent to the
  4476. // server as null. It is an error if a field in this list has a
  4477. // non-empty value. This may be used to include null fields in Patch
  4478. // requests.
  4479. NullFields []string `json:"-"`
  4480. }
  4481. func (s *ConnectionDraining) MarshalJSON() ([]byte, error) {
  4482. type NoMethod ConnectionDraining
  4483. raw := NoMethod(*s)
  4484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4485. }
  4486. // CustomerEncryptionKey: Represents a customer-supplied encryption key
  4487. type CustomerEncryptionKey struct {
  4488. // KmsKeyName: The name of the encryption key that is stored in Google
  4489. // Cloud KMS.
  4490. KmsKeyName string `json:"kmsKeyName,omitempty"`
  4491. // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded
  4492. // in RFC 4648 base64 to either encrypt or decrypt this resource.
  4493. RawKey string `json:"rawKey,omitempty"`
  4494. // Sha256: [Output only] The RFC 4648 base64 encoded SHA-256 hash of the
  4495. // customer-supplied encryption key that protects this resource.
  4496. Sha256 string `json:"sha256,omitempty"`
  4497. // ForceSendFields is a list of field names (e.g. "KmsKeyName") to
  4498. // unconditionally include in API requests. By default, fields with
  4499. // empty values are omitted from API requests. However, any non-pointer,
  4500. // non-interface field appearing in ForceSendFields will be sent to the
  4501. // server regardless of whether the field is empty or not. This may be
  4502. // used to include empty fields in Patch requests.
  4503. ForceSendFields []string `json:"-"`
  4504. // NullFields is a list of field names (e.g. "KmsKeyName") to include in
  4505. // API requests with the JSON null value. By default, fields with empty
  4506. // values are omitted from API requests. However, any field with an
  4507. // empty value appearing in NullFields will be sent to the server as
  4508. // null. It is an error if a field in this list has a non-empty value.
  4509. // This may be used to include null fields in Patch requests.
  4510. NullFields []string `json:"-"`
  4511. }
  4512. func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
  4513. type NoMethod CustomerEncryptionKey
  4514. raw := NoMethod(*s)
  4515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4516. }
  4517. type CustomerEncryptionKeyProtectedDisk struct {
  4518. // DiskEncryptionKey: Decrypts data associated with the disk with a
  4519. // customer-supplied encryption key.
  4520. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  4521. // Source: Specifies a valid partial or full URL to an existing
  4522. // Persistent Disk resource. This field is only applicable for
  4523. // persistent disks.
  4524. Source string `json:"source,omitempty"`
  4525. // ForceSendFields is a list of field names (e.g. "DiskEncryptionKey")
  4526. // to unconditionally include in API requests. By default, fields with
  4527. // empty values are omitted from API requests. However, any non-pointer,
  4528. // non-interface field appearing in ForceSendFields will be sent to the
  4529. // server regardless of whether the field is empty or not. This may be
  4530. // used to include empty fields in Patch requests.
  4531. ForceSendFields []string `json:"-"`
  4532. // NullFields is a list of field names (e.g. "DiskEncryptionKey") to
  4533. // include in API requests with the JSON null value. By default, fields
  4534. // with empty values are omitted from API requests. However, any field
  4535. // with an empty value appearing in NullFields will be sent to the
  4536. // server as null. It is an error if a field in this list has a
  4537. // non-empty value. This may be used to include null fields in Patch
  4538. // requests.
  4539. NullFields []string `json:"-"`
  4540. }
  4541. func (s *CustomerEncryptionKeyProtectedDisk) MarshalJSON() ([]byte, error) {
  4542. type NoMethod CustomerEncryptionKeyProtectedDisk
  4543. raw := NoMethod(*s)
  4544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4545. }
  4546. // DeprecationStatus: Deprecation status for a public resource.
  4547. type DeprecationStatus struct {
  4548. // Deleted: An optional RFC3339 timestamp on or after which the state of
  4549. // this resource is intended to change to DELETED. This is only
  4550. // informational and the status will not change unless the client
  4551. // explicitly changes it.
  4552. Deleted string `json:"deleted,omitempty"`
  4553. // Deprecated: An optional RFC3339 timestamp on or after which the state
  4554. // of this resource is intended to change to DEPRECATED. This is only
  4555. // informational and the status will not change unless the client
  4556. // explicitly changes it.
  4557. Deprecated string `json:"deprecated,omitempty"`
  4558. // Obsolete: An optional RFC3339 timestamp on or after which the state
  4559. // of this resource is intended to change to OBSOLETE. This is only
  4560. // informational and the status will not change unless the client
  4561. // explicitly changes it.
  4562. Obsolete string `json:"obsolete,omitempty"`
  4563. // Replacement: The URL of the suggested replacement for a deprecated
  4564. // resource. The suggested replacement resource must be the same kind of
  4565. // resource as the deprecated resource.
  4566. Replacement string `json:"replacement,omitempty"`
  4567. // State: The deprecation state of this resource. This can be ACTIVE
  4568. // DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the
  4569. // end of life date for an image, can use ACTIVE. Operations which
  4570. // create a new resource using a DEPRECATED resource will return
  4571. // successfully, but with a warning indicating the deprecated resource
  4572. // and recommending its replacement. Operations which use OBSOLETE or
  4573. // DELETED resources will be rejected and result in an error.
  4574. //
  4575. // Possible values:
  4576. // "ACTIVE"
  4577. // "DELETED"
  4578. // "DEPRECATED"
  4579. // "OBSOLETE"
  4580. State string `json:"state,omitempty"`
  4581. // ForceSendFields is a list of field names (e.g. "Deleted") to
  4582. // unconditionally include in API requests. By default, fields with
  4583. // empty values are omitted from API requests. However, any non-pointer,
  4584. // non-interface field appearing in ForceSendFields will be sent to the
  4585. // server regardless of whether the field is empty or not. This may be
  4586. // used to include empty fields in Patch requests.
  4587. ForceSendFields []string `json:"-"`
  4588. // NullFields is a list of field names (e.g. "Deleted") to include in
  4589. // API requests with the JSON null value. By default, fields with empty
  4590. // values are omitted from API requests. However, any field with an
  4591. // empty value appearing in NullFields will be sent to the server as
  4592. // null. It is an error if a field in this list has a non-empty value.
  4593. // This may be used to include null fields in Patch requests.
  4594. NullFields []string `json:"-"`
  4595. }
  4596. func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
  4597. type NoMethod DeprecationStatus
  4598. raw := NoMethod(*s)
  4599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4600. }
  4601. // Disk: A Disk resource. (== resource_for beta.disks ==) (==
  4602. // resource_for v1.disks ==)
  4603. type Disk struct {
  4604. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4605. // format.
  4606. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4607. // Description: An optional description of this resource. Provide this
  4608. // property when you create the resource.
  4609. Description string `json:"description,omitempty"`
  4610. // DiskEncryptionKey: Encrypts the disk using a customer-supplied
  4611. // encryption key.
  4612. //
  4613. // After you encrypt a disk with a customer-supplied key, you must
  4614. // provide the same key if you use the disk later (e.g. to create a disk
  4615. // snapshot or an image, or to attach the disk to a virtual
  4616. // machine).
  4617. //
  4618. // Customer-supplied encryption keys do not protect access to metadata
  4619. // of the disk.
  4620. //
  4621. // If you do not provide an encryption key when creating the disk, then
  4622. // the disk will be encrypted using an automatically generated key and
  4623. // you do not need to provide a key to use the disk later.
  4624. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  4625. // GuestOsFeatures: A list of features to enable on the guest operating
  4626. // system. Applicable only for bootable images. Read Enabling guest
  4627. // operating system features to see a list of available options.
  4628. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  4629. // Id: [Output Only] The unique identifier for the resource. This
  4630. // identifier is defined by the server.
  4631. Id uint64 `json:"id,omitempty,string"`
  4632. // Kind: [Output Only] Type of the resource. Always compute#disk for
  4633. // disks.
  4634. Kind string `json:"kind,omitempty"`
  4635. // LabelFingerprint: A fingerprint for the labels being applied to this
  4636. // disk, which is essentially a hash of the labels set used for
  4637. // optimistic locking. The fingerprint is initially generated by Compute
  4638. // Engine and changes after every request to modify or update labels.
  4639. // You must always provide an up-to-date fingerprint hash in order to
  4640. // update or change labels, otherwise the request will fail with error
  4641. // 412 conditionNotMet.
  4642. //
  4643. // To see the latest fingerprint, make a get() request to retrieve a
  4644. // disk.
  4645. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  4646. // Labels: Labels to apply to this disk. These can be later modified by
  4647. // the setLabels method.
  4648. Labels map[string]string `json:"labels,omitempty"`
  4649. // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339
  4650. // text format.
  4651. LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"`
  4652. // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339
  4653. // text format.
  4654. LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"`
  4655. // LicenseCodes: Integer license codes indicating which licenses are
  4656. // attached to this disk.
  4657. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  4658. // Licenses: A list of publicly visible licenses. Reserved for Google's
  4659. // use.
  4660. Licenses []string `json:"licenses,omitempty"`
  4661. // Name: Name of the resource. Provided by the client when the resource
  4662. // is created. The name must be 1-63 characters long, and comply with
  4663. // RFC1035. Specifically, the name must be 1-63 characters long and
  4664. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  4665. // the first character must be a lowercase letter, and all following
  4666. // characters must be a dash, lowercase letter, or digit, except the
  4667. // last character, which cannot be a dash.
  4668. Name string `json:"name,omitempty"`
  4669. // Options: Internal use only.
  4670. Options string `json:"options,omitempty"`
  4671. // PhysicalBlockSizeBytes: Physical block size of the persistent disk,
  4672. // in bytes. If not present in a request, a default value is used.
  4673. // Currently supported sizes are 4096 and 16384, other sizes may be
  4674. // added in the future. If an unsupported value is requested, the error
  4675. // message will list the supported values for the caller's project.
  4676. PhysicalBlockSizeBytes int64 `json:"physicalBlockSizeBytes,omitempty,string"`
  4677. // Region: [Output Only] URL of the region where the disk resides. Only
  4678. // applicable for regional resources. You must specify this field as
  4679. // part of the HTTP request URL. It is not settable as a field in the
  4680. // request body.
  4681. Region string `json:"region,omitempty"`
  4682. // ReplicaZones: URLs of the zones where the disk should be replicated
  4683. // to. Only applicable for regional resources.
  4684. ReplicaZones []string `json:"replicaZones,omitempty"`
  4685. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  4686. // resource.
  4687. SelfLink string `json:"selfLink,omitempty"`
  4688. // SizeGb: Size of the persistent disk, specified in GB. You can specify
  4689. // this field when creating a persistent disk using the sourceImage or
  4690. // sourceSnapshot parameter, or specify it alone to create an empty
  4691. // persistent disk.
  4692. //
  4693. // If you specify this field along with sourceImage or sourceSnapshot,
  4694. // the value of sizeGb must not be less than the size of the sourceImage
  4695. // or the size of the snapshot. Acceptable values are 1 to 65536,
  4696. // inclusive.
  4697. SizeGb int64 `json:"sizeGb,omitempty,string"`
  4698. // SourceImage: The source image used to create this disk. If the source
  4699. // image is deleted, this field will not be set.
  4700. //
  4701. // To create a disk with one of the public operating system images,
  4702. // specify the image by its family name. For example, specify
  4703. // family/debian-9 to use the latest Debian 9
  4704. // image:
  4705. // projects/debian-cloud/global/images/family/debian-9
  4706. //
  4707. //
  4708. // Alternati
  4709. // vely, use a specific version of a public operating system
  4710. // image:
  4711. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  4712. //
  4713. //
  4714. //
  4715. // To create a disk with a custom image that you created, specify the
  4716. // image name in the following
  4717. // format:
  4718. // global/images/my-custom-image
  4719. //
  4720. //
  4721. // You can also specify a custom image by its image family, which
  4722. // returns the latest version of the image in that family. Replace the
  4723. // image name with
  4724. // family/family-name:
  4725. // global/images/family/my-image-family
  4726. SourceImage string `json:"sourceImage,omitempty"`
  4727. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  4728. // source image. Required if the source image is protected by a
  4729. // customer-supplied encryption key.
  4730. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  4731. // SourceImageId: [Output Only] The ID value of the image used to create
  4732. // this disk. This value identifies the exact image that was used to
  4733. // create this persistent disk. For example, if you created the
  4734. // persistent disk from an image that was later deleted and recreated
  4735. // under the same name, the source image ID would identify the exact
  4736. // version of the image that was used.
  4737. SourceImageId string `json:"sourceImageId,omitempty"`
  4738. // SourceSnapshot: The source snapshot used to create this disk. You can
  4739. // provide this as a partial or full URL to the resource. For example,
  4740. // the following are valid values:
  4741. // -
  4742. // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
  4743. // - projects/project/global/snapshots/snapshot
  4744. // - global/snapshots/snapshot
  4745. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  4746. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  4747. // the source snapshot. Required if the source snapshot is protected by
  4748. // a customer-supplied encryption key.
  4749. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  4750. // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to
  4751. // create this disk. This value identifies the exact snapshot that was
  4752. // used to create this persistent disk. For example, if you created the
  4753. // persistent disk from a snapshot that was later deleted and recreated
  4754. // under the same name, the source snapshot ID would identify the exact
  4755. // version of the snapshot that was used.
  4756. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  4757. // Status: [Output Only] The status of disk creation.
  4758. //
  4759. // Possible values:
  4760. // "CREATING"
  4761. // "DELETING"
  4762. // "FAILED"
  4763. // "READY"
  4764. // "RESTORING"
  4765. Status string `json:"status,omitempty"`
  4766. // Type: URL of the disk type resource describing which disk type to use
  4767. // to create the disk. Provide this when creating the disk. For example:
  4768. // project/zones/zone/diskTypes/pd-standard or pd-ssd
  4769. Type string `json:"type,omitempty"`
  4770. // Users: [Output Only] Links to the users of the disk (attached
  4771. // instances) in form: project/zones/zone/instances/instance
  4772. Users []string `json:"users,omitempty"`
  4773. // Zone: [Output Only] URL of the zone where the disk resides. You must
  4774. // specify this field as part of the HTTP request URL. It is not
  4775. // settable as a field in the request body.
  4776. Zone string `json:"zone,omitempty"`
  4777. // ServerResponse contains the HTTP response code and headers from the
  4778. // server.
  4779. googleapi.ServerResponse `json:"-"`
  4780. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  4781. // to unconditionally include in API requests. By default, fields with
  4782. // empty values are omitted from API requests. However, any non-pointer,
  4783. // non-interface field appearing in ForceSendFields will be sent to the
  4784. // server regardless of whether the field is empty or not. This may be
  4785. // used to include empty fields in Patch requests.
  4786. ForceSendFields []string `json:"-"`
  4787. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  4788. // include in API requests with the JSON null value. By default, fields
  4789. // with empty values are omitted from API requests. However, any field
  4790. // with an empty value appearing in NullFields will be sent to the
  4791. // server as null. It is an error if a field in this list has a
  4792. // non-empty value. This may be used to include null fields in Patch
  4793. // requests.
  4794. NullFields []string `json:"-"`
  4795. }
  4796. func (s *Disk) MarshalJSON() ([]byte, error) {
  4797. type NoMethod Disk
  4798. raw := NoMethod(*s)
  4799. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4800. }
  4801. type DiskAggregatedList struct {
  4802. // Id: [Output Only] Unique identifier for the resource; defined by the
  4803. // server.
  4804. Id string `json:"id,omitempty"`
  4805. // Items: A list of DisksScopedList resources.
  4806. Items map[string]DisksScopedList `json:"items,omitempty"`
  4807. // Kind: [Output Only] Type of resource. Always
  4808. // compute#diskAggregatedList for aggregated lists of persistent disks.
  4809. Kind string `json:"kind,omitempty"`
  4810. // NextPageToken: [Output Only] This token allows you to get the next
  4811. // page of results for list requests. If the number of results is larger
  4812. // than maxResults, use the nextPageToken as a value for the query
  4813. // parameter pageToken in the next list request. Subsequent list
  4814. // requests will have their own nextPageToken to continue paging through
  4815. // the results.
  4816. NextPageToken string `json:"nextPageToken,omitempty"`
  4817. // SelfLink: [Output Only] Server-defined URL for this resource.
  4818. SelfLink string `json:"selfLink,omitempty"`
  4819. // Warning: [Output Only] Informational warning message.
  4820. Warning *DiskAggregatedListWarning `json:"warning,omitempty"`
  4821. // ServerResponse contains the HTTP response code and headers from the
  4822. // server.
  4823. googleapi.ServerResponse `json:"-"`
  4824. // ForceSendFields is a list of field names (e.g. "Id") to
  4825. // unconditionally include in API requests. By default, fields with
  4826. // empty values are omitted from API requests. However, any non-pointer,
  4827. // non-interface field appearing in ForceSendFields will be sent to the
  4828. // server regardless of whether the field is empty or not. This may be
  4829. // used to include empty fields in Patch requests.
  4830. ForceSendFields []string `json:"-"`
  4831. // NullFields is a list of field names (e.g. "Id") to include in API
  4832. // requests with the JSON null value. By default, fields with empty
  4833. // values are omitted from API requests. However, any field with an
  4834. // empty value appearing in NullFields will be sent to the server as
  4835. // null. It is an error if a field in this list has a non-empty value.
  4836. // This may be used to include null fields in Patch requests.
  4837. NullFields []string `json:"-"`
  4838. }
  4839. func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) {
  4840. type NoMethod DiskAggregatedList
  4841. raw := NoMethod(*s)
  4842. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4843. }
  4844. // DiskAggregatedListWarning: [Output Only] Informational warning
  4845. // message.
  4846. type DiskAggregatedListWarning struct {
  4847. // Code: [Output Only] A warning code, if applicable. For example,
  4848. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4849. // the response.
  4850. //
  4851. // Possible values:
  4852. // "CLEANUP_FAILED"
  4853. // "DEPRECATED_RESOURCE_USED"
  4854. // "DEPRECATED_TYPE_USED"
  4855. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4856. // "EXPERIMENTAL_TYPE_USED"
  4857. // "EXTERNAL_API_WARNING"
  4858. // "FIELD_VALUE_OVERRIDEN"
  4859. // "INJECTED_KERNELS_DEPRECATED"
  4860. // "MISSING_TYPE_DEPENDENCY"
  4861. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4862. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4863. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4864. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4865. // "NEXT_HOP_NOT_RUNNING"
  4866. // "NOT_CRITICAL_ERROR"
  4867. // "NO_RESULTS_ON_PAGE"
  4868. // "REQUIRED_TOS_AGREEMENT"
  4869. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4870. // "RESOURCE_NOT_DELETED"
  4871. // "SCHEMA_VALIDATION_IGNORED"
  4872. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4873. // "UNDECLARED_PROPERTIES"
  4874. // "UNREACHABLE"
  4875. Code string `json:"code,omitempty"`
  4876. // Data: [Output Only] Metadata about this warning in key: value format.
  4877. // For example:
  4878. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4879. Data []*DiskAggregatedListWarningData `json:"data,omitempty"`
  4880. // Message: [Output Only] A human-readable description of the warning
  4881. // code.
  4882. Message string `json:"message,omitempty"`
  4883. // ForceSendFields is a list of field names (e.g. "Code") to
  4884. // unconditionally include in API requests. By default, fields with
  4885. // empty values are omitted from API requests. However, any non-pointer,
  4886. // non-interface field appearing in ForceSendFields will be sent to the
  4887. // server regardless of whether the field is empty or not. This may be
  4888. // used to include empty fields in Patch requests.
  4889. ForceSendFields []string `json:"-"`
  4890. // NullFields is a list of field names (e.g. "Code") to include in API
  4891. // requests with the JSON null value. By default, fields with empty
  4892. // values are omitted from API requests. However, any field with an
  4893. // empty value appearing in NullFields will be sent to the server as
  4894. // null. It is an error if a field in this list has a non-empty value.
  4895. // This may be used to include null fields in Patch requests.
  4896. NullFields []string `json:"-"`
  4897. }
  4898. func (s *DiskAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4899. type NoMethod DiskAggregatedListWarning
  4900. raw := NoMethod(*s)
  4901. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4902. }
  4903. type DiskAggregatedListWarningData struct {
  4904. // Key: [Output Only] A key that provides more detail on the warning
  4905. // being returned. For example, for warnings where there are no results
  4906. // in a list request for a particular zone, this key might be scope and
  4907. // the key value might be the zone name. Other examples might be a key
  4908. // indicating a deprecated resource and a suggested replacement, or a
  4909. // warning about invalid network settings (for example, if an instance
  4910. // attempts to perform IP forwarding but is not enabled for IP
  4911. // forwarding).
  4912. Key string `json:"key,omitempty"`
  4913. // Value: [Output Only] A warning data value corresponding to the key.
  4914. Value string `json:"value,omitempty"`
  4915. // ForceSendFields is a list of field names (e.g. "Key") to
  4916. // unconditionally include in API requests. By default, fields with
  4917. // empty values are omitted from API requests. However, any non-pointer,
  4918. // non-interface field appearing in ForceSendFields will be sent to the
  4919. // server regardless of whether the field is empty or not. This may be
  4920. // used to include empty fields in Patch requests.
  4921. ForceSendFields []string `json:"-"`
  4922. // NullFields is a list of field names (e.g. "Key") to include in API
  4923. // requests with the JSON null value. By default, fields with empty
  4924. // values are omitted from API requests. However, any field with an
  4925. // empty value appearing in NullFields will be sent to the server as
  4926. // null. It is an error if a field in this list has a non-empty value.
  4927. // This may be used to include null fields in Patch requests.
  4928. NullFields []string `json:"-"`
  4929. }
  4930. func (s *DiskAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4931. type NoMethod DiskAggregatedListWarningData
  4932. raw := NoMethod(*s)
  4933. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4934. }
  4935. // DiskInstantiationConfig: A specification of the desired way to
  4936. // instantiate a disk in the instance template when its created from a
  4937. // source instance.
  4938. type DiskInstantiationConfig struct {
  4939. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  4940. // instance is deleted (but not when the disk is detached from the
  4941. // instance).
  4942. AutoDelete bool `json:"autoDelete,omitempty"`
  4943. // CustomImage: The custom source image to be used to restore this disk
  4944. // when instantiating this instance template.
  4945. CustomImage string `json:"customImage,omitempty"`
  4946. // DeviceName: Specifies the device name of the disk to which the
  4947. // configurations apply to.
  4948. DeviceName string `json:"deviceName,omitempty"`
  4949. // InstantiateFrom: Specifies whether to include the disk and what image
  4950. // to use. Possible values are:
  4951. // - source-image: to use the same image that was used to create the
  4952. // source instance's corresponding disk. Applicable to the boot disk and
  4953. // additional read-write disks.
  4954. // - source-image-family: to use the same image family that was used to
  4955. // create the source instance's corresponding disk. Applicable to the
  4956. // boot disk and additional read-write disks.
  4957. // - custom-image: to use a user-provided image url for disk creation.
  4958. // Applicable to the boot disk and additional read-write disks.
  4959. // - attach-read-only: to attach a read-only disk. Applicable to
  4960. // read-only disks.
  4961. // - do-not-include: to exclude a disk from the template. Applicable to
  4962. // additional read-write disks, local SSDs, and read-only disks.
  4963. //
  4964. // Possible values:
  4965. // "ATTACH_READ_ONLY"
  4966. // "BLANK"
  4967. // "CUSTOM_IMAGE"
  4968. // "DEFAULT"
  4969. // "DO_NOT_INCLUDE"
  4970. // "SOURCE_IMAGE"
  4971. // "SOURCE_IMAGE_FAMILY"
  4972. InstantiateFrom string `json:"instantiateFrom,omitempty"`
  4973. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  4974. // unconditionally include in API requests. By default, fields with
  4975. // empty values are omitted from API requests. However, any non-pointer,
  4976. // non-interface field appearing in ForceSendFields will be sent to the
  4977. // server regardless of whether the field is empty or not. This may be
  4978. // used to include empty fields in Patch requests.
  4979. ForceSendFields []string `json:"-"`
  4980. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  4981. // API requests with the JSON null value. By default, fields with empty
  4982. // values are omitted from API requests. However, any field with an
  4983. // empty value appearing in NullFields will be sent to the server as
  4984. // null. It is an error if a field in this list has a non-empty value.
  4985. // This may be used to include null fields in Patch requests.
  4986. NullFields []string `json:"-"`
  4987. }
  4988. func (s *DiskInstantiationConfig) MarshalJSON() ([]byte, error) {
  4989. type NoMethod DiskInstantiationConfig
  4990. raw := NoMethod(*s)
  4991. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4992. }
  4993. // DiskList: A list of Disk resources.
  4994. type DiskList struct {
  4995. // Id: [Output Only] Unique identifier for the resource; defined by the
  4996. // server.
  4997. Id string `json:"id,omitempty"`
  4998. // Items: A list of Disk resources.
  4999. Items []*Disk `json:"items,omitempty"`
  5000. // Kind: [Output Only] Type of resource. Always compute#diskList for
  5001. // lists of disks.
  5002. Kind string `json:"kind,omitempty"`
  5003. // NextPageToken: [Output Only] This token allows you to get the next
  5004. // page of results for list requests. If the number of results is larger
  5005. // than maxResults, use the nextPageToken as a value for the query
  5006. // parameter pageToken in the next list request. Subsequent list
  5007. // requests will have their own nextPageToken to continue paging through
  5008. // the results.
  5009. NextPageToken string `json:"nextPageToken,omitempty"`
  5010. // SelfLink: [Output Only] Server-defined URL for this resource.
  5011. SelfLink string `json:"selfLink,omitempty"`
  5012. // Warning: [Output Only] Informational warning message.
  5013. Warning *DiskListWarning `json:"warning,omitempty"`
  5014. // ServerResponse contains the HTTP response code and headers from the
  5015. // server.
  5016. googleapi.ServerResponse `json:"-"`
  5017. // ForceSendFields is a list of field names (e.g. "Id") to
  5018. // unconditionally include in API requests. By default, fields with
  5019. // empty values are omitted from API requests. However, any non-pointer,
  5020. // non-interface field appearing in ForceSendFields will be sent to the
  5021. // server regardless of whether the field is empty or not. This may be
  5022. // used to include empty fields in Patch requests.
  5023. ForceSendFields []string `json:"-"`
  5024. // NullFields is a list of field names (e.g. "Id") to include in API
  5025. // requests with the JSON null value. By default, fields with empty
  5026. // values are omitted from API requests. However, any field with an
  5027. // empty value appearing in NullFields will be sent to the server as
  5028. // null. It is an error if a field in this list has a non-empty value.
  5029. // This may be used to include null fields in Patch requests.
  5030. NullFields []string `json:"-"`
  5031. }
  5032. func (s *DiskList) MarshalJSON() ([]byte, error) {
  5033. type NoMethod DiskList
  5034. raw := NoMethod(*s)
  5035. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5036. }
  5037. // DiskListWarning: [Output Only] Informational warning message.
  5038. type DiskListWarning struct {
  5039. // Code: [Output Only] A warning code, if applicable. For example,
  5040. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5041. // the response.
  5042. //
  5043. // Possible values:
  5044. // "CLEANUP_FAILED"
  5045. // "DEPRECATED_RESOURCE_USED"
  5046. // "DEPRECATED_TYPE_USED"
  5047. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5048. // "EXPERIMENTAL_TYPE_USED"
  5049. // "EXTERNAL_API_WARNING"
  5050. // "FIELD_VALUE_OVERRIDEN"
  5051. // "INJECTED_KERNELS_DEPRECATED"
  5052. // "MISSING_TYPE_DEPENDENCY"
  5053. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5054. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5055. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5056. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5057. // "NEXT_HOP_NOT_RUNNING"
  5058. // "NOT_CRITICAL_ERROR"
  5059. // "NO_RESULTS_ON_PAGE"
  5060. // "REQUIRED_TOS_AGREEMENT"
  5061. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5062. // "RESOURCE_NOT_DELETED"
  5063. // "SCHEMA_VALIDATION_IGNORED"
  5064. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5065. // "UNDECLARED_PROPERTIES"
  5066. // "UNREACHABLE"
  5067. Code string `json:"code,omitempty"`
  5068. // Data: [Output Only] Metadata about this warning in key: value format.
  5069. // For example:
  5070. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5071. Data []*DiskListWarningData `json:"data,omitempty"`
  5072. // Message: [Output Only] A human-readable description of the warning
  5073. // code.
  5074. Message string `json:"message,omitempty"`
  5075. // ForceSendFields is a list of field names (e.g. "Code") to
  5076. // unconditionally include in API requests. By default, fields with
  5077. // empty values are omitted from API requests. However, any non-pointer,
  5078. // non-interface field appearing in ForceSendFields will be sent to the
  5079. // server regardless of whether the field is empty or not. This may be
  5080. // used to include empty fields in Patch requests.
  5081. ForceSendFields []string `json:"-"`
  5082. // NullFields is a list of field names (e.g. "Code") to include in API
  5083. // requests with the JSON null value. By default, fields with empty
  5084. // values are omitted from API requests. However, any field with an
  5085. // empty value appearing in NullFields will be sent to the server as
  5086. // null. It is an error if a field in this list has a non-empty value.
  5087. // This may be used to include null fields in Patch requests.
  5088. NullFields []string `json:"-"`
  5089. }
  5090. func (s *DiskListWarning) MarshalJSON() ([]byte, error) {
  5091. type NoMethod DiskListWarning
  5092. raw := NoMethod(*s)
  5093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5094. }
  5095. type DiskListWarningData struct {
  5096. // Key: [Output Only] A key that provides more detail on the warning
  5097. // being returned. For example, for warnings where there are no results
  5098. // in a list request for a particular zone, this key might be scope and
  5099. // the key value might be the zone name. Other examples might be a key
  5100. // indicating a deprecated resource and a suggested replacement, or a
  5101. // warning about invalid network settings (for example, if an instance
  5102. // attempts to perform IP forwarding but is not enabled for IP
  5103. // forwarding).
  5104. Key string `json:"key,omitempty"`
  5105. // Value: [Output Only] A warning data value corresponding to the key.
  5106. Value string `json:"value,omitempty"`
  5107. // ForceSendFields is a list of field names (e.g. "Key") to
  5108. // unconditionally include in API requests. By default, fields with
  5109. // empty values are omitted from API requests. However, any non-pointer,
  5110. // non-interface field appearing in ForceSendFields will be sent to the
  5111. // server regardless of whether the field is empty or not. This may be
  5112. // used to include empty fields in Patch requests.
  5113. ForceSendFields []string `json:"-"`
  5114. // NullFields is a list of field names (e.g. "Key") to include in API
  5115. // requests with the JSON null value. By default, fields with empty
  5116. // values are omitted from API requests. However, any field with an
  5117. // empty value appearing in NullFields will be sent to the server as
  5118. // null. It is an error if a field in this list has a non-empty value.
  5119. // This may be used to include null fields in Patch requests.
  5120. NullFields []string `json:"-"`
  5121. }
  5122. func (s *DiskListWarningData) MarshalJSON() ([]byte, error) {
  5123. type NoMethod DiskListWarningData
  5124. raw := NoMethod(*s)
  5125. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5126. }
  5127. type DiskMoveRequest struct {
  5128. // DestinationZone: The URL of the destination zone to move the disk.
  5129. // This can be a full or partial URL. For example, the following are all
  5130. // valid URLs to a zone:
  5131. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  5132. //
  5133. // - projects/project/zones/zone
  5134. // - zones/zone
  5135. DestinationZone string `json:"destinationZone,omitempty"`
  5136. // TargetDisk: The URL of the target disk to move. This can be a full or
  5137. // partial URL. For example, the following are all valid URLs to a disk:
  5138. //
  5139. // -
  5140. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  5141. // - projects/project/zones/zone/disks/disk
  5142. // - zones/zone/disks/disk
  5143. TargetDisk string `json:"targetDisk,omitempty"`
  5144. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  5145. // unconditionally include in API requests. By default, fields with
  5146. // empty values are omitted from API requests. However, any non-pointer,
  5147. // non-interface field appearing in ForceSendFields will be sent to the
  5148. // server regardless of whether the field is empty or not. This may be
  5149. // used to include empty fields in Patch requests.
  5150. ForceSendFields []string `json:"-"`
  5151. // NullFields is a list of field names (e.g. "DestinationZone") to
  5152. // include in API requests with the JSON null value. By default, fields
  5153. // with empty values are omitted from API requests. However, any field
  5154. // with an empty value appearing in NullFields will be sent to the
  5155. // server as null. It is an error if a field in this list has a
  5156. // non-empty value. This may be used to include null fields in Patch
  5157. // requests.
  5158. NullFields []string `json:"-"`
  5159. }
  5160. func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) {
  5161. type NoMethod DiskMoveRequest
  5162. raw := NoMethod(*s)
  5163. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5164. }
  5165. // DiskType: A DiskType resource. (== resource_for beta.diskTypes ==)
  5166. // (== resource_for v1.diskTypes ==)
  5167. type DiskType struct {
  5168. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5169. // format.
  5170. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5171. // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in
  5172. // GB.
  5173. DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`
  5174. // Deprecated: [Output Only] The deprecation status associated with this
  5175. // disk type.
  5176. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  5177. // Description: [Output Only] An optional description of this resource.
  5178. Description string `json:"description,omitempty"`
  5179. // Id: [Output Only] The unique identifier for the resource. This
  5180. // identifier is defined by the server.
  5181. Id uint64 `json:"id,omitempty,string"`
  5182. // Kind: [Output Only] Type of the resource. Always compute#diskType for
  5183. // disk types.
  5184. Kind string `json:"kind,omitempty"`
  5185. // Name: [Output Only] Name of the resource.
  5186. Name string `json:"name,omitempty"`
  5187. // Region: [Output Only] URL of the region where the disk type resides.
  5188. // Only applicable for regional resources. You must specify this field
  5189. // as part of the HTTP request URL. It is not settable as a field in the
  5190. // request body.
  5191. Region string `json:"region,omitempty"`
  5192. // SelfLink: [Output Only] Server-defined URL for the resource.
  5193. SelfLink string `json:"selfLink,omitempty"`
  5194. // ValidDiskSize: [Output Only] An optional textual description of the
  5195. // valid disk size, such as "10GB-10TB".
  5196. ValidDiskSize string `json:"validDiskSize,omitempty"`
  5197. // Zone: [Output Only] URL of the zone where the disk type resides. You
  5198. // must specify this field as part of the HTTP request URL. It is not
  5199. // settable as a field in the request body.
  5200. Zone string `json:"zone,omitempty"`
  5201. // ServerResponse contains the HTTP response code and headers from the
  5202. // server.
  5203. googleapi.ServerResponse `json:"-"`
  5204. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5205. // to unconditionally include in API requests. By default, fields with
  5206. // empty values are omitted from API requests. However, any non-pointer,
  5207. // non-interface field appearing in ForceSendFields will be sent to the
  5208. // server regardless of whether the field is empty or not. This may be
  5209. // used to include empty fields in Patch requests.
  5210. ForceSendFields []string `json:"-"`
  5211. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  5212. // include in API requests with the JSON null value. By default, fields
  5213. // with empty values are omitted from API requests. However, any field
  5214. // with an empty value appearing in NullFields will be sent to the
  5215. // server as null. It is an error if a field in this list has a
  5216. // non-empty value. This may be used to include null fields in Patch
  5217. // requests.
  5218. NullFields []string `json:"-"`
  5219. }
  5220. func (s *DiskType) MarshalJSON() ([]byte, error) {
  5221. type NoMethod DiskType
  5222. raw := NoMethod(*s)
  5223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5224. }
  5225. type DiskTypeAggregatedList struct {
  5226. // Id: [Output Only] Unique identifier for the resource; defined by the
  5227. // server.
  5228. Id string `json:"id,omitempty"`
  5229. // Items: A list of DiskTypesScopedList resources.
  5230. Items map[string]DiskTypesScopedList `json:"items,omitempty"`
  5231. // Kind: [Output Only] Type of resource. Always
  5232. // compute#diskTypeAggregatedList.
  5233. Kind string `json:"kind,omitempty"`
  5234. // NextPageToken: [Output Only] This token allows you to get the next
  5235. // page of results for list requests. If the number of results is larger
  5236. // than maxResults, use the nextPageToken as a value for the query
  5237. // parameter pageToken in the next list request. Subsequent list
  5238. // requests will have their own nextPageToken to continue paging through
  5239. // the results.
  5240. NextPageToken string `json:"nextPageToken,omitempty"`
  5241. // SelfLink: [Output Only] Server-defined URL for this resource.
  5242. SelfLink string `json:"selfLink,omitempty"`
  5243. // Warning: [Output Only] Informational warning message.
  5244. Warning *DiskTypeAggregatedListWarning `json:"warning,omitempty"`
  5245. // ServerResponse contains the HTTP response code and headers from the
  5246. // server.
  5247. googleapi.ServerResponse `json:"-"`
  5248. // ForceSendFields is a list of field names (e.g. "Id") to
  5249. // unconditionally include in API requests. By default, fields with
  5250. // empty values are omitted from API requests. However, any non-pointer,
  5251. // non-interface field appearing in ForceSendFields will be sent to the
  5252. // server regardless of whether the field is empty or not. This may be
  5253. // used to include empty fields in Patch requests.
  5254. ForceSendFields []string `json:"-"`
  5255. // NullFields is a list of field names (e.g. "Id") to include in API
  5256. // requests with the JSON null value. By default, fields with empty
  5257. // values are omitted from API requests. However, any field with an
  5258. // empty value appearing in NullFields will be sent to the server as
  5259. // null. It is an error if a field in this list has a non-empty value.
  5260. // This may be used to include null fields in Patch requests.
  5261. NullFields []string `json:"-"`
  5262. }
  5263. func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
  5264. type NoMethod DiskTypeAggregatedList
  5265. raw := NoMethod(*s)
  5266. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5267. }
  5268. // DiskTypeAggregatedListWarning: [Output Only] Informational warning
  5269. // message.
  5270. type DiskTypeAggregatedListWarning struct {
  5271. // Code: [Output Only] A warning code, if applicable. For example,
  5272. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5273. // the response.
  5274. //
  5275. // Possible values:
  5276. // "CLEANUP_FAILED"
  5277. // "DEPRECATED_RESOURCE_USED"
  5278. // "DEPRECATED_TYPE_USED"
  5279. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5280. // "EXPERIMENTAL_TYPE_USED"
  5281. // "EXTERNAL_API_WARNING"
  5282. // "FIELD_VALUE_OVERRIDEN"
  5283. // "INJECTED_KERNELS_DEPRECATED"
  5284. // "MISSING_TYPE_DEPENDENCY"
  5285. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5286. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5287. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5288. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5289. // "NEXT_HOP_NOT_RUNNING"
  5290. // "NOT_CRITICAL_ERROR"
  5291. // "NO_RESULTS_ON_PAGE"
  5292. // "REQUIRED_TOS_AGREEMENT"
  5293. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5294. // "RESOURCE_NOT_DELETED"
  5295. // "SCHEMA_VALIDATION_IGNORED"
  5296. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5297. // "UNDECLARED_PROPERTIES"
  5298. // "UNREACHABLE"
  5299. Code string `json:"code,omitempty"`
  5300. // Data: [Output Only] Metadata about this warning in key: value format.
  5301. // For example:
  5302. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5303. Data []*DiskTypeAggregatedListWarningData `json:"data,omitempty"`
  5304. // Message: [Output Only] A human-readable description of the warning
  5305. // code.
  5306. Message string `json:"message,omitempty"`
  5307. // ForceSendFields is a list of field names (e.g. "Code") to
  5308. // unconditionally include in API requests. By default, fields with
  5309. // empty values are omitted from API requests. However, any non-pointer,
  5310. // non-interface field appearing in ForceSendFields will be sent to the
  5311. // server regardless of whether the field is empty or not. This may be
  5312. // used to include empty fields in Patch requests.
  5313. ForceSendFields []string `json:"-"`
  5314. // NullFields is a list of field names (e.g. "Code") to include in API
  5315. // requests with the JSON null value. By default, fields with empty
  5316. // values are omitted from API requests. However, any field with an
  5317. // empty value appearing in NullFields will be sent to the server as
  5318. // null. It is an error if a field in this list has a non-empty value.
  5319. // This may be used to include null fields in Patch requests.
  5320. NullFields []string `json:"-"`
  5321. }
  5322. func (s *DiskTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  5323. type NoMethod DiskTypeAggregatedListWarning
  5324. raw := NoMethod(*s)
  5325. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5326. }
  5327. type DiskTypeAggregatedListWarningData struct {
  5328. // Key: [Output Only] A key that provides more detail on the warning
  5329. // being returned. For example, for warnings where there are no results
  5330. // in a list request for a particular zone, this key might be scope and
  5331. // the key value might be the zone name. Other examples might be a key
  5332. // indicating a deprecated resource and a suggested replacement, or a
  5333. // warning about invalid network settings (for example, if an instance
  5334. // attempts to perform IP forwarding but is not enabled for IP
  5335. // forwarding).
  5336. Key string `json:"key,omitempty"`
  5337. // Value: [Output Only] A warning data value corresponding to the key.
  5338. Value string `json:"value,omitempty"`
  5339. // ForceSendFields is a list of field names (e.g. "Key") to
  5340. // unconditionally include in API requests. By default, fields with
  5341. // empty values are omitted from API requests. However, any non-pointer,
  5342. // non-interface field appearing in ForceSendFields will be sent to the
  5343. // server regardless of whether the field is empty or not. This may be
  5344. // used to include empty fields in Patch requests.
  5345. ForceSendFields []string `json:"-"`
  5346. // NullFields is a list of field names (e.g. "Key") to include in API
  5347. // requests with the JSON null value. By default, fields with empty
  5348. // values are omitted from API requests. However, any field with an
  5349. // empty value appearing in NullFields will be sent to the server as
  5350. // null. It is an error if a field in this list has a non-empty value.
  5351. // This may be used to include null fields in Patch requests.
  5352. NullFields []string `json:"-"`
  5353. }
  5354. func (s *DiskTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  5355. type NoMethod DiskTypeAggregatedListWarningData
  5356. raw := NoMethod(*s)
  5357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5358. }
  5359. // DiskTypeList: Contains a list of disk types.
  5360. type DiskTypeList struct {
  5361. // Id: [Output Only] Unique identifier for the resource; defined by the
  5362. // server.
  5363. Id string `json:"id,omitempty"`
  5364. // Items: A list of DiskType resources.
  5365. Items []*DiskType `json:"items,omitempty"`
  5366. // Kind: [Output Only] Type of resource. Always compute#diskTypeList for
  5367. // disk types.
  5368. Kind string `json:"kind,omitempty"`
  5369. // NextPageToken: [Output Only] This token allows you to get the next
  5370. // page of results for list requests. If the number of results is larger
  5371. // than maxResults, use the nextPageToken as a value for the query
  5372. // parameter pageToken in the next list request. Subsequent list
  5373. // requests will have their own nextPageToken to continue paging through
  5374. // the results.
  5375. NextPageToken string `json:"nextPageToken,omitempty"`
  5376. // SelfLink: [Output Only] Server-defined URL for this resource.
  5377. SelfLink string `json:"selfLink,omitempty"`
  5378. // Warning: [Output Only] Informational warning message.
  5379. Warning *DiskTypeListWarning `json:"warning,omitempty"`
  5380. // ServerResponse contains the HTTP response code and headers from the
  5381. // server.
  5382. googleapi.ServerResponse `json:"-"`
  5383. // ForceSendFields is a list of field names (e.g. "Id") to
  5384. // unconditionally include in API requests. By default, fields with
  5385. // empty values are omitted from API requests. However, any non-pointer,
  5386. // non-interface field appearing in ForceSendFields will be sent to the
  5387. // server regardless of whether the field is empty or not. This may be
  5388. // used to include empty fields in Patch requests.
  5389. ForceSendFields []string `json:"-"`
  5390. // NullFields is a list of field names (e.g. "Id") to include in API
  5391. // requests with the JSON null value. By default, fields with empty
  5392. // values are omitted from API requests. However, any field with an
  5393. // empty value appearing in NullFields will be sent to the server as
  5394. // null. It is an error if a field in this list has a non-empty value.
  5395. // This may be used to include null fields in Patch requests.
  5396. NullFields []string `json:"-"`
  5397. }
  5398. func (s *DiskTypeList) MarshalJSON() ([]byte, error) {
  5399. type NoMethod DiskTypeList
  5400. raw := NoMethod(*s)
  5401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5402. }
  5403. // DiskTypeListWarning: [Output Only] Informational warning message.
  5404. type DiskTypeListWarning struct {
  5405. // Code: [Output Only] A warning code, if applicable. For example,
  5406. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5407. // the response.
  5408. //
  5409. // Possible values:
  5410. // "CLEANUP_FAILED"
  5411. // "DEPRECATED_RESOURCE_USED"
  5412. // "DEPRECATED_TYPE_USED"
  5413. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5414. // "EXPERIMENTAL_TYPE_USED"
  5415. // "EXTERNAL_API_WARNING"
  5416. // "FIELD_VALUE_OVERRIDEN"
  5417. // "INJECTED_KERNELS_DEPRECATED"
  5418. // "MISSING_TYPE_DEPENDENCY"
  5419. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5420. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5421. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5422. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5423. // "NEXT_HOP_NOT_RUNNING"
  5424. // "NOT_CRITICAL_ERROR"
  5425. // "NO_RESULTS_ON_PAGE"
  5426. // "REQUIRED_TOS_AGREEMENT"
  5427. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5428. // "RESOURCE_NOT_DELETED"
  5429. // "SCHEMA_VALIDATION_IGNORED"
  5430. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5431. // "UNDECLARED_PROPERTIES"
  5432. // "UNREACHABLE"
  5433. Code string `json:"code,omitempty"`
  5434. // Data: [Output Only] Metadata about this warning in key: value format.
  5435. // For example:
  5436. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5437. Data []*DiskTypeListWarningData `json:"data,omitempty"`
  5438. // Message: [Output Only] A human-readable description of the warning
  5439. // code.
  5440. Message string `json:"message,omitempty"`
  5441. // ForceSendFields is a list of field names (e.g. "Code") to
  5442. // unconditionally include in API requests. By default, fields with
  5443. // empty values are omitted from API requests. However, any non-pointer,
  5444. // non-interface field appearing in ForceSendFields will be sent to the
  5445. // server regardless of whether the field is empty or not. This may be
  5446. // used to include empty fields in Patch requests.
  5447. ForceSendFields []string `json:"-"`
  5448. // NullFields is a list of field names (e.g. "Code") to include in API
  5449. // requests with the JSON null value. By default, fields with empty
  5450. // values are omitted from API requests. However, any field with an
  5451. // empty value appearing in NullFields will be sent to the server as
  5452. // null. It is an error if a field in this list has a non-empty value.
  5453. // This may be used to include null fields in Patch requests.
  5454. NullFields []string `json:"-"`
  5455. }
  5456. func (s *DiskTypeListWarning) MarshalJSON() ([]byte, error) {
  5457. type NoMethod DiskTypeListWarning
  5458. raw := NoMethod(*s)
  5459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5460. }
  5461. type DiskTypeListWarningData struct {
  5462. // Key: [Output Only] A key that provides more detail on the warning
  5463. // being returned. For example, for warnings where there are no results
  5464. // in a list request for a particular zone, this key might be scope and
  5465. // the key value might be the zone name. Other examples might be a key
  5466. // indicating a deprecated resource and a suggested replacement, or a
  5467. // warning about invalid network settings (for example, if an instance
  5468. // attempts to perform IP forwarding but is not enabled for IP
  5469. // forwarding).
  5470. Key string `json:"key,omitempty"`
  5471. // Value: [Output Only] A warning data value corresponding to the key.
  5472. Value string `json:"value,omitempty"`
  5473. // ForceSendFields is a list of field names (e.g. "Key") to
  5474. // unconditionally include in API requests. By default, fields with
  5475. // empty values are omitted from API requests. However, any non-pointer,
  5476. // non-interface field appearing in ForceSendFields will be sent to the
  5477. // server regardless of whether the field is empty or not. This may be
  5478. // used to include empty fields in Patch requests.
  5479. ForceSendFields []string `json:"-"`
  5480. // NullFields is a list of field names (e.g. "Key") to include in API
  5481. // requests with the JSON null value. By default, fields with empty
  5482. // values are omitted from API requests. However, any field with an
  5483. // empty value appearing in NullFields will be sent to the server as
  5484. // null. It is an error if a field in this list has a non-empty value.
  5485. // This may be used to include null fields in Patch requests.
  5486. NullFields []string `json:"-"`
  5487. }
  5488. func (s *DiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  5489. type NoMethod DiskTypeListWarningData
  5490. raw := NoMethod(*s)
  5491. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5492. }
  5493. type DiskTypesScopedList struct {
  5494. // DiskTypes: [Output Only] A list of disk types contained in this
  5495. // scope.
  5496. DiskTypes []*DiskType `json:"diskTypes,omitempty"`
  5497. // Warning: [Output Only] Informational warning which replaces the list
  5498. // of disk types when the list is empty.
  5499. Warning *DiskTypesScopedListWarning `json:"warning,omitempty"`
  5500. // ForceSendFields is a list of field names (e.g. "DiskTypes") to
  5501. // unconditionally include in API requests. By default, fields with
  5502. // empty values are omitted from API requests. However, any non-pointer,
  5503. // non-interface field appearing in ForceSendFields will be sent to the
  5504. // server regardless of whether the field is empty or not. This may be
  5505. // used to include empty fields in Patch requests.
  5506. ForceSendFields []string `json:"-"`
  5507. // NullFields is a list of field names (e.g. "DiskTypes") to include in
  5508. // API requests with the JSON null value. By default, fields with empty
  5509. // values are omitted from API requests. However, any field with an
  5510. // empty value appearing in NullFields will be sent to the server as
  5511. // null. It is an error if a field in this list has a non-empty value.
  5512. // This may be used to include null fields in Patch requests.
  5513. NullFields []string `json:"-"`
  5514. }
  5515. func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) {
  5516. type NoMethod DiskTypesScopedList
  5517. raw := NoMethod(*s)
  5518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5519. }
  5520. // DiskTypesScopedListWarning: [Output Only] Informational warning which
  5521. // replaces the list of disk types when the list is empty.
  5522. type DiskTypesScopedListWarning struct {
  5523. // Code: [Output Only] A warning code, if applicable. For example,
  5524. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5525. // the response.
  5526. //
  5527. // Possible values:
  5528. // "CLEANUP_FAILED"
  5529. // "DEPRECATED_RESOURCE_USED"
  5530. // "DEPRECATED_TYPE_USED"
  5531. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5532. // "EXPERIMENTAL_TYPE_USED"
  5533. // "EXTERNAL_API_WARNING"
  5534. // "FIELD_VALUE_OVERRIDEN"
  5535. // "INJECTED_KERNELS_DEPRECATED"
  5536. // "MISSING_TYPE_DEPENDENCY"
  5537. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5538. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5539. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5540. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5541. // "NEXT_HOP_NOT_RUNNING"
  5542. // "NOT_CRITICAL_ERROR"
  5543. // "NO_RESULTS_ON_PAGE"
  5544. // "REQUIRED_TOS_AGREEMENT"
  5545. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5546. // "RESOURCE_NOT_DELETED"
  5547. // "SCHEMA_VALIDATION_IGNORED"
  5548. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5549. // "UNDECLARED_PROPERTIES"
  5550. // "UNREACHABLE"
  5551. Code string `json:"code,omitempty"`
  5552. // Data: [Output Only] Metadata about this warning in key: value format.
  5553. // For example:
  5554. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5555. Data []*DiskTypesScopedListWarningData `json:"data,omitempty"`
  5556. // Message: [Output Only] A human-readable description of the warning
  5557. // code.
  5558. Message string `json:"message,omitempty"`
  5559. // ForceSendFields is a list of field names (e.g. "Code") to
  5560. // unconditionally include in API requests. By default, fields with
  5561. // empty values are omitted from API requests. However, any non-pointer,
  5562. // non-interface field appearing in ForceSendFields will be sent to the
  5563. // server regardless of whether the field is empty or not. This may be
  5564. // used to include empty fields in Patch requests.
  5565. ForceSendFields []string `json:"-"`
  5566. // NullFields is a list of field names (e.g. "Code") to include in API
  5567. // requests with the JSON null value. By default, fields with empty
  5568. // values are omitted from API requests. However, any field with an
  5569. // empty value appearing in NullFields will be sent to the server as
  5570. // null. It is an error if a field in this list has a non-empty value.
  5571. // This may be used to include null fields in Patch requests.
  5572. NullFields []string `json:"-"`
  5573. }
  5574. func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  5575. type NoMethod DiskTypesScopedListWarning
  5576. raw := NoMethod(*s)
  5577. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5578. }
  5579. type DiskTypesScopedListWarningData struct {
  5580. // Key: [Output Only] A key that provides more detail on the warning
  5581. // being returned. For example, for warnings where there are no results
  5582. // in a list request for a particular zone, this key might be scope and
  5583. // the key value might be the zone name. Other examples might be a key
  5584. // indicating a deprecated resource and a suggested replacement, or a
  5585. // warning about invalid network settings (for example, if an instance
  5586. // attempts to perform IP forwarding but is not enabled for IP
  5587. // forwarding).
  5588. Key string `json:"key,omitempty"`
  5589. // Value: [Output Only] A warning data value corresponding to the key.
  5590. Value string `json:"value,omitempty"`
  5591. // ForceSendFields is a list of field names (e.g. "Key") to
  5592. // unconditionally include in API requests. By default, fields with
  5593. // empty values are omitted from API requests. However, any non-pointer,
  5594. // non-interface field appearing in ForceSendFields will be sent to the
  5595. // server regardless of whether the field is empty or not. This may be
  5596. // used to include empty fields in Patch requests.
  5597. ForceSendFields []string `json:"-"`
  5598. // NullFields is a list of field names (e.g. "Key") to include in API
  5599. // requests with the JSON null value. By default, fields with empty
  5600. // values are omitted from API requests. However, any field with an
  5601. // empty value appearing in NullFields will be sent to the server as
  5602. // null. It is an error if a field in this list has a non-empty value.
  5603. // This may be used to include null fields in Patch requests.
  5604. NullFields []string `json:"-"`
  5605. }
  5606. func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  5607. type NoMethod DiskTypesScopedListWarningData
  5608. raw := NoMethod(*s)
  5609. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5610. }
  5611. type DisksResizeRequest struct {
  5612. // SizeGb: The new size of the persistent disk, which is specified in
  5613. // GB.
  5614. SizeGb int64 `json:"sizeGb,omitempty,string"`
  5615. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  5616. // unconditionally include in API requests. By default, fields with
  5617. // empty values are omitted from API requests. However, any non-pointer,
  5618. // non-interface field appearing in ForceSendFields will be sent to the
  5619. // server regardless of whether the field is empty or not. This may be
  5620. // used to include empty fields in Patch requests.
  5621. ForceSendFields []string `json:"-"`
  5622. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  5623. // requests with the JSON null value. By default, fields with empty
  5624. // values are omitted from API requests. However, any field with an
  5625. // empty value appearing in NullFields will be sent to the server as
  5626. // null. It is an error if a field in this list has a non-empty value.
  5627. // This may be used to include null fields in Patch requests.
  5628. NullFields []string `json:"-"`
  5629. }
  5630. func (s *DisksResizeRequest) MarshalJSON() ([]byte, error) {
  5631. type NoMethod DisksResizeRequest
  5632. raw := NoMethod(*s)
  5633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5634. }
  5635. type DisksScopedList struct {
  5636. // Disks: [Output Only] A list of disks contained in this scope.
  5637. Disks []*Disk `json:"disks,omitempty"`
  5638. // Warning: [Output Only] Informational warning which replaces the list
  5639. // of disks when the list is empty.
  5640. Warning *DisksScopedListWarning `json:"warning,omitempty"`
  5641. // ForceSendFields is a list of field names (e.g. "Disks") to
  5642. // unconditionally include in API requests. By default, fields with
  5643. // empty values are omitted from API requests. However, any non-pointer,
  5644. // non-interface field appearing in ForceSendFields will be sent to the
  5645. // server regardless of whether the field is empty or not. This may be
  5646. // used to include empty fields in Patch requests.
  5647. ForceSendFields []string `json:"-"`
  5648. // NullFields is a list of field names (e.g. "Disks") to include in API
  5649. // requests with the JSON null value. By default, fields with empty
  5650. // values are omitted from API requests. However, any field with an
  5651. // empty value appearing in NullFields will be sent to the server as
  5652. // null. It is an error if a field in this list has a non-empty value.
  5653. // This may be used to include null fields in Patch requests.
  5654. NullFields []string `json:"-"`
  5655. }
  5656. func (s *DisksScopedList) MarshalJSON() ([]byte, error) {
  5657. type NoMethod DisksScopedList
  5658. raw := NoMethod(*s)
  5659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5660. }
  5661. // DisksScopedListWarning: [Output Only] Informational warning which
  5662. // replaces the list of disks when the list is empty.
  5663. type DisksScopedListWarning struct {
  5664. // Code: [Output Only] A warning code, if applicable. For example,
  5665. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5666. // the response.
  5667. //
  5668. // Possible values:
  5669. // "CLEANUP_FAILED"
  5670. // "DEPRECATED_RESOURCE_USED"
  5671. // "DEPRECATED_TYPE_USED"
  5672. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5673. // "EXPERIMENTAL_TYPE_USED"
  5674. // "EXTERNAL_API_WARNING"
  5675. // "FIELD_VALUE_OVERRIDEN"
  5676. // "INJECTED_KERNELS_DEPRECATED"
  5677. // "MISSING_TYPE_DEPENDENCY"
  5678. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5679. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5680. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5681. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5682. // "NEXT_HOP_NOT_RUNNING"
  5683. // "NOT_CRITICAL_ERROR"
  5684. // "NO_RESULTS_ON_PAGE"
  5685. // "REQUIRED_TOS_AGREEMENT"
  5686. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5687. // "RESOURCE_NOT_DELETED"
  5688. // "SCHEMA_VALIDATION_IGNORED"
  5689. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5690. // "UNDECLARED_PROPERTIES"
  5691. // "UNREACHABLE"
  5692. Code string `json:"code,omitempty"`
  5693. // Data: [Output Only] Metadata about this warning in key: value format.
  5694. // For example:
  5695. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5696. Data []*DisksScopedListWarningData `json:"data,omitempty"`
  5697. // Message: [Output Only] A human-readable description of the warning
  5698. // code.
  5699. Message string `json:"message,omitempty"`
  5700. // ForceSendFields is a list of field names (e.g. "Code") to
  5701. // unconditionally include in API requests. By default, fields with
  5702. // empty values are omitted from API requests. However, any non-pointer,
  5703. // non-interface field appearing in ForceSendFields will be sent to the
  5704. // server regardless of whether the field is empty or not. This may be
  5705. // used to include empty fields in Patch requests.
  5706. ForceSendFields []string `json:"-"`
  5707. // NullFields is a list of field names (e.g. "Code") to include in API
  5708. // requests with the JSON null value. By default, fields with empty
  5709. // values are omitted from API requests. However, any field with an
  5710. // empty value appearing in NullFields will be sent to the server as
  5711. // null. It is an error if a field in this list has a non-empty value.
  5712. // This may be used to include null fields in Patch requests.
  5713. NullFields []string `json:"-"`
  5714. }
  5715. func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) {
  5716. type NoMethod DisksScopedListWarning
  5717. raw := NoMethod(*s)
  5718. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5719. }
  5720. type DisksScopedListWarningData struct {
  5721. // Key: [Output Only] A key that provides more detail on the warning
  5722. // being returned. For example, for warnings where there are no results
  5723. // in a list request for a particular zone, this key might be scope and
  5724. // the key value might be the zone name. Other examples might be a key
  5725. // indicating a deprecated resource and a suggested replacement, or a
  5726. // warning about invalid network settings (for example, if an instance
  5727. // attempts to perform IP forwarding but is not enabled for IP
  5728. // forwarding).
  5729. Key string `json:"key,omitempty"`
  5730. // Value: [Output Only] A warning data value corresponding to the key.
  5731. Value string `json:"value,omitempty"`
  5732. // ForceSendFields is a list of field names (e.g. "Key") to
  5733. // unconditionally include in API requests. By default, fields with
  5734. // empty values are omitted from API requests. However, any non-pointer,
  5735. // non-interface field appearing in ForceSendFields will be sent to the
  5736. // server regardless of whether the field is empty or not. This may be
  5737. // used to include empty fields in Patch requests.
  5738. ForceSendFields []string `json:"-"`
  5739. // NullFields is a list of field names (e.g. "Key") to include in API
  5740. // requests with the JSON null value. By default, fields with empty
  5741. // values are omitted from API requests. However, any field with an
  5742. // empty value appearing in NullFields will be sent to the server as
  5743. // null. It is an error if a field in this list has a non-empty value.
  5744. // This may be used to include null fields in Patch requests.
  5745. NullFields []string `json:"-"`
  5746. }
  5747. func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
  5748. type NoMethod DisksScopedListWarningData
  5749. raw := NoMethod(*s)
  5750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5751. }
  5752. type DistributionPolicy struct {
  5753. // Zones: Zones where the regional managed instance group will create
  5754. // and manage instances.
  5755. Zones []*DistributionPolicyZoneConfiguration `json:"zones,omitempty"`
  5756. // ForceSendFields is a list of field names (e.g. "Zones") to
  5757. // unconditionally include in API requests. By default, fields with
  5758. // empty values are omitted from API requests. However, any non-pointer,
  5759. // non-interface field appearing in ForceSendFields will be sent to the
  5760. // server regardless of whether the field is empty or not. This may be
  5761. // used to include empty fields in Patch requests.
  5762. ForceSendFields []string `json:"-"`
  5763. // NullFields is a list of field names (e.g. "Zones") to include in API
  5764. // requests with the JSON null value. By default, fields with empty
  5765. // values are omitted from API requests. However, any field with an
  5766. // empty value appearing in NullFields will be sent to the server as
  5767. // null. It is an error if a field in this list has a non-empty value.
  5768. // This may be used to include null fields in Patch requests.
  5769. NullFields []string `json:"-"`
  5770. }
  5771. func (s *DistributionPolicy) MarshalJSON() ([]byte, error) {
  5772. type NoMethod DistributionPolicy
  5773. raw := NoMethod(*s)
  5774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5775. }
  5776. type DistributionPolicyZoneConfiguration struct {
  5777. // Zone: The URL of the zone. The zone must exist in the region where
  5778. // the managed instance group is located.
  5779. Zone string `json:"zone,omitempty"`
  5780. // ForceSendFields is a list of field names (e.g. "Zone") to
  5781. // unconditionally include in API requests. By default, fields with
  5782. // empty values are omitted from API requests. However, any non-pointer,
  5783. // non-interface field appearing in ForceSendFields will be sent to the
  5784. // server regardless of whether the field is empty or not. This may be
  5785. // used to include empty fields in Patch requests.
  5786. ForceSendFields []string `json:"-"`
  5787. // NullFields is a list of field names (e.g. "Zone") to include in API
  5788. // requests with the JSON null value. By default, fields with empty
  5789. // values are omitted from API requests. However, any field with an
  5790. // empty value appearing in NullFields will be sent to the server as
  5791. // null. It is an error if a field in this list has a non-empty value.
  5792. // This may be used to include null fields in Patch requests.
  5793. NullFields []string `json:"-"`
  5794. }
  5795. func (s *DistributionPolicyZoneConfiguration) MarshalJSON() ([]byte, error) {
  5796. type NoMethod DistributionPolicyZoneConfiguration
  5797. raw := NoMethod(*s)
  5798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5799. }
  5800. // Expr: Represents an expression text. Example:
  5801. //
  5802. // title: "User account presence" description: "Determines whether the
  5803. // request has a user account" expression: "size(request.user) > 0"
  5804. type Expr struct {
  5805. // Description: An optional description of the expression. This is a
  5806. // longer text which describes the expression, e.g. when hovered over it
  5807. // in a UI.
  5808. Description string `json:"description,omitempty"`
  5809. // Expression: Textual representation of an expression in Common
  5810. // Expression Language syntax.
  5811. //
  5812. // The application context of the containing message determines which
  5813. // well-known feature set of CEL is supported.
  5814. Expression string `json:"expression,omitempty"`
  5815. // Location: An optional string indicating the location of the
  5816. // expression for error reporting, e.g. a file name and a position in
  5817. // the file.
  5818. Location string `json:"location,omitempty"`
  5819. // Title: An optional title for the expression, i.e. a short string
  5820. // describing its purpose. This can be used e.g. in UIs which allow to
  5821. // enter the expression.
  5822. Title string `json:"title,omitempty"`
  5823. // ForceSendFields is a list of field names (e.g. "Description") to
  5824. // unconditionally include in API requests. By default, fields with
  5825. // empty values are omitted from API requests. However, any non-pointer,
  5826. // non-interface field appearing in ForceSendFields will be sent to the
  5827. // server regardless of whether the field is empty or not. This may be
  5828. // used to include empty fields in Patch requests.
  5829. ForceSendFields []string `json:"-"`
  5830. // NullFields is a list of field names (e.g. "Description") to include
  5831. // in API requests with the JSON null value. By default, fields with
  5832. // empty values are omitted from API requests. However, any field with
  5833. // an empty value appearing in NullFields will be sent to the server as
  5834. // null. It is an error if a field in this list has a non-empty value.
  5835. // This may be used to include null fields in Patch requests.
  5836. NullFields []string `json:"-"`
  5837. }
  5838. func (s *Expr) MarshalJSON() ([]byte, error) {
  5839. type NoMethod Expr
  5840. raw := NoMethod(*s)
  5841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5842. }
  5843. // Firewall: Represents a Firewall resource.
  5844. type Firewall struct {
  5845. // Allowed: The list of ALLOW rules specified by this firewall. Each
  5846. // rule specifies a protocol and port-range tuple that describes a
  5847. // permitted connection.
  5848. Allowed []*FirewallAllowed `json:"allowed,omitempty"`
  5849. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5850. // format.
  5851. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5852. // Denied: The list of DENY rules specified by this firewall. Each rule
  5853. // specifies a protocol and port-range tuple that describes a denied
  5854. // connection.
  5855. Denied []*FirewallDenied `json:"denied,omitempty"`
  5856. // Description: An optional description of this resource. Provide this
  5857. // property when you create the resource.
  5858. Description string `json:"description,omitempty"`
  5859. // DestinationRanges: If destination ranges are specified, the firewall
  5860. // will apply only to traffic that has destination IP address in these
  5861. // ranges. These ranges must be expressed in CIDR format. Only IPv4 is
  5862. // supported.
  5863. DestinationRanges []string `json:"destinationRanges,omitempty"`
  5864. // Direction: Direction of traffic to which this firewall applies;
  5865. // default is INGRESS. Note: For INGRESS traffic, it is NOT supported to
  5866. // specify destinationRanges; For EGRESS traffic, it is NOT supported to
  5867. // specify sourceRanges OR sourceTags.
  5868. //
  5869. // Possible values:
  5870. // "EGRESS"
  5871. // "INGRESS"
  5872. Direction string `json:"direction,omitempty"`
  5873. // Disabled: Denotes whether the firewall rule is disabled, i.e not
  5874. // applied to the network it is associated with. When set to true, the
  5875. // firewall rule is not enforced and the network behaves as if it did
  5876. // not exist. If this is unspecified, the firewall rule will be enabled.
  5877. Disabled bool `json:"disabled,omitempty"`
  5878. // Id: [Output Only] The unique identifier for the resource. This
  5879. // identifier is defined by the server.
  5880. Id uint64 `json:"id,omitempty,string"`
  5881. // Kind: [Output Only] Type of the resource. Always compute#firewall for
  5882. // firewall rules.
  5883. Kind string `json:"kind,omitempty"`
  5884. // LogConfig: This field denotes the logging options for a particular
  5885. // firewall rule. If logging is enabled, logs will be exported to
  5886. // Stackdriver.
  5887. LogConfig *FirewallLogConfig `json:"logConfig,omitempty"`
  5888. // Name: Name of the resource; provided by the client when the resource
  5889. // is created. The name must be 1-63 characters long, and comply with
  5890. // RFC1035. Specifically, the name must be 1-63 characters long and
  5891. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  5892. // the first character must be a lowercase letter, and all following
  5893. // characters must be a dash, lowercase letter, or digit, except the
  5894. // last character, which cannot be a dash.
  5895. Name string `json:"name,omitempty"`
  5896. // Network: URL of the network resource for this firewall rule. If not
  5897. // specified when creating a firewall rule, the default network is
  5898. // used:
  5899. // global/networks/default
  5900. // If you choose to specify this property, you can specify the network
  5901. // as a full or partial URL. For example, the following are all valid
  5902. // URLs:
  5903. // -
  5904. // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network
  5905. // - projects/myproject/global/networks/my-network
  5906. // - global/networks/default
  5907. Network string `json:"network,omitempty"`
  5908. // Priority: Priority for this rule. This is an integer between 0 and
  5909. // 65535, both inclusive. When not specified, the value assumed is 1000.
  5910. // Relative priorities determine precedence of conflicting rules. Lower
  5911. // value of priority implies higher precedence (eg, a rule with priority
  5912. // 0 has higher precedence than a rule with priority 1). DENY rules take
  5913. // precedence over ALLOW rules having equal priority.
  5914. Priority int64 `json:"priority,omitempty"`
  5915. // SelfLink: [Output Only] Server-defined URL for the resource.
  5916. SelfLink string `json:"selfLink,omitempty"`
  5917. // SourceRanges: If source ranges are specified, the firewall will apply
  5918. // only to traffic that has source IP address in these ranges. These
  5919. // ranges must be expressed in CIDR format. One or both of sourceRanges
  5920. // and sourceTags may be set. If both properties are set, the firewall
  5921. // will apply to traffic that has source IP address within sourceRanges
  5922. // OR the source IP that belongs to a tag listed in the sourceTags
  5923. // property. The connection does not need to match both properties for
  5924. // the firewall to apply. Only IPv4 is supported.
  5925. SourceRanges []string `json:"sourceRanges,omitempty"`
  5926. // SourceServiceAccounts: If source service accounts are specified, the
  5927. // firewall will apply only to traffic originating from an instance with
  5928. // a service account in this list. Source service accounts cannot be
  5929. // used to control traffic to an instance's external IP address because
  5930. // service accounts are associated with an instance, not an IP address.
  5931. // sourceRanges can be set at the same time as sourceServiceAccounts. If
  5932. // both are set, the firewall will apply to traffic that has source IP
  5933. // address within sourceRanges OR the source IP belongs to an instance
  5934. // with service account listed in sourceServiceAccount. The connection
  5935. // does not need to match both properties for the firewall to apply.
  5936. // sourceServiceAccounts cannot be used at the same time as sourceTags
  5937. // or targetTags.
  5938. SourceServiceAccounts []string `json:"sourceServiceAccounts,omitempty"`
  5939. // SourceTags: If source tags are specified, the firewall rule applies
  5940. // only to traffic with source IPs that match the primary network
  5941. // interfaces of VM instances that have the tag and are in the same VPC
  5942. // network. Source tags cannot be used to control traffic to an
  5943. // instance's external IP address, it only applies to traffic between
  5944. // instances in the same virtual network. Because tags are associated
  5945. // with instances, not IP addresses. One or both of sourceRanges and
  5946. // sourceTags may be set. If both properties are set, the firewall will
  5947. // apply to traffic that has source IP address within sourceRanges OR
  5948. // the source IP that belongs to a tag listed in the sourceTags
  5949. // property. The connection does not need to match both properties for
  5950. // the firewall to apply.
  5951. SourceTags []string `json:"sourceTags,omitempty"`
  5952. // TargetServiceAccounts: A list of service accounts indicating sets of
  5953. // instances located in the network that may make network connections as
  5954. // specified in allowed[]. targetServiceAccounts cannot be used at the
  5955. // same time as targetTags or sourceTags. If neither
  5956. // targetServiceAccounts nor targetTags are specified, the firewall rule
  5957. // applies to all instances on the specified network.
  5958. TargetServiceAccounts []string `json:"targetServiceAccounts,omitempty"`
  5959. // TargetTags: A list of tags that controls which instances the firewall
  5960. // rule applies to. If targetTags are specified, then the firewall rule
  5961. // applies only to instances in the VPC network that have one of those
  5962. // tags. If no targetTags are specified, the firewall rule applies to
  5963. // all instances on the specified network.
  5964. TargetTags []string `json:"targetTags,omitempty"`
  5965. // ServerResponse contains the HTTP response code and headers from the
  5966. // server.
  5967. googleapi.ServerResponse `json:"-"`
  5968. // ForceSendFields is a list of field names (e.g. "Allowed") to
  5969. // unconditionally include in API requests. By default, fields with
  5970. // empty values are omitted from API requests. However, any non-pointer,
  5971. // non-interface field appearing in ForceSendFields will be sent to the
  5972. // server regardless of whether the field is empty or not. This may be
  5973. // used to include empty fields in Patch requests.
  5974. ForceSendFields []string `json:"-"`
  5975. // NullFields is a list of field names (e.g. "Allowed") to include in
  5976. // API requests with the JSON null value. By default, fields with empty
  5977. // values are omitted from API requests. However, any field with an
  5978. // empty value appearing in NullFields will be sent to the server as
  5979. // null. It is an error if a field in this list has a non-empty value.
  5980. // This may be used to include null fields in Patch requests.
  5981. NullFields []string `json:"-"`
  5982. }
  5983. func (s *Firewall) MarshalJSON() ([]byte, error) {
  5984. type NoMethod Firewall
  5985. raw := NoMethod(*s)
  5986. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5987. }
  5988. type FirewallAllowed struct {
  5989. // IPProtocol: The IP protocol to which this rule applies. The protocol
  5990. // type is required when creating a firewall rule. This value can either
  5991. // be one of the following well known protocol strings (tcp, udp, icmp,
  5992. // esp, ah, ipip, sctp), or the IP protocol number.
  5993. IPProtocol string `json:"IPProtocol,omitempty"`
  5994. // Ports: An optional list of ports to which this rule applies. This
  5995. // field is only applicable for UDP or TCP protocol. Each entry must be
  5996. // either an integer or a range. If not specified, this rule applies to
  5997. // connections through any port.
  5998. //
  5999. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  6000. Ports []string `json:"ports,omitempty"`
  6001. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  6002. // unconditionally include in API requests. By default, fields with
  6003. // empty values are omitted from API requests. However, any non-pointer,
  6004. // non-interface field appearing in ForceSendFields will be sent to the
  6005. // server regardless of whether the field is empty or not. This may be
  6006. // used to include empty fields in Patch requests.
  6007. ForceSendFields []string `json:"-"`
  6008. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  6009. // API requests with the JSON null value. By default, fields with empty
  6010. // values are omitted from API requests. However, any field with an
  6011. // empty value appearing in NullFields will be sent to the server as
  6012. // null. It is an error if a field in this list has a non-empty value.
  6013. // This may be used to include null fields in Patch requests.
  6014. NullFields []string `json:"-"`
  6015. }
  6016. func (s *FirewallAllowed) MarshalJSON() ([]byte, error) {
  6017. type NoMethod FirewallAllowed
  6018. raw := NoMethod(*s)
  6019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6020. }
  6021. type FirewallDenied struct {
  6022. // IPProtocol: The IP protocol to which this rule applies. The protocol
  6023. // type is required when creating a firewall rule. This value can either
  6024. // be one of the following well known protocol strings (tcp, udp, icmp,
  6025. // esp, ah, ipip, sctp), or the IP protocol number.
  6026. IPProtocol string `json:"IPProtocol,omitempty"`
  6027. // Ports: An optional list of ports to which this rule applies. This
  6028. // field is only applicable for UDP or TCP protocol. Each entry must be
  6029. // either an integer or a range. If not specified, this rule applies to
  6030. // connections through any port.
  6031. //
  6032. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  6033. Ports []string `json:"ports,omitempty"`
  6034. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  6035. // unconditionally include in API requests. By default, fields with
  6036. // empty values are omitted from API requests. However, any non-pointer,
  6037. // non-interface field appearing in ForceSendFields will be sent to the
  6038. // server regardless of whether the field is empty or not. This may be
  6039. // used to include empty fields in Patch requests.
  6040. ForceSendFields []string `json:"-"`
  6041. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  6042. // API requests with the JSON null value. By default, fields with empty
  6043. // values are omitted from API requests. However, any field with an
  6044. // empty value appearing in NullFields will be sent to the server as
  6045. // null. It is an error if a field in this list has a non-empty value.
  6046. // This may be used to include null fields in Patch requests.
  6047. NullFields []string `json:"-"`
  6048. }
  6049. func (s *FirewallDenied) MarshalJSON() ([]byte, error) {
  6050. type NoMethod FirewallDenied
  6051. raw := NoMethod(*s)
  6052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6053. }
  6054. // FirewallList: Contains a list of firewalls.
  6055. type FirewallList struct {
  6056. // Id: [Output Only] Unique identifier for the resource; defined by the
  6057. // server.
  6058. Id string `json:"id,omitempty"`
  6059. // Items: A list of Firewall resources.
  6060. Items []*Firewall `json:"items,omitempty"`
  6061. // Kind: [Output Only] Type of resource. Always compute#firewallList for
  6062. // lists of firewalls.
  6063. Kind string `json:"kind,omitempty"`
  6064. // NextPageToken: [Output Only] This token allows you to get the next
  6065. // page of results for list requests. If the number of results is larger
  6066. // than maxResults, use the nextPageToken as a value for the query
  6067. // parameter pageToken in the next list request. Subsequent list
  6068. // requests will have their own nextPageToken to continue paging through
  6069. // the results.
  6070. NextPageToken string `json:"nextPageToken,omitempty"`
  6071. // SelfLink: [Output Only] Server-defined URL for this resource.
  6072. SelfLink string `json:"selfLink,omitempty"`
  6073. // Warning: [Output Only] Informational warning message.
  6074. Warning *FirewallListWarning `json:"warning,omitempty"`
  6075. // ServerResponse contains the HTTP response code and headers from the
  6076. // server.
  6077. googleapi.ServerResponse `json:"-"`
  6078. // ForceSendFields is a list of field names (e.g. "Id") to
  6079. // unconditionally include in API requests. By default, fields with
  6080. // empty values are omitted from API requests. However, any non-pointer,
  6081. // non-interface field appearing in ForceSendFields will be sent to the
  6082. // server regardless of whether the field is empty or not. This may be
  6083. // used to include empty fields in Patch requests.
  6084. ForceSendFields []string `json:"-"`
  6085. // NullFields is a list of field names (e.g. "Id") to include in API
  6086. // requests with the JSON null value. By default, fields with empty
  6087. // values are omitted from API requests. However, any field with an
  6088. // empty value appearing in NullFields will be sent to the server as
  6089. // null. It is an error if a field in this list has a non-empty value.
  6090. // This may be used to include null fields in Patch requests.
  6091. NullFields []string `json:"-"`
  6092. }
  6093. func (s *FirewallList) MarshalJSON() ([]byte, error) {
  6094. type NoMethod FirewallList
  6095. raw := NoMethod(*s)
  6096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6097. }
  6098. // FirewallListWarning: [Output Only] Informational warning message.
  6099. type FirewallListWarning struct {
  6100. // Code: [Output Only] A warning code, if applicable. For example,
  6101. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6102. // the response.
  6103. //
  6104. // Possible values:
  6105. // "CLEANUP_FAILED"
  6106. // "DEPRECATED_RESOURCE_USED"
  6107. // "DEPRECATED_TYPE_USED"
  6108. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6109. // "EXPERIMENTAL_TYPE_USED"
  6110. // "EXTERNAL_API_WARNING"
  6111. // "FIELD_VALUE_OVERRIDEN"
  6112. // "INJECTED_KERNELS_DEPRECATED"
  6113. // "MISSING_TYPE_DEPENDENCY"
  6114. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6115. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6116. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6117. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6118. // "NEXT_HOP_NOT_RUNNING"
  6119. // "NOT_CRITICAL_ERROR"
  6120. // "NO_RESULTS_ON_PAGE"
  6121. // "REQUIRED_TOS_AGREEMENT"
  6122. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6123. // "RESOURCE_NOT_DELETED"
  6124. // "SCHEMA_VALIDATION_IGNORED"
  6125. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6126. // "UNDECLARED_PROPERTIES"
  6127. // "UNREACHABLE"
  6128. Code string `json:"code,omitempty"`
  6129. // Data: [Output Only] Metadata about this warning in key: value format.
  6130. // For example:
  6131. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6132. Data []*FirewallListWarningData `json:"data,omitempty"`
  6133. // Message: [Output Only] A human-readable description of the warning
  6134. // code.
  6135. Message string `json:"message,omitempty"`
  6136. // ForceSendFields is a list of field names (e.g. "Code") to
  6137. // unconditionally include in API requests. By default, fields with
  6138. // empty values are omitted from API requests. However, any non-pointer,
  6139. // non-interface field appearing in ForceSendFields will be sent to the
  6140. // server regardless of whether the field is empty or not. This may be
  6141. // used to include empty fields in Patch requests.
  6142. ForceSendFields []string `json:"-"`
  6143. // NullFields is a list of field names (e.g. "Code") to include in API
  6144. // requests with the JSON null value. By default, fields with empty
  6145. // values are omitted from API requests. However, any field with an
  6146. // empty value appearing in NullFields will be sent to the server as
  6147. // null. It is an error if a field in this list has a non-empty value.
  6148. // This may be used to include null fields in Patch requests.
  6149. NullFields []string `json:"-"`
  6150. }
  6151. func (s *FirewallListWarning) MarshalJSON() ([]byte, error) {
  6152. type NoMethod FirewallListWarning
  6153. raw := NoMethod(*s)
  6154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6155. }
  6156. type FirewallListWarningData struct {
  6157. // Key: [Output Only] A key that provides more detail on the warning
  6158. // being returned. For example, for warnings where there are no results
  6159. // in a list request for a particular zone, this key might be scope and
  6160. // the key value might be the zone name. Other examples might be a key
  6161. // indicating a deprecated resource and a suggested replacement, or a
  6162. // warning about invalid network settings (for example, if an instance
  6163. // attempts to perform IP forwarding but is not enabled for IP
  6164. // forwarding).
  6165. Key string `json:"key,omitempty"`
  6166. // Value: [Output Only] A warning data value corresponding to the key.
  6167. Value string `json:"value,omitempty"`
  6168. // ForceSendFields is a list of field names (e.g. "Key") to
  6169. // unconditionally include in API requests. By default, fields with
  6170. // empty values are omitted from API requests. However, any non-pointer,
  6171. // non-interface field appearing in ForceSendFields will be sent to the
  6172. // server regardless of whether the field is empty or not. This may be
  6173. // used to include empty fields in Patch requests.
  6174. ForceSendFields []string `json:"-"`
  6175. // NullFields is a list of field names (e.g. "Key") to include in API
  6176. // requests with the JSON null value. By default, fields with empty
  6177. // values are omitted from API requests. However, any field with an
  6178. // empty value appearing in NullFields will be sent to the server as
  6179. // null. It is an error if a field in this list has a non-empty value.
  6180. // This may be used to include null fields in Patch requests.
  6181. NullFields []string `json:"-"`
  6182. }
  6183. func (s *FirewallListWarningData) MarshalJSON() ([]byte, error) {
  6184. type NoMethod FirewallListWarningData
  6185. raw := NoMethod(*s)
  6186. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6187. }
  6188. // FirewallLogConfig: The available logging options for a firewall rule.
  6189. type FirewallLogConfig struct {
  6190. // Enable: This field denotes whether to enable logging for a particular
  6191. // firewall rule.
  6192. Enable bool `json:"enable,omitempty"`
  6193. // ForceSendFields is a list of field names (e.g. "Enable") to
  6194. // unconditionally include in API requests. By default, fields with
  6195. // empty values are omitted from API requests. However, any non-pointer,
  6196. // non-interface field appearing in ForceSendFields will be sent to the
  6197. // server regardless of whether the field is empty or not. This may be
  6198. // used to include empty fields in Patch requests.
  6199. ForceSendFields []string `json:"-"`
  6200. // NullFields is a list of field names (e.g. "Enable") to include in API
  6201. // requests with the JSON null value. By default, fields with empty
  6202. // values are omitted from API requests. However, any field with an
  6203. // empty value appearing in NullFields will be sent to the server as
  6204. // null. It is an error if a field in this list has a non-empty value.
  6205. // This may be used to include null fields in Patch requests.
  6206. NullFields []string `json:"-"`
  6207. }
  6208. func (s *FirewallLogConfig) MarshalJSON() ([]byte, error) {
  6209. type NoMethod FirewallLogConfig
  6210. raw := NoMethod(*s)
  6211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6212. }
  6213. // FixedOrPercent: Encapsulates numeric value that can be either
  6214. // absolute or relative.
  6215. type FixedOrPercent struct {
  6216. // Calculated: [Output Only] Absolute value of VM instances calculated
  6217. // based on the specific mode.
  6218. //
  6219. //
  6220. // - If the value is fixed, then the caculated value is equal to the
  6221. // fixed value.
  6222. // - If the value is a percent, then the calculated value is percent/100
  6223. // * targetSize. For example, the calculated value of a 80% of a managed
  6224. // instance group with 150 instances would be (80/100 * 150) = 120 VM
  6225. // instances. If there is a remainder, the number is rounded up.
  6226. Calculated int64 `json:"calculated,omitempty"`
  6227. // Fixed: Specifies a fixed number of VM instances. This must be a
  6228. // positive integer.
  6229. Fixed int64 `json:"fixed,omitempty"`
  6230. // Percent: Specifies a percentage of instances between 0 to 100%,
  6231. // inclusive. For example, specify 80 for 80%.
  6232. Percent int64 `json:"percent,omitempty"`
  6233. // ForceSendFields is a list of field names (e.g. "Calculated") to
  6234. // unconditionally include in API requests. By default, fields with
  6235. // empty values are omitted from API requests. However, any non-pointer,
  6236. // non-interface field appearing in ForceSendFields will be sent to the
  6237. // server regardless of whether the field is empty or not. This may be
  6238. // used to include empty fields in Patch requests.
  6239. ForceSendFields []string `json:"-"`
  6240. // NullFields is a list of field names (e.g. "Calculated") to include in
  6241. // API requests with the JSON null value. By default, fields with empty
  6242. // values are omitted from API requests. However, any field with an
  6243. // empty value appearing in NullFields will be sent to the server as
  6244. // null. It is an error if a field in this list has a non-empty value.
  6245. // This may be used to include null fields in Patch requests.
  6246. NullFields []string `json:"-"`
  6247. }
  6248. func (s *FixedOrPercent) MarshalJSON() ([]byte, error) {
  6249. type NoMethod FixedOrPercent
  6250. raw := NoMethod(*s)
  6251. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6252. }
  6253. // ForwardingRule: A ForwardingRule resource. A ForwardingRule resource
  6254. // specifies which pool of target virtual machines to forward a packet
  6255. // to if it matches the given [IPAddress, IPProtocol, ports] tuple. (==
  6256. // resource_for beta.forwardingRules ==) (== resource_for
  6257. // v1.forwardingRules ==) (== resource_for beta.globalForwardingRules
  6258. // ==) (== resource_for v1.globalForwardingRules ==) (== resource_for
  6259. // beta.regionForwardingRules ==) (== resource_for
  6260. // v1.regionForwardingRules ==)
  6261. type ForwardingRule struct {
  6262. // IPAddress: The IP address that this forwarding rule is serving on
  6263. // behalf of.
  6264. //
  6265. // Addresses are restricted based on the forwarding rule's load
  6266. // balancing scheme (EXTERNAL or INTERNAL) and scope (global or
  6267. // regional).
  6268. //
  6269. // When the load balancing scheme is EXTERNAL, for global forwarding
  6270. // rules, the address must be a global IP, and for regional forwarding
  6271. // rules, the address must live in the same region as the forwarding
  6272. // rule. If this field is empty, an ephemeral IPv4 address from the same
  6273. // scope (global or regional) will be assigned. A regional forwarding
  6274. // rule supports IPv4 only. A global forwarding rule supports either
  6275. // IPv4 or IPv6.
  6276. //
  6277. // When the load balancing scheme is INTERNAL_SELF_MANAGED, this must be
  6278. // a URL reference to an existing Address resource ( internal regional
  6279. // static IP address), with a purpose of GCE_END_POINT and address_type
  6280. // of INTERNAL.
  6281. //
  6282. // When the load balancing scheme is INTERNAL, this can only be an RFC
  6283. // 1918 IP address belonging to the network/subnet configured for the
  6284. // forwarding rule. By default, if this field is empty, an ephemeral
  6285. // internal IP address will be automatically allocated from the IP range
  6286. // of the subnet or network configured for this forwarding rule.
  6287. //
  6288. // An address can be specified either by a literal IP address or a URL
  6289. // reference to an existing Address resource. The following examples are
  6290. // all valid:
  6291. // - 100.1.2.3
  6292. // -
  6293. // https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address
  6294. // - projects/project/regions/region/addresses/address
  6295. // - regions/region/addresses/address
  6296. // - global/addresses/address
  6297. // - address
  6298. IPAddress string `json:"IPAddress,omitempty"`
  6299. // IPProtocol: The IP protocol to which this rule applies. Valid options
  6300. // are TCP, UDP, ESP, AH, SCTP or ICMP.
  6301. //
  6302. // When the load balancing scheme is INTERNAL, only TCP and UDP are
  6303. // valid. When the load balancing scheme is INTERNAL_SELF_MANAGED, only
  6304. // TCPis valid.
  6305. //
  6306. // Possible values:
  6307. // "AH"
  6308. // "ESP"
  6309. // "ICMP"
  6310. // "SCTP"
  6311. // "TCP"
  6312. // "UDP"
  6313. IPProtocol string `json:"IPProtocol,omitempty"`
  6314. // AllPorts: This field is used along with the backend_service field for
  6315. // internal load balancing or with the target field for internal
  6316. // TargetInstance. This field cannot be used with port or portRange
  6317. // fields.
  6318. //
  6319. // When the load balancing scheme is INTERNAL and protocol is TCP/UDP,
  6320. // specify this field to allow packets addressed to any ports will be
  6321. // forwarded to the backends configured with this forwarding rule.
  6322. AllPorts bool `json:"allPorts,omitempty"`
  6323. // BackendService: This field is only used for INTERNAL load
  6324. // balancing.
  6325. //
  6326. // For internal load balancing, this field identifies the BackendService
  6327. // resource to receive the matched traffic.
  6328. BackendService string `json:"backendService,omitempty"`
  6329. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6330. // format.
  6331. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6332. // Description: An optional description of this resource. Provide this
  6333. // property when you create the resource.
  6334. Description string `json:"description,omitempty"`
  6335. // Id: [Output Only] The unique identifier for the resource. This
  6336. // identifier is defined by the server.
  6337. Id uint64 `json:"id,omitempty,string"`
  6338. // IpVersion: The IP Version that will be used by this forwarding rule.
  6339. // Valid options are IPV4 or IPV6. This can only be specified for an
  6340. // external global forwarding rule.
  6341. //
  6342. // Possible values:
  6343. // "IPV4"
  6344. // "IPV6"
  6345. // "UNSPECIFIED_VERSION"
  6346. IpVersion string `json:"ipVersion,omitempty"`
  6347. // Kind: [Output Only] Type of the resource. Always
  6348. // compute#forwardingRule for Forwarding Rule resources.
  6349. Kind string `json:"kind,omitempty"`
  6350. // LoadBalancingScheme: This signifies what the ForwardingRule will be
  6351. // used for and can only take the following values: INTERNAL,
  6352. // INTERNAL_SELF_MANAGED, EXTERNAL. The value of INTERNAL means that
  6353. // this will be used for Internal Network Load Balancing (TCP, UDP). The
  6354. // value of INTERNAL_SELF_MANAGED means that this will be used for
  6355. // Internal Global HTTP(S) LB. The value of EXTERNAL means that this
  6356. // will be used for External Load Balancing (HTTP(S) LB, External
  6357. // TCP/UDP LB, SSL Proxy)
  6358. //
  6359. // Possible values:
  6360. // "EXTERNAL"
  6361. // "INTERNAL"
  6362. // "INVALID"
  6363. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  6364. // Name: Name of the resource; provided by the client when the resource
  6365. // is created. The name must be 1-63 characters long, and comply with
  6366. // RFC1035. Specifically, the name must be 1-63 characters long and
  6367. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  6368. // the first character must be a lowercase letter, and all following
  6369. // characters must be a dash, lowercase letter, or digit, except the
  6370. // last character, which cannot be a dash.
  6371. Name string `json:"name,omitempty"`
  6372. // Network: This field is not used for external load balancing.
  6373. //
  6374. // For INTERNAL and INTERNAL_SELF_MANAGED load balancing, this field
  6375. // identifies the network that the load balanced IP should belong to for
  6376. // this Forwarding Rule. If this field is not specified, the default
  6377. // network will be used.
  6378. Network string `json:"network,omitempty"`
  6379. // NetworkTier: This signifies the networking tier used for configuring
  6380. // this load balancer and can only take the following values: PREMIUM ,
  6381. // STANDARD.
  6382. //
  6383. // For regional ForwardingRule, the valid values are PREMIUM and
  6384. // STANDARD. For GlobalForwardingRule, the valid value is PREMIUM.
  6385. //
  6386. // If this field is not specified, it is assumed to be PREMIUM. If
  6387. // IPAddress is specified, this value must be equal to the networkTier
  6388. // of the Address.
  6389. //
  6390. // Possible values:
  6391. // "PREMIUM"
  6392. // "STANDARD"
  6393. NetworkTier string `json:"networkTier,omitempty"`
  6394. // PortRange: This field is used along with the target field for
  6395. // TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy,
  6396. // TargetVpnGateway, TargetPool, TargetInstance.
  6397. //
  6398. // Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets
  6399. // addressed to ports in the specified range will be forwarded to
  6400. // target. Forwarding rules with the same [IPAddress, IPProtocol] pair
  6401. // must have disjoint port ranges.
  6402. //
  6403. // Some types of forwarding target have constraints on the acceptable
  6404. // ports:
  6405. // - TargetHttpProxy: 80, 8080
  6406. // - TargetHttpsProxy: 443
  6407. // - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  6408. // 995, 1688, 1883, 5222
  6409. // - TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  6410. // 995, 1688, 1883, 5222
  6411. // - TargetVpnGateway: 500, 4500
  6412. PortRange string `json:"portRange,omitempty"`
  6413. // Ports: This field is used along with the backend_service field for
  6414. // internal load balancing.
  6415. //
  6416. // When the load balancing scheme is INTERNAL, a list of ports can be
  6417. // configured, for example, ['80'], ['8000','9000'] etc. Only packets
  6418. // addressed to these ports will be forwarded to the backends configured
  6419. // with this forwarding rule.
  6420. //
  6421. // You may specify a maximum of up to 5 ports.
  6422. Ports []string `json:"ports,omitempty"`
  6423. // Region: [Output Only] URL of the region where the regional forwarding
  6424. // rule resides. This field is not applicable to global forwarding
  6425. // rules. You must specify this field as part of the HTTP request URL.
  6426. // It is not settable as a field in the request body.
  6427. Region string `json:"region,omitempty"`
  6428. // SelfLink: [Output Only] Server-defined URL for the resource.
  6429. SelfLink string `json:"selfLink,omitempty"`
  6430. // ServiceLabel: An optional prefix to the service name for this
  6431. // Forwarding Rule. If specified, will be the first label of the fully
  6432. // qualified service name.
  6433. //
  6434. // The label must be 1-63 characters long, and comply with RFC1035.
  6435. // Specifically, the label must be 1-63 characters long and match the
  6436. // regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
  6437. // character must be a lowercase letter, and all following characters
  6438. // must be a dash, lowercase letter, or digit, except the last
  6439. // character, which cannot be a dash.
  6440. //
  6441. // This field is only used for internal load balancing.
  6442. ServiceLabel string `json:"serviceLabel,omitempty"`
  6443. // ServiceName: [Output Only] The internal fully qualified service name
  6444. // for this Forwarding Rule.
  6445. //
  6446. // This field is only used for internal load balancing.
  6447. ServiceName string `json:"serviceName,omitempty"`
  6448. // Subnetwork: This field is only used for INTERNAL load balancing.
  6449. //
  6450. // For internal load balancing, this field identifies the subnetwork
  6451. // that the load balanced IP should belong to for this Forwarding
  6452. // Rule.
  6453. //
  6454. // If the network specified is in auto subnet mode, this field is
  6455. // optional. However, if the network is in custom subnet mode, a
  6456. // subnetwork must be specified.
  6457. Subnetwork string `json:"subnetwork,omitempty"`
  6458. // Target: The URL of the target resource to receive the matched
  6459. // traffic. For regional forwarding rules, this target must live in the
  6460. // same region as the forwarding rule. For global forwarding rules, this
  6461. // target must be a global load balancing resource. The forwarded
  6462. // traffic must be of a type appropriate to the target object. For
  6463. // INTERNAL_SELF_MANAGED load balancing, only HTTP and HTTPS targets are
  6464. // valid.
  6465. Target string `json:"target,omitempty"`
  6466. // ServerResponse contains the HTTP response code and headers from the
  6467. // server.
  6468. googleapi.ServerResponse `json:"-"`
  6469. // ForceSendFields is a list of field names (e.g. "IPAddress") to
  6470. // unconditionally include in API requests. By default, fields with
  6471. // empty values are omitted from API requests. However, any non-pointer,
  6472. // non-interface field appearing in ForceSendFields will be sent to the
  6473. // server regardless of whether the field is empty or not. This may be
  6474. // used to include empty fields in Patch requests.
  6475. ForceSendFields []string `json:"-"`
  6476. // NullFields is a list of field names (e.g. "IPAddress") to include in
  6477. // API requests with the JSON null value. By default, fields with empty
  6478. // values are omitted from API requests. However, any field with an
  6479. // empty value appearing in NullFields will be sent to the server as
  6480. // null. It is an error if a field in this list has a non-empty value.
  6481. // This may be used to include null fields in Patch requests.
  6482. NullFields []string `json:"-"`
  6483. }
  6484. func (s *ForwardingRule) MarshalJSON() ([]byte, error) {
  6485. type NoMethod ForwardingRule
  6486. raw := NoMethod(*s)
  6487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6488. }
  6489. type ForwardingRuleAggregatedList struct {
  6490. // Id: [Output Only] Unique identifier for the resource; defined by the
  6491. // server.
  6492. Id string `json:"id,omitempty"`
  6493. // Items: A list of ForwardingRulesScopedList resources.
  6494. Items map[string]ForwardingRulesScopedList `json:"items,omitempty"`
  6495. // Kind: [Output Only] Type of resource. Always
  6496. // compute#forwardingRuleAggregatedList for lists of forwarding rules.
  6497. Kind string `json:"kind,omitempty"`
  6498. // NextPageToken: [Output Only] This token allows you to get the next
  6499. // page of results for list requests. If the number of results is larger
  6500. // than maxResults, use the nextPageToken as a value for the query
  6501. // parameter pageToken in the next list request. Subsequent list
  6502. // requests will have their own nextPageToken to continue paging through
  6503. // the results.
  6504. NextPageToken string `json:"nextPageToken,omitempty"`
  6505. // SelfLink: [Output Only] Server-defined URL for this resource.
  6506. SelfLink string `json:"selfLink,omitempty"`
  6507. // Warning: [Output Only] Informational warning message.
  6508. Warning *ForwardingRuleAggregatedListWarning `json:"warning,omitempty"`
  6509. // ServerResponse contains the HTTP response code and headers from the
  6510. // server.
  6511. googleapi.ServerResponse `json:"-"`
  6512. // ForceSendFields is a list of field names (e.g. "Id") to
  6513. // unconditionally include in API requests. By default, fields with
  6514. // empty values are omitted from API requests. However, any non-pointer,
  6515. // non-interface field appearing in ForceSendFields will be sent to the
  6516. // server regardless of whether the field is empty or not. This may be
  6517. // used to include empty fields in Patch requests.
  6518. ForceSendFields []string `json:"-"`
  6519. // NullFields is a list of field names (e.g. "Id") to include in API
  6520. // requests with the JSON null value. By default, fields with empty
  6521. // values are omitted from API requests. However, any field with an
  6522. // empty value appearing in NullFields will be sent to the server as
  6523. // null. It is an error if a field in this list has a non-empty value.
  6524. // This may be used to include null fields in Patch requests.
  6525. NullFields []string `json:"-"`
  6526. }
  6527. func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
  6528. type NoMethod ForwardingRuleAggregatedList
  6529. raw := NoMethod(*s)
  6530. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6531. }
  6532. // ForwardingRuleAggregatedListWarning: [Output Only] Informational
  6533. // warning message.
  6534. type ForwardingRuleAggregatedListWarning struct {
  6535. // Code: [Output Only] A warning code, if applicable. For example,
  6536. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6537. // the response.
  6538. //
  6539. // Possible values:
  6540. // "CLEANUP_FAILED"
  6541. // "DEPRECATED_RESOURCE_USED"
  6542. // "DEPRECATED_TYPE_USED"
  6543. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6544. // "EXPERIMENTAL_TYPE_USED"
  6545. // "EXTERNAL_API_WARNING"
  6546. // "FIELD_VALUE_OVERRIDEN"
  6547. // "INJECTED_KERNELS_DEPRECATED"
  6548. // "MISSING_TYPE_DEPENDENCY"
  6549. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6550. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6551. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6552. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6553. // "NEXT_HOP_NOT_RUNNING"
  6554. // "NOT_CRITICAL_ERROR"
  6555. // "NO_RESULTS_ON_PAGE"
  6556. // "REQUIRED_TOS_AGREEMENT"
  6557. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6558. // "RESOURCE_NOT_DELETED"
  6559. // "SCHEMA_VALIDATION_IGNORED"
  6560. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6561. // "UNDECLARED_PROPERTIES"
  6562. // "UNREACHABLE"
  6563. Code string `json:"code,omitempty"`
  6564. // Data: [Output Only] Metadata about this warning in key: value format.
  6565. // For example:
  6566. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6567. Data []*ForwardingRuleAggregatedListWarningData `json:"data,omitempty"`
  6568. // Message: [Output Only] A human-readable description of the warning
  6569. // code.
  6570. Message string `json:"message,omitempty"`
  6571. // ForceSendFields is a list of field names (e.g. "Code") to
  6572. // unconditionally include in API requests. By default, fields with
  6573. // empty values are omitted from API requests. However, any non-pointer,
  6574. // non-interface field appearing in ForceSendFields will be sent to the
  6575. // server regardless of whether the field is empty or not. This may be
  6576. // used to include empty fields in Patch requests.
  6577. ForceSendFields []string `json:"-"`
  6578. // NullFields is a list of field names (e.g. "Code") to include in API
  6579. // requests with the JSON null value. By default, fields with empty
  6580. // values are omitted from API requests. However, any field with an
  6581. // empty value appearing in NullFields will be sent to the server as
  6582. // null. It is an error if a field in this list has a non-empty value.
  6583. // This may be used to include null fields in Patch requests.
  6584. NullFields []string `json:"-"`
  6585. }
  6586. func (s *ForwardingRuleAggregatedListWarning) MarshalJSON() ([]byte, error) {
  6587. type NoMethod ForwardingRuleAggregatedListWarning
  6588. raw := NoMethod(*s)
  6589. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6590. }
  6591. type ForwardingRuleAggregatedListWarningData struct {
  6592. // Key: [Output Only] A key that provides more detail on the warning
  6593. // being returned. For example, for warnings where there are no results
  6594. // in a list request for a particular zone, this key might be scope and
  6595. // the key value might be the zone name. Other examples might be a key
  6596. // indicating a deprecated resource and a suggested replacement, or a
  6597. // warning about invalid network settings (for example, if an instance
  6598. // attempts to perform IP forwarding but is not enabled for IP
  6599. // forwarding).
  6600. Key string `json:"key,omitempty"`
  6601. // Value: [Output Only] A warning data value corresponding to the key.
  6602. Value string `json:"value,omitempty"`
  6603. // ForceSendFields is a list of field names (e.g. "Key") to
  6604. // unconditionally include in API requests. By default, fields with
  6605. // empty values are omitted from API requests. However, any non-pointer,
  6606. // non-interface field appearing in ForceSendFields will be sent to the
  6607. // server regardless of whether the field is empty or not. This may be
  6608. // used to include empty fields in Patch requests.
  6609. ForceSendFields []string `json:"-"`
  6610. // NullFields is a list of field names (e.g. "Key") to include in API
  6611. // requests with the JSON null value. By default, fields with empty
  6612. // values are omitted from API requests. However, any field with an
  6613. // empty value appearing in NullFields will be sent to the server as
  6614. // null. It is an error if a field in this list has a non-empty value.
  6615. // This may be used to include null fields in Patch requests.
  6616. NullFields []string `json:"-"`
  6617. }
  6618. func (s *ForwardingRuleAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  6619. type NoMethod ForwardingRuleAggregatedListWarningData
  6620. raw := NoMethod(*s)
  6621. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6622. }
  6623. // ForwardingRuleList: Contains a list of ForwardingRule resources.
  6624. type ForwardingRuleList struct {
  6625. // Id: [Output Only] Unique identifier for the resource; defined by the
  6626. // server.
  6627. Id string `json:"id,omitempty"`
  6628. // Items: A list of ForwardingRule resources.
  6629. Items []*ForwardingRule `json:"items,omitempty"`
  6630. // Kind: Type of resource.
  6631. Kind string `json:"kind,omitempty"`
  6632. // NextPageToken: [Output Only] This token allows you to get the next
  6633. // page of results for list requests. If the number of results is larger
  6634. // than maxResults, use the nextPageToken as a value for the query
  6635. // parameter pageToken in the next list request. Subsequent list
  6636. // requests will have their own nextPageToken to continue paging through
  6637. // the results.
  6638. NextPageToken string `json:"nextPageToken,omitempty"`
  6639. // SelfLink: [Output Only] Server-defined URL for this resource.
  6640. SelfLink string `json:"selfLink,omitempty"`
  6641. // Warning: [Output Only] Informational warning message.
  6642. Warning *ForwardingRuleListWarning `json:"warning,omitempty"`
  6643. // ServerResponse contains the HTTP response code and headers from the
  6644. // server.
  6645. googleapi.ServerResponse `json:"-"`
  6646. // ForceSendFields is a list of field names (e.g. "Id") to
  6647. // unconditionally include in API requests. By default, fields with
  6648. // empty values are omitted from API requests. However, any non-pointer,
  6649. // non-interface field appearing in ForceSendFields will be sent to the
  6650. // server regardless of whether the field is empty or not. This may be
  6651. // used to include empty fields in Patch requests.
  6652. ForceSendFields []string `json:"-"`
  6653. // NullFields is a list of field names (e.g. "Id") to include in API
  6654. // requests with the JSON null value. By default, fields with empty
  6655. // values are omitted from API requests. However, any field with an
  6656. // empty value appearing in NullFields will be sent to the server as
  6657. // null. It is an error if a field in this list has a non-empty value.
  6658. // This may be used to include null fields in Patch requests.
  6659. NullFields []string `json:"-"`
  6660. }
  6661. func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) {
  6662. type NoMethod ForwardingRuleList
  6663. raw := NoMethod(*s)
  6664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6665. }
  6666. // ForwardingRuleListWarning: [Output Only] Informational warning
  6667. // message.
  6668. type ForwardingRuleListWarning struct {
  6669. // Code: [Output Only] A warning code, if applicable. For example,
  6670. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6671. // the response.
  6672. //
  6673. // Possible values:
  6674. // "CLEANUP_FAILED"
  6675. // "DEPRECATED_RESOURCE_USED"
  6676. // "DEPRECATED_TYPE_USED"
  6677. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6678. // "EXPERIMENTAL_TYPE_USED"
  6679. // "EXTERNAL_API_WARNING"
  6680. // "FIELD_VALUE_OVERRIDEN"
  6681. // "INJECTED_KERNELS_DEPRECATED"
  6682. // "MISSING_TYPE_DEPENDENCY"
  6683. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6684. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6685. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6686. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6687. // "NEXT_HOP_NOT_RUNNING"
  6688. // "NOT_CRITICAL_ERROR"
  6689. // "NO_RESULTS_ON_PAGE"
  6690. // "REQUIRED_TOS_AGREEMENT"
  6691. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6692. // "RESOURCE_NOT_DELETED"
  6693. // "SCHEMA_VALIDATION_IGNORED"
  6694. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6695. // "UNDECLARED_PROPERTIES"
  6696. // "UNREACHABLE"
  6697. Code string `json:"code,omitempty"`
  6698. // Data: [Output Only] Metadata about this warning in key: value format.
  6699. // For example:
  6700. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6701. Data []*ForwardingRuleListWarningData `json:"data,omitempty"`
  6702. // Message: [Output Only] A human-readable description of the warning
  6703. // code.
  6704. Message string `json:"message,omitempty"`
  6705. // ForceSendFields is a list of field names (e.g. "Code") to
  6706. // unconditionally include in API requests. By default, fields with
  6707. // empty values are omitted from API requests. However, any non-pointer,
  6708. // non-interface field appearing in ForceSendFields will be sent to the
  6709. // server regardless of whether the field is empty or not. This may be
  6710. // used to include empty fields in Patch requests.
  6711. ForceSendFields []string `json:"-"`
  6712. // NullFields is a list of field names (e.g. "Code") to include in API
  6713. // requests with the JSON null value. By default, fields with empty
  6714. // values are omitted from API requests. However, any field with an
  6715. // empty value appearing in NullFields will be sent to the server as
  6716. // null. It is an error if a field in this list has a non-empty value.
  6717. // This may be used to include null fields in Patch requests.
  6718. NullFields []string `json:"-"`
  6719. }
  6720. func (s *ForwardingRuleListWarning) MarshalJSON() ([]byte, error) {
  6721. type NoMethod ForwardingRuleListWarning
  6722. raw := NoMethod(*s)
  6723. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6724. }
  6725. type ForwardingRuleListWarningData struct {
  6726. // Key: [Output Only] A key that provides more detail on the warning
  6727. // being returned. For example, for warnings where there are no results
  6728. // in a list request for a particular zone, this key might be scope and
  6729. // the key value might be the zone name. Other examples might be a key
  6730. // indicating a deprecated resource and a suggested replacement, or a
  6731. // warning about invalid network settings (for example, if an instance
  6732. // attempts to perform IP forwarding but is not enabled for IP
  6733. // forwarding).
  6734. Key string `json:"key,omitempty"`
  6735. // Value: [Output Only] A warning data value corresponding to the key.
  6736. Value string `json:"value,omitempty"`
  6737. // ForceSendFields is a list of field names (e.g. "Key") to
  6738. // unconditionally include in API requests. By default, fields with
  6739. // empty values are omitted from API requests. However, any non-pointer,
  6740. // non-interface field appearing in ForceSendFields will be sent to the
  6741. // server regardless of whether the field is empty or not. This may be
  6742. // used to include empty fields in Patch requests.
  6743. ForceSendFields []string `json:"-"`
  6744. // NullFields is a list of field names (e.g. "Key") to include in API
  6745. // requests with the JSON null value. By default, fields with empty
  6746. // values are omitted from API requests. However, any field with an
  6747. // empty value appearing in NullFields will be sent to the server as
  6748. // null. It is an error if a field in this list has a non-empty value.
  6749. // This may be used to include null fields in Patch requests.
  6750. NullFields []string `json:"-"`
  6751. }
  6752. func (s *ForwardingRuleListWarningData) MarshalJSON() ([]byte, error) {
  6753. type NoMethod ForwardingRuleListWarningData
  6754. raw := NoMethod(*s)
  6755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6756. }
  6757. type ForwardingRulesScopedList struct {
  6758. // ForwardingRules: A list of forwarding rules contained in this scope.
  6759. ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"`
  6760. // Warning: Informational warning which replaces the list of forwarding
  6761. // rules when the list is empty.
  6762. Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"`
  6763. // ForceSendFields is a list of field names (e.g. "ForwardingRules") to
  6764. // unconditionally include in API requests. By default, fields with
  6765. // empty values are omitted from API requests. However, any non-pointer,
  6766. // non-interface field appearing in ForceSendFields will be sent to the
  6767. // server regardless of whether the field is empty or not. This may be
  6768. // used to include empty fields in Patch requests.
  6769. ForceSendFields []string `json:"-"`
  6770. // NullFields is a list of field names (e.g. "ForwardingRules") to
  6771. // include in API requests with the JSON null value. By default, fields
  6772. // with empty values are omitted from API requests. However, any field
  6773. // with an empty value appearing in NullFields will be sent to the
  6774. // server as null. It is an error if a field in this list has a
  6775. // non-empty value. This may be used to include null fields in Patch
  6776. // requests.
  6777. NullFields []string `json:"-"`
  6778. }
  6779. func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
  6780. type NoMethod ForwardingRulesScopedList
  6781. raw := NoMethod(*s)
  6782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6783. }
  6784. // ForwardingRulesScopedListWarning: Informational warning which
  6785. // replaces the list of forwarding rules when the list is empty.
  6786. type ForwardingRulesScopedListWarning struct {
  6787. // Code: [Output Only] A warning code, if applicable. For example,
  6788. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6789. // the response.
  6790. //
  6791. // Possible values:
  6792. // "CLEANUP_FAILED"
  6793. // "DEPRECATED_RESOURCE_USED"
  6794. // "DEPRECATED_TYPE_USED"
  6795. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6796. // "EXPERIMENTAL_TYPE_USED"
  6797. // "EXTERNAL_API_WARNING"
  6798. // "FIELD_VALUE_OVERRIDEN"
  6799. // "INJECTED_KERNELS_DEPRECATED"
  6800. // "MISSING_TYPE_DEPENDENCY"
  6801. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6802. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6803. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6804. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6805. // "NEXT_HOP_NOT_RUNNING"
  6806. // "NOT_CRITICAL_ERROR"
  6807. // "NO_RESULTS_ON_PAGE"
  6808. // "REQUIRED_TOS_AGREEMENT"
  6809. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6810. // "RESOURCE_NOT_DELETED"
  6811. // "SCHEMA_VALIDATION_IGNORED"
  6812. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6813. // "UNDECLARED_PROPERTIES"
  6814. // "UNREACHABLE"
  6815. Code string `json:"code,omitempty"`
  6816. // Data: [Output Only] Metadata about this warning in key: value format.
  6817. // For example:
  6818. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6819. Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"`
  6820. // Message: [Output Only] A human-readable description of the warning
  6821. // code.
  6822. Message string `json:"message,omitempty"`
  6823. // ForceSendFields is a list of field names (e.g. "Code") to
  6824. // unconditionally include in API requests. By default, fields with
  6825. // empty values are omitted from API requests. However, any non-pointer,
  6826. // non-interface field appearing in ForceSendFields will be sent to the
  6827. // server regardless of whether the field is empty or not. This may be
  6828. // used to include empty fields in Patch requests.
  6829. ForceSendFields []string `json:"-"`
  6830. // NullFields is a list of field names (e.g. "Code") to include in API
  6831. // requests with the JSON null value. By default, fields with empty
  6832. // values are omitted from API requests. However, any field with an
  6833. // empty value appearing in NullFields will be sent to the server as
  6834. // null. It is an error if a field in this list has a non-empty value.
  6835. // This may be used to include null fields in Patch requests.
  6836. NullFields []string `json:"-"`
  6837. }
  6838. func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
  6839. type NoMethod ForwardingRulesScopedListWarning
  6840. raw := NoMethod(*s)
  6841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6842. }
  6843. type ForwardingRulesScopedListWarningData struct {
  6844. // Key: [Output Only] A key that provides more detail on the warning
  6845. // being returned. For example, for warnings where there are no results
  6846. // in a list request for a particular zone, this key might be scope and
  6847. // the key value might be the zone name. Other examples might be a key
  6848. // indicating a deprecated resource and a suggested replacement, or a
  6849. // warning about invalid network settings (for example, if an instance
  6850. // attempts to perform IP forwarding but is not enabled for IP
  6851. // forwarding).
  6852. Key string `json:"key,omitempty"`
  6853. // Value: [Output Only] A warning data value corresponding to the key.
  6854. Value string `json:"value,omitempty"`
  6855. // ForceSendFields is a list of field names (e.g. "Key") to
  6856. // unconditionally include in API requests. By default, fields with
  6857. // empty values are omitted from API requests. However, any non-pointer,
  6858. // non-interface field appearing in ForceSendFields will be sent to the
  6859. // server regardless of whether the field is empty or not. This may be
  6860. // used to include empty fields in Patch requests.
  6861. ForceSendFields []string `json:"-"`
  6862. // NullFields is a list of field names (e.g. "Key") to include in API
  6863. // requests with the JSON null value. By default, fields with empty
  6864. // values are omitted from API requests. However, any field with an
  6865. // empty value appearing in NullFields will be sent to the server as
  6866. // null. It is an error if a field in this list has a non-empty value.
  6867. // This may be used to include null fields in Patch requests.
  6868. NullFields []string `json:"-"`
  6869. }
  6870. func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
  6871. type NoMethod ForwardingRulesScopedListWarningData
  6872. raw := NoMethod(*s)
  6873. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6874. }
  6875. type GlobalSetLabelsRequest struct {
  6876. // LabelFingerprint: The fingerprint of the previous set of labels for
  6877. // this resource, used to detect conflicts. The fingerprint is initially
  6878. // generated by Compute Engine and changes after every request to modify
  6879. // or update labels. You must always provide an up-to-date fingerprint
  6880. // hash when updating or changing labels, otherwise the request will
  6881. // fail with error 412 conditionNotMet. Make a get() request to the
  6882. // resource to get the latest fingerprint.
  6883. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  6884. // Labels: A list of labels to apply for this resource. Each label key &
  6885. // value must comply with RFC1035. Specifically, the name must be 1-63
  6886. // characters long and match the regular expression
  6887. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  6888. // a lowercase letter, and all following characters must be a dash,
  6889. // lowercase letter, or digit, except the last character, which cannot
  6890. // be a dash. For example, "webserver-frontend": "images". A label value
  6891. // can also be empty (e.g. "my-label": "").
  6892. Labels map[string]string `json:"labels,omitempty"`
  6893. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  6894. // unconditionally include in API requests. By default, fields with
  6895. // empty values are omitted from API requests. However, any non-pointer,
  6896. // non-interface field appearing in ForceSendFields will be sent to the
  6897. // server regardless of whether the field is empty or not. This may be
  6898. // used to include empty fields in Patch requests.
  6899. ForceSendFields []string `json:"-"`
  6900. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  6901. // include in API requests with the JSON null value. By default, fields
  6902. // with empty values are omitted from API requests. However, any field
  6903. // with an empty value appearing in NullFields will be sent to the
  6904. // server as null. It is an error if a field in this list has a
  6905. // non-empty value. This may be used to include null fields in Patch
  6906. // requests.
  6907. NullFields []string `json:"-"`
  6908. }
  6909. func (s *GlobalSetLabelsRequest) MarshalJSON() ([]byte, error) {
  6910. type NoMethod GlobalSetLabelsRequest
  6911. raw := NoMethod(*s)
  6912. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6913. }
  6914. type GlobalSetPolicyRequest struct {
  6915. // Bindings: Flatten Policy to create a backward compatible wire-format.
  6916. // Deprecated. Use 'policy' to specify bindings.
  6917. Bindings []*Binding `json:"bindings,omitempty"`
  6918. // Etag: Flatten Policy to create a backward compatible wire-format.
  6919. // Deprecated. Use 'policy' to specify the etag.
  6920. Etag string `json:"etag,omitempty"`
  6921. // Policy: REQUIRED: The complete policy to be applied to the
  6922. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  6923. // empty policy is in general a valid policy but certain services (like
  6924. // Projects) might reject them.
  6925. Policy *Policy `json:"policy,omitempty"`
  6926. // ForceSendFields is a list of field names (e.g. "Bindings") to
  6927. // unconditionally include in API requests. By default, fields with
  6928. // empty values are omitted from API requests. However, any non-pointer,
  6929. // non-interface field appearing in ForceSendFields will be sent to the
  6930. // server regardless of whether the field is empty or not. This may be
  6931. // used to include empty fields in Patch requests.
  6932. ForceSendFields []string `json:"-"`
  6933. // NullFields is a list of field names (e.g. "Bindings") to include in
  6934. // API requests with the JSON null value. By default, fields with empty
  6935. // values are omitted from API requests. However, any field with an
  6936. // empty value appearing in NullFields will be sent to the server as
  6937. // null. It is an error if a field in this list has a non-empty value.
  6938. // This may be used to include null fields in Patch requests.
  6939. NullFields []string `json:"-"`
  6940. }
  6941. func (s *GlobalSetPolicyRequest) MarshalJSON() ([]byte, error) {
  6942. type NoMethod GlobalSetPolicyRequest
  6943. raw := NoMethod(*s)
  6944. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6945. }
  6946. // GuestOsFeature: Guest OS features.
  6947. type GuestOsFeature struct {
  6948. // Type: The ID of a supported feature. Read Enabling guest operating
  6949. // system features to see a list of available options.
  6950. //
  6951. // Possible values:
  6952. // "FEATURE_TYPE_UNSPECIFIED"
  6953. // "MULTI_IP_SUBNET"
  6954. // "SECURE_BOOT"
  6955. // "UEFI_COMPATIBLE"
  6956. // "VIRTIO_SCSI_MULTIQUEUE"
  6957. // "WINDOWS"
  6958. Type string `json:"type,omitempty"`
  6959. // ForceSendFields is a list of field names (e.g. "Type") to
  6960. // unconditionally include in API requests. By default, fields with
  6961. // empty values are omitted from API requests. However, any non-pointer,
  6962. // non-interface field appearing in ForceSendFields will be sent to the
  6963. // server regardless of whether the field is empty or not. This may be
  6964. // used to include empty fields in Patch requests.
  6965. ForceSendFields []string `json:"-"`
  6966. // NullFields is a list of field names (e.g. "Type") to include in API
  6967. // requests with the JSON null value. By default, fields with empty
  6968. // values are omitted from API requests. However, any field with an
  6969. // empty value appearing in NullFields will be sent to the server as
  6970. // null. It is an error if a field in this list has a non-empty value.
  6971. // This may be used to include null fields in Patch requests.
  6972. NullFields []string `json:"-"`
  6973. }
  6974. func (s *GuestOsFeature) MarshalJSON() ([]byte, error) {
  6975. type NoMethod GuestOsFeature
  6976. raw := NoMethod(*s)
  6977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6978. }
  6979. type HTTP2HealthCheck struct {
  6980. // Host: The value of the host header in the HTTP/2 health check
  6981. // request. If left empty (default value), the IP on behalf of which
  6982. // this health check is performed will be used.
  6983. Host string `json:"host,omitempty"`
  6984. // Port: The TCP port number for the health check request. The default
  6985. // value is 443. Valid values are 1 through 65535.
  6986. Port int64 `json:"port,omitempty"`
  6987. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  6988. // both port and port_name are defined, port takes precedence.
  6989. PortName string `json:"portName,omitempty"`
  6990. // ProxyHeader: Specifies the type of proxy header to append before
  6991. // sending data to the backend, either NONE or PROXY_V1. The default is
  6992. // NONE.
  6993. //
  6994. // Possible values:
  6995. // "NONE"
  6996. // "PROXY_V1"
  6997. ProxyHeader string `json:"proxyHeader,omitempty"`
  6998. // RequestPath: The request path of the HTTP/2 health check request. The
  6999. // default value is /.
  7000. RequestPath string `json:"requestPath,omitempty"`
  7001. // Response: The string to match anywhere in the first 1024 bytes of the
  7002. // response body. If left empty (the default value), the status code
  7003. // determines health. The response data can only be ASCII.
  7004. Response string `json:"response,omitempty"`
  7005. // ForceSendFields is a list of field names (e.g. "Host") to
  7006. // unconditionally include in API requests. By default, fields with
  7007. // empty values are omitted from API requests. However, any non-pointer,
  7008. // non-interface field appearing in ForceSendFields will be sent to the
  7009. // server regardless of whether the field is empty or not. This may be
  7010. // used to include empty fields in Patch requests.
  7011. ForceSendFields []string `json:"-"`
  7012. // NullFields is a list of field names (e.g. "Host") to include in API
  7013. // requests with the JSON null value. By default, fields with empty
  7014. // values are omitted from API requests. However, any field with an
  7015. // empty value appearing in NullFields will be sent to the server as
  7016. // null. It is an error if a field in this list has a non-empty value.
  7017. // This may be used to include null fields in Patch requests.
  7018. NullFields []string `json:"-"`
  7019. }
  7020. func (s *HTTP2HealthCheck) MarshalJSON() ([]byte, error) {
  7021. type NoMethod HTTP2HealthCheck
  7022. raw := NoMethod(*s)
  7023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7024. }
  7025. type HTTPHealthCheck struct {
  7026. // Host: The value of the host header in the HTTP health check request.
  7027. // If left empty (default value), the IP on behalf of which this health
  7028. // check is performed will be used.
  7029. Host string `json:"host,omitempty"`
  7030. // Port: The TCP port number for the health check request. The default
  7031. // value is 80. Valid values are 1 through 65535.
  7032. Port int64 `json:"port,omitempty"`
  7033. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  7034. // both port and port_name are defined, port takes precedence.
  7035. PortName string `json:"portName,omitempty"`
  7036. // ProxyHeader: Specifies the type of proxy header to append before
  7037. // sending data to the backend, either NONE or PROXY_V1. The default is
  7038. // NONE.
  7039. //
  7040. // Possible values:
  7041. // "NONE"
  7042. // "PROXY_V1"
  7043. ProxyHeader string `json:"proxyHeader,omitempty"`
  7044. // RequestPath: The request path of the HTTP health check request. The
  7045. // default value is /.
  7046. RequestPath string `json:"requestPath,omitempty"`
  7047. // Response: The string to match anywhere in the first 1024 bytes of the
  7048. // response body. If left empty (the default value), the status code
  7049. // determines health. The response data can only be ASCII.
  7050. Response string `json:"response,omitempty"`
  7051. // ForceSendFields is a list of field names (e.g. "Host") to
  7052. // unconditionally include in API requests. By default, fields with
  7053. // empty values are omitted from API requests. However, any non-pointer,
  7054. // non-interface field appearing in ForceSendFields will be sent to the
  7055. // server regardless of whether the field is empty or not. This may be
  7056. // used to include empty fields in Patch requests.
  7057. ForceSendFields []string `json:"-"`
  7058. // NullFields is a list of field names (e.g. "Host") to include in API
  7059. // requests with the JSON null value. By default, fields with empty
  7060. // values are omitted from API requests. However, any field with an
  7061. // empty value appearing in NullFields will be sent to the server as
  7062. // null. It is an error if a field in this list has a non-empty value.
  7063. // This may be used to include null fields in Patch requests.
  7064. NullFields []string `json:"-"`
  7065. }
  7066. func (s *HTTPHealthCheck) MarshalJSON() ([]byte, error) {
  7067. type NoMethod HTTPHealthCheck
  7068. raw := NoMethod(*s)
  7069. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7070. }
  7071. type HTTPSHealthCheck struct {
  7072. // Host: The value of the host header in the HTTPS health check request.
  7073. // If left empty (default value), the IP on behalf of which this health
  7074. // check is performed will be used.
  7075. Host string `json:"host,omitempty"`
  7076. // Port: The TCP port number for the health check request. The default
  7077. // value is 443. Valid values are 1 through 65535.
  7078. Port int64 `json:"port,omitempty"`
  7079. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  7080. // both port and port_name are defined, port takes precedence.
  7081. PortName string `json:"portName,omitempty"`
  7082. // ProxyHeader: Specifies the type of proxy header to append before
  7083. // sending data to the backend, either NONE or PROXY_V1. The default is
  7084. // NONE.
  7085. //
  7086. // Possible values:
  7087. // "NONE"
  7088. // "PROXY_V1"
  7089. ProxyHeader string `json:"proxyHeader,omitempty"`
  7090. // RequestPath: The request path of the HTTPS health check request. The
  7091. // default value is /.
  7092. RequestPath string `json:"requestPath,omitempty"`
  7093. // Response: The string to match anywhere in the first 1024 bytes of the
  7094. // response body. If left empty (the default value), the status code
  7095. // determines health. The response data can only be ASCII.
  7096. Response string `json:"response,omitempty"`
  7097. // ForceSendFields is a list of field names (e.g. "Host") to
  7098. // unconditionally include in API requests. By default, fields with
  7099. // empty values are omitted from API requests. However, any non-pointer,
  7100. // non-interface field appearing in ForceSendFields will be sent to the
  7101. // server regardless of whether the field is empty or not. This may be
  7102. // used to include empty fields in Patch requests.
  7103. ForceSendFields []string `json:"-"`
  7104. // NullFields is a list of field names (e.g. "Host") to include in API
  7105. // requests with the JSON null value. By default, fields with empty
  7106. // values are omitted from API requests. However, any field with an
  7107. // empty value appearing in NullFields will be sent to the server as
  7108. // null. It is an error if a field in this list has a non-empty value.
  7109. // This may be used to include null fields in Patch requests.
  7110. NullFields []string `json:"-"`
  7111. }
  7112. func (s *HTTPSHealthCheck) MarshalJSON() ([]byte, error) {
  7113. type NoMethod HTTPSHealthCheck
  7114. raw := NoMethod(*s)
  7115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7116. }
  7117. // HealthCheck: An HealthCheck resource. This resource defines a
  7118. // template for how individual virtual machines should be checked for
  7119. // health, via one of the supported protocols.
  7120. type HealthCheck struct {
  7121. // CheckIntervalSec: How often (in seconds) to send a health check. The
  7122. // default value is 5 seconds.
  7123. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  7124. // CreationTimestamp: [Output Only] Creation timestamp in 3339 text
  7125. // format.
  7126. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7127. // Description: An optional description of this resource. Provide this
  7128. // property when you create the resource.
  7129. Description string `json:"description,omitempty"`
  7130. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  7131. // after this many consecutive successes. The default value is 2.
  7132. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  7133. Http2HealthCheck *HTTP2HealthCheck `json:"http2HealthCheck,omitempty"`
  7134. HttpHealthCheck *HTTPHealthCheck `json:"httpHealthCheck,omitempty"`
  7135. HttpsHealthCheck *HTTPSHealthCheck `json:"httpsHealthCheck,omitempty"`
  7136. // Id: [Output Only] The unique identifier for the resource. This
  7137. // identifier is defined by the server.
  7138. Id uint64 `json:"id,omitempty,string"`
  7139. // Kind: Type of the resource.
  7140. Kind string `json:"kind,omitempty"`
  7141. // Name: Name of the resource. Provided by the client when the resource
  7142. // is created. The name must be 1-63 characters long, and comply with
  7143. // RFC1035. Specifically, the name must be 1-63 characters long and
  7144. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7145. // the first character must be a lowercase letter, and all following
  7146. // characters must be a dash, lowercase letter, or digit, except the
  7147. // last character, which cannot be a dash.
  7148. Name string `json:"name,omitempty"`
  7149. // SelfLink: [Output Only] Server-defined URL for the resource.
  7150. SelfLink string `json:"selfLink,omitempty"`
  7151. SslHealthCheck *SSLHealthCheck `json:"sslHealthCheck,omitempty"`
  7152. TcpHealthCheck *TCPHealthCheck `json:"tcpHealthCheck,omitempty"`
  7153. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  7154. // The default value is 5 seconds. It is invalid for timeoutSec to have
  7155. // greater value than checkIntervalSec.
  7156. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  7157. // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP or
  7158. // HTTPS. If not specified, the default is TCP. Exactly one of the
  7159. // protocol-specific health check field must be specified, which must
  7160. // match type field.
  7161. //
  7162. // Possible values:
  7163. // "HTTP"
  7164. // "HTTP2"
  7165. // "HTTPS"
  7166. // "INVALID"
  7167. // "SSL"
  7168. // "TCP"
  7169. Type string `json:"type,omitempty"`
  7170. // UnhealthyThreshold: A so-far healthy instance will be marked
  7171. // unhealthy after this many consecutive failures. The default value is
  7172. // 2.
  7173. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  7174. // ServerResponse contains the HTTP response code and headers from the
  7175. // server.
  7176. googleapi.ServerResponse `json:"-"`
  7177. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  7178. // unconditionally include in API requests. By default, fields with
  7179. // empty values are omitted from API requests. However, any non-pointer,
  7180. // non-interface field appearing in ForceSendFields will be sent to the
  7181. // server regardless of whether the field is empty or not. This may be
  7182. // used to include empty fields in Patch requests.
  7183. ForceSendFields []string `json:"-"`
  7184. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  7185. // include in API requests with the JSON null value. By default, fields
  7186. // with empty values are omitted from API requests. However, any field
  7187. // with an empty value appearing in NullFields will be sent to the
  7188. // server as null. It is an error if a field in this list has a
  7189. // non-empty value. This may be used to include null fields in Patch
  7190. // requests.
  7191. NullFields []string `json:"-"`
  7192. }
  7193. func (s *HealthCheck) MarshalJSON() ([]byte, error) {
  7194. type NoMethod HealthCheck
  7195. raw := NoMethod(*s)
  7196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7197. }
  7198. // HealthCheckList: Contains a list of HealthCheck resources.
  7199. type HealthCheckList struct {
  7200. // Id: [Output Only] Unique identifier for the resource; defined by the
  7201. // server.
  7202. Id string `json:"id,omitempty"`
  7203. // Items: A list of HealthCheck resources.
  7204. Items []*HealthCheck `json:"items,omitempty"`
  7205. // Kind: Type of resource.
  7206. Kind string `json:"kind,omitempty"`
  7207. // NextPageToken: [Output Only] This token allows you to get the next
  7208. // page of results for list requests. If the number of results is larger
  7209. // than maxResults, use the nextPageToken as a value for the query
  7210. // parameter pageToken in the next list request. Subsequent list
  7211. // requests will have their own nextPageToken to continue paging through
  7212. // the results.
  7213. NextPageToken string `json:"nextPageToken,omitempty"`
  7214. // SelfLink: [Output Only] Server-defined URL for this resource.
  7215. SelfLink string `json:"selfLink,omitempty"`
  7216. // Warning: [Output Only] Informational warning message.
  7217. Warning *HealthCheckListWarning `json:"warning,omitempty"`
  7218. // ServerResponse contains the HTTP response code and headers from the
  7219. // server.
  7220. googleapi.ServerResponse `json:"-"`
  7221. // ForceSendFields is a list of field names (e.g. "Id") to
  7222. // unconditionally include in API requests. By default, fields with
  7223. // empty values are omitted from API requests. However, any non-pointer,
  7224. // non-interface field appearing in ForceSendFields will be sent to the
  7225. // server regardless of whether the field is empty or not. This may be
  7226. // used to include empty fields in Patch requests.
  7227. ForceSendFields []string `json:"-"`
  7228. // NullFields is a list of field names (e.g. "Id") to include in API
  7229. // requests with the JSON null value. By default, fields with empty
  7230. // values are omitted from API requests. However, any field with an
  7231. // empty value appearing in NullFields will be sent to the server as
  7232. // null. It is an error if a field in this list has a non-empty value.
  7233. // This may be used to include null fields in Patch requests.
  7234. NullFields []string `json:"-"`
  7235. }
  7236. func (s *HealthCheckList) MarshalJSON() ([]byte, error) {
  7237. type NoMethod HealthCheckList
  7238. raw := NoMethod(*s)
  7239. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7240. }
  7241. // HealthCheckListWarning: [Output Only] Informational warning message.
  7242. type HealthCheckListWarning struct {
  7243. // Code: [Output Only] A warning code, if applicable. For example,
  7244. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7245. // the response.
  7246. //
  7247. // Possible values:
  7248. // "CLEANUP_FAILED"
  7249. // "DEPRECATED_RESOURCE_USED"
  7250. // "DEPRECATED_TYPE_USED"
  7251. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7252. // "EXPERIMENTAL_TYPE_USED"
  7253. // "EXTERNAL_API_WARNING"
  7254. // "FIELD_VALUE_OVERRIDEN"
  7255. // "INJECTED_KERNELS_DEPRECATED"
  7256. // "MISSING_TYPE_DEPENDENCY"
  7257. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7258. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7259. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7260. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7261. // "NEXT_HOP_NOT_RUNNING"
  7262. // "NOT_CRITICAL_ERROR"
  7263. // "NO_RESULTS_ON_PAGE"
  7264. // "REQUIRED_TOS_AGREEMENT"
  7265. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7266. // "RESOURCE_NOT_DELETED"
  7267. // "SCHEMA_VALIDATION_IGNORED"
  7268. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7269. // "UNDECLARED_PROPERTIES"
  7270. // "UNREACHABLE"
  7271. Code string `json:"code,omitempty"`
  7272. // Data: [Output Only] Metadata about this warning in key: value format.
  7273. // For example:
  7274. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7275. Data []*HealthCheckListWarningData `json:"data,omitempty"`
  7276. // Message: [Output Only] A human-readable description of the warning
  7277. // code.
  7278. Message string `json:"message,omitempty"`
  7279. // ForceSendFields is a list of field names (e.g. "Code") to
  7280. // unconditionally include in API requests. By default, fields with
  7281. // empty values are omitted from API requests. However, any non-pointer,
  7282. // non-interface field appearing in ForceSendFields will be sent to the
  7283. // server regardless of whether the field is empty or not. This may be
  7284. // used to include empty fields in Patch requests.
  7285. ForceSendFields []string `json:"-"`
  7286. // NullFields is a list of field names (e.g. "Code") to include in API
  7287. // requests with the JSON null value. By default, fields with empty
  7288. // values are omitted from API requests. However, any field with an
  7289. // empty value appearing in NullFields will be sent to the server as
  7290. // null. It is an error if a field in this list has a non-empty value.
  7291. // This may be used to include null fields in Patch requests.
  7292. NullFields []string `json:"-"`
  7293. }
  7294. func (s *HealthCheckListWarning) MarshalJSON() ([]byte, error) {
  7295. type NoMethod HealthCheckListWarning
  7296. raw := NoMethod(*s)
  7297. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7298. }
  7299. type HealthCheckListWarningData struct {
  7300. // Key: [Output Only] A key that provides more detail on the warning
  7301. // being returned. For example, for warnings where there are no results
  7302. // in a list request for a particular zone, this key might be scope and
  7303. // the key value might be the zone name. Other examples might be a key
  7304. // indicating a deprecated resource and a suggested replacement, or a
  7305. // warning about invalid network settings (for example, if an instance
  7306. // attempts to perform IP forwarding but is not enabled for IP
  7307. // forwarding).
  7308. Key string `json:"key,omitempty"`
  7309. // Value: [Output Only] A warning data value corresponding to the key.
  7310. Value string `json:"value,omitempty"`
  7311. // ForceSendFields is a list of field names (e.g. "Key") to
  7312. // unconditionally include in API requests. By default, fields with
  7313. // empty values are omitted from API requests. However, any non-pointer,
  7314. // non-interface field appearing in ForceSendFields will be sent to the
  7315. // server regardless of whether the field is empty or not. This may be
  7316. // used to include empty fields in Patch requests.
  7317. ForceSendFields []string `json:"-"`
  7318. // NullFields is a list of field names (e.g. "Key") to include in API
  7319. // requests with the JSON null value. By default, fields with empty
  7320. // values are omitted from API requests. However, any field with an
  7321. // empty value appearing in NullFields will be sent to the server as
  7322. // null. It is an error if a field in this list has a non-empty value.
  7323. // This may be used to include null fields in Patch requests.
  7324. NullFields []string `json:"-"`
  7325. }
  7326. func (s *HealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  7327. type NoMethod HealthCheckListWarningData
  7328. raw := NoMethod(*s)
  7329. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7330. }
  7331. // HealthCheckReference: A full or valid partial URL to a health check.
  7332. // For example, the following are valid URLs:
  7333. // -
  7334. // https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check
  7335. // - projects/project-id/global/httpHealthChecks/health-check
  7336. // - global/httpHealthChecks/health-check
  7337. type HealthCheckReference struct {
  7338. HealthCheck string `json:"healthCheck,omitempty"`
  7339. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  7340. // unconditionally include in API requests. By default, fields with
  7341. // empty values are omitted from API requests. However, any non-pointer,
  7342. // non-interface field appearing in ForceSendFields will be sent to the
  7343. // server regardless of whether the field is empty or not. This may be
  7344. // used to include empty fields in Patch requests.
  7345. ForceSendFields []string `json:"-"`
  7346. // NullFields is a list of field names (e.g. "HealthCheck") to include
  7347. // in API requests with the JSON null value. By default, fields with
  7348. // empty values are omitted from API requests. However, any field with
  7349. // an empty value appearing in NullFields will be sent to the server as
  7350. // null. It is an error if a field in this list has a non-empty value.
  7351. // This may be used to include null fields in Patch requests.
  7352. NullFields []string `json:"-"`
  7353. }
  7354. func (s *HealthCheckReference) MarshalJSON() ([]byte, error) {
  7355. type NoMethod HealthCheckReference
  7356. raw := NoMethod(*s)
  7357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7358. }
  7359. type HealthStatus struct {
  7360. // HealthState: Health state of the instance.
  7361. //
  7362. // Possible values:
  7363. // "HEALTHY"
  7364. // "UNHEALTHY"
  7365. HealthState string `json:"healthState,omitempty"`
  7366. // Instance: URL of the instance resource.
  7367. Instance string `json:"instance,omitempty"`
  7368. // IpAddress: The IP address represented by this resource.
  7369. IpAddress string `json:"ipAddress,omitempty"`
  7370. // Port: The port on the instance.
  7371. Port int64 `json:"port,omitempty"`
  7372. // ForceSendFields is a list of field names (e.g. "HealthState") to
  7373. // unconditionally include in API requests. By default, fields with
  7374. // empty values are omitted from API requests. However, any non-pointer,
  7375. // non-interface field appearing in ForceSendFields will be sent to the
  7376. // server regardless of whether the field is empty or not. This may be
  7377. // used to include empty fields in Patch requests.
  7378. ForceSendFields []string `json:"-"`
  7379. // NullFields is a list of field names (e.g. "HealthState") to include
  7380. // in API requests with the JSON null value. By default, fields with
  7381. // empty values are omitted from API requests. However, any field with
  7382. // an empty value appearing in NullFields will be sent to the server as
  7383. // null. It is an error if a field in this list has a non-empty value.
  7384. // This may be used to include null fields in Patch requests.
  7385. NullFields []string `json:"-"`
  7386. }
  7387. func (s *HealthStatus) MarshalJSON() ([]byte, error) {
  7388. type NoMethod HealthStatus
  7389. raw := NoMethod(*s)
  7390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7391. }
  7392. // HostRule: UrlMaps A host-matching rule for a URL. If matched, will
  7393. // use the named PathMatcher to select the BackendService.
  7394. type HostRule struct {
  7395. // Description: An optional description of this resource. Provide this
  7396. // property when you create the resource.
  7397. Description string `json:"description,omitempty"`
  7398. // Hosts: The list of host patterns to match. They must be valid
  7399. // hostnames, except * will match any string of ([a-z0-9-.]*). In that
  7400. // case, * must be the first character and must be followed in the
  7401. // pattern by either - or ..
  7402. Hosts []string `json:"hosts,omitempty"`
  7403. // PathMatcher: The name of the PathMatcher to use to match the path
  7404. // portion of the URL if the hostRule matches the URL's host portion.
  7405. PathMatcher string `json:"pathMatcher,omitempty"`
  7406. // ForceSendFields is a list of field names (e.g. "Description") to
  7407. // unconditionally include in API requests. By default, fields with
  7408. // empty values are omitted from API requests. However, any non-pointer,
  7409. // non-interface field appearing in ForceSendFields will be sent to the
  7410. // server regardless of whether the field is empty or not. This may be
  7411. // used to include empty fields in Patch requests.
  7412. ForceSendFields []string `json:"-"`
  7413. // NullFields is a list of field names (e.g. "Description") to include
  7414. // in API requests with the JSON null value. By default, fields with
  7415. // empty values are omitted from API requests. However, any field with
  7416. // an empty value appearing in NullFields will be sent to the server as
  7417. // null. It is an error if a field in this list has a non-empty value.
  7418. // This may be used to include null fields in Patch requests.
  7419. NullFields []string `json:"-"`
  7420. }
  7421. func (s *HostRule) MarshalJSON() ([]byte, error) {
  7422. type NoMethod HostRule
  7423. raw := NoMethod(*s)
  7424. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7425. }
  7426. // HttpHealthCheck: An HttpHealthCheck resource. This resource defines a
  7427. // template for how individual instances should be checked for health,
  7428. // via HTTP.
  7429. type HttpHealthCheck struct {
  7430. // CheckIntervalSec: How often (in seconds) to send a health check. The
  7431. // default value is 5 seconds.
  7432. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  7433. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7434. // format.
  7435. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7436. // Description: An optional description of this resource. Provide this
  7437. // property when you create the resource.
  7438. Description string `json:"description,omitempty"`
  7439. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  7440. // after this many consecutive successes. The default value is 2.
  7441. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  7442. // Host: The value of the host header in the HTTP health check request.
  7443. // If left empty (default value), the public IP on behalf of which this
  7444. // health check is performed will be used.
  7445. Host string `json:"host,omitempty"`
  7446. // Id: [Output Only] The unique identifier for the resource. This
  7447. // identifier is defined by the server.
  7448. Id uint64 `json:"id,omitempty,string"`
  7449. // Kind: [Output Only] Type of the resource. Always
  7450. // compute#httpHealthCheck for HTTP health checks.
  7451. Kind string `json:"kind,omitempty"`
  7452. // Name: Name of the resource. Provided by the client when the resource
  7453. // is created. The name must be 1-63 characters long, and comply with
  7454. // RFC1035. Specifically, the name must be 1-63 characters long and
  7455. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7456. // the first character must be a lowercase letter, and all following
  7457. // characters must be a dash, lowercase letter, or digit, except the
  7458. // last character, which cannot be a dash.
  7459. Name string `json:"name,omitempty"`
  7460. // Port: The TCP port number for the HTTP health check request. The
  7461. // default value is 80.
  7462. Port int64 `json:"port,omitempty"`
  7463. // RequestPath: The request path of the HTTP health check request. The
  7464. // default value is /.
  7465. RequestPath string `json:"requestPath,omitempty"`
  7466. // SelfLink: [Output Only] Server-defined URL for the resource.
  7467. SelfLink string `json:"selfLink,omitempty"`
  7468. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  7469. // The default value is 5 seconds. It is invalid for timeoutSec to have
  7470. // greater value than checkIntervalSec.
  7471. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  7472. // UnhealthyThreshold: A so-far healthy instance will be marked
  7473. // unhealthy after this many consecutive failures. The default value is
  7474. // 2.
  7475. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  7476. // ServerResponse contains the HTTP response code and headers from the
  7477. // server.
  7478. googleapi.ServerResponse `json:"-"`
  7479. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  7480. // unconditionally include in API requests. By default, fields with
  7481. // empty values are omitted from API requests. However, any non-pointer,
  7482. // non-interface field appearing in ForceSendFields will be sent to the
  7483. // server regardless of whether the field is empty or not. This may be
  7484. // used to include empty fields in Patch requests.
  7485. ForceSendFields []string `json:"-"`
  7486. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  7487. // include in API requests with the JSON null value. By default, fields
  7488. // with empty values are omitted from API requests. However, any field
  7489. // with an empty value appearing in NullFields will be sent to the
  7490. // server as null. It is an error if a field in this list has a
  7491. // non-empty value. This may be used to include null fields in Patch
  7492. // requests.
  7493. NullFields []string `json:"-"`
  7494. }
  7495. func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) {
  7496. type NoMethod HttpHealthCheck
  7497. raw := NoMethod(*s)
  7498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7499. }
  7500. // HttpHealthCheckList: Contains a list of HttpHealthCheck resources.
  7501. type HttpHealthCheckList struct {
  7502. // Id: [Output Only] Unique identifier for the resource; defined by the
  7503. // server.
  7504. Id string `json:"id,omitempty"`
  7505. // Items: A list of HttpHealthCheck resources.
  7506. Items []*HttpHealthCheck `json:"items,omitempty"`
  7507. // Kind: Type of resource.
  7508. Kind string `json:"kind,omitempty"`
  7509. // NextPageToken: [Output Only] This token allows you to get the next
  7510. // page of results for list requests. If the number of results is larger
  7511. // than maxResults, use the nextPageToken as a value for the query
  7512. // parameter pageToken in the next list request. Subsequent list
  7513. // requests will have their own nextPageToken to continue paging through
  7514. // the results.
  7515. NextPageToken string `json:"nextPageToken,omitempty"`
  7516. // SelfLink: [Output Only] Server-defined URL for this resource.
  7517. SelfLink string `json:"selfLink,omitempty"`
  7518. // Warning: [Output Only] Informational warning message.
  7519. Warning *HttpHealthCheckListWarning `json:"warning,omitempty"`
  7520. // ServerResponse contains the HTTP response code and headers from the
  7521. // server.
  7522. googleapi.ServerResponse `json:"-"`
  7523. // ForceSendFields is a list of field names (e.g. "Id") to
  7524. // unconditionally include in API requests. By default, fields with
  7525. // empty values are omitted from API requests. However, any non-pointer,
  7526. // non-interface field appearing in ForceSendFields will be sent to the
  7527. // server regardless of whether the field is empty or not. This may be
  7528. // used to include empty fields in Patch requests.
  7529. ForceSendFields []string `json:"-"`
  7530. // NullFields is a list of field names (e.g. "Id") to include in API
  7531. // requests with the JSON null value. By default, fields with empty
  7532. // values are omitted from API requests. However, any field with an
  7533. // empty value appearing in NullFields will be sent to the server as
  7534. // null. It is an error if a field in this list has a non-empty value.
  7535. // This may be used to include null fields in Patch requests.
  7536. NullFields []string `json:"-"`
  7537. }
  7538. func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) {
  7539. type NoMethod HttpHealthCheckList
  7540. raw := NoMethod(*s)
  7541. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7542. }
  7543. // HttpHealthCheckListWarning: [Output Only] Informational warning
  7544. // message.
  7545. type HttpHealthCheckListWarning struct {
  7546. // Code: [Output Only] A warning code, if applicable. For example,
  7547. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7548. // the response.
  7549. //
  7550. // Possible values:
  7551. // "CLEANUP_FAILED"
  7552. // "DEPRECATED_RESOURCE_USED"
  7553. // "DEPRECATED_TYPE_USED"
  7554. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7555. // "EXPERIMENTAL_TYPE_USED"
  7556. // "EXTERNAL_API_WARNING"
  7557. // "FIELD_VALUE_OVERRIDEN"
  7558. // "INJECTED_KERNELS_DEPRECATED"
  7559. // "MISSING_TYPE_DEPENDENCY"
  7560. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7561. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7562. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7563. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7564. // "NEXT_HOP_NOT_RUNNING"
  7565. // "NOT_CRITICAL_ERROR"
  7566. // "NO_RESULTS_ON_PAGE"
  7567. // "REQUIRED_TOS_AGREEMENT"
  7568. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7569. // "RESOURCE_NOT_DELETED"
  7570. // "SCHEMA_VALIDATION_IGNORED"
  7571. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7572. // "UNDECLARED_PROPERTIES"
  7573. // "UNREACHABLE"
  7574. Code string `json:"code,omitempty"`
  7575. // Data: [Output Only] Metadata about this warning in key: value format.
  7576. // For example:
  7577. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7578. Data []*HttpHealthCheckListWarningData `json:"data,omitempty"`
  7579. // Message: [Output Only] A human-readable description of the warning
  7580. // code.
  7581. Message string `json:"message,omitempty"`
  7582. // ForceSendFields is a list of field names (e.g. "Code") to
  7583. // unconditionally include in API requests. By default, fields with
  7584. // empty values are omitted from API requests. However, any non-pointer,
  7585. // non-interface field appearing in ForceSendFields will be sent to the
  7586. // server regardless of whether the field is empty or not. This may be
  7587. // used to include empty fields in Patch requests.
  7588. ForceSendFields []string `json:"-"`
  7589. // NullFields is a list of field names (e.g. "Code") to include in API
  7590. // requests with the JSON null value. By default, fields with empty
  7591. // values are omitted from API requests. However, any field with an
  7592. // empty value appearing in NullFields will be sent to the server as
  7593. // null. It is an error if a field in this list has a non-empty value.
  7594. // This may be used to include null fields in Patch requests.
  7595. NullFields []string `json:"-"`
  7596. }
  7597. func (s *HttpHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  7598. type NoMethod HttpHealthCheckListWarning
  7599. raw := NoMethod(*s)
  7600. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7601. }
  7602. type HttpHealthCheckListWarningData struct {
  7603. // Key: [Output Only] A key that provides more detail on the warning
  7604. // being returned. For example, for warnings where there are no results
  7605. // in a list request for a particular zone, this key might be scope and
  7606. // the key value might be the zone name. Other examples might be a key
  7607. // indicating a deprecated resource and a suggested replacement, or a
  7608. // warning about invalid network settings (for example, if an instance
  7609. // attempts to perform IP forwarding but is not enabled for IP
  7610. // forwarding).
  7611. Key string `json:"key,omitempty"`
  7612. // Value: [Output Only] A warning data value corresponding to the key.
  7613. Value string `json:"value,omitempty"`
  7614. // ForceSendFields is a list of field names (e.g. "Key") to
  7615. // unconditionally include in API requests. By default, fields with
  7616. // empty values are omitted from API requests. However, any non-pointer,
  7617. // non-interface field appearing in ForceSendFields will be sent to the
  7618. // server regardless of whether the field is empty or not. This may be
  7619. // used to include empty fields in Patch requests.
  7620. ForceSendFields []string `json:"-"`
  7621. // NullFields is a list of field names (e.g. "Key") to include in API
  7622. // requests with the JSON null value. By default, fields with empty
  7623. // values are omitted from API requests. However, any field with an
  7624. // empty value appearing in NullFields will be sent to the server as
  7625. // null. It is an error if a field in this list has a non-empty value.
  7626. // This may be used to include null fields in Patch requests.
  7627. NullFields []string `json:"-"`
  7628. }
  7629. func (s *HttpHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  7630. type NoMethod HttpHealthCheckListWarningData
  7631. raw := NoMethod(*s)
  7632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7633. }
  7634. // HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines
  7635. // a template for how individual instances should be checked for health,
  7636. // via HTTPS.
  7637. type HttpsHealthCheck struct {
  7638. // CheckIntervalSec: How often (in seconds) to send a health check. The
  7639. // default value is 5 seconds.
  7640. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  7641. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7642. // format.
  7643. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7644. // Description: An optional description of this resource. Provide this
  7645. // property when you create the resource.
  7646. Description string `json:"description,omitempty"`
  7647. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  7648. // after this many consecutive successes. The default value is 2.
  7649. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  7650. // Host: The value of the host header in the HTTPS health check request.
  7651. // If left empty (default value), the public IP on behalf of which this
  7652. // health check is performed will be used.
  7653. Host string `json:"host,omitempty"`
  7654. // Id: [Output Only] The unique identifier for the resource. This
  7655. // identifier is defined by the server.
  7656. Id uint64 `json:"id,omitempty,string"`
  7657. // Kind: Type of the resource.
  7658. Kind string `json:"kind,omitempty"`
  7659. // Name: Name of the resource. Provided by the client when the resource
  7660. // is created. The name must be 1-63 characters long, and comply with
  7661. // RFC1035. Specifically, the name must be 1-63 characters long and
  7662. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7663. // the first character must be a lowercase letter, and all following
  7664. // characters must be a dash, lowercase letter, or digit, except the
  7665. // last character, which cannot be a dash.
  7666. Name string `json:"name,omitempty"`
  7667. // Port: The TCP port number for the HTTPS health check request. The
  7668. // default value is 443.
  7669. Port int64 `json:"port,omitempty"`
  7670. // RequestPath: The request path of the HTTPS health check request. The
  7671. // default value is "/".
  7672. RequestPath string `json:"requestPath,omitempty"`
  7673. // SelfLink: [Output Only] Server-defined URL for the resource.
  7674. SelfLink string `json:"selfLink,omitempty"`
  7675. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  7676. // The default value is 5 seconds. It is invalid for timeoutSec to have
  7677. // a greater value than checkIntervalSec.
  7678. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  7679. // UnhealthyThreshold: A so-far healthy instance will be marked
  7680. // unhealthy after this many consecutive failures. The default value is
  7681. // 2.
  7682. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  7683. // ServerResponse contains the HTTP response code and headers from the
  7684. // server.
  7685. googleapi.ServerResponse `json:"-"`
  7686. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  7687. // unconditionally include in API requests. By default, fields with
  7688. // empty values are omitted from API requests. However, any non-pointer,
  7689. // non-interface field appearing in ForceSendFields will be sent to the
  7690. // server regardless of whether the field is empty or not. This may be
  7691. // used to include empty fields in Patch requests.
  7692. ForceSendFields []string `json:"-"`
  7693. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  7694. // include in API requests with the JSON null value. By default, fields
  7695. // with empty values are omitted from API requests. However, any field
  7696. // with an empty value appearing in NullFields will be sent to the
  7697. // server as null. It is an error if a field in this list has a
  7698. // non-empty value. This may be used to include null fields in Patch
  7699. // requests.
  7700. NullFields []string `json:"-"`
  7701. }
  7702. func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) {
  7703. type NoMethod HttpsHealthCheck
  7704. raw := NoMethod(*s)
  7705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7706. }
  7707. // HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources.
  7708. type HttpsHealthCheckList struct {
  7709. // Id: [Output Only] Unique identifier for the resource; defined by the
  7710. // server.
  7711. Id string `json:"id,omitempty"`
  7712. // Items: A list of HttpsHealthCheck resources.
  7713. Items []*HttpsHealthCheck `json:"items,omitempty"`
  7714. // Kind: Type of resource.
  7715. Kind string `json:"kind,omitempty"`
  7716. // NextPageToken: [Output Only] This token allows you to get the next
  7717. // page of results for list requests. If the number of results is larger
  7718. // than maxResults, use the nextPageToken as a value for the query
  7719. // parameter pageToken in the next list request. Subsequent list
  7720. // requests will have their own nextPageToken to continue paging through
  7721. // the results.
  7722. NextPageToken string `json:"nextPageToken,omitempty"`
  7723. // SelfLink: [Output Only] Server-defined URL for this resource.
  7724. SelfLink string `json:"selfLink,omitempty"`
  7725. // Warning: [Output Only] Informational warning message.
  7726. Warning *HttpsHealthCheckListWarning `json:"warning,omitempty"`
  7727. // ServerResponse contains the HTTP response code and headers from the
  7728. // server.
  7729. googleapi.ServerResponse `json:"-"`
  7730. // ForceSendFields is a list of field names (e.g. "Id") to
  7731. // unconditionally include in API requests. By default, fields with
  7732. // empty values are omitted from API requests. However, any non-pointer,
  7733. // non-interface field appearing in ForceSendFields will be sent to the
  7734. // server regardless of whether the field is empty or not. This may be
  7735. // used to include empty fields in Patch requests.
  7736. ForceSendFields []string `json:"-"`
  7737. // NullFields is a list of field names (e.g. "Id") to include in API
  7738. // requests with the JSON null value. By default, fields with empty
  7739. // values are omitted from API requests. However, any field with an
  7740. // empty value appearing in NullFields will be sent to the server as
  7741. // null. It is an error if a field in this list has a non-empty value.
  7742. // This may be used to include null fields in Patch requests.
  7743. NullFields []string `json:"-"`
  7744. }
  7745. func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
  7746. type NoMethod HttpsHealthCheckList
  7747. raw := NoMethod(*s)
  7748. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7749. }
  7750. // HttpsHealthCheckListWarning: [Output Only] Informational warning
  7751. // message.
  7752. type HttpsHealthCheckListWarning struct {
  7753. // Code: [Output Only] A warning code, if applicable. For example,
  7754. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7755. // the response.
  7756. //
  7757. // Possible values:
  7758. // "CLEANUP_FAILED"
  7759. // "DEPRECATED_RESOURCE_USED"
  7760. // "DEPRECATED_TYPE_USED"
  7761. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7762. // "EXPERIMENTAL_TYPE_USED"
  7763. // "EXTERNAL_API_WARNING"
  7764. // "FIELD_VALUE_OVERRIDEN"
  7765. // "INJECTED_KERNELS_DEPRECATED"
  7766. // "MISSING_TYPE_DEPENDENCY"
  7767. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7768. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7769. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7770. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7771. // "NEXT_HOP_NOT_RUNNING"
  7772. // "NOT_CRITICAL_ERROR"
  7773. // "NO_RESULTS_ON_PAGE"
  7774. // "REQUIRED_TOS_AGREEMENT"
  7775. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7776. // "RESOURCE_NOT_DELETED"
  7777. // "SCHEMA_VALIDATION_IGNORED"
  7778. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7779. // "UNDECLARED_PROPERTIES"
  7780. // "UNREACHABLE"
  7781. Code string `json:"code,omitempty"`
  7782. // Data: [Output Only] Metadata about this warning in key: value format.
  7783. // For example:
  7784. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7785. Data []*HttpsHealthCheckListWarningData `json:"data,omitempty"`
  7786. // Message: [Output Only] A human-readable description of the warning
  7787. // code.
  7788. Message string `json:"message,omitempty"`
  7789. // ForceSendFields is a list of field names (e.g. "Code") to
  7790. // unconditionally include in API requests. By default, fields with
  7791. // empty values are omitted from API requests. However, any non-pointer,
  7792. // non-interface field appearing in ForceSendFields will be sent to the
  7793. // server regardless of whether the field is empty or not. This may be
  7794. // used to include empty fields in Patch requests.
  7795. ForceSendFields []string `json:"-"`
  7796. // NullFields is a list of field names (e.g. "Code") to include in API
  7797. // requests with the JSON null value. By default, fields with empty
  7798. // values are omitted from API requests. However, any field with an
  7799. // empty value appearing in NullFields will be sent to the server as
  7800. // null. It is an error if a field in this list has a non-empty value.
  7801. // This may be used to include null fields in Patch requests.
  7802. NullFields []string `json:"-"`
  7803. }
  7804. func (s *HttpsHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  7805. type NoMethod HttpsHealthCheckListWarning
  7806. raw := NoMethod(*s)
  7807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7808. }
  7809. type HttpsHealthCheckListWarningData struct {
  7810. // Key: [Output Only] A key that provides more detail on the warning
  7811. // being returned. For example, for warnings where there are no results
  7812. // in a list request for a particular zone, this key might be scope and
  7813. // the key value might be the zone name. Other examples might be a key
  7814. // indicating a deprecated resource and a suggested replacement, or a
  7815. // warning about invalid network settings (for example, if an instance
  7816. // attempts to perform IP forwarding but is not enabled for IP
  7817. // forwarding).
  7818. Key string `json:"key,omitempty"`
  7819. // Value: [Output Only] A warning data value corresponding to the key.
  7820. Value string `json:"value,omitempty"`
  7821. // ForceSendFields is a list of field names (e.g. "Key") to
  7822. // unconditionally include in API requests. By default, fields with
  7823. // empty values are omitted from API requests. However, any non-pointer,
  7824. // non-interface field appearing in ForceSendFields will be sent to the
  7825. // server regardless of whether the field is empty or not. This may be
  7826. // used to include empty fields in Patch requests.
  7827. ForceSendFields []string `json:"-"`
  7828. // NullFields is a list of field names (e.g. "Key") to include in API
  7829. // requests with the JSON null value. By default, fields with empty
  7830. // values are omitted from API requests. However, any field with an
  7831. // empty value appearing in NullFields will be sent to the server as
  7832. // null. It is an error if a field in this list has a non-empty value.
  7833. // This may be used to include null fields in Patch requests.
  7834. NullFields []string `json:"-"`
  7835. }
  7836. func (s *HttpsHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  7837. type NoMethod HttpsHealthCheckListWarningData
  7838. raw := NoMethod(*s)
  7839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7840. }
  7841. // Image: An Image resource. (== resource_for beta.images ==) (==
  7842. // resource_for v1.images ==)
  7843. type Image struct {
  7844. // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
  7845. // Cloud Storage (in bytes).
  7846. ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"`
  7847. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7848. // format.
  7849. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7850. // Deprecated: The deprecation status associated with this image.
  7851. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  7852. // Description: An optional description of this resource. Provide this
  7853. // property when you create the resource.
  7854. Description string `json:"description,omitempty"`
  7855. // DiskSizeGb: Size of the image when restored onto a persistent disk
  7856. // (in GB).
  7857. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  7858. // Family: The name of the image family to which this image belongs. You
  7859. // can create disks by specifying an image family instead of a specific
  7860. // image name. The image family always returns its latest image that is
  7861. // not deprecated. The name of the image family must comply with
  7862. // RFC1035.
  7863. Family string `json:"family,omitempty"`
  7864. // GuestOsFeatures: A list of features to enable on the guest operating
  7865. // system. Applicable only for bootable images. Read Enabling guest
  7866. // operating system features to see a list of available options.
  7867. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  7868. // Id: [Output Only] The unique identifier for the resource. This
  7869. // identifier is defined by the server.
  7870. Id uint64 `json:"id,omitempty,string"`
  7871. // ImageEncryptionKey: Encrypts the image using a customer-supplied
  7872. // encryption key.
  7873. //
  7874. // After you encrypt an image with a customer-supplied key, you must
  7875. // provide the same key if you use the image later (e.g. to create a
  7876. // disk from the image).
  7877. //
  7878. // Customer-supplied encryption keys do not protect access to metadata
  7879. // of the disk.
  7880. //
  7881. // If you do not provide an encryption key when creating the image, then
  7882. // the disk will be encrypted using an automatically generated key and
  7883. // you do not need to provide a key to use the image later.
  7884. ImageEncryptionKey *CustomerEncryptionKey `json:"imageEncryptionKey,omitempty"`
  7885. // Kind: [Output Only] Type of the resource. Always compute#image for
  7886. // images.
  7887. Kind string `json:"kind,omitempty"`
  7888. // LabelFingerprint: A fingerprint for the labels being applied to this
  7889. // image, which is essentially a hash of the labels used for optimistic
  7890. // locking. The fingerprint is initially generated by Compute Engine and
  7891. // changes after every request to modify or update labels. You must
  7892. // always provide an up-to-date fingerprint hash in order to update or
  7893. // change labels, otherwise the request will fail with error 412
  7894. // conditionNotMet.
  7895. //
  7896. // To see the latest fingerprint, make a get() request to retrieve an
  7897. // image.
  7898. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  7899. // Labels: Labels to apply to this image. These can be later modified by
  7900. // the setLabels method.
  7901. Labels map[string]string `json:"labels,omitempty"`
  7902. // LicenseCodes: Integer license codes indicating which licenses are
  7903. // attached to this image.
  7904. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  7905. // Licenses: Any applicable license URI.
  7906. Licenses []string `json:"licenses,omitempty"`
  7907. // Name: Name of the resource; provided by the client when the resource
  7908. // is created. The name must be 1-63 characters long, and comply with
  7909. // RFC1035. Specifically, the name must be 1-63 characters long and
  7910. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7911. // the first character must be a lowercase letter, and all following
  7912. // characters must be a dash, lowercase letter, or digit, except the
  7913. // last character, which cannot be a dash.
  7914. Name string `json:"name,omitempty"`
  7915. // RawDisk: The parameters of the raw disk image.
  7916. RawDisk *ImageRawDisk `json:"rawDisk,omitempty"`
  7917. // SelfLink: [Output Only] Server-defined URL for the resource.
  7918. SelfLink string `json:"selfLink,omitempty"`
  7919. // SourceDisk: URL of the source disk used to create this image. This
  7920. // can be a full or valid partial URL. You must provide either this
  7921. // property or the rawDisk.source property but not both to create an
  7922. // image. For example, the following are valid values:
  7923. // -
  7924. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  7925. // - projects/project/zones/zone/disks/disk
  7926. // - zones/zone/disks/disk
  7927. SourceDisk string `json:"sourceDisk,omitempty"`
  7928. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  7929. // source disk. Required if the source disk is protected by a
  7930. // customer-supplied encryption key.
  7931. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  7932. // SourceDiskId: [Output Only] The ID value of the disk used to create
  7933. // this image. This value may be used to determine whether the image was
  7934. // taken from the current or a previous instance of a given disk name.
  7935. SourceDiskId string `json:"sourceDiskId,omitempty"`
  7936. // SourceImage: URL of the source image used to create this image. This
  7937. // can be a full or valid partial URL. You must provide exactly one of:
  7938. //
  7939. // - this property, or
  7940. // - the rawDisk.source property, or
  7941. // - the sourceDisk property in order to create an image.
  7942. SourceImage string `json:"sourceImage,omitempty"`
  7943. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  7944. // source image. Required if the source image is protected by a
  7945. // customer-supplied encryption key.
  7946. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  7947. // SourceImageId: [Output Only] The ID value of the image used to create
  7948. // this image. This value may be used to determine whether the image was
  7949. // taken from the current or a previous instance of a given image name.
  7950. SourceImageId string `json:"sourceImageId,omitempty"`
  7951. // SourceSnapshot: URL of the source snapshot used to create this image.
  7952. // This can be a full or valid partial URL. You must provide exactly one
  7953. // of:
  7954. // - this property, or
  7955. // - the sourceImage property, or
  7956. // - the rawDisk.source property, or
  7957. // - the sourceDisk property in order to create an image.
  7958. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  7959. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  7960. // the source snapshot. Required if the source snapshot is protected by
  7961. // a customer-supplied encryption key.
  7962. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  7963. // SourceSnapshotId: [Output Only] The ID value of the snapshot used to
  7964. // create this image. This value may be used to determine whether the
  7965. // snapshot was taken from the current or a previous instance of a given
  7966. // snapshot name.
  7967. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  7968. // SourceType: The type of the image used to create this disk. The
  7969. // default and only value is RAW
  7970. //
  7971. // Possible values:
  7972. // "RAW" (default)
  7973. SourceType string `json:"sourceType,omitempty"`
  7974. // Status: [Output Only] The status of the image. An image can be used
  7975. // to create other resources, such as instances, only after the image
  7976. // has been successfully created and the status is set to READY.
  7977. // Possible values are FAILED, PENDING, or READY.
  7978. //
  7979. // Possible values:
  7980. // "DELETING"
  7981. // "FAILED"
  7982. // "PENDING"
  7983. // "READY"
  7984. Status string `json:"status,omitempty"`
  7985. // ServerResponse contains the HTTP response code and headers from the
  7986. // server.
  7987. googleapi.ServerResponse `json:"-"`
  7988. // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to
  7989. // unconditionally include in API requests. By default, fields with
  7990. // empty values are omitted from API requests. However, any non-pointer,
  7991. // non-interface field appearing in ForceSendFields will be sent to the
  7992. // server regardless of whether the field is empty or not. This may be
  7993. // used to include empty fields in Patch requests.
  7994. ForceSendFields []string `json:"-"`
  7995. // NullFields is a list of field names (e.g. "ArchiveSizeBytes") to
  7996. // include in API requests with the JSON null value. By default, fields
  7997. // with empty values are omitted from API requests. However, any field
  7998. // with an empty value appearing in NullFields will be sent to the
  7999. // server as null. It is an error if a field in this list has a
  8000. // non-empty value. This may be used to include null fields in Patch
  8001. // requests.
  8002. NullFields []string `json:"-"`
  8003. }
  8004. func (s *Image) MarshalJSON() ([]byte, error) {
  8005. type NoMethod Image
  8006. raw := NoMethod(*s)
  8007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8008. }
  8009. // ImageRawDisk: The parameters of the raw disk image.
  8010. type ImageRawDisk struct {
  8011. // ContainerType: The format used to encode and transmit the block
  8012. // device, which should be TAR. This is just a container and
  8013. // transmission format and not a runtime format. Provided by the client
  8014. // when the disk image is created.
  8015. //
  8016. // Possible values:
  8017. // "TAR"
  8018. ContainerType string `json:"containerType,omitempty"`
  8019. // Sha1Checksum: An optional SHA1 checksum of the disk image before
  8020. // unpackaging provided by the client when the disk image is created.
  8021. Sha1Checksum string `json:"sha1Checksum,omitempty"`
  8022. // Source: The full Google Cloud Storage URL where the disk image is
  8023. // stored. You must provide either this property or the sourceDisk
  8024. // property but not both.
  8025. Source string `json:"source,omitempty"`
  8026. // ForceSendFields is a list of field names (e.g. "ContainerType") to
  8027. // unconditionally include in API requests. By default, fields with
  8028. // empty values are omitted from API requests. However, any non-pointer,
  8029. // non-interface field appearing in ForceSendFields will be sent to the
  8030. // server regardless of whether the field is empty or not. This may be
  8031. // used to include empty fields in Patch requests.
  8032. ForceSendFields []string `json:"-"`
  8033. // NullFields is a list of field names (e.g. "ContainerType") to include
  8034. // in API requests with the JSON null value. By default, fields with
  8035. // empty values are omitted from API requests. However, any field with
  8036. // an empty value appearing in NullFields will be sent to the server as
  8037. // null. It is an error if a field in this list has a non-empty value.
  8038. // This may be used to include null fields in Patch requests.
  8039. NullFields []string `json:"-"`
  8040. }
  8041. func (s *ImageRawDisk) MarshalJSON() ([]byte, error) {
  8042. type NoMethod ImageRawDisk
  8043. raw := NoMethod(*s)
  8044. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8045. }
  8046. // ImageList: Contains a list of images.
  8047. type ImageList struct {
  8048. // Id: [Output Only] Unique identifier for the resource; defined by the
  8049. // server.
  8050. Id string `json:"id,omitempty"`
  8051. // Items: A list of Image resources.
  8052. Items []*Image `json:"items,omitempty"`
  8053. // Kind: Type of resource.
  8054. Kind string `json:"kind,omitempty"`
  8055. // NextPageToken: [Output Only] This token allows you to get the next
  8056. // page of results for list requests. If the number of results is larger
  8057. // than maxResults, use the nextPageToken as a value for the query
  8058. // parameter pageToken in the next list request. Subsequent list
  8059. // requests will have their own nextPageToken to continue paging through
  8060. // the results.
  8061. NextPageToken string `json:"nextPageToken,omitempty"`
  8062. // SelfLink: [Output Only] Server-defined URL for this resource.
  8063. SelfLink string `json:"selfLink,omitempty"`
  8064. // Warning: [Output Only] Informational warning message.
  8065. Warning *ImageListWarning `json:"warning,omitempty"`
  8066. // ServerResponse contains the HTTP response code and headers from the
  8067. // server.
  8068. googleapi.ServerResponse `json:"-"`
  8069. // ForceSendFields is a list of field names (e.g. "Id") to
  8070. // unconditionally include in API requests. By default, fields with
  8071. // empty values are omitted from API requests. However, any non-pointer,
  8072. // non-interface field appearing in ForceSendFields will be sent to the
  8073. // server regardless of whether the field is empty or not. This may be
  8074. // used to include empty fields in Patch requests.
  8075. ForceSendFields []string `json:"-"`
  8076. // NullFields is a list of field names (e.g. "Id") to include in API
  8077. // requests with the JSON null value. By default, fields with empty
  8078. // values are omitted from API requests. However, any field with an
  8079. // empty value appearing in NullFields will be sent to the server as
  8080. // null. It is an error if a field in this list has a non-empty value.
  8081. // This may be used to include null fields in Patch requests.
  8082. NullFields []string `json:"-"`
  8083. }
  8084. func (s *ImageList) MarshalJSON() ([]byte, error) {
  8085. type NoMethod ImageList
  8086. raw := NoMethod(*s)
  8087. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8088. }
  8089. // ImageListWarning: [Output Only] Informational warning message.
  8090. type ImageListWarning struct {
  8091. // Code: [Output Only] A warning code, if applicable. For example,
  8092. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8093. // the response.
  8094. //
  8095. // Possible values:
  8096. // "CLEANUP_FAILED"
  8097. // "DEPRECATED_RESOURCE_USED"
  8098. // "DEPRECATED_TYPE_USED"
  8099. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8100. // "EXPERIMENTAL_TYPE_USED"
  8101. // "EXTERNAL_API_WARNING"
  8102. // "FIELD_VALUE_OVERRIDEN"
  8103. // "INJECTED_KERNELS_DEPRECATED"
  8104. // "MISSING_TYPE_DEPENDENCY"
  8105. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8106. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8107. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8108. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8109. // "NEXT_HOP_NOT_RUNNING"
  8110. // "NOT_CRITICAL_ERROR"
  8111. // "NO_RESULTS_ON_PAGE"
  8112. // "REQUIRED_TOS_AGREEMENT"
  8113. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8114. // "RESOURCE_NOT_DELETED"
  8115. // "SCHEMA_VALIDATION_IGNORED"
  8116. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8117. // "UNDECLARED_PROPERTIES"
  8118. // "UNREACHABLE"
  8119. Code string `json:"code,omitempty"`
  8120. // Data: [Output Only] Metadata about this warning in key: value format.
  8121. // For example:
  8122. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8123. Data []*ImageListWarningData `json:"data,omitempty"`
  8124. // Message: [Output Only] A human-readable description of the warning
  8125. // code.
  8126. Message string `json:"message,omitempty"`
  8127. // ForceSendFields is a list of field names (e.g. "Code") to
  8128. // unconditionally include in API requests. By default, fields with
  8129. // empty values are omitted from API requests. However, any non-pointer,
  8130. // non-interface field appearing in ForceSendFields will be sent to the
  8131. // server regardless of whether the field is empty or not. This may be
  8132. // used to include empty fields in Patch requests.
  8133. ForceSendFields []string `json:"-"`
  8134. // NullFields is a list of field names (e.g. "Code") to include in API
  8135. // requests with the JSON null value. By default, fields with empty
  8136. // values are omitted from API requests. However, any field with an
  8137. // empty value appearing in NullFields will be sent to the server as
  8138. // null. It is an error if a field in this list has a non-empty value.
  8139. // This may be used to include null fields in Patch requests.
  8140. NullFields []string `json:"-"`
  8141. }
  8142. func (s *ImageListWarning) MarshalJSON() ([]byte, error) {
  8143. type NoMethod ImageListWarning
  8144. raw := NoMethod(*s)
  8145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8146. }
  8147. type ImageListWarningData struct {
  8148. // Key: [Output Only] A key that provides more detail on the warning
  8149. // being returned. For example, for warnings where there are no results
  8150. // in a list request for a particular zone, this key might be scope and
  8151. // the key value might be the zone name. Other examples might be a key
  8152. // indicating a deprecated resource and a suggested replacement, or a
  8153. // warning about invalid network settings (for example, if an instance
  8154. // attempts to perform IP forwarding but is not enabled for IP
  8155. // forwarding).
  8156. Key string `json:"key,omitempty"`
  8157. // Value: [Output Only] A warning data value corresponding to the key.
  8158. Value string `json:"value,omitempty"`
  8159. // ForceSendFields is a list of field names (e.g. "Key") to
  8160. // unconditionally include in API requests. By default, fields with
  8161. // empty values are omitted from API requests. However, any non-pointer,
  8162. // non-interface field appearing in ForceSendFields will be sent to the
  8163. // server regardless of whether the field is empty or not. This may be
  8164. // used to include empty fields in Patch requests.
  8165. ForceSendFields []string `json:"-"`
  8166. // NullFields is a list of field names (e.g. "Key") to include in API
  8167. // requests with the JSON null value. By default, fields with empty
  8168. // values are omitted from API requests. However, any field with an
  8169. // empty value appearing in NullFields will be sent to the server as
  8170. // null. It is an error if a field in this list has a non-empty value.
  8171. // This may be used to include null fields in Patch requests.
  8172. NullFields []string `json:"-"`
  8173. }
  8174. func (s *ImageListWarningData) MarshalJSON() ([]byte, error) {
  8175. type NoMethod ImageListWarningData
  8176. raw := NoMethod(*s)
  8177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8178. }
  8179. // Instance: An Instance resource. (== resource_for beta.instances ==)
  8180. // (== resource_for v1.instances ==)
  8181. type Instance struct {
  8182. // CanIpForward: Allows this instance to send and receive packets with
  8183. // non-matching destination or source IPs. This is required if you plan
  8184. // to use this instance to forward routes. For more information, see
  8185. // Enabling IP Forwarding.
  8186. CanIpForward bool `json:"canIpForward,omitempty"`
  8187. // CpuPlatform: [Output Only] The CPU platform used by this instance.
  8188. CpuPlatform string `json:"cpuPlatform,omitempty"`
  8189. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  8190. // format.
  8191. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8192. // DeletionProtection: Whether the resource should be protected against
  8193. // deletion.
  8194. DeletionProtection bool `json:"deletionProtection,omitempty"`
  8195. // Description: An optional description of this resource. Provide this
  8196. // property when you create the resource.
  8197. Description string `json:"description,omitempty"`
  8198. // Disks: Array of disks associated with this instance. Persistent disks
  8199. // must be created before you can assign them.
  8200. Disks []*AttachedDisk `json:"disks,omitempty"`
  8201. // GuestAccelerators: A list of the type and count of accelerator cards
  8202. // attached to the instance.
  8203. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  8204. Hostname string `json:"hostname,omitempty"`
  8205. // Id: [Output Only] The unique identifier for the resource. This
  8206. // identifier is defined by the server.
  8207. Id uint64 `json:"id,omitempty,string"`
  8208. // Kind: [Output Only] Type of the resource. Always compute#instance for
  8209. // instances.
  8210. Kind string `json:"kind,omitempty"`
  8211. // LabelFingerprint: A fingerprint for this request, which is
  8212. // essentially a hash of the label's contents and used for optimistic
  8213. // locking. The fingerprint is initially generated by Compute Engine and
  8214. // changes after every request to modify or update labels. You must
  8215. // always provide an up-to-date fingerprint hash in order to update or
  8216. // change labels.
  8217. //
  8218. // To see the latest fingerprint, make get() request to the instance.
  8219. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  8220. // Labels: Labels to apply to this instance. These can be later modified
  8221. // by the setLabels method.
  8222. Labels map[string]string `json:"labels,omitempty"`
  8223. // MachineType: Full or partial URL of the machine type resource to use
  8224. // for this instance, in the format:
  8225. // zones/zone/machineTypes/machine-type. This is provided by the client
  8226. // when the instance is created. For example, the following is a valid
  8227. // partial url to a predefined machine
  8228. // type:
  8229. // zones/us-central1-f/machineTypes/n1-standard-1
  8230. //
  8231. //
  8232. // To create a custom machine type, provide a URL to a machine type in
  8233. // the following format, where CPUS is 1 or an even number up to 32 (2,
  8234. // 4, 6, ... 24, etc), and MEMORY is the total memory for this instance.
  8235. // Memory must be a multiple of 256 MB and must be supplied in MB (e.g.
  8236. // 5 GB of memory is 5120
  8237. // MB):
  8238. // zones/zone/machineTypes/custom-CPUS-MEMORY
  8239. //
  8240. //
  8241. // For example: zones/us-central1-f/machineTypes/custom-4-5120
  8242. //
  8243. // For a full list of restrictions, read the Specifications for custom
  8244. // machine types.
  8245. MachineType string `json:"machineType,omitempty"`
  8246. // Metadata: The metadata key/value pairs assigned to this instance.
  8247. // This includes custom metadata and predefined keys.
  8248. Metadata *Metadata `json:"metadata,omitempty"`
  8249. // MinCpuPlatform: Specifies a minimum CPU platform for the VM instance.
  8250. // Applicable values are the friendly names of CPU platforms, such as
  8251. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  8252. // Bridge".
  8253. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  8254. // Name: The name of the resource, provided by the client when initially
  8255. // creating the resource. The resource name must be 1-63 characters
  8256. // long, and comply with RFC1035. Specifically, the name must be 1-63
  8257. // characters long and match the regular expression
  8258. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  8259. // a lowercase letter, and all following characters must be a dash,
  8260. // lowercase letter, or digit, except the last character, which cannot
  8261. // be a dash.
  8262. Name string `json:"name,omitempty"`
  8263. // NetworkInterfaces: An array of network configurations for this
  8264. // instance. These specify how interfaces are configured to interact
  8265. // with other network services, such as connecting to the internet.
  8266. // Multiple interfaces are supported per instance.
  8267. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  8268. // Scheduling: Sets the scheduling options for this instance.
  8269. Scheduling *Scheduling `json:"scheduling,omitempty"`
  8270. // SelfLink: [Output Only] Server-defined URL for this resource.
  8271. SelfLink string `json:"selfLink,omitempty"`
  8272. // ServiceAccounts: A list of service accounts, with their specified
  8273. // scopes, authorized for this instance. Only one service account per VM
  8274. // instance is supported.
  8275. //
  8276. // Service accounts generate access tokens that can be accessed through
  8277. // the metadata server and used to authenticate applications on the
  8278. // instance. See Service Accounts for more information.
  8279. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  8280. // StartRestricted: [Output Only] Whether a VM has been restricted for
  8281. // start because Compute Engine has detected suspicious activity.
  8282. StartRestricted bool `json:"startRestricted,omitempty"`
  8283. // Status: [Output Only] The status of the instance. One of the
  8284. // following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED,
  8285. // SUSPENDING, SUSPENDED, and TERMINATED.
  8286. //
  8287. // Possible values:
  8288. // "PROVISIONING"
  8289. // "REPAIRING"
  8290. // "RUNNING"
  8291. // "STAGING"
  8292. // "STOPPED"
  8293. // "STOPPING"
  8294. // "SUSPENDED"
  8295. // "SUSPENDING"
  8296. // "TERMINATED"
  8297. Status string `json:"status,omitempty"`
  8298. // StatusMessage: [Output Only] An optional, human-readable explanation
  8299. // of the status.
  8300. StatusMessage string `json:"statusMessage,omitempty"`
  8301. // Tags: Tags to apply to this instance. Tags are used to identify valid
  8302. // sources or targets for network firewalls and are specified by the
  8303. // client during instance creation. The tags can be later modified by
  8304. // the setTags method. Each tag within the list must comply with
  8305. // RFC1035. Multiple tags can be specified via the 'tags.items' field.
  8306. Tags *Tags `json:"tags,omitempty"`
  8307. // Zone: [Output Only] URL of the zone where the instance resides. You
  8308. // must specify this field as part of the HTTP request URL. It is not
  8309. // settable as a field in the request body.
  8310. Zone string `json:"zone,omitempty"`
  8311. // ServerResponse contains the HTTP response code and headers from the
  8312. // server.
  8313. googleapi.ServerResponse `json:"-"`
  8314. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  8315. // unconditionally include in API requests. By default, fields with
  8316. // empty values are omitted from API requests. However, any non-pointer,
  8317. // non-interface field appearing in ForceSendFields will be sent to the
  8318. // server regardless of whether the field is empty or not. This may be
  8319. // used to include empty fields in Patch requests.
  8320. ForceSendFields []string `json:"-"`
  8321. // NullFields is a list of field names (e.g. "CanIpForward") to include
  8322. // in API requests with the JSON null value. By default, fields with
  8323. // empty values are omitted from API requests. However, any field with
  8324. // an empty value appearing in NullFields will be sent to the server as
  8325. // null. It is an error if a field in this list has a non-empty value.
  8326. // This may be used to include null fields in Patch requests.
  8327. NullFields []string `json:"-"`
  8328. }
  8329. func (s *Instance) MarshalJSON() ([]byte, error) {
  8330. type NoMethod Instance
  8331. raw := NoMethod(*s)
  8332. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8333. }
  8334. type InstanceAggregatedList struct {
  8335. // Id: [Output Only] Unique identifier for the resource; defined by the
  8336. // server.
  8337. Id string `json:"id,omitempty"`
  8338. // Items: A list of InstancesScopedList resources.
  8339. Items map[string]InstancesScopedList `json:"items,omitempty"`
  8340. // Kind: [Output Only] Type of resource. Always
  8341. // compute#instanceAggregatedList for aggregated lists of Instance
  8342. // resources.
  8343. Kind string `json:"kind,omitempty"`
  8344. // NextPageToken: [Output Only] This token allows you to get the next
  8345. // page of results for list requests. If the number of results is larger
  8346. // than maxResults, use the nextPageToken as a value for the query
  8347. // parameter pageToken in the next list request. Subsequent list
  8348. // requests will have their own nextPageToken to continue paging through
  8349. // the results.
  8350. NextPageToken string `json:"nextPageToken,omitempty"`
  8351. // SelfLink: [Output Only] Server-defined URL for this resource.
  8352. SelfLink string `json:"selfLink,omitempty"`
  8353. // Warning: [Output Only] Informational warning message.
  8354. Warning *InstanceAggregatedListWarning `json:"warning,omitempty"`
  8355. // ServerResponse contains the HTTP response code and headers from the
  8356. // server.
  8357. googleapi.ServerResponse `json:"-"`
  8358. // ForceSendFields is a list of field names (e.g. "Id") to
  8359. // unconditionally include in API requests. By default, fields with
  8360. // empty values are omitted from API requests. However, any non-pointer,
  8361. // non-interface field appearing in ForceSendFields will be sent to the
  8362. // server regardless of whether the field is empty or not. This may be
  8363. // used to include empty fields in Patch requests.
  8364. ForceSendFields []string `json:"-"`
  8365. // NullFields is a list of field names (e.g. "Id") to include in API
  8366. // requests with the JSON null value. By default, fields with empty
  8367. // values are omitted from API requests. However, any field with an
  8368. // empty value appearing in NullFields will be sent to the server as
  8369. // null. It is an error if a field in this list has a non-empty value.
  8370. // This may be used to include null fields in Patch requests.
  8371. NullFields []string `json:"-"`
  8372. }
  8373. func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) {
  8374. type NoMethod InstanceAggregatedList
  8375. raw := NoMethod(*s)
  8376. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8377. }
  8378. // InstanceAggregatedListWarning: [Output Only] Informational warning
  8379. // message.
  8380. type InstanceAggregatedListWarning struct {
  8381. // Code: [Output Only] A warning code, if applicable. For example,
  8382. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8383. // the response.
  8384. //
  8385. // Possible values:
  8386. // "CLEANUP_FAILED"
  8387. // "DEPRECATED_RESOURCE_USED"
  8388. // "DEPRECATED_TYPE_USED"
  8389. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8390. // "EXPERIMENTAL_TYPE_USED"
  8391. // "EXTERNAL_API_WARNING"
  8392. // "FIELD_VALUE_OVERRIDEN"
  8393. // "INJECTED_KERNELS_DEPRECATED"
  8394. // "MISSING_TYPE_DEPENDENCY"
  8395. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8396. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8397. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8398. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8399. // "NEXT_HOP_NOT_RUNNING"
  8400. // "NOT_CRITICAL_ERROR"
  8401. // "NO_RESULTS_ON_PAGE"
  8402. // "REQUIRED_TOS_AGREEMENT"
  8403. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8404. // "RESOURCE_NOT_DELETED"
  8405. // "SCHEMA_VALIDATION_IGNORED"
  8406. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8407. // "UNDECLARED_PROPERTIES"
  8408. // "UNREACHABLE"
  8409. Code string `json:"code,omitempty"`
  8410. // Data: [Output Only] Metadata about this warning in key: value format.
  8411. // For example:
  8412. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8413. Data []*InstanceAggregatedListWarningData `json:"data,omitempty"`
  8414. // Message: [Output Only] A human-readable description of the warning
  8415. // code.
  8416. Message string `json:"message,omitempty"`
  8417. // ForceSendFields is a list of field names (e.g. "Code") to
  8418. // unconditionally include in API requests. By default, fields with
  8419. // empty values are omitted from API requests. However, any non-pointer,
  8420. // non-interface field appearing in ForceSendFields will be sent to the
  8421. // server regardless of whether the field is empty or not. This may be
  8422. // used to include empty fields in Patch requests.
  8423. ForceSendFields []string `json:"-"`
  8424. // NullFields is a list of field names (e.g. "Code") to include in API
  8425. // requests with the JSON null value. By default, fields with empty
  8426. // values are omitted from API requests. However, any field with an
  8427. // empty value appearing in NullFields will be sent to the server as
  8428. // null. It is an error if a field in this list has a non-empty value.
  8429. // This may be used to include null fields in Patch requests.
  8430. NullFields []string `json:"-"`
  8431. }
  8432. func (s *InstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8433. type NoMethod InstanceAggregatedListWarning
  8434. raw := NoMethod(*s)
  8435. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8436. }
  8437. type InstanceAggregatedListWarningData struct {
  8438. // Key: [Output Only] A key that provides more detail on the warning
  8439. // being returned. For example, for warnings where there are no results
  8440. // in a list request for a particular zone, this key might be scope and
  8441. // the key value might be the zone name. Other examples might be a key
  8442. // indicating a deprecated resource and a suggested replacement, or a
  8443. // warning about invalid network settings (for example, if an instance
  8444. // attempts to perform IP forwarding but is not enabled for IP
  8445. // forwarding).
  8446. Key string `json:"key,omitempty"`
  8447. // Value: [Output Only] A warning data value corresponding to the key.
  8448. Value string `json:"value,omitempty"`
  8449. // ForceSendFields is a list of field names (e.g. "Key") to
  8450. // unconditionally include in API requests. By default, fields with
  8451. // empty values are omitted from API requests. However, any non-pointer,
  8452. // non-interface field appearing in ForceSendFields will be sent to the
  8453. // server regardless of whether the field is empty or not. This may be
  8454. // used to include empty fields in Patch requests.
  8455. ForceSendFields []string `json:"-"`
  8456. // NullFields is a list of field names (e.g. "Key") to include in API
  8457. // requests with the JSON null value. By default, fields with empty
  8458. // values are omitted from API requests. However, any field with an
  8459. // empty value appearing in NullFields will be sent to the server as
  8460. // null. It is an error if a field in this list has a non-empty value.
  8461. // This may be used to include null fields in Patch requests.
  8462. NullFields []string `json:"-"`
  8463. }
  8464. func (s *InstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8465. type NoMethod InstanceAggregatedListWarningData
  8466. raw := NoMethod(*s)
  8467. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8468. }
  8469. // InstanceGroup: InstanceGroups (== resource_for beta.instanceGroups
  8470. // ==) (== resource_for v1.instanceGroups ==) (== resource_for
  8471. // beta.regionInstanceGroups ==) (== resource_for
  8472. // v1.regionInstanceGroups ==)
  8473. type InstanceGroup struct {
  8474. // CreationTimestamp: [Output Only] The creation timestamp for this
  8475. // instance group in RFC3339 text format.
  8476. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8477. // Description: An optional description of this resource. Provide this
  8478. // property when you create the resource.
  8479. Description string `json:"description,omitempty"`
  8480. // Fingerprint: [Output Only] The fingerprint of the named ports. The
  8481. // system uses this fingerprint to detect conflicts when multiple users
  8482. // change the named ports concurrently.
  8483. Fingerprint string `json:"fingerprint,omitempty"`
  8484. // Id: [Output Only] A unique identifier for this instance group,
  8485. // generated by the server.
  8486. Id uint64 `json:"id,omitempty,string"`
  8487. // Kind: [Output Only] The resource type, which is always
  8488. // compute#instanceGroup for instance groups.
  8489. Kind string `json:"kind,omitempty"`
  8490. // Name: The name of the instance group. The name must be 1-63
  8491. // characters long, and comply with RFC1035.
  8492. Name string `json:"name,omitempty"`
  8493. // NamedPorts: Assigns a name to a port number. For example: {name:
  8494. // "http", port: 80}
  8495. //
  8496. // This allows the system to reference ports by the assigned name
  8497. // instead of a port number. Named ports can also contain multiple
  8498. // ports. For example: [{name: "http", port: 80},{name: "http", port:
  8499. // 8080}]
  8500. //
  8501. // Named ports apply to all instances in this instance group.
  8502. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  8503. // Network: The URL of the network to which all instances in the
  8504. // instance group belong.
  8505. Network string `json:"network,omitempty"`
  8506. // Region: [Output Only] The URL of the region where the instance group
  8507. // is located (for regional resources).
  8508. Region string `json:"region,omitempty"`
  8509. // SelfLink: [Output Only] The URL for this instance group. The server
  8510. // generates this URL.
  8511. SelfLink string `json:"selfLink,omitempty"`
  8512. // Size: [Output Only] The total number of instances in the instance
  8513. // group.
  8514. Size int64 `json:"size,omitempty"`
  8515. // Subnetwork: [Output Only] The URL of the subnetwork to which all
  8516. // instances in the instance group belong.
  8517. Subnetwork string `json:"subnetwork,omitempty"`
  8518. // Zone: [Output Only] The URL of the zone where the instance group is
  8519. // located (for zonal resources).
  8520. Zone string `json:"zone,omitempty"`
  8521. // ServerResponse contains the HTTP response code and headers from the
  8522. // server.
  8523. googleapi.ServerResponse `json:"-"`
  8524. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  8525. // to unconditionally include in API requests. By default, fields with
  8526. // empty values are omitted from API requests. However, any non-pointer,
  8527. // non-interface field appearing in ForceSendFields will be sent to the
  8528. // server regardless of whether the field is empty or not. This may be
  8529. // used to include empty fields in Patch requests.
  8530. ForceSendFields []string `json:"-"`
  8531. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  8532. // include in API requests with the JSON null value. By default, fields
  8533. // with empty values are omitted from API requests. However, any field
  8534. // with an empty value appearing in NullFields will be sent to the
  8535. // server as null. It is an error if a field in this list has a
  8536. // non-empty value. This may be used to include null fields in Patch
  8537. // requests.
  8538. NullFields []string `json:"-"`
  8539. }
  8540. func (s *InstanceGroup) MarshalJSON() ([]byte, error) {
  8541. type NoMethod InstanceGroup
  8542. raw := NoMethod(*s)
  8543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8544. }
  8545. type InstanceGroupAggregatedList struct {
  8546. // Id: [Output Only] Unique identifier for the resource; defined by the
  8547. // server.
  8548. Id string `json:"id,omitempty"`
  8549. // Items: A list of InstanceGroupsScopedList resources.
  8550. Items map[string]InstanceGroupsScopedList `json:"items,omitempty"`
  8551. // Kind: [Output Only] The resource type, which is always
  8552. // compute#instanceGroupAggregatedList for aggregated lists of instance
  8553. // groups.
  8554. Kind string `json:"kind,omitempty"`
  8555. // NextPageToken: [Output Only] This token allows you to get the next
  8556. // page of results for list requests. If the number of results is larger
  8557. // than maxResults, use the nextPageToken as a value for the query
  8558. // parameter pageToken in the next list request. Subsequent list
  8559. // requests will have their own nextPageToken to continue paging through
  8560. // the results.
  8561. NextPageToken string `json:"nextPageToken,omitempty"`
  8562. // SelfLink: [Output Only] Server-defined URL for this resource.
  8563. SelfLink string `json:"selfLink,omitempty"`
  8564. // Warning: [Output Only] Informational warning message.
  8565. Warning *InstanceGroupAggregatedListWarning `json:"warning,omitempty"`
  8566. // ServerResponse contains the HTTP response code and headers from the
  8567. // server.
  8568. googleapi.ServerResponse `json:"-"`
  8569. // ForceSendFields is a list of field names (e.g. "Id") to
  8570. // unconditionally include in API requests. By default, fields with
  8571. // empty values are omitted from API requests. However, any non-pointer,
  8572. // non-interface field appearing in ForceSendFields will be sent to the
  8573. // server regardless of whether the field is empty or not. This may be
  8574. // used to include empty fields in Patch requests.
  8575. ForceSendFields []string `json:"-"`
  8576. // NullFields is a list of field names (e.g. "Id") to include in API
  8577. // requests with the JSON null value. By default, fields with empty
  8578. // values are omitted from API requests. However, any field with an
  8579. // empty value appearing in NullFields will be sent to the server as
  8580. // null. It is an error if a field in this list has a non-empty value.
  8581. // This may be used to include null fields in Patch requests.
  8582. NullFields []string `json:"-"`
  8583. }
  8584. func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
  8585. type NoMethod InstanceGroupAggregatedList
  8586. raw := NoMethod(*s)
  8587. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8588. }
  8589. // InstanceGroupAggregatedListWarning: [Output Only] Informational
  8590. // warning message.
  8591. type InstanceGroupAggregatedListWarning struct {
  8592. // Code: [Output Only] A warning code, if applicable. For example,
  8593. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8594. // the response.
  8595. //
  8596. // Possible values:
  8597. // "CLEANUP_FAILED"
  8598. // "DEPRECATED_RESOURCE_USED"
  8599. // "DEPRECATED_TYPE_USED"
  8600. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8601. // "EXPERIMENTAL_TYPE_USED"
  8602. // "EXTERNAL_API_WARNING"
  8603. // "FIELD_VALUE_OVERRIDEN"
  8604. // "INJECTED_KERNELS_DEPRECATED"
  8605. // "MISSING_TYPE_DEPENDENCY"
  8606. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8607. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8608. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8609. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8610. // "NEXT_HOP_NOT_RUNNING"
  8611. // "NOT_CRITICAL_ERROR"
  8612. // "NO_RESULTS_ON_PAGE"
  8613. // "REQUIRED_TOS_AGREEMENT"
  8614. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8615. // "RESOURCE_NOT_DELETED"
  8616. // "SCHEMA_VALIDATION_IGNORED"
  8617. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8618. // "UNDECLARED_PROPERTIES"
  8619. // "UNREACHABLE"
  8620. Code string `json:"code,omitempty"`
  8621. // Data: [Output Only] Metadata about this warning in key: value format.
  8622. // For example:
  8623. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8624. Data []*InstanceGroupAggregatedListWarningData `json:"data,omitempty"`
  8625. // Message: [Output Only] A human-readable description of the warning
  8626. // code.
  8627. Message string `json:"message,omitempty"`
  8628. // ForceSendFields is a list of field names (e.g. "Code") to
  8629. // unconditionally include in API requests. By default, fields with
  8630. // empty values are omitted from API requests. However, any non-pointer,
  8631. // non-interface field appearing in ForceSendFields will be sent to the
  8632. // server regardless of whether the field is empty or not. This may be
  8633. // used to include empty fields in Patch requests.
  8634. ForceSendFields []string `json:"-"`
  8635. // NullFields is a list of field names (e.g. "Code") to include in API
  8636. // requests with the JSON null value. By default, fields with empty
  8637. // values are omitted from API requests. However, any field with an
  8638. // empty value appearing in NullFields will be sent to the server as
  8639. // null. It is an error if a field in this list has a non-empty value.
  8640. // This may be used to include null fields in Patch requests.
  8641. NullFields []string `json:"-"`
  8642. }
  8643. func (s *InstanceGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8644. type NoMethod InstanceGroupAggregatedListWarning
  8645. raw := NoMethod(*s)
  8646. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8647. }
  8648. type InstanceGroupAggregatedListWarningData struct {
  8649. // Key: [Output Only] A key that provides more detail on the warning
  8650. // being returned. For example, for warnings where there are no results
  8651. // in a list request for a particular zone, this key might be scope and
  8652. // the key value might be the zone name. Other examples might be a key
  8653. // indicating a deprecated resource and a suggested replacement, or a
  8654. // warning about invalid network settings (for example, if an instance
  8655. // attempts to perform IP forwarding but is not enabled for IP
  8656. // forwarding).
  8657. Key string `json:"key,omitempty"`
  8658. // Value: [Output Only] A warning data value corresponding to the key.
  8659. Value string `json:"value,omitempty"`
  8660. // ForceSendFields is a list of field names (e.g. "Key") to
  8661. // unconditionally include in API requests. By default, fields with
  8662. // empty values are omitted from API requests. However, any non-pointer,
  8663. // non-interface field appearing in ForceSendFields will be sent to the
  8664. // server regardless of whether the field is empty or not. This may be
  8665. // used to include empty fields in Patch requests.
  8666. ForceSendFields []string `json:"-"`
  8667. // NullFields is a list of field names (e.g. "Key") to include in API
  8668. // requests with the JSON null value. By default, fields with empty
  8669. // values are omitted from API requests. However, any field with an
  8670. // empty value appearing in NullFields will be sent to the server as
  8671. // null. It is an error if a field in this list has a non-empty value.
  8672. // This may be used to include null fields in Patch requests.
  8673. NullFields []string `json:"-"`
  8674. }
  8675. func (s *InstanceGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8676. type NoMethod InstanceGroupAggregatedListWarningData
  8677. raw := NoMethod(*s)
  8678. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8679. }
  8680. // InstanceGroupList: A list of InstanceGroup resources.
  8681. type InstanceGroupList struct {
  8682. // Id: [Output Only] Unique identifier for the resource; defined by the
  8683. // server.
  8684. Id string `json:"id,omitempty"`
  8685. // Items: A list of InstanceGroup resources.
  8686. Items []*InstanceGroup `json:"items,omitempty"`
  8687. // Kind: [Output Only] The resource type, which is always
  8688. // compute#instanceGroupList for instance group lists.
  8689. Kind string `json:"kind,omitempty"`
  8690. // NextPageToken: [Output Only] This token allows you to get the next
  8691. // page of results for list requests. If the number of results is larger
  8692. // than maxResults, use the nextPageToken as a value for the query
  8693. // parameter pageToken in the next list request. Subsequent list
  8694. // requests will have their own nextPageToken to continue paging through
  8695. // the results.
  8696. NextPageToken string `json:"nextPageToken,omitempty"`
  8697. // SelfLink: [Output Only] Server-defined URL for this resource.
  8698. SelfLink string `json:"selfLink,omitempty"`
  8699. // Warning: [Output Only] Informational warning message.
  8700. Warning *InstanceGroupListWarning `json:"warning,omitempty"`
  8701. // ServerResponse contains the HTTP response code and headers from the
  8702. // server.
  8703. googleapi.ServerResponse `json:"-"`
  8704. // ForceSendFields is a list of field names (e.g. "Id") to
  8705. // unconditionally include in API requests. By default, fields with
  8706. // empty values are omitted from API requests. However, any non-pointer,
  8707. // non-interface field appearing in ForceSendFields will be sent to the
  8708. // server regardless of whether the field is empty or not. This may be
  8709. // used to include empty fields in Patch requests.
  8710. ForceSendFields []string `json:"-"`
  8711. // NullFields is a list of field names (e.g. "Id") to include in API
  8712. // requests with the JSON null value. By default, fields with empty
  8713. // values are omitted from API requests. However, any field with an
  8714. // empty value appearing in NullFields will be sent to the server as
  8715. // null. It is an error if a field in this list has a non-empty value.
  8716. // This may be used to include null fields in Patch requests.
  8717. NullFields []string `json:"-"`
  8718. }
  8719. func (s *InstanceGroupList) MarshalJSON() ([]byte, error) {
  8720. type NoMethod InstanceGroupList
  8721. raw := NoMethod(*s)
  8722. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8723. }
  8724. // InstanceGroupListWarning: [Output Only] Informational warning
  8725. // message.
  8726. type InstanceGroupListWarning struct {
  8727. // Code: [Output Only] A warning code, if applicable. For example,
  8728. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8729. // the response.
  8730. //
  8731. // Possible values:
  8732. // "CLEANUP_FAILED"
  8733. // "DEPRECATED_RESOURCE_USED"
  8734. // "DEPRECATED_TYPE_USED"
  8735. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8736. // "EXPERIMENTAL_TYPE_USED"
  8737. // "EXTERNAL_API_WARNING"
  8738. // "FIELD_VALUE_OVERRIDEN"
  8739. // "INJECTED_KERNELS_DEPRECATED"
  8740. // "MISSING_TYPE_DEPENDENCY"
  8741. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8742. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8743. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8744. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8745. // "NEXT_HOP_NOT_RUNNING"
  8746. // "NOT_CRITICAL_ERROR"
  8747. // "NO_RESULTS_ON_PAGE"
  8748. // "REQUIRED_TOS_AGREEMENT"
  8749. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8750. // "RESOURCE_NOT_DELETED"
  8751. // "SCHEMA_VALIDATION_IGNORED"
  8752. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8753. // "UNDECLARED_PROPERTIES"
  8754. // "UNREACHABLE"
  8755. Code string `json:"code,omitempty"`
  8756. // Data: [Output Only] Metadata about this warning in key: value format.
  8757. // For example:
  8758. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8759. Data []*InstanceGroupListWarningData `json:"data,omitempty"`
  8760. // Message: [Output Only] A human-readable description of the warning
  8761. // code.
  8762. Message string `json:"message,omitempty"`
  8763. // ForceSendFields is a list of field names (e.g. "Code") to
  8764. // unconditionally include in API requests. By default, fields with
  8765. // empty values are omitted from API requests. However, any non-pointer,
  8766. // non-interface field appearing in ForceSendFields will be sent to the
  8767. // server regardless of whether the field is empty or not. This may be
  8768. // used to include empty fields in Patch requests.
  8769. ForceSendFields []string `json:"-"`
  8770. // NullFields is a list of field names (e.g. "Code") to include in API
  8771. // requests with the JSON null value. By default, fields with empty
  8772. // values are omitted from API requests. However, any field with an
  8773. // empty value appearing in NullFields will be sent to the server as
  8774. // null. It is an error if a field in this list has a non-empty value.
  8775. // This may be used to include null fields in Patch requests.
  8776. NullFields []string `json:"-"`
  8777. }
  8778. func (s *InstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  8779. type NoMethod InstanceGroupListWarning
  8780. raw := NoMethod(*s)
  8781. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8782. }
  8783. type InstanceGroupListWarningData struct {
  8784. // Key: [Output Only] A key that provides more detail on the warning
  8785. // being returned. For example, for warnings where there are no results
  8786. // in a list request for a particular zone, this key might be scope and
  8787. // the key value might be the zone name. Other examples might be a key
  8788. // indicating a deprecated resource and a suggested replacement, or a
  8789. // warning about invalid network settings (for example, if an instance
  8790. // attempts to perform IP forwarding but is not enabled for IP
  8791. // forwarding).
  8792. Key string `json:"key,omitempty"`
  8793. // Value: [Output Only] A warning data value corresponding to the key.
  8794. Value string `json:"value,omitempty"`
  8795. // ForceSendFields is a list of field names (e.g. "Key") to
  8796. // unconditionally include in API requests. By default, fields with
  8797. // empty values are omitted from API requests. However, any non-pointer,
  8798. // non-interface field appearing in ForceSendFields will be sent to the
  8799. // server regardless of whether the field is empty or not. This may be
  8800. // used to include empty fields in Patch requests.
  8801. ForceSendFields []string `json:"-"`
  8802. // NullFields is a list of field names (e.g. "Key") to include in API
  8803. // requests with the JSON null value. By default, fields with empty
  8804. // values are omitted from API requests. However, any field with an
  8805. // empty value appearing in NullFields will be sent to the server as
  8806. // null. It is an error if a field in this list has a non-empty value.
  8807. // This may be used to include null fields in Patch requests.
  8808. NullFields []string `json:"-"`
  8809. }
  8810. func (s *InstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  8811. type NoMethod InstanceGroupListWarningData
  8812. raw := NoMethod(*s)
  8813. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8814. }
  8815. // InstanceGroupManager: An Instance Group Manager resource. (==
  8816. // resource_for beta.instanceGroupManagers ==) (== resource_for
  8817. // v1.instanceGroupManagers ==) (== resource_for
  8818. // beta.regionInstanceGroupManagers ==) (== resource_for
  8819. // v1.regionInstanceGroupManagers ==)
  8820. type InstanceGroupManager struct {
  8821. // AutoHealingPolicies: The autohealing policy for this managed instance
  8822. // group. You can specify only one value.
  8823. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  8824. // BaseInstanceName: The base instance name to use for instances in this
  8825. // group. The value must be 1-58 characters long. Instances are named by
  8826. // appending a hyphen and a random four-character string to the base
  8827. // instance name. The base instance name must comply with RFC1035.
  8828. BaseInstanceName string `json:"baseInstanceName,omitempty"`
  8829. // CreationTimestamp: [Output Only] The creation timestamp for this
  8830. // managed instance group in RFC3339 text format.
  8831. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8832. // CurrentActions: [Output Only] The list of instance actions and the
  8833. // number of instances in this managed instance group that are scheduled
  8834. // for each of those actions.
  8835. CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"`
  8836. // Description: An optional description of this resource. Provide this
  8837. // property when you create the resource.
  8838. Description string `json:"description,omitempty"`
  8839. // DistributionPolicy: Policy specifying intended distribution of
  8840. // instances in regional managed instance group.
  8841. DistributionPolicy *DistributionPolicy `json:"distributionPolicy,omitempty"`
  8842. // Fingerprint: Fingerprint of this resource. This field may be used in
  8843. // optimistic locking. It will be ignored when inserting an
  8844. // InstanceGroupManager. An up-to-date fingerprint must be provided in
  8845. // order to update the InstanceGroupManager, otherwise the request will
  8846. // fail with error 412 conditionNotMet.
  8847. //
  8848. // To see the latest fingerprint, make a get() request to retrieve an
  8849. // InstanceGroupManager.
  8850. Fingerprint string `json:"fingerprint,omitempty"`
  8851. // Id: [Output Only] A unique identifier for this resource type. The
  8852. // server generates this identifier.
  8853. Id uint64 `json:"id,omitempty,string"`
  8854. // InstanceGroup: [Output Only] The URL of the Instance Group resource.
  8855. InstanceGroup string `json:"instanceGroup,omitempty"`
  8856. // InstanceTemplate: The URL of the instance template that is specified
  8857. // for this managed instance group. The group uses this template to
  8858. // create all new instances in the managed instance group.
  8859. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  8860. // Kind: [Output Only] The resource type, which is always
  8861. // compute#instanceGroupManager for managed instance groups.
  8862. Kind string `json:"kind,omitempty"`
  8863. // Name: The name of the managed instance group. The name must be 1-63
  8864. // characters long, and comply with RFC1035.
  8865. Name string `json:"name,omitempty"`
  8866. // NamedPorts: Named ports configured for the Instance Groups
  8867. // complementary to this Instance Group Manager.
  8868. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  8869. // Region: [Output Only] The URL of the region where the managed
  8870. // instance group resides (for regional resources).
  8871. Region string `json:"region,omitempty"`
  8872. // SelfLink: [Output Only] The URL for this managed instance group. The
  8873. // server defines this URL.
  8874. SelfLink string `json:"selfLink,omitempty"`
  8875. // Status: [Output Only] The status of this managed instance group.
  8876. Status *InstanceGroupManagerStatus `json:"status,omitempty"`
  8877. // TargetPools: The URLs for all TargetPool resources to which instances
  8878. // in the instanceGroup field are added. The target pools automatically
  8879. // apply to all of the instances in the managed instance group.
  8880. TargetPools []string `json:"targetPools,omitempty"`
  8881. // TargetSize: The target number of running instances for this managed
  8882. // instance group. Deleting or abandoning instances reduces this number.
  8883. // Resizing the group changes this number.
  8884. TargetSize int64 `json:"targetSize,omitempty"`
  8885. // UpdatePolicy: The update policy for this managed instance group.
  8886. UpdatePolicy *InstanceGroupManagerUpdatePolicy `json:"updatePolicy,omitempty"`
  8887. // Versions: Specifies the instance templates used by this managed
  8888. // instance group to create instances.
  8889. //
  8890. // Each version is defined by an instanceTemplate. Every template can
  8891. // appear at most once per instance group. This field overrides the
  8892. // top-level instanceTemplate field. Read more about the relationships
  8893. // between these fields. Exactly one version must leave the targetSize
  8894. // field unset. That version will be applied to all remaining instances.
  8895. // For more information, read about canary updates.
  8896. Versions []*InstanceGroupManagerVersion `json:"versions,omitempty"`
  8897. // Zone: [Output Only] The URL of the zone where the managed instance
  8898. // group is located (for zonal resources).
  8899. Zone string `json:"zone,omitempty"`
  8900. // ServerResponse contains the HTTP response code and headers from the
  8901. // server.
  8902. googleapi.ServerResponse `json:"-"`
  8903. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  8904. // to unconditionally include in API requests. By default, fields with
  8905. // empty values are omitted from API requests. However, any non-pointer,
  8906. // non-interface field appearing in ForceSendFields will be sent to the
  8907. // server regardless of whether the field is empty or not. This may be
  8908. // used to include empty fields in Patch requests.
  8909. ForceSendFields []string `json:"-"`
  8910. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  8911. // include in API requests with the JSON null value. By default, fields
  8912. // with empty values are omitted from API requests. However, any field
  8913. // with an empty value appearing in NullFields will be sent to the
  8914. // server as null. It is an error if a field in this list has a
  8915. // non-empty value. This may be used to include null fields in Patch
  8916. // requests.
  8917. NullFields []string `json:"-"`
  8918. }
  8919. func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) {
  8920. type NoMethod InstanceGroupManager
  8921. raw := NoMethod(*s)
  8922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8923. }
  8924. type InstanceGroupManagerActionsSummary struct {
  8925. // Abandoning: [Output Only] The total number of instances in the
  8926. // managed instance group that are scheduled to be abandoned. Abandoning
  8927. // an instance removes it from the managed instance group without
  8928. // deleting it.
  8929. Abandoning int64 `json:"abandoning,omitempty"`
  8930. // Creating: [Output Only] The number of instances in the managed
  8931. // instance group that are scheduled to be created or are currently
  8932. // being created. If the group fails to create any of these instances,
  8933. // it tries again until it creates the instance successfully.
  8934. //
  8935. // If you have disabled creation retries, this field will not be
  8936. // populated; instead, the creatingWithoutRetries field will be
  8937. // populated.
  8938. Creating int64 `json:"creating,omitempty"`
  8939. // CreatingWithoutRetries: [Output Only] The number of instances that
  8940. // the managed instance group will attempt to create. The group attempts
  8941. // to create each instance only once. If the group fails to create any
  8942. // of these instances, it decreases the group's targetSize value
  8943. // accordingly.
  8944. CreatingWithoutRetries int64 `json:"creatingWithoutRetries,omitempty"`
  8945. // Deleting: [Output Only] The number of instances in the managed
  8946. // instance group that are scheduled to be deleted or are currently
  8947. // being deleted.
  8948. Deleting int64 `json:"deleting,omitempty"`
  8949. // None: [Output Only] The number of instances in the managed instance
  8950. // group that are running and have no scheduled actions.
  8951. None int64 `json:"none,omitempty"`
  8952. // Recreating: [Output Only] The number of instances in the managed
  8953. // instance group that are scheduled to be recreated or are currently
  8954. // being being recreated. Recreating an instance deletes the existing
  8955. // root persistent disk and creates a new disk from the image that is
  8956. // defined in the instance template.
  8957. Recreating int64 `json:"recreating,omitempty"`
  8958. // Refreshing: [Output Only] The number of instances in the managed
  8959. // instance group that are being reconfigured with properties that do
  8960. // not require a restart or a recreate action. For example, setting or
  8961. // removing target pools for the instance.
  8962. Refreshing int64 `json:"refreshing,omitempty"`
  8963. // Restarting: [Output Only] The number of instances in the managed
  8964. // instance group that are scheduled to be restarted or are currently
  8965. // being restarted.
  8966. Restarting int64 `json:"restarting,omitempty"`
  8967. // Verifying: [Output Only] The number of instances in the managed
  8968. // instance group that are being verified. See the
  8969. // managedInstances[].currentAction property in the listManagedInstances
  8970. // method documentation.
  8971. Verifying int64 `json:"verifying,omitempty"`
  8972. // ForceSendFields is a list of field names (e.g. "Abandoning") to
  8973. // unconditionally include in API requests. By default, fields with
  8974. // empty values are omitted from API requests. However, any non-pointer,
  8975. // non-interface field appearing in ForceSendFields will be sent to the
  8976. // server regardless of whether the field is empty or not. This may be
  8977. // used to include empty fields in Patch requests.
  8978. ForceSendFields []string `json:"-"`
  8979. // NullFields is a list of field names (e.g. "Abandoning") to include in
  8980. // API requests with the JSON null value. By default, fields with empty
  8981. // values are omitted from API requests. However, any field with an
  8982. // empty value appearing in NullFields will be sent to the server as
  8983. // null. It is an error if a field in this list has a non-empty value.
  8984. // This may be used to include null fields in Patch requests.
  8985. NullFields []string `json:"-"`
  8986. }
  8987. func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
  8988. type NoMethod InstanceGroupManagerActionsSummary
  8989. raw := NoMethod(*s)
  8990. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8991. }
  8992. type InstanceGroupManagerAggregatedList struct {
  8993. // Id: [Output Only] Unique identifier for the resource; defined by the
  8994. // server.
  8995. Id string `json:"id,omitempty"`
  8996. // Items: A list of InstanceGroupManagersScopedList resources.
  8997. Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"`
  8998. // Kind: [Output Only] The resource type, which is always
  8999. // compute#instanceGroupManagerAggregatedList for an aggregated list of
  9000. // managed instance groups.
  9001. Kind string `json:"kind,omitempty"`
  9002. // NextPageToken: [Output Only] This token allows you to get the next
  9003. // page of results for list requests. If the number of results is larger
  9004. // than maxResults, use the nextPageToken as a value for the query
  9005. // parameter pageToken in the next list request. Subsequent list
  9006. // requests will have their own nextPageToken to continue paging through
  9007. // the results.
  9008. NextPageToken string `json:"nextPageToken,omitempty"`
  9009. // SelfLink: [Output Only] Server-defined URL for this resource.
  9010. SelfLink string `json:"selfLink,omitempty"`
  9011. // Warning: [Output Only] Informational warning message.
  9012. Warning *InstanceGroupManagerAggregatedListWarning `json:"warning,omitempty"`
  9013. // ServerResponse contains the HTTP response code and headers from the
  9014. // server.
  9015. googleapi.ServerResponse `json:"-"`
  9016. // ForceSendFields is a list of field names (e.g. "Id") to
  9017. // unconditionally include in API requests. By default, fields with
  9018. // empty values are omitted from API requests. However, any non-pointer,
  9019. // non-interface field appearing in ForceSendFields will be sent to the
  9020. // server regardless of whether the field is empty or not. This may be
  9021. // used to include empty fields in Patch requests.
  9022. ForceSendFields []string `json:"-"`
  9023. // NullFields is a list of field names (e.g. "Id") to include in API
  9024. // requests with the JSON null value. By default, fields with empty
  9025. // values are omitted from API requests. However, any field with an
  9026. // empty value appearing in NullFields will be sent to the server as
  9027. // null. It is an error if a field in this list has a non-empty value.
  9028. // This may be used to include null fields in Patch requests.
  9029. NullFields []string `json:"-"`
  9030. }
  9031. func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
  9032. type NoMethod InstanceGroupManagerAggregatedList
  9033. raw := NoMethod(*s)
  9034. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9035. }
  9036. // InstanceGroupManagerAggregatedListWarning: [Output Only]
  9037. // Informational warning message.
  9038. type InstanceGroupManagerAggregatedListWarning struct {
  9039. // Code: [Output Only] A warning code, if applicable. For example,
  9040. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9041. // the response.
  9042. //
  9043. // Possible values:
  9044. // "CLEANUP_FAILED"
  9045. // "DEPRECATED_RESOURCE_USED"
  9046. // "DEPRECATED_TYPE_USED"
  9047. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9048. // "EXPERIMENTAL_TYPE_USED"
  9049. // "EXTERNAL_API_WARNING"
  9050. // "FIELD_VALUE_OVERRIDEN"
  9051. // "INJECTED_KERNELS_DEPRECATED"
  9052. // "MISSING_TYPE_DEPENDENCY"
  9053. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9054. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9055. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9056. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9057. // "NEXT_HOP_NOT_RUNNING"
  9058. // "NOT_CRITICAL_ERROR"
  9059. // "NO_RESULTS_ON_PAGE"
  9060. // "REQUIRED_TOS_AGREEMENT"
  9061. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9062. // "RESOURCE_NOT_DELETED"
  9063. // "SCHEMA_VALIDATION_IGNORED"
  9064. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9065. // "UNDECLARED_PROPERTIES"
  9066. // "UNREACHABLE"
  9067. Code string `json:"code,omitempty"`
  9068. // Data: [Output Only] Metadata about this warning in key: value format.
  9069. // For example:
  9070. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9071. Data []*InstanceGroupManagerAggregatedListWarningData `json:"data,omitempty"`
  9072. // Message: [Output Only] A human-readable description of the warning
  9073. // code.
  9074. Message string `json:"message,omitempty"`
  9075. // ForceSendFields is a list of field names (e.g. "Code") to
  9076. // unconditionally include in API requests. By default, fields with
  9077. // empty values are omitted from API requests. However, any non-pointer,
  9078. // non-interface field appearing in ForceSendFields will be sent to the
  9079. // server regardless of whether the field is empty or not. This may be
  9080. // used to include empty fields in Patch requests.
  9081. ForceSendFields []string `json:"-"`
  9082. // NullFields is a list of field names (e.g. "Code") to include in API
  9083. // requests with the JSON null value. By default, fields with empty
  9084. // values are omitted from API requests. However, any field with an
  9085. // empty value appearing in NullFields will be sent to the server as
  9086. // null. It is an error if a field in this list has a non-empty value.
  9087. // This may be used to include null fields in Patch requests.
  9088. NullFields []string `json:"-"`
  9089. }
  9090. func (s *InstanceGroupManagerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  9091. type NoMethod InstanceGroupManagerAggregatedListWarning
  9092. raw := NoMethod(*s)
  9093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9094. }
  9095. type InstanceGroupManagerAggregatedListWarningData struct {
  9096. // Key: [Output Only] A key that provides more detail on the warning
  9097. // being returned. For example, for warnings where there are no results
  9098. // in a list request for a particular zone, this key might be scope and
  9099. // the key value might be the zone name. Other examples might be a key
  9100. // indicating a deprecated resource and a suggested replacement, or a
  9101. // warning about invalid network settings (for example, if an instance
  9102. // attempts to perform IP forwarding but is not enabled for IP
  9103. // forwarding).
  9104. Key string `json:"key,omitempty"`
  9105. // Value: [Output Only] A warning data value corresponding to the key.
  9106. Value string `json:"value,omitempty"`
  9107. // ForceSendFields is a list of field names (e.g. "Key") to
  9108. // unconditionally include in API requests. By default, fields with
  9109. // empty values are omitted from API requests. However, any non-pointer,
  9110. // non-interface field appearing in ForceSendFields will be sent to the
  9111. // server regardless of whether the field is empty or not. This may be
  9112. // used to include empty fields in Patch requests.
  9113. ForceSendFields []string `json:"-"`
  9114. // NullFields is a list of field names (e.g. "Key") to include in API
  9115. // requests with the JSON null value. By default, fields with empty
  9116. // values are omitted from API requests. However, any field with an
  9117. // empty value appearing in NullFields will be sent to the server as
  9118. // null. It is an error if a field in this list has a non-empty value.
  9119. // This may be used to include null fields in Patch requests.
  9120. NullFields []string `json:"-"`
  9121. }
  9122. func (s *InstanceGroupManagerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  9123. type NoMethod InstanceGroupManagerAggregatedListWarningData
  9124. raw := NoMethod(*s)
  9125. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9126. }
  9127. type InstanceGroupManagerAutoHealingPolicy struct {
  9128. // HealthCheck: The URL for the health check that signals autohealing.
  9129. HealthCheck string `json:"healthCheck,omitempty"`
  9130. // InitialDelaySec: The number of seconds that the managed instance
  9131. // group waits before it applies autohealing policies to new instances
  9132. // or recently recreated instances. This initial delay allows instances
  9133. // to initialize and run their startup scripts before the instance group
  9134. // determines that they are UNHEALTHY. This prevents the managed
  9135. // instance group from recreating its instances prematurely. This value
  9136. // must be from range [0, 3600].
  9137. InitialDelaySec int64 `json:"initialDelaySec,omitempty"`
  9138. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  9139. // unconditionally include in API requests. By default, fields with
  9140. // empty values are omitted from API requests. However, any non-pointer,
  9141. // non-interface field appearing in ForceSendFields will be sent to the
  9142. // server regardless of whether the field is empty or not. This may be
  9143. // used to include empty fields in Patch requests.
  9144. ForceSendFields []string `json:"-"`
  9145. // NullFields is a list of field names (e.g. "HealthCheck") to include
  9146. // in API requests with the JSON null value. By default, fields with
  9147. // empty values are omitted from API requests. However, any field with
  9148. // an empty value appearing in NullFields will be sent to the server as
  9149. // null. It is an error if a field in this list has a non-empty value.
  9150. // This may be used to include null fields in Patch requests.
  9151. NullFields []string `json:"-"`
  9152. }
  9153. func (s *InstanceGroupManagerAutoHealingPolicy) MarshalJSON() ([]byte, error) {
  9154. type NoMethod InstanceGroupManagerAutoHealingPolicy
  9155. raw := NoMethod(*s)
  9156. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9157. }
  9158. // InstanceGroupManagerList: [Output Only] A list of managed instance
  9159. // groups.
  9160. type InstanceGroupManagerList struct {
  9161. // Id: [Output Only] Unique identifier for the resource; defined by the
  9162. // server.
  9163. Id string `json:"id,omitempty"`
  9164. // Items: A list of InstanceGroupManager resources.
  9165. Items []*InstanceGroupManager `json:"items,omitempty"`
  9166. // Kind: [Output Only] The resource type, which is always
  9167. // compute#instanceGroupManagerList for a list of managed instance
  9168. // groups.
  9169. Kind string `json:"kind,omitempty"`
  9170. // NextPageToken: [Output Only] This token allows you to get the next
  9171. // page of results for list requests. If the number of results is larger
  9172. // than maxResults, use the nextPageToken as a value for the query
  9173. // parameter pageToken in the next list request. Subsequent list
  9174. // requests will have their own nextPageToken to continue paging through
  9175. // the results.
  9176. NextPageToken string `json:"nextPageToken,omitempty"`
  9177. // SelfLink: [Output Only] Server-defined URL for this resource.
  9178. SelfLink string `json:"selfLink,omitempty"`
  9179. // Warning: [Output Only] Informational warning message.
  9180. Warning *InstanceGroupManagerListWarning `json:"warning,omitempty"`
  9181. // ServerResponse contains the HTTP response code and headers from the
  9182. // server.
  9183. googleapi.ServerResponse `json:"-"`
  9184. // ForceSendFields is a list of field names (e.g. "Id") to
  9185. // unconditionally include in API requests. By default, fields with
  9186. // empty values are omitted from API requests. However, any non-pointer,
  9187. // non-interface field appearing in ForceSendFields will be sent to the
  9188. // server regardless of whether the field is empty or not. This may be
  9189. // used to include empty fields in Patch requests.
  9190. ForceSendFields []string `json:"-"`
  9191. // NullFields is a list of field names (e.g. "Id") to include in API
  9192. // requests with the JSON null value. By default, fields with empty
  9193. // values are omitted from API requests. However, any field with an
  9194. // empty value appearing in NullFields will be sent to the server as
  9195. // null. It is an error if a field in this list has a non-empty value.
  9196. // This may be used to include null fields in Patch requests.
  9197. NullFields []string `json:"-"`
  9198. }
  9199. func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  9200. type NoMethod InstanceGroupManagerList
  9201. raw := NoMethod(*s)
  9202. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9203. }
  9204. // InstanceGroupManagerListWarning: [Output Only] Informational warning
  9205. // message.
  9206. type InstanceGroupManagerListWarning struct {
  9207. // Code: [Output Only] A warning code, if applicable. For example,
  9208. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9209. // the response.
  9210. //
  9211. // Possible values:
  9212. // "CLEANUP_FAILED"
  9213. // "DEPRECATED_RESOURCE_USED"
  9214. // "DEPRECATED_TYPE_USED"
  9215. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9216. // "EXPERIMENTAL_TYPE_USED"
  9217. // "EXTERNAL_API_WARNING"
  9218. // "FIELD_VALUE_OVERRIDEN"
  9219. // "INJECTED_KERNELS_DEPRECATED"
  9220. // "MISSING_TYPE_DEPENDENCY"
  9221. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9222. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9223. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9224. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9225. // "NEXT_HOP_NOT_RUNNING"
  9226. // "NOT_CRITICAL_ERROR"
  9227. // "NO_RESULTS_ON_PAGE"
  9228. // "REQUIRED_TOS_AGREEMENT"
  9229. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9230. // "RESOURCE_NOT_DELETED"
  9231. // "SCHEMA_VALIDATION_IGNORED"
  9232. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9233. // "UNDECLARED_PROPERTIES"
  9234. // "UNREACHABLE"
  9235. Code string `json:"code,omitempty"`
  9236. // Data: [Output Only] Metadata about this warning in key: value format.
  9237. // For example:
  9238. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9239. Data []*InstanceGroupManagerListWarningData `json:"data,omitempty"`
  9240. // Message: [Output Only] A human-readable description of the warning
  9241. // code.
  9242. Message string `json:"message,omitempty"`
  9243. // ForceSendFields is a list of field names (e.g. "Code") to
  9244. // unconditionally include in API requests. By default, fields with
  9245. // empty values are omitted from API requests. However, any non-pointer,
  9246. // non-interface field appearing in ForceSendFields will be sent to the
  9247. // server regardless of whether the field is empty or not. This may be
  9248. // used to include empty fields in Patch requests.
  9249. ForceSendFields []string `json:"-"`
  9250. // NullFields is a list of field names (e.g. "Code") to include in API
  9251. // requests with the JSON null value. By default, fields with empty
  9252. // values are omitted from API requests. However, any field with an
  9253. // empty value appearing in NullFields will be sent to the server as
  9254. // null. It is an error if a field in this list has a non-empty value.
  9255. // This may be used to include null fields in Patch requests.
  9256. NullFields []string `json:"-"`
  9257. }
  9258. func (s *InstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  9259. type NoMethod InstanceGroupManagerListWarning
  9260. raw := NoMethod(*s)
  9261. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9262. }
  9263. type InstanceGroupManagerListWarningData struct {
  9264. // Key: [Output Only] A key that provides more detail on the warning
  9265. // being returned. For example, for warnings where there are no results
  9266. // in a list request for a particular zone, this key might be scope and
  9267. // the key value might be the zone name. Other examples might be a key
  9268. // indicating a deprecated resource and a suggested replacement, or a
  9269. // warning about invalid network settings (for example, if an instance
  9270. // attempts to perform IP forwarding but is not enabled for IP
  9271. // forwarding).
  9272. Key string `json:"key,omitempty"`
  9273. // Value: [Output Only] A warning data value corresponding to the key.
  9274. Value string `json:"value,omitempty"`
  9275. // ForceSendFields is a list of field names (e.g. "Key") to
  9276. // unconditionally include in API requests. By default, fields with
  9277. // empty values are omitted from API requests. However, any non-pointer,
  9278. // non-interface field appearing in ForceSendFields will be sent to the
  9279. // server regardless of whether the field is empty or not. This may be
  9280. // used to include empty fields in Patch requests.
  9281. ForceSendFields []string `json:"-"`
  9282. // NullFields is a list of field names (e.g. "Key") to include in API
  9283. // requests with the JSON null value. By default, fields with empty
  9284. // values are omitted from API requests. However, any field with an
  9285. // empty value appearing in NullFields will be sent to the server as
  9286. // null. It is an error if a field in this list has a non-empty value.
  9287. // This may be used to include null fields in Patch requests.
  9288. NullFields []string `json:"-"`
  9289. }
  9290. func (s *InstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  9291. type NoMethod InstanceGroupManagerListWarningData
  9292. raw := NoMethod(*s)
  9293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9294. }
  9295. type InstanceGroupManagerStatus struct {
  9296. // IsStable: [Output Only] A bit indicating whether the managed instance
  9297. // group is in a stable state. A stable state means that: none of the
  9298. // instances in the managed instance group is currently undergoing any
  9299. // type of change (for example, creation, restart, or deletion); no
  9300. // future changes are scheduled for instances in the managed instance
  9301. // group; and the managed instance group itself is not being modified.
  9302. IsStable bool `json:"isStable,omitempty"`
  9303. // ForceSendFields is a list of field names (e.g. "IsStable") to
  9304. // unconditionally include in API requests. By default, fields with
  9305. // empty values are omitted from API requests. However, any non-pointer,
  9306. // non-interface field appearing in ForceSendFields will be sent to the
  9307. // server regardless of whether the field is empty or not. This may be
  9308. // used to include empty fields in Patch requests.
  9309. ForceSendFields []string `json:"-"`
  9310. // NullFields is a list of field names (e.g. "IsStable") to include in
  9311. // API requests with the JSON null value. By default, fields with empty
  9312. // values are omitted from API requests. However, any field with an
  9313. // empty value appearing in NullFields will be sent to the server as
  9314. // null. It is an error if a field in this list has a non-empty value.
  9315. // This may be used to include null fields in Patch requests.
  9316. NullFields []string `json:"-"`
  9317. }
  9318. func (s *InstanceGroupManagerStatus) MarshalJSON() ([]byte, error) {
  9319. type NoMethod InstanceGroupManagerStatus
  9320. raw := NoMethod(*s)
  9321. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9322. }
  9323. type InstanceGroupManagerUpdatePolicy struct {
  9324. // MaxSurge: The maximum number of instances that can be created above
  9325. // the specified targetSize during the update process. By default, a
  9326. // fixed value of 1 is used. This value can be either a fixed number or
  9327. // a percentage if the instance group has 10 or more instances. If you
  9328. // set a percentage, the number of instances will be rounded up if
  9329. // necessary.
  9330. //
  9331. // At least one of either maxSurge or maxUnavailable must be greater
  9332. // than 0. Learn more about maxSurge.
  9333. MaxSurge *FixedOrPercent `json:"maxSurge,omitempty"`
  9334. // MaxUnavailable: The maximum number of instances that can be
  9335. // unavailable during the update process. An instance is considered
  9336. // available if all of the following conditions are satisfied:
  9337. //
  9338. //
  9339. // - The instance's status is RUNNING.
  9340. // - If there is a health check on the instance group, the instance's
  9341. // liveness health check result must be HEALTHY at least once. If there
  9342. // is no health check on the group, then the instance only needs to have
  9343. // a status of RUNNING to be considered available. By default, a fixed
  9344. // value of 1 is used. This value can be either a fixed number or a
  9345. // percentage if the instance group has 10 or more instances. If you set
  9346. // a percentage, the number of instances will be rounded up if
  9347. // necessary.
  9348. //
  9349. // At least one of either maxSurge or maxUnavailable must be greater
  9350. // than 0. Learn more about maxUnavailable.
  9351. MaxUnavailable *FixedOrPercent `json:"maxUnavailable,omitempty"`
  9352. // MinimalAction: Minimal action to be taken on an instance. You can
  9353. // specify either RESTART to restart existing instances or REPLACE to
  9354. // delete and create new instances from the target template. If you
  9355. // specify a RESTART, the Updater will attempt to perform that action
  9356. // only. However, if the Updater determines that the minimal action you
  9357. // specify is not enough to perform the update, it might perform a more
  9358. // disruptive action.
  9359. //
  9360. // Possible values:
  9361. // "REPLACE"
  9362. // "RESTART"
  9363. MinimalAction string `json:"minimalAction,omitempty"`
  9364. // Possible values:
  9365. // "OPPORTUNISTIC"
  9366. // "PROACTIVE"
  9367. Type string `json:"type,omitempty"`
  9368. // ForceSendFields is a list of field names (e.g. "MaxSurge") to
  9369. // unconditionally include in API requests. By default, fields with
  9370. // empty values are omitted from API requests. However, any non-pointer,
  9371. // non-interface field appearing in ForceSendFields will be sent to the
  9372. // server regardless of whether the field is empty or not. This may be
  9373. // used to include empty fields in Patch requests.
  9374. ForceSendFields []string `json:"-"`
  9375. // NullFields is a list of field names (e.g. "MaxSurge") to include in
  9376. // API requests with the JSON null value. By default, fields with empty
  9377. // values are omitted from API requests. However, any field with an
  9378. // empty value appearing in NullFields will be sent to the server as
  9379. // null. It is an error if a field in this list has a non-empty value.
  9380. // This may be used to include null fields in Patch requests.
  9381. NullFields []string `json:"-"`
  9382. }
  9383. func (s *InstanceGroupManagerUpdatePolicy) MarshalJSON() ([]byte, error) {
  9384. type NoMethod InstanceGroupManagerUpdatePolicy
  9385. raw := NoMethod(*s)
  9386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9387. }
  9388. type InstanceGroupManagerVersion struct {
  9389. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  9390. // Name: Name of the version. Unique among all versions in the scope of
  9391. // this managed instance group.
  9392. Name string `json:"name,omitempty"`
  9393. // TargetSize: Specifies the intended number of instances to be created
  9394. // from the instanceTemplate. The final number of instances created from
  9395. // the template will be equal to:
  9396. // - If expressed as a fixed number, the minimum of either
  9397. // targetSize.fixed or instanceGroupManager.targetSize is used.
  9398. // - if expressed as a percent, the targetSize would be
  9399. // (targetSize.percent/100 * InstanceGroupManager.targetSize) If there
  9400. // is a remainder, the number is rounded up. If unset, this version
  9401. // will update any remaining instances not updated by another version.
  9402. // Read Starting a canary update for more information.
  9403. TargetSize *FixedOrPercent `json:"targetSize,omitempty"`
  9404. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  9405. // unconditionally include in API requests. By default, fields with
  9406. // empty values are omitted from API requests. However, any non-pointer,
  9407. // non-interface field appearing in ForceSendFields will be sent to the
  9408. // server regardless of whether the field is empty or not. This may be
  9409. // used to include empty fields in Patch requests.
  9410. ForceSendFields []string `json:"-"`
  9411. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  9412. // include in API requests with the JSON null value. By default, fields
  9413. // with empty values are omitted from API requests. However, any field
  9414. // with an empty value appearing in NullFields will be sent to the
  9415. // server as null. It is an error if a field in this list has a
  9416. // non-empty value. This may be used to include null fields in Patch
  9417. // requests.
  9418. NullFields []string `json:"-"`
  9419. }
  9420. func (s *InstanceGroupManagerVersion) MarshalJSON() ([]byte, error) {
  9421. type NoMethod InstanceGroupManagerVersion
  9422. raw := NoMethod(*s)
  9423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9424. }
  9425. type InstanceGroupManagersAbandonInstancesRequest struct {
  9426. // Instances: The URLs of one or more instances to abandon. This can be
  9427. // a full URL or a partial URL, such as
  9428. // zones/[ZONE]/instances/[INSTANCE_NAME].
  9429. Instances []string `json:"instances,omitempty"`
  9430. // ForceSendFields is a list of field names (e.g. "Instances") to
  9431. // unconditionally include in API requests. By default, fields with
  9432. // empty values are omitted from API requests. However, any non-pointer,
  9433. // non-interface field appearing in ForceSendFields will be sent to the
  9434. // server regardless of whether the field is empty or not. This may be
  9435. // used to include empty fields in Patch requests.
  9436. ForceSendFields []string `json:"-"`
  9437. // NullFields is a list of field names (e.g. "Instances") to include in
  9438. // API requests with the JSON null value. By default, fields with empty
  9439. // values are omitted from API requests. However, any field with an
  9440. // empty value appearing in NullFields will be sent to the server as
  9441. // null. It is an error if a field in this list has a non-empty value.
  9442. // This may be used to include null fields in Patch requests.
  9443. NullFields []string `json:"-"`
  9444. }
  9445. func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  9446. type NoMethod InstanceGroupManagersAbandonInstancesRequest
  9447. raw := NoMethod(*s)
  9448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9449. }
  9450. type InstanceGroupManagersDeleteInstancesRequest struct {
  9451. // Instances: The URLs of one or more instances to delete. This can be a
  9452. // full URL or a partial URL, such as
  9453. // zones/[ZONE]/instances/[INSTANCE_NAME].
  9454. Instances []string `json:"instances,omitempty"`
  9455. // ForceSendFields is a list of field names (e.g. "Instances") to
  9456. // unconditionally include in API requests. By default, fields with
  9457. // empty values are omitted from API requests. However, any non-pointer,
  9458. // non-interface field appearing in ForceSendFields will be sent to the
  9459. // server regardless of whether the field is empty or not. This may be
  9460. // used to include empty fields in Patch requests.
  9461. ForceSendFields []string `json:"-"`
  9462. // NullFields is a list of field names (e.g. "Instances") to include in
  9463. // API requests with the JSON null value. By default, fields with empty
  9464. // values are omitted from API requests. However, any field with an
  9465. // empty value appearing in NullFields will be sent to the server as
  9466. // null. It is an error if a field in this list has a non-empty value.
  9467. // This may be used to include null fields in Patch requests.
  9468. NullFields []string `json:"-"`
  9469. }
  9470. func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  9471. type NoMethod InstanceGroupManagersDeleteInstancesRequest
  9472. raw := NoMethod(*s)
  9473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9474. }
  9475. type InstanceGroupManagersListManagedInstancesResponse struct {
  9476. // ManagedInstances: [Output Only] The list of instances in the managed
  9477. // instance group.
  9478. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  9479. // ServerResponse contains the HTTP response code and headers from the
  9480. // server.
  9481. googleapi.ServerResponse `json:"-"`
  9482. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  9483. // unconditionally include in API requests. By default, fields with
  9484. // empty values are omitted from API requests. However, any non-pointer,
  9485. // non-interface field appearing in ForceSendFields will be sent to the
  9486. // server regardless of whether the field is empty or not. This may be
  9487. // used to include empty fields in Patch requests.
  9488. ForceSendFields []string `json:"-"`
  9489. // NullFields is a list of field names (e.g. "ManagedInstances") to
  9490. // include in API requests with the JSON null value. By default, fields
  9491. // with empty values are omitted from API requests. However, any field
  9492. // with an empty value appearing in NullFields will be sent to the
  9493. // server as null. It is an error if a field in this list has a
  9494. // non-empty value. This may be used to include null fields in Patch
  9495. // requests.
  9496. NullFields []string `json:"-"`
  9497. }
  9498. func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
  9499. type NoMethod InstanceGroupManagersListManagedInstancesResponse
  9500. raw := NoMethod(*s)
  9501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9502. }
  9503. type InstanceGroupManagersRecreateInstancesRequest struct {
  9504. // Instances: The URLs of one or more instances to recreate. This can be
  9505. // a full URL or a partial URL, such as
  9506. // zones/[ZONE]/instances/[INSTANCE_NAME].
  9507. Instances []string `json:"instances,omitempty"`
  9508. // ForceSendFields is a list of field names (e.g. "Instances") to
  9509. // unconditionally include in API requests. By default, fields with
  9510. // empty values are omitted from API requests. However, any non-pointer,
  9511. // non-interface field appearing in ForceSendFields will be sent to the
  9512. // server regardless of whether the field is empty or not. This may be
  9513. // used to include empty fields in Patch requests.
  9514. ForceSendFields []string `json:"-"`
  9515. // NullFields is a list of field names (e.g. "Instances") to include in
  9516. // API requests with the JSON null value. By default, fields with empty
  9517. // values are omitted from API requests. However, any field with an
  9518. // empty value appearing in NullFields will be sent to the server as
  9519. // null. It is an error if a field in this list has a non-empty value.
  9520. // This may be used to include null fields in Patch requests.
  9521. NullFields []string `json:"-"`
  9522. }
  9523. func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
  9524. type NoMethod InstanceGroupManagersRecreateInstancesRequest
  9525. raw := NoMethod(*s)
  9526. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9527. }
  9528. type InstanceGroupManagersScopedList struct {
  9529. // InstanceGroupManagers: [Output Only] The list of managed instance
  9530. // groups that are contained in the specified project and zone.
  9531. InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"`
  9532. // Warning: [Output Only] The warning that replaces the list of managed
  9533. // instance groups when the list is empty.
  9534. Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"`
  9535. // ForceSendFields is a list of field names (e.g.
  9536. // "InstanceGroupManagers") to unconditionally include in API requests.
  9537. // By default, fields with empty values are omitted from API requests.
  9538. // However, any non-pointer, non-interface field appearing in
  9539. // ForceSendFields will be sent to the server regardless of whether the
  9540. // field is empty or not. This may be used to include empty fields in
  9541. // Patch requests.
  9542. ForceSendFields []string `json:"-"`
  9543. // NullFields is a list of field names (e.g. "InstanceGroupManagers") to
  9544. // include in API requests with the JSON null value. By default, fields
  9545. // with empty values are omitted from API requests. However, any field
  9546. // with an empty value appearing in NullFields will be sent to the
  9547. // server as null. It is an error if a field in this list has a
  9548. // non-empty value. This may be used to include null fields in Patch
  9549. // requests.
  9550. NullFields []string `json:"-"`
  9551. }
  9552. func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
  9553. type NoMethod InstanceGroupManagersScopedList
  9554. raw := NoMethod(*s)
  9555. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9556. }
  9557. // InstanceGroupManagersScopedListWarning: [Output Only] The warning
  9558. // that replaces the list of managed instance groups when the list is
  9559. // empty.
  9560. type InstanceGroupManagersScopedListWarning struct {
  9561. // Code: [Output Only] A warning code, if applicable. For example,
  9562. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9563. // the response.
  9564. //
  9565. // Possible values:
  9566. // "CLEANUP_FAILED"
  9567. // "DEPRECATED_RESOURCE_USED"
  9568. // "DEPRECATED_TYPE_USED"
  9569. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9570. // "EXPERIMENTAL_TYPE_USED"
  9571. // "EXTERNAL_API_WARNING"
  9572. // "FIELD_VALUE_OVERRIDEN"
  9573. // "INJECTED_KERNELS_DEPRECATED"
  9574. // "MISSING_TYPE_DEPENDENCY"
  9575. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9576. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9577. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9578. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9579. // "NEXT_HOP_NOT_RUNNING"
  9580. // "NOT_CRITICAL_ERROR"
  9581. // "NO_RESULTS_ON_PAGE"
  9582. // "REQUIRED_TOS_AGREEMENT"
  9583. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9584. // "RESOURCE_NOT_DELETED"
  9585. // "SCHEMA_VALIDATION_IGNORED"
  9586. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9587. // "UNDECLARED_PROPERTIES"
  9588. // "UNREACHABLE"
  9589. Code string `json:"code,omitempty"`
  9590. // Data: [Output Only] Metadata about this warning in key: value format.
  9591. // For example:
  9592. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9593. Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"`
  9594. // Message: [Output Only] A human-readable description of the warning
  9595. // code.
  9596. Message string `json:"message,omitempty"`
  9597. // ForceSendFields is a list of field names (e.g. "Code") to
  9598. // unconditionally include in API requests. By default, fields with
  9599. // empty values are omitted from API requests. However, any non-pointer,
  9600. // non-interface field appearing in ForceSendFields will be sent to the
  9601. // server regardless of whether the field is empty or not. This may be
  9602. // used to include empty fields in Patch requests.
  9603. ForceSendFields []string `json:"-"`
  9604. // NullFields is a list of field names (e.g. "Code") to include in API
  9605. // requests with the JSON null value. By default, fields with empty
  9606. // values are omitted from API requests. However, any field with an
  9607. // empty value appearing in NullFields will be sent to the server as
  9608. // null. It is an error if a field in this list has a non-empty value.
  9609. // This may be used to include null fields in Patch requests.
  9610. NullFields []string `json:"-"`
  9611. }
  9612. func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
  9613. type NoMethod InstanceGroupManagersScopedListWarning
  9614. raw := NoMethod(*s)
  9615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9616. }
  9617. type InstanceGroupManagersScopedListWarningData struct {
  9618. // Key: [Output Only] A key that provides more detail on the warning
  9619. // being returned. For example, for warnings where there are no results
  9620. // in a list request for a particular zone, this key might be scope and
  9621. // the key value might be the zone name. Other examples might be a key
  9622. // indicating a deprecated resource and a suggested replacement, or a
  9623. // warning about invalid network settings (for example, if an instance
  9624. // attempts to perform IP forwarding but is not enabled for IP
  9625. // forwarding).
  9626. Key string `json:"key,omitempty"`
  9627. // Value: [Output Only] A warning data value corresponding to the key.
  9628. Value string `json:"value,omitempty"`
  9629. // ForceSendFields is a list of field names (e.g. "Key") to
  9630. // unconditionally include in API requests. By default, fields with
  9631. // empty values are omitted from API requests. However, any non-pointer,
  9632. // non-interface field appearing in ForceSendFields will be sent to the
  9633. // server regardless of whether the field is empty or not. This may be
  9634. // used to include empty fields in Patch requests.
  9635. ForceSendFields []string `json:"-"`
  9636. // NullFields is a list of field names (e.g. "Key") to include in API
  9637. // requests with the JSON null value. By default, fields with empty
  9638. // values are omitted from API requests. However, any field with an
  9639. // empty value appearing in NullFields will be sent to the server as
  9640. // null. It is an error if a field in this list has a non-empty value.
  9641. // This may be used to include null fields in Patch requests.
  9642. NullFields []string `json:"-"`
  9643. }
  9644. func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
  9645. type NoMethod InstanceGroupManagersScopedListWarningData
  9646. raw := NoMethod(*s)
  9647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9648. }
  9649. type InstanceGroupManagersSetInstanceTemplateRequest struct {
  9650. // InstanceTemplate: The URL of the instance template that is specified
  9651. // for this managed instance group. The group uses this template to
  9652. // create all new instances in the managed instance group.
  9653. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  9654. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  9655. // unconditionally include in API requests. By default, fields with
  9656. // empty values are omitted from API requests. However, any non-pointer,
  9657. // non-interface field appearing in ForceSendFields will be sent to the
  9658. // server regardless of whether the field is empty or not. This may be
  9659. // used to include empty fields in Patch requests.
  9660. ForceSendFields []string `json:"-"`
  9661. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  9662. // include in API requests with the JSON null value. By default, fields
  9663. // with empty values are omitted from API requests. However, any field
  9664. // with an empty value appearing in NullFields will be sent to the
  9665. // server as null. It is an error if a field in this list has a
  9666. // non-empty value. This may be used to include null fields in Patch
  9667. // requests.
  9668. NullFields []string `json:"-"`
  9669. }
  9670. func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
  9671. type NoMethod InstanceGroupManagersSetInstanceTemplateRequest
  9672. raw := NoMethod(*s)
  9673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9674. }
  9675. type InstanceGroupManagersSetTargetPoolsRequest struct {
  9676. // Fingerprint: The fingerprint of the target pools information. Use
  9677. // this optional property to prevent conflicts when multiple users
  9678. // change the target pools settings concurrently. Obtain the fingerprint
  9679. // with the instanceGroupManagers.get method. Then, include the
  9680. // fingerprint in your request to ensure that you do not overwrite
  9681. // changes that were applied from another concurrent request.
  9682. Fingerprint string `json:"fingerprint,omitempty"`
  9683. // TargetPools: The list of target pool URLs that instances in this
  9684. // managed instance group belong to. The managed instance group applies
  9685. // these target pools to all of the instances in the group. Existing
  9686. // instances and new instances in the group all receive these target
  9687. // pool settings.
  9688. TargetPools []string `json:"targetPools,omitempty"`
  9689. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  9690. // unconditionally include in API requests. By default, fields with
  9691. // empty values are omitted from API requests. However, any non-pointer,
  9692. // non-interface field appearing in ForceSendFields will be sent to the
  9693. // server regardless of whether the field is empty or not. This may be
  9694. // used to include empty fields in Patch requests.
  9695. ForceSendFields []string `json:"-"`
  9696. // NullFields is a list of field names (e.g. "Fingerprint") to include
  9697. // in API requests with the JSON null value. By default, fields with
  9698. // empty values are omitted from API requests. However, any field with
  9699. // an empty value appearing in NullFields will be sent to the server as
  9700. // null. It is an error if a field in this list has a non-empty value.
  9701. // This may be used to include null fields in Patch requests.
  9702. NullFields []string `json:"-"`
  9703. }
  9704. func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  9705. type NoMethod InstanceGroupManagersSetTargetPoolsRequest
  9706. raw := NoMethod(*s)
  9707. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9708. }
  9709. type InstanceGroupsAddInstancesRequest struct {
  9710. // Instances: The list of instances to add to the instance group.
  9711. Instances []*InstanceReference `json:"instances,omitempty"`
  9712. // ForceSendFields is a list of field names (e.g. "Instances") to
  9713. // unconditionally include in API requests. By default, fields with
  9714. // empty values are omitted from API requests. However, any non-pointer,
  9715. // non-interface field appearing in ForceSendFields will be sent to the
  9716. // server regardless of whether the field is empty or not. This may be
  9717. // used to include empty fields in Patch requests.
  9718. ForceSendFields []string `json:"-"`
  9719. // NullFields is a list of field names (e.g. "Instances") to include in
  9720. // API requests with the JSON null value. By default, fields with empty
  9721. // values are omitted from API requests. However, any field with an
  9722. // empty value appearing in NullFields will be sent to the server as
  9723. // null. It is an error if a field in this list has a non-empty value.
  9724. // This may be used to include null fields in Patch requests.
  9725. NullFields []string `json:"-"`
  9726. }
  9727. func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
  9728. type NoMethod InstanceGroupsAddInstancesRequest
  9729. raw := NoMethod(*s)
  9730. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9731. }
  9732. type InstanceGroupsListInstances struct {
  9733. // Id: [Output Only] Unique identifier for the resource; defined by the
  9734. // server.
  9735. Id string `json:"id,omitempty"`
  9736. // Items: A list of InstanceWithNamedPorts resources.
  9737. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  9738. // Kind: [Output Only] The resource type, which is always
  9739. // compute#instanceGroupsListInstances for the list of instances in the
  9740. // specified instance group.
  9741. Kind string `json:"kind,omitempty"`
  9742. // NextPageToken: [Output Only] This token allows you to get the next
  9743. // page of results for list requests. If the number of results is larger
  9744. // than maxResults, use the nextPageToken as a value for the query
  9745. // parameter pageToken in the next list request. Subsequent list
  9746. // requests will have their own nextPageToken to continue paging through
  9747. // the results.
  9748. NextPageToken string `json:"nextPageToken,omitempty"`
  9749. // SelfLink: [Output Only] Server-defined URL for this resource.
  9750. SelfLink string `json:"selfLink,omitempty"`
  9751. // Warning: [Output Only] Informational warning message.
  9752. Warning *InstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  9753. // ServerResponse contains the HTTP response code and headers from the
  9754. // server.
  9755. googleapi.ServerResponse `json:"-"`
  9756. // ForceSendFields is a list of field names (e.g. "Id") to
  9757. // unconditionally include in API requests. By default, fields with
  9758. // empty values are omitted from API requests. However, any non-pointer,
  9759. // non-interface field appearing in ForceSendFields will be sent to the
  9760. // server regardless of whether the field is empty or not. This may be
  9761. // used to include empty fields in Patch requests.
  9762. ForceSendFields []string `json:"-"`
  9763. // NullFields is a list of field names (e.g. "Id") to include in API
  9764. // requests with the JSON null value. By default, fields with empty
  9765. // values are omitted from API requests. However, any field with an
  9766. // empty value appearing in NullFields will be sent to the server as
  9767. // null. It is an error if a field in this list has a non-empty value.
  9768. // This may be used to include null fields in Patch requests.
  9769. NullFields []string `json:"-"`
  9770. }
  9771. func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  9772. type NoMethod InstanceGroupsListInstances
  9773. raw := NoMethod(*s)
  9774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9775. }
  9776. // InstanceGroupsListInstancesWarning: [Output Only] Informational
  9777. // warning message.
  9778. type InstanceGroupsListInstancesWarning struct {
  9779. // Code: [Output Only] A warning code, if applicable. For example,
  9780. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9781. // the response.
  9782. //
  9783. // Possible values:
  9784. // "CLEANUP_FAILED"
  9785. // "DEPRECATED_RESOURCE_USED"
  9786. // "DEPRECATED_TYPE_USED"
  9787. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9788. // "EXPERIMENTAL_TYPE_USED"
  9789. // "EXTERNAL_API_WARNING"
  9790. // "FIELD_VALUE_OVERRIDEN"
  9791. // "INJECTED_KERNELS_DEPRECATED"
  9792. // "MISSING_TYPE_DEPENDENCY"
  9793. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9794. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9795. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9796. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9797. // "NEXT_HOP_NOT_RUNNING"
  9798. // "NOT_CRITICAL_ERROR"
  9799. // "NO_RESULTS_ON_PAGE"
  9800. // "REQUIRED_TOS_AGREEMENT"
  9801. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9802. // "RESOURCE_NOT_DELETED"
  9803. // "SCHEMA_VALIDATION_IGNORED"
  9804. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9805. // "UNDECLARED_PROPERTIES"
  9806. // "UNREACHABLE"
  9807. Code string `json:"code,omitempty"`
  9808. // Data: [Output Only] Metadata about this warning in key: value format.
  9809. // For example:
  9810. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9811. Data []*InstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  9812. // Message: [Output Only] A human-readable description of the warning
  9813. // code.
  9814. Message string `json:"message,omitempty"`
  9815. // ForceSendFields is a list of field names (e.g. "Code") to
  9816. // unconditionally include in API requests. By default, fields with
  9817. // empty values are omitted from API requests. However, any non-pointer,
  9818. // non-interface field appearing in ForceSendFields will be sent to the
  9819. // server regardless of whether the field is empty or not. This may be
  9820. // used to include empty fields in Patch requests.
  9821. ForceSendFields []string `json:"-"`
  9822. // NullFields is a list of field names (e.g. "Code") to include in API
  9823. // requests with the JSON null value. By default, fields with empty
  9824. // values are omitted from API requests. However, any field with an
  9825. // empty value appearing in NullFields will be sent to the server as
  9826. // null. It is an error if a field in this list has a non-empty value.
  9827. // This may be used to include null fields in Patch requests.
  9828. NullFields []string `json:"-"`
  9829. }
  9830. func (s *InstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  9831. type NoMethod InstanceGroupsListInstancesWarning
  9832. raw := NoMethod(*s)
  9833. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9834. }
  9835. type InstanceGroupsListInstancesWarningData struct {
  9836. // Key: [Output Only] A key that provides more detail on the warning
  9837. // being returned. For example, for warnings where there are no results
  9838. // in a list request for a particular zone, this key might be scope and
  9839. // the key value might be the zone name. Other examples might be a key
  9840. // indicating a deprecated resource and a suggested replacement, or a
  9841. // warning about invalid network settings (for example, if an instance
  9842. // attempts to perform IP forwarding but is not enabled for IP
  9843. // forwarding).
  9844. Key string `json:"key,omitempty"`
  9845. // Value: [Output Only] A warning data value corresponding to the key.
  9846. Value string `json:"value,omitempty"`
  9847. // ForceSendFields is a list of field names (e.g. "Key") to
  9848. // unconditionally include in API requests. By default, fields with
  9849. // empty values are omitted from API requests. However, any non-pointer,
  9850. // non-interface field appearing in ForceSendFields will be sent to the
  9851. // server regardless of whether the field is empty or not. This may be
  9852. // used to include empty fields in Patch requests.
  9853. ForceSendFields []string `json:"-"`
  9854. // NullFields is a list of field names (e.g. "Key") to include in API
  9855. // requests with the JSON null value. By default, fields with empty
  9856. // values are omitted from API requests. However, any field with an
  9857. // empty value appearing in NullFields will be sent to the server as
  9858. // null. It is an error if a field in this list has a non-empty value.
  9859. // This may be used to include null fields in Patch requests.
  9860. NullFields []string `json:"-"`
  9861. }
  9862. func (s *InstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  9863. type NoMethod InstanceGroupsListInstancesWarningData
  9864. raw := NoMethod(*s)
  9865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9866. }
  9867. type InstanceGroupsListInstancesRequest struct {
  9868. // InstanceState: A filter for the state of the instances in the
  9869. // instance group. Valid options are ALL or RUNNING. If you do not
  9870. // specify this parameter the list includes all instances regardless of
  9871. // their state.
  9872. //
  9873. // Possible values:
  9874. // "ALL"
  9875. // "RUNNING"
  9876. InstanceState string `json:"instanceState,omitempty"`
  9877. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  9878. // unconditionally include in API requests. By default, fields with
  9879. // empty values are omitted from API requests. However, any non-pointer,
  9880. // non-interface field appearing in ForceSendFields will be sent to the
  9881. // server regardless of whether the field is empty or not. This may be
  9882. // used to include empty fields in Patch requests.
  9883. ForceSendFields []string `json:"-"`
  9884. // NullFields is a list of field names (e.g. "InstanceState") to include
  9885. // in API requests with the JSON null value. By default, fields with
  9886. // empty values are omitted from API requests. However, any field with
  9887. // an empty value appearing in NullFields will be sent to the server as
  9888. // null. It is an error if a field in this list has a non-empty value.
  9889. // This may be used to include null fields in Patch requests.
  9890. NullFields []string `json:"-"`
  9891. }
  9892. func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  9893. type NoMethod InstanceGroupsListInstancesRequest
  9894. raw := NoMethod(*s)
  9895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9896. }
  9897. type InstanceGroupsRemoveInstancesRequest struct {
  9898. // Instances: The list of instances to remove from the instance group.
  9899. Instances []*InstanceReference `json:"instances,omitempty"`
  9900. // ForceSendFields is a list of field names (e.g. "Instances") to
  9901. // unconditionally include in API requests. By default, fields with
  9902. // empty values are omitted from API requests. However, any non-pointer,
  9903. // non-interface field appearing in ForceSendFields will be sent to the
  9904. // server regardless of whether the field is empty or not. This may be
  9905. // used to include empty fields in Patch requests.
  9906. ForceSendFields []string `json:"-"`
  9907. // NullFields is a list of field names (e.g. "Instances") to include in
  9908. // API requests with the JSON null value. By default, fields with empty
  9909. // values are omitted from API requests. However, any field with an
  9910. // empty value appearing in NullFields will be sent to the server as
  9911. // null. It is an error if a field in this list has a non-empty value.
  9912. // This may be used to include null fields in Patch requests.
  9913. NullFields []string `json:"-"`
  9914. }
  9915. func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
  9916. type NoMethod InstanceGroupsRemoveInstancesRequest
  9917. raw := NoMethod(*s)
  9918. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9919. }
  9920. type InstanceGroupsScopedList struct {
  9921. // InstanceGroups: [Output Only] The list of instance groups that are
  9922. // contained in this scope.
  9923. InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"`
  9924. // Warning: [Output Only] An informational warning that replaces the
  9925. // list of instance groups when the list is empty.
  9926. Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"`
  9927. // ForceSendFields is a list of field names (e.g. "InstanceGroups") to
  9928. // unconditionally include in API requests. By default, fields with
  9929. // empty values are omitted from API requests. However, any non-pointer,
  9930. // non-interface field appearing in ForceSendFields will be sent to the
  9931. // server regardless of whether the field is empty or not. This may be
  9932. // used to include empty fields in Patch requests.
  9933. ForceSendFields []string `json:"-"`
  9934. // NullFields is a list of field names (e.g. "InstanceGroups") to
  9935. // include in API requests with the JSON null value. By default, fields
  9936. // with empty values are omitted from API requests. However, any field
  9937. // with an empty value appearing in NullFields will be sent to the
  9938. // server as null. It is an error if a field in this list has a
  9939. // non-empty value. This may be used to include null fields in Patch
  9940. // requests.
  9941. NullFields []string `json:"-"`
  9942. }
  9943. func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
  9944. type NoMethod InstanceGroupsScopedList
  9945. raw := NoMethod(*s)
  9946. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9947. }
  9948. // InstanceGroupsScopedListWarning: [Output Only] An informational
  9949. // warning that replaces the list of instance groups when the list is
  9950. // empty.
  9951. type InstanceGroupsScopedListWarning struct {
  9952. // Code: [Output Only] A warning code, if applicable. For example,
  9953. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9954. // the response.
  9955. //
  9956. // Possible values:
  9957. // "CLEANUP_FAILED"
  9958. // "DEPRECATED_RESOURCE_USED"
  9959. // "DEPRECATED_TYPE_USED"
  9960. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9961. // "EXPERIMENTAL_TYPE_USED"
  9962. // "EXTERNAL_API_WARNING"
  9963. // "FIELD_VALUE_OVERRIDEN"
  9964. // "INJECTED_KERNELS_DEPRECATED"
  9965. // "MISSING_TYPE_DEPENDENCY"
  9966. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9967. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9968. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9969. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9970. // "NEXT_HOP_NOT_RUNNING"
  9971. // "NOT_CRITICAL_ERROR"
  9972. // "NO_RESULTS_ON_PAGE"
  9973. // "REQUIRED_TOS_AGREEMENT"
  9974. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9975. // "RESOURCE_NOT_DELETED"
  9976. // "SCHEMA_VALIDATION_IGNORED"
  9977. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9978. // "UNDECLARED_PROPERTIES"
  9979. // "UNREACHABLE"
  9980. Code string `json:"code,omitempty"`
  9981. // Data: [Output Only] Metadata about this warning in key: value format.
  9982. // For example:
  9983. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9984. Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"`
  9985. // Message: [Output Only] A human-readable description of the warning
  9986. // code.
  9987. Message string `json:"message,omitempty"`
  9988. // ForceSendFields is a list of field names (e.g. "Code") to
  9989. // unconditionally include in API requests. By default, fields with
  9990. // empty values are omitted from API requests. However, any non-pointer,
  9991. // non-interface field appearing in ForceSendFields will be sent to the
  9992. // server regardless of whether the field is empty or not. This may be
  9993. // used to include empty fields in Patch requests.
  9994. ForceSendFields []string `json:"-"`
  9995. // NullFields is a list of field names (e.g. "Code") to include in API
  9996. // requests with the JSON null value. By default, fields with empty
  9997. // values are omitted from API requests. However, any field with an
  9998. // empty value appearing in NullFields will be sent to the server as
  9999. // null. It is an error if a field in this list has a non-empty value.
  10000. // This may be used to include null fields in Patch requests.
  10001. NullFields []string `json:"-"`
  10002. }
  10003. func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  10004. type NoMethod InstanceGroupsScopedListWarning
  10005. raw := NoMethod(*s)
  10006. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10007. }
  10008. type InstanceGroupsScopedListWarningData struct {
  10009. // Key: [Output Only] A key that provides more detail on the warning
  10010. // being returned. For example, for warnings where there are no results
  10011. // in a list request for a particular zone, this key might be scope and
  10012. // the key value might be the zone name. Other examples might be a key
  10013. // indicating a deprecated resource and a suggested replacement, or a
  10014. // warning about invalid network settings (for example, if an instance
  10015. // attempts to perform IP forwarding but is not enabled for IP
  10016. // forwarding).
  10017. Key string `json:"key,omitempty"`
  10018. // Value: [Output Only] A warning data value corresponding to the key.
  10019. Value string `json:"value,omitempty"`
  10020. // ForceSendFields is a list of field names (e.g. "Key") to
  10021. // unconditionally include in API requests. By default, fields with
  10022. // empty values are omitted from API requests. However, any non-pointer,
  10023. // non-interface field appearing in ForceSendFields will be sent to the
  10024. // server regardless of whether the field is empty or not. This may be
  10025. // used to include empty fields in Patch requests.
  10026. ForceSendFields []string `json:"-"`
  10027. // NullFields is a list of field names (e.g. "Key") to include in API
  10028. // requests with the JSON null value. By default, fields with empty
  10029. // values are omitted from API requests. However, any field with an
  10030. // empty value appearing in NullFields will be sent to the server as
  10031. // null. It is an error if a field in this list has a non-empty value.
  10032. // This may be used to include null fields in Patch requests.
  10033. NullFields []string `json:"-"`
  10034. }
  10035. func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  10036. type NoMethod InstanceGroupsScopedListWarningData
  10037. raw := NoMethod(*s)
  10038. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10039. }
  10040. type InstanceGroupsSetNamedPortsRequest struct {
  10041. // Fingerprint: The fingerprint of the named ports information for this
  10042. // instance group. Use this optional property to prevent conflicts when
  10043. // multiple users change the named ports settings concurrently. Obtain
  10044. // the fingerprint with the instanceGroups.get method. Then, include the
  10045. // fingerprint in your request to ensure that you do not overwrite
  10046. // changes that were applied from another concurrent request. A request
  10047. // with an incorrect fingerprint will fail with error 412
  10048. // conditionNotMet.
  10049. Fingerprint string `json:"fingerprint,omitempty"`
  10050. // NamedPorts: The list of named ports to set for this instance group.
  10051. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  10052. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  10053. // unconditionally include in API requests. By default, fields with
  10054. // empty values are omitted from API requests. However, any non-pointer,
  10055. // non-interface field appearing in ForceSendFields will be sent to the
  10056. // server regardless of whether the field is empty or not. This may be
  10057. // used to include empty fields in Patch requests.
  10058. ForceSendFields []string `json:"-"`
  10059. // NullFields is a list of field names (e.g. "Fingerprint") to include
  10060. // in API requests with the JSON null value. By default, fields with
  10061. // empty values are omitted from API requests. However, any field with
  10062. // an empty value appearing in NullFields will be sent to the server as
  10063. // null. It is an error if a field in this list has a non-empty value.
  10064. // This may be used to include null fields in Patch requests.
  10065. NullFields []string `json:"-"`
  10066. }
  10067. func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  10068. type NoMethod InstanceGroupsSetNamedPortsRequest
  10069. raw := NoMethod(*s)
  10070. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10071. }
  10072. // InstanceList: Contains a list of instances.
  10073. type InstanceList struct {
  10074. // Id: [Output Only] Unique identifier for the resource; defined by the
  10075. // server.
  10076. Id string `json:"id,omitempty"`
  10077. // Items: A list of Instance resources.
  10078. Items []*Instance `json:"items,omitempty"`
  10079. // Kind: [Output Only] Type of resource. Always compute#instanceList for
  10080. // lists of Instance resources.
  10081. Kind string `json:"kind,omitempty"`
  10082. // NextPageToken: [Output Only] This token allows you to get the next
  10083. // page of results for list requests. If the number of results is larger
  10084. // than maxResults, use the nextPageToken as a value for the query
  10085. // parameter pageToken in the next list request. Subsequent list
  10086. // requests will have their own nextPageToken to continue paging through
  10087. // the results.
  10088. NextPageToken string `json:"nextPageToken,omitempty"`
  10089. // SelfLink: [Output Only] Server-defined URL for this resource.
  10090. SelfLink string `json:"selfLink,omitempty"`
  10091. // Warning: [Output Only] Informational warning message.
  10092. Warning *InstanceListWarning `json:"warning,omitempty"`
  10093. // ServerResponse contains the HTTP response code and headers from the
  10094. // server.
  10095. googleapi.ServerResponse `json:"-"`
  10096. // ForceSendFields is a list of field names (e.g. "Id") to
  10097. // unconditionally include in API requests. By default, fields with
  10098. // empty values are omitted from API requests. However, any non-pointer,
  10099. // non-interface field appearing in ForceSendFields will be sent to the
  10100. // server regardless of whether the field is empty or not. This may be
  10101. // used to include empty fields in Patch requests.
  10102. ForceSendFields []string `json:"-"`
  10103. // NullFields is a list of field names (e.g. "Id") to include in API
  10104. // requests with the JSON null value. By default, fields with empty
  10105. // values are omitted from API requests. However, any field with an
  10106. // empty value appearing in NullFields will be sent to the server as
  10107. // null. It is an error if a field in this list has a non-empty value.
  10108. // This may be used to include null fields in Patch requests.
  10109. NullFields []string `json:"-"`
  10110. }
  10111. func (s *InstanceList) MarshalJSON() ([]byte, error) {
  10112. type NoMethod InstanceList
  10113. raw := NoMethod(*s)
  10114. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10115. }
  10116. // InstanceListWarning: [Output Only] Informational warning message.
  10117. type InstanceListWarning struct {
  10118. // Code: [Output Only] A warning code, if applicable. For example,
  10119. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10120. // the response.
  10121. //
  10122. // Possible values:
  10123. // "CLEANUP_FAILED"
  10124. // "DEPRECATED_RESOURCE_USED"
  10125. // "DEPRECATED_TYPE_USED"
  10126. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10127. // "EXPERIMENTAL_TYPE_USED"
  10128. // "EXTERNAL_API_WARNING"
  10129. // "FIELD_VALUE_OVERRIDEN"
  10130. // "INJECTED_KERNELS_DEPRECATED"
  10131. // "MISSING_TYPE_DEPENDENCY"
  10132. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10133. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10134. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10135. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10136. // "NEXT_HOP_NOT_RUNNING"
  10137. // "NOT_CRITICAL_ERROR"
  10138. // "NO_RESULTS_ON_PAGE"
  10139. // "REQUIRED_TOS_AGREEMENT"
  10140. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10141. // "RESOURCE_NOT_DELETED"
  10142. // "SCHEMA_VALIDATION_IGNORED"
  10143. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10144. // "UNDECLARED_PROPERTIES"
  10145. // "UNREACHABLE"
  10146. Code string `json:"code,omitempty"`
  10147. // Data: [Output Only] Metadata about this warning in key: value format.
  10148. // For example:
  10149. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10150. Data []*InstanceListWarningData `json:"data,omitempty"`
  10151. // Message: [Output Only] A human-readable description of the warning
  10152. // code.
  10153. Message string `json:"message,omitempty"`
  10154. // ForceSendFields is a list of field names (e.g. "Code") to
  10155. // unconditionally include in API requests. By default, fields with
  10156. // empty values are omitted from API requests. However, any non-pointer,
  10157. // non-interface field appearing in ForceSendFields will be sent to the
  10158. // server regardless of whether the field is empty or not. This may be
  10159. // used to include empty fields in Patch requests.
  10160. ForceSendFields []string `json:"-"`
  10161. // NullFields is a list of field names (e.g. "Code") to include in API
  10162. // requests with the JSON null value. By default, fields with empty
  10163. // values are omitted from API requests. However, any field with an
  10164. // empty value appearing in NullFields will be sent to the server as
  10165. // null. It is an error if a field in this list has a non-empty value.
  10166. // This may be used to include null fields in Patch requests.
  10167. NullFields []string `json:"-"`
  10168. }
  10169. func (s *InstanceListWarning) MarshalJSON() ([]byte, error) {
  10170. type NoMethod InstanceListWarning
  10171. raw := NoMethod(*s)
  10172. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10173. }
  10174. type InstanceListWarningData struct {
  10175. // Key: [Output Only] A key that provides more detail on the warning
  10176. // being returned. For example, for warnings where there are no results
  10177. // in a list request for a particular zone, this key might be scope and
  10178. // the key value might be the zone name. Other examples might be a key
  10179. // indicating a deprecated resource and a suggested replacement, or a
  10180. // warning about invalid network settings (for example, if an instance
  10181. // attempts to perform IP forwarding but is not enabled for IP
  10182. // forwarding).
  10183. Key string `json:"key,omitempty"`
  10184. // Value: [Output Only] A warning data value corresponding to the key.
  10185. Value string `json:"value,omitempty"`
  10186. // ForceSendFields is a list of field names (e.g. "Key") to
  10187. // unconditionally include in API requests. By default, fields with
  10188. // empty values are omitted from API requests. However, any non-pointer,
  10189. // non-interface field appearing in ForceSendFields will be sent to the
  10190. // server regardless of whether the field is empty or not. This may be
  10191. // used to include empty fields in Patch requests.
  10192. ForceSendFields []string `json:"-"`
  10193. // NullFields is a list of field names (e.g. "Key") to include in API
  10194. // requests with the JSON null value. By default, fields with empty
  10195. // values are omitted from API requests. However, any field with an
  10196. // empty value appearing in NullFields will be sent to the server as
  10197. // null. It is an error if a field in this list has a non-empty value.
  10198. // This may be used to include null fields in Patch requests.
  10199. NullFields []string `json:"-"`
  10200. }
  10201. func (s *InstanceListWarningData) MarshalJSON() ([]byte, error) {
  10202. type NoMethod InstanceListWarningData
  10203. raw := NoMethod(*s)
  10204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10205. }
  10206. // InstanceListReferrers: Contains a list of instance referrers.
  10207. type InstanceListReferrers struct {
  10208. // Id: [Output Only] Unique identifier for the resource; defined by the
  10209. // server.
  10210. Id string `json:"id,omitempty"`
  10211. // Items: A list of Reference resources.
  10212. Items []*Reference `json:"items,omitempty"`
  10213. // Kind: [Output Only] Type of resource. Always
  10214. // compute#instanceListReferrers for lists of Instance referrers.
  10215. Kind string `json:"kind,omitempty"`
  10216. // NextPageToken: [Output Only] This token allows you to get the next
  10217. // page of results for list requests. If the number of results is larger
  10218. // than maxResults, use the nextPageToken as a value for the query
  10219. // parameter pageToken in the next list request. Subsequent list
  10220. // requests will have their own nextPageToken to continue paging through
  10221. // the results.
  10222. NextPageToken string `json:"nextPageToken,omitempty"`
  10223. // SelfLink: [Output Only] Server-defined URL for this resource.
  10224. SelfLink string `json:"selfLink,omitempty"`
  10225. // Warning: [Output Only] Informational warning message.
  10226. Warning *InstanceListReferrersWarning `json:"warning,omitempty"`
  10227. // ServerResponse contains the HTTP response code and headers from the
  10228. // server.
  10229. googleapi.ServerResponse `json:"-"`
  10230. // ForceSendFields is a list of field names (e.g. "Id") to
  10231. // unconditionally include in API requests. By default, fields with
  10232. // empty values are omitted from API requests. However, any non-pointer,
  10233. // non-interface field appearing in ForceSendFields will be sent to the
  10234. // server regardless of whether the field is empty or not. This may be
  10235. // used to include empty fields in Patch requests.
  10236. ForceSendFields []string `json:"-"`
  10237. // NullFields is a list of field names (e.g. "Id") to include in API
  10238. // requests with the JSON null value. By default, fields with empty
  10239. // values are omitted from API requests. However, any field with an
  10240. // empty value appearing in NullFields will be sent to the server as
  10241. // null. It is an error if a field in this list has a non-empty value.
  10242. // This may be used to include null fields in Patch requests.
  10243. NullFields []string `json:"-"`
  10244. }
  10245. func (s *InstanceListReferrers) MarshalJSON() ([]byte, error) {
  10246. type NoMethod InstanceListReferrers
  10247. raw := NoMethod(*s)
  10248. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10249. }
  10250. // InstanceListReferrersWarning: [Output Only] Informational warning
  10251. // message.
  10252. type InstanceListReferrersWarning struct {
  10253. // Code: [Output Only] A warning code, if applicable. For example,
  10254. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10255. // the response.
  10256. //
  10257. // Possible values:
  10258. // "CLEANUP_FAILED"
  10259. // "DEPRECATED_RESOURCE_USED"
  10260. // "DEPRECATED_TYPE_USED"
  10261. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10262. // "EXPERIMENTAL_TYPE_USED"
  10263. // "EXTERNAL_API_WARNING"
  10264. // "FIELD_VALUE_OVERRIDEN"
  10265. // "INJECTED_KERNELS_DEPRECATED"
  10266. // "MISSING_TYPE_DEPENDENCY"
  10267. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10268. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10269. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10270. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10271. // "NEXT_HOP_NOT_RUNNING"
  10272. // "NOT_CRITICAL_ERROR"
  10273. // "NO_RESULTS_ON_PAGE"
  10274. // "REQUIRED_TOS_AGREEMENT"
  10275. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10276. // "RESOURCE_NOT_DELETED"
  10277. // "SCHEMA_VALIDATION_IGNORED"
  10278. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10279. // "UNDECLARED_PROPERTIES"
  10280. // "UNREACHABLE"
  10281. Code string `json:"code,omitempty"`
  10282. // Data: [Output Only] Metadata about this warning in key: value format.
  10283. // For example:
  10284. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10285. Data []*InstanceListReferrersWarningData `json:"data,omitempty"`
  10286. // Message: [Output Only] A human-readable description of the warning
  10287. // code.
  10288. Message string `json:"message,omitempty"`
  10289. // ForceSendFields is a list of field names (e.g. "Code") to
  10290. // unconditionally include in API requests. By default, fields with
  10291. // empty values are omitted from API requests. However, any non-pointer,
  10292. // non-interface field appearing in ForceSendFields will be sent to the
  10293. // server regardless of whether the field is empty or not. This may be
  10294. // used to include empty fields in Patch requests.
  10295. ForceSendFields []string `json:"-"`
  10296. // NullFields is a list of field names (e.g. "Code") to include in API
  10297. // requests with the JSON null value. By default, fields with empty
  10298. // values are omitted from API requests. However, any field with an
  10299. // empty value appearing in NullFields will be sent to the server as
  10300. // null. It is an error if a field in this list has a non-empty value.
  10301. // This may be used to include null fields in Patch requests.
  10302. NullFields []string `json:"-"`
  10303. }
  10304. func (s *InstanceListReferrersWarning) MarshalJSON() ([]byte, error) {
  10305. type NoMethod InstanceListReferrersWarning
  10306. raw := NoMethod(*s)
  10307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10308. }
  10309. type InstanceListReferrersWarningData struct {
  10310. // Key: [Output Only] A key that provides more detail on the warning
  10311. // being returned. For example, for warnings where there are no results
  10312. // in a list request for a particular zone, this key might be scope and
  10313. // the key value might be the zone name. Other examples might be a key
  10314. // indicating a deprecated resource and a suggested replacement, or a
  10315. // warning about invalid network settings (for example, if an instance
  10316. // attempts to perform IP forwarding but is not enabled for IP
  10317. // forwarding).
  10318. Key string `json:"key,omitempty"`
  10319. // Value: [Output Only] A warning data value corresponding to the key.
  10320. Value string `json:"value,omitempty"`
  10321. // ForceSendFields is a list of field names (e.g. "Key") to
  10322. // unconditionally include in API requests. By default, fields with
  10323. // empty values are omitted from API requests. However, any non-pointer,
  10324. // non-interface field appearing in ForceSendFields will be sent to the
  10325. // server regardless of whether the field is empty or not. This may be
  10326. // used to include empty fields in Patch requests.
  10327. ForceSendFields []string `json:"-"`
  10328. // NullFields is a list of field names (e.g. "Key") to include in API
  10329. // requests with the JSON null value. By default, fields with empty
  10330. // values are omitted from API requests. However, any field with an
  10331. // empty value appearing in NullFields will be sent to the server as
  10332. // null. It is an error if a field in this list has a non-empty value.
  10333. // This may be used to include null fields in Patch requests.
  10334. NullFields []string `json:"-"`
  10335. }
  10336. func (s *InstanceListReferrersWarningData) MarshalJSON() ([]byte, error) {
  10337. type NoMethod InstanceListReferrersWarningData
  10338. raw := NoMethod(*s)
  10339. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10340. }
  10341. type InstanceMoveRequest struct {
  10342. // DestinationZone: The URL of the destination zone to move the
  10343. // instance. This can be a full or partial URL. For example, the
  10344. // following are all valid URLs to a zone:
  10345. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  10346. //
  10347. // - projects/project/zones/zone
  10348. // - zones/zone
  10349. DestinationZone string `json:"destinationZone,omitempty"`
  10350. // TargetInstance: The URL of the target instance to move. This can be a
  10351. // full or partial URL. For example, the following are all valid URLs to
  10352. // an instance:
  10353. // -
  10354. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  10355. // - projects/project/zones/zone/instances/instance
  10356. // - zones/zone/instances/instance
  10357. TargetInstance string `json:"targetInstance,omitempty"`
  10358. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  10359. // unconditionally include in API requests. By default, fields with
  10360. // empty values are omitted from API requests. However, any non-pointer,
  10361. // non-interface field appearing in ForceSendFields will be sent to the
  10362. // server regardless of whether the field is empty or not. This may be
  10363. // used to include empty fields in Patch requests.
  10364. ForceSendFields []string `json:"-"`
  10365. // NullFields is a list of field names (e.g. "DestinationZone") to
  10366. // include in API requests with the JSON null value. By default, fields
  10367. // with empty values are omitted from API requests. However, any field
  10368. // with an empty value appearing in NullFields will be sent to the
  10369. // server as null. It is an error if a field in this list has a
  10370. // non-empty value. This may be used to include null fields in Patch
  10371. // requests.
  10372. NullFields []string `json:"-"`
  10373. }
  10374. func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) {
  10375. type NoMethod InstanceMoveRequest
  10376. raw := NoMethod(*s)
  10377. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10378. }
  10379. type InstanceProperties struct {
  10380. // CanIpForward: Enables instances created based on this template to
  10381. // send packets with source IP addresses other than their own and
  10382. // receive packets with destination IP addresses other than their own.
  10383. // If these instances will be used as an IP gateway or it will be set as
  10384. // the next-hop in a Route resource, specify true. If unsure, leave this
  10385. // set to false. See the Enable IP forwarding documentation for more
  10386. // information.
  10387. CanIpForward bool `json:"canIpForward,omitempty"`
  10388. // Description: An optional text description for the instances that are
  10389. // created from this instance template.
  10390. Description string `json:"description,omitempty"`
  10391. // Disks: An array of disks that are associated with the instances that
  10392. // are created from this template.
  10393. Disks []*AttachedDisk `json:"disks,omitempty"`
  10394. // GuestAccelerators: A list of guest accelerator cards' type and count
  10395. // to use for instances created from the instance template.
  10396. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  10397. // Labels: Labels to apply to instances that are created from this
  10398. // template.
  10399. Labels map[string]string `json:"labels,omitempty"`
  10400. // MachineType: The machine type to use for instances that are created
  10401. // from this template.
  10402. MachineType string `json:"machineType,omitempty"`
  10403. // Metadata: The metadata key/value pairs to assign to instances that
  10404. // are created from this template. These pairs can consist of custom
  10405. // metadata or predefined keys. See Project and instance metadata for
  10406. // more information.
  10407. Metadata *Metadata `json:"metadata,omitempty"`
  10408. // MinCpuPlatform: Minimum cpu/platform to be used by this instance. The
  10409. // instance may be scheduled on the specified or newer cpu/platform.
  10410. // Applicable values are the friendly names of CPU platforms, such as
  10411. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  10412. // Bridge". For more information, read Specifying a Minimum CPU
  10413. // Platform.
  10414. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  10415. // NetworkInterfaces: An array of network access configurations for this
  10416. // interface.
  10417. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  10418. // Scheduling: Specifies the scheduling options for the instances that
  10419. // are created from this template.
  10420. Scheduling *Scheduling `json:"scheduling,omitempty"`
  10421. // ServiceAccounts: A list of service accounts with specified scopes.
  10422. // Access tokens for these service accounts are available to the
  10423. // instances that are created from this template. Use metadata queries
  10424. // to obtain the access tokens for these instances.
  10425. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  10426. // Tags: A list of tags to apply to the instances that are created from
  10427. // this template. The tags identify valid sources or targets for network
  10428. // firewalls. The setTags method can modify this list of tags. Each tag
  10429. // within the list must comply with RFC1035.
  10430. Tags *Tags `json:"tags,omitempty"`
  10431. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  10432. // unconditionally include in API requests. By default, fields with
  10433. // empty values are omitted from API requests. However, any non-pointer,
  10434. // non-interface field appearing in ForceSendFields will be sent to the
  10435. // server regardless of whether the field is empty or not. This may be
  10436. // used to include empty fields in Patch requests.
  10437. ForceSendFields []string `json:"-"`
  10438. // NullFields is a list of field names (e.g. "CanIpForward") to include
  10439. // in API requests with the JSON null value. By default, fields with
  10440. // empty values are omitted from API requests. However, any field with
  10441. // an empty value appearing in NullFields will be sent to the server as
  10442. // null. It is an error if a field in this list has a non-empty value.
  10443. // This may be used to include null fields in Patch requests.
  10444. NullFields []string `json:"-"`
  10445. }
  10446. func (s *InstanceProperties) MarshalJSON() ([]byte, error) {
  10447. type NoMethod InstanceProperties
  10448. raw := NoMethod(*s)
  10449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10450. }
  10451. type InstanceReference struct {
  10452. // Instance: The URL for a specific instance.
  10453. Instance string `json:"instance,omitempty"`
  10454. // ForceSendFields is a list of field names (e.g. "Instance") to
  10455. // unconditionally include in API requests. By default, fields with
  10456. // empty values are omitted from API requests. However, any non-pointer,
  10457. // non-interface field appearing in ForceSendFields will be sent to the
  10458. // server regardless of whether the field is empty or not. This may be
  10459. // used to include empty fields in Patch requests.
  10460. ForceSendFields []string `json:"-"`
  10461. // NullFields is a list of field names (e.g. "Instance") to include in
  10462. // API requests with the JSON null value. By default, fields with empty
  10463. // values are omitted from API requests. However, any field with an
  10464. // empty value appearing in NullFields will be sent to the server as
  10465. // null. It is an error if a field in this list has a non-empty value.
  10466. // This may be used to include null fields in Patch requests.
  10467. NullFields []string `json:"-"`
  10468. }
  10469. func (s *InstanceReference) MarshalJSON() ([]byte, error) {
  10470. type NoMethod InstanceReference
  10471. raw := NoMethod(*s)
  10472. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10473. }
  10474. // InstanceTemplate: An Instance Template resource. (== resource_for
  10475. // beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)
  10476. type InstanceTemplate struct {
  10477. // CreationTimestamp: [Output Only] The creation timestamp for this
  10478. // instance template in RFC3339 text format.
  10479. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10480. // Description: An optional description of this resource. Provide this
  10481. // property when you create the resource.
  10482. Description string `json:"description,omitempty"`
  10483. // Id: [Output Only] A unique identifier for this instance template. The
  10484. // server defines this identifier.
  10485. Id uint64 `json:"id,omitempty,string"`
  10486. // Kind: [Output Only] The resource type, which is always
  10487. // compute#instanceTemplate for instance templates.
  10488. Kind string `json:"kind,omitempty"`
  10489. // Name: Name of the resource; provided by the client when the resource
  10490. // is created. The name must be 1-63 characters long, and comply with
  10491. // RFC1035. Specifically, the name must be 1-63 characters long and
  10492. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  10493. // the first character must be a lowercase letter, and all following
  10494. // characters must be a dash, lowercase letter, or digit, except the
  10495. // last character, which cannot be a dash.
  10496. Name string `json:"name,omitempty"`
  10497. // Properties: The instance properties for this instance template.
  10498. Properties *InstanceProperties `json:"properties,omitempty"`
  10499. // SelfLink: [Output Only] The URL for this instance template. The
  10500. // server defines this URL.
  10501. SelfLink string `json:"selfLink,omitempty"`
  10502. // SourceInstance: The source instance used to create the template. You
  10503. // can provide this as a partial or full URL to the resource. For
  10504. // example, the following are valid values:
  10505. // -
  10506. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  10507. // - projects/project/zones/zone/instances/instance
  10508. SourceInstance string `json:"sourceInstance,omitempty"`
  10509. // SourceInstanceParams: The source instance params to use to create
  10510. // this instance template.
  10511. SourceInstanceParams *SourceInstanceParams `json:"sourceInstanceParams,omitempty"`
  10512. // ServerResponse contains the HTTP response code and headers from the
  10513. // server.
  10514. googleapi.ServerResponse `json:"-"`
  10515. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  10516. // to unconditionally include in API requests. By default, fields with
  10517. // empty values are omitted from API requests. However, any non-pointer,
  10518. // non-interface field appearing in ForceSendFields will be sent to the
  10519. // server regardless of whether the field is empty or not. This may be
  10520. // used to include empty fields in Patch requests.
  10521. ForceSendFields []string `json:"-"`
  10522. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  10523. // include in API requests with the JSON null value. By default, fields
  10524. // with empty values are omitted from API requests. However, any field
  10525. // with an empty value appearing in NullFields will be sent to the
  10526. // server as null. It is an error if a field in this list has a
  10527. // non-empty value. This may be used to include null fields in Patch
  10528. // requests.
  10529. NullFields []string `json:"-"`
  10530. }
  10531. func (s *InstanceTemplate) MarshalJSON() ([]byte, error) {
  10532. type NoMethod InstanceTemplate
  10533. raw := NoMethod(*s)
  10534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10535. }
  10536. // InstanceTemplateList: A list of instance templates.
  10537. type InstanceTemplateList struct {
  10538. // Id: [Output Only] Unique identifier for the resource; defined by the
  10539. // server.
  10540. Id string `json:"id,omitempty"`
  10541. // Items: A list of InstanceTemplate resources.
  10542. Items []*InstanceTemplate `json:"items,omitempty"`
  10543. // Kind: [Output Only] The resource type, which is always
  10544. // compute#instanceTemplatesListResponse for instance template lists.
  10545. Kind string `json:"kind,omitempty"`
  10546. // NextPageToken: [Output Only] This token allows you to get the next
  10547. // page of results for list requests. If the number of results is larger
  10548. // than maxResults, use the nextPageToken as a value for the query
  10549. // parameter pageToken in the next list request. Subsequent list
  10550. // requests will have their own nextPageToken to continue paging through
  10551. // the results.
  10552. NextPageToken string `json:"nextPageToken,omitempty"`
  10553. // SelfLink: [Output Only] Server-defined URL for this resource.
  10554. SelfLink string `json:"selfLink,omitempty"`
  10555. // Warning: [Output Only] Informational warning message.
  10556. Warning *InstanceTemplateListWarning `json:"warning,omitempty"`
  10557. // ServerResponse contains the HTTP response code and headers from the
  10558. // server.
  10559. googleapi.ServerResponse `json:"-"`
  10560. // ForceSendFields is a list of field names (e.g. "Id") to
  10561. // unconditionally include in API requests. By default, fields with
  10562. // empty values are omitted from API requests. However, any non-pointer,
  10563. // non-interface field appearing in ForceSendFields will be sent to the
  10564. // server regardless of whether the field is empty or not. This may be
  10565. // used to include empty fields in Patch requests.
  10566. ForceSendFields []string `json:"-"`
  10567. // NullFields is a list of field names (e.g. "Id") to include in API
  10568. // requests with the JSON null value. By default, fields with empty
  10569. // values are omitted from API requests. However, any field with an
  10570. // empty value appearing in NullFields will be sent to the server as
  10571. // null. It is an error if a field in this list has a non-empty value.
  10572. // This may be used to include null fields in Patch requests.
  10573. NullFields []string `json:"-"`
  10574. }
  10575. func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) {
  10576. type NoMethod InstanceTemplateList
  10577. raw := NoMethod(*s)
  10578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10579. }
  10580. // InstanceTemplateListWarning: [Output Only] Informational warning
  10581. // message.
  10582. type InstanceTemplateListWarning struct {
  10583. // Code: [Output Only] A warning code, if applicable. For example,
  10584. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10585. // the response.
  10586. //
  10587. // Possible values:
  10588. // "CLEANUP_FAILED"
  10589. // "DEPRECATED_RESOURCE_USED"
  10590. // "DEPRECATED_TYPE_USED"
  10591. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10592. // "EXPERIMENTAL_TYPE_USED"
  10593. // "EXTERNAL_API_WARNING"
  10594. // "FIELD_VALUE_OVERRIDEN"
  10595. // "INJECTED_KERNELS_DEPRECATED"
  10596. // "MISSING_TYPE_DEPENDENCY"
  10597. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10598. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10599. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10600. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10601. // "NEXT_HOP_NOT_RUNNING"
  10602. // "NOT_CRITICAL_ERROR"
  10603. // "NO_RESULTS_ON_PAGE"
  10604. // "REQUIRED_TOS_AGREEMENT"
  10605. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10606. // "RESOURCE_NOT_DELETED"
  10607. // "SCHEMA_VALIDATION_IGNORED"
  10608. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10609. // "UNDECLARED_PROPERTIES"
  10610. // "UNREACHABLE"
  10611. Code string `json:"code,omitempty"`
  10612. // Data: [Output Only] Metadata about this warning in key: value format.
  10613. // For example:
  10614. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10615. Data []*InstanceTemplateListWarningData `json:"data,omitempty"`
  10616. // Message: [Output Only] A human-readable description of the warning
  10617. // code.
  10618. Message string `json:"message,omitempty"`
  10619. // ForceSendFields is a list of field names (e.g. "Code") to
  10620. // unconditionally include in API requests. By default, fields with
  10621. // empty values are omitted from API requests. However, any non-pointer,
  10622. // non-interface field appearing in ForceSendFields will be sent to the
  10623. // server regardless of whether the field is empty or not. This may be
  10624. // used to include empty fields in Patch requests.
  10625. ForceSendFields []string `json:"-"`
  10626. // NullFields is a list of field names (e.g. "Code") to include in API
  10627. // requests with the JSON null value. By default, fields with empty
  10628. // values are omitted from API requests. However, any field with an
  10629. // empty value appearing in NullFields will be sent to the server as
  10630. // null. It is an error if a field in this list has a non-empty value.
  10631. // This may be used to include null fields in Patch requests.
  10632. NullFields []string `json:"-"`
  10633. }
  10634. func (s *InstanceTemplateListWarning) MarshalJSON() ([]byte, error) {
  10635. type NoMethod InstanceTemplateListWarning
  10636. raw := NoMethod(*s)
  10637. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10638. }
  10639. type InstanceTemplateListWarningData struct {
  10640. // Key: [Output Only] A key that provides more detail on the warning
  10641. // being returned. For example, for warnings where there are no results
  10642. // in a list request for a particular zone, this key might be scope and
  10643. // the key value might be the zone name. Other examples might be a key
  10644. // indicating a deprecated resource and a suggested replacement, or a
  10645. // warning about invalid network settings (for example, if an instance
  10646. // attempts to perform IP forwarding but is not enabled for IP
  10647. // forwarding).
  10648. Key string `json:"key,omitempty"`
  10649. // Value: [Output Only] A warning data value corresponding to the key.
  10650. Value string `json:"value,omitempty"`
  10651. // ForceSendFields is a list of field names (e.g. "Key") to
  10652. // unconditionally include in API requests. By default, fields with
  10653. // empty values are omitted from API requests. However, any non-pointer,
  10654. // non-interface field appearing in ForceSendFields will be sent to the
  10655. // server regardless of whether the field is empty or not. This may be
  10656. // used to include empty fields in Patch requests.
  10657. ForceSendFields []string `json:"-"`
  10658. // NullFields is a list of field names (e.g. "Key") to include in API
  10659. // requests with the JSON null value. By default, fields with empty
  10660. // values are omitted from API requests. However, any field with an
  10661. // empty value appearing in NullFields will be sent to the server as
  10662. // null. It is an error if a field in this list has a non-empty value.
  10663. // This may be used to include null fields in Patch requests.
  10664. NullFields []string `json:"-"`
  10665. }
  10666. func (s *InstanceTemplateListWarningData) MarshalJSON() ([]byte, error) {
  10667. type NoMethod InstanceTemplateListWarningData
  10668. raw := NoMethod(*s)
  10669. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10670. }
  10671. type InstanceWithNamedPorts struct {
  10672. // Instance: [Output Only] The URL of the instance.
  10673. Instance string `json:"instance,omitempty"`
  10674. // NamedPorts: [Output Only] The named ports that belong to this
  10675. // instance group.
  10676. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  10677. // Status: [Output Only] The status of the instance.
  10678. //
  10679. // Possible values:
  10680. // "PROVISIONING"
  10681. // "REPAIRING"
  10682. // "RUNNING"
  10683. // "STAGING"
  10684. // "STOPPED"
  10685. // "STOPPING"
  10686. // "SUSPENDED"
  10687. // "SUSPENDING"
  10688. // "TERMINATED"
  10689. Status string `json:"status,omitempty"`
  10690. // ForceSendFields is a list of field names (e.g. "Instance") to
  10691. // unconditionally include in API requests. By default, fields with
  10692. // empty values are omitted from API requests. However, any non-pointer,
  10693. // non-interface field appearing in ForceSendFields will be sent to the
  10694. // server regardless of whether the field is empty or not. This may be
  10695. // used to include empty fields in Patch requests.
  10696. ForceSendFields []string `json:"-"`
  10697. // NullFields is a list of field names (e.g. "Instance") to include in
  10698. // API requests with the JSON null value. By default, fields with empty
  10699. // values are omitted from API requests. However, any field with an
  10700. // empty value appearing in NullFields will be sent to the server as
  10701. // null. It is an error if a field in this list has a non-empty value.
  10702. // This may be used to include null fields in Patch requests.
  10703. NullFields []string `json:"-"`
  10704. }
  10705. func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
  10706. type NoMethod InstanceWithNamedPorts
  10707. raw := NoMethod(*s)
  10708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10709. }
  10710. type InstancesScopedList struct {
  10711. // Instances: [Output Only] A list of instances contained in this scope.
  10712. Instances []*Instance `json:"instances,omitempty"`
  10713. // Warning: [Output Only] Informational warning which replaces the list
  10714. // of instances when the list is empty.
  10715. Warning *InstancesScopedListWarning `json:"warning,omitempty"`
  10716. // ForceSendFields is a list of field names (e.g. "Instances") to
  10717. // unconditionally include in API requests. By default, fields with
  10718. // empty values are omitted from API requests. However, any non-pointer,
  10719. // non-interface field appearing in ForceSendFields will be sent to the
  10720. // server regardless of whether the field is empty or not. This may be
  10721. // used to include empty fields in Patch requests.
  10722. ForceSendFields []string `json:"-"`
  10723. // NullFields is a list of field names (e.g. "Instances") to include in
  10724. // API requests with the JSON null value. By default, fields with empty
  10725. // values are omitted from API requests. However, any field with an
  10726. // empty value appearing in NullFields will be sent to the server as
  10727. // null. It is an error if a field in this list has a non-empty value.
  10728. // This may be used to include null fields in Patch requests.
  10729. NullFields []string `json:"-"`
  10730. }
  10731. func (s *InstancesScopedList) MarshalJSON() ([]byte, error) {
  10732. type NoMethod InstancesScopedList
  10733. raw := NoMethod(*s)
  10734. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10735. }
  10736. // InstancesScopedListWarning: [Output Only] Informational warning which
  10737. // replaces the list of instances when the list is empty.
  10738. type InstancesScopedListWarning struct {
  10739. // Code: [Output Only] A warning code, if applicable. For example,
  10740. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10741. // the response.
  10742. //
  10743. // Possible values:
  10744. // "CLEANUP_FAILED"
  10745. // "DEPRECATED_RESOURCE_USED"
  10746. // "DEPRECATED_TYPE_USED"
  10747. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10748. // "EXPERIMENTAL_TYPE_USED"
  10749. // "EXTERNAL_API_WARNING"
  10750. // "FIELD_VALUE_OVERRIDEN"
  10751. // "INJECTED_KERNELS_DEPRECATED"
  10752. // "MISSING_TYPE_DEPENDENCY"
  10753. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10754. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10755. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10756. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10757. // "NEXT_HOP_NOT_RUNNING"
  10758. // "NOT_CRITICAL_ERROR"
  10759. // "NO_RESULTS_ON_PAGE"
  10760. // "REQUIRED_TOS_AGREEMENT"
  10761. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10762. // "RESOURCE_NOT_DELETED"
  10763. // "SCHEMA_VALIDATION_IGNORED"
  10764. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10765. // "UNDECLARED_PROPERTIES"
  10766. // "UNREACHABLE"
  10767. Code string `json:"code,omitempty"`
  10768. // Data: [Output Only] Metadata about this warning in key: value format.
  10769. // For example:
  10770. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10771. Data []*InstancesScopedListWarningData `json:"data,omitempty"`
  10772. // Message: [Output Only] A human-readable description of the warning
  10773. // code.
  10774. Message string `json:"message,omitempty"`
  10775. // ForceSendFields is a list of field names (e.g. "Code") to
  10776. // unconditionally include in API requests. By default, fields with
  10777. // empty values are omitted from API requests. However, any non-pointer,
  10778. // non-interface field appearing in ForceSendFields will be sent to the
  10779. // server regardless of whether the field is empty or not. This may be
  10780. // used to include empty fields in Patch requests.
  10781. ForceSendFields []string `json:"-"`
  10782. // NullFields is a list of field names (e.g. "Code") to include in API
  10783. // requests with the JSON null value. By default, fields with empty
  10784. // values are omitted from API requests. However, any field with an
  10785. // empty value appearing in NullFields will be sent to the server as
  10786. // null. It is an error if a field in this list has a non-empty value.
  10787. // This may be used to include null fields in Patch requests.
  10788. NullFields []string `json:"-"`
  10789. }
  10790. func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  10791. type NoMethod InstancesScopedListWarning
  10792. raw := NoMethod(*s)
  10793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10794. }
  10795. type InstancesScopedListWarningData struct {
  10796. // Key: [Output Only] A key that provides more detail on the warning
  10797. // being returned. For example, for warnings where there are no results
  10798. // in a list request for a particular zone, this key might be scope and
  10799. // the key value might be the zone name. Other examples might be a key
  10800. // indicating a deprecated resource and a suggested replacement, or a
  10801. // warning about invalid network settings (for example, if an instance
  10802. // attempts to perform IP forwarding but is not enabled for IP
  10803. // forwarding).
  10804. Key string `json:"key,omitempty"`
  10805. // Value: [Output Only] A warning data value corresponding to the key.
  10806. Value string `json:"value,omitempty"`
  10807. // ForceSendFields is a list of field names (e.g. "Key") to
  10808. // unconditionally include in API requests. By default, fields with
  10809. // empty values are omitted from API requests. However, any non-pointer,
  10810. // non-interface field appearing in ForceSendFields will be sent to the
  10811. // server regardless of whether the field is empty or not. This may be
  10812. // used to include empty fields in Patch requests.
  10813. ForceSendFields []string `json:"-"`
  10814. // NullFields is a list of field names (e.g. "Key") to include in API
  10815. // requests with the JSON null value. By default, fields with empty
  10816. // values are omitted from API requests. However, any field with an
  10817. // empty value appearing in NullFields will be sent to the server as
  10818. // null. It is an error if a field in this list has a non-empty value.
  10819. // This may be used to include null fields in Patch requests.
  10820. NullFields []string `json:"-"`
  10821. }
  10822. func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  10823. type NoMethod InstancesScopedListWarningData
  10824. raw := NoMethod(*s)
  10825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10826. }
  10827. type InstancesSetLabelsRequest struct {
  10828. // LabelFingerprint: Fingerprint of the previous set of labels for this
  10829. // resource, used to prevent conflicts. Provide the latest fingerprint
  10830. // value when making a request to add or change labels.
  10831. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  10832. Labels map[string]string `json:"labels,omitempty"`
  10833. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  10834. // unconditionally include in API requests. By default, fields with
  10835. // empty values are omitted from API requests. However, any non-pointer,
  10836. // non-interface field appearing in ForceSendFields will be sent to the
  10837. // server regardless of whether the field is empty or not. This may be
  10838. // used to include empty fields in Patch requests.
  10839. ForceSendFields []string `json:"-"`
  10840. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  10841. // include in API requests with the JSON null value. By default, fields
  10842. // with empty values are omitted from API requests. However, any field
  10843. // with an empty value appearing in NullFields will be sent to the
  10844. // server as null. It is an error if a field in this list has a
  10845. // non-empty value. This may be used to include null fields in Patch
  10846. // requests.
  10847. NullFields []string `json:"-"`
  10848. }
  10849. func (s *InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) {
  10850. type NoMethod InstancesSetLabelsRequest
  10851. raw := NoMethod(*s)
  10852. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10853. }
  10854. type InstancesSetMachineResourcesRequest struct {
  10855. // GuestAccelerators: A list of the type and count of accelerator cards
  10856. // attached to the instance.
  10857. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  10858. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  10859. // to unconditionally include in API requests. By default, fields with
  10860. // empty values are omitted from API requests. However, any non-pointer,
  10861. // non-interface field appearing in ForceSendFields will be sent to the
  10862. // server regardless of whether the field is empty or not. This may be
  10863. // used to include empty fields in Patch requests.
  10864. ForceSendFields []string `json:"-"`
  10865. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  10866. // include in API requests with the JSON null value. By default, fields
  10867. // with empty values are omitted from API requests. However, any field
  10868. // with an empty value appearing in NullFields will be sent to the
  10869. // server as null. It is an error if a field in this list has a
  10870. // non-empty value. This may be used to include null fields in Patch
  10871. // requests.
  10872. NullFields []string `json:"-"`
  10873. }
  10874. func (s *InstancesSetMachineResourcesRequest) MarshalJSON() ([]byte, error) {
  10875. type NoMethod InstancesSetMachineResourcesRequest
  10876. raw := NoMethod(*s)
  10877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10878. }
  10879. type InstancesSetMachineTypeRequest struct {
  10880. // MachineType: Full or partial URL of the machine type resource. See
  10881. // Machine Types for a full list of machine types. For example:
  10882. // zones/us-central1-f/machineTypes/n1-standard-1
  10883. MachineType string `json:"machineType,omitempty"`
  10884. // ForceSendFields is a list of field names (e.g. "MachineType") to
  10885. // unconditionally include in API requests. By default, fields with
  10886. // empty values are omitted from API requests. However, any non-pointer,
  10887. // non-interface field appearing in ForceSendFields will be sent to the
  10888. // server regardless of whether the field is empty or not. This may be
  10889. // used to include empty fields in Patch requests.
  10890. ForceSendFields []string `json:"-"`
  10891. // NullFields is a list of field names (e.g. "MachineType") to include
  10892. // in API requests with the JSON null value. By default, fields with
  10893. // empty values are omitted from API requests. However, any field with
  10894. // an empty value appearing in NullFields will be sent to the server as
  10895. // null. It is an error if a field in this list has a non-empty value.
  10896. // This may be used to include null fields in Patch requests.
  10897. NullFields []string `json:"-"`
  10898. }
  10899. func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
  10900. type NoMethod InstancesSetMachineTypeRequest
  10901. raw := NoMethod(*s)
  10902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10903. }
  10904. type InstancesSetMinCpuPlatformRequest struct {
  10905. // MinCpuPlatform: Minimum cpu/platform this instance should be started
  10906. // at.
  10907. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  10908. // ForceSendFields is a list of field names (e.g. "MinCpuPlatform") to
  10909. // unconditionally include in API requests. By default, fields with
  10910. // empty values are omitted from API requests. However, any non-pointer,
  10911. // non-interface field appearing in ForceSendFields will be sent to the
  10912. // server regardless of whether the field is empty or not. This may be
  10913. // used to include empty fields in Patch requests.
  10914. ForceSendFields []string `json:"-"`
  10915. // NullFields is a list of field names (e.g. "MinCpuPlatform") to
  10916. // include in API requests with the JSON null value. By default, fields
  10917. // with empty values are omitted from API requests. However, any field
  10918. // with an empty value appearing in NullFields will be sent to the
  10919. // server as null. It is an error if a field in this list has a
  10920. // non-empty value. This may be used to include null fields in Patch
  10921. // requests.
  10922. NullFields []string `json:"-"`
  10923. }
  10924. func (s *InstancesSetMinCpuPlatformRequest) MarshalJSON() ([]byte, error) {
  10925. type NoMethod InstancesSetMinCpuPlatformRequest
  10926. raw := NoMethod(*s)
  10927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10928. }
  10929. type InstancesSetServiceAccountRequest struct {
  10930. // Email: Email address of the service account.
  10931. Email string `json:"email,omitempty"`
  10932. // Scopes: The list of scopes to be made available for this service
  10933. // account.
  10934. Scopes []string `json:"scopes,omitempty"`
  10935. // ForceSendFields is a list of field names (e.g. "Email") to
  10936. // unconditionally include in API requests. By default, fields with
  10937. // empty values are omitted from API requests. However, any non-pointer,
  10938. // non-interface field appearing in ForceSendFields will be sent to the
  10939. // server regardless of whether the field is empty or not. This may be
  10940. // used to include empty fields in Patch requests.
  10941. ForceSendFields []string `json:"-"`
  10942. // NullFields is a list of field names (e.g. "Email") to include in API
  10943. // requests with the JSON null value. By default, fields with empty
  10944. // values are omitted from API requests. However, any field with an
  10945. // empty value appearing in NullFields will be sent to the server as
  10946. // null. It is an error if a field in this list has a non-empty value.
  10947. // This may be used to include null fields in Patch requests.
  10948. NullFields []string `json:"-"`
  10949. }
  10950. func (s *InstancesSetServiceAccountRequest) MarshalJSON() ([]byte, error) {
  10951. type NoMethod InstancesSetServiceAccountRequest
  10952. raw := NoMethod(*s)
  10953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10954. }
  10955. type InstancesStartWithEncryptionKeyRequest struct {
  10956. // Disks: Array of disks associated with this instance that are
  10957. // protected with a customer-supplied encryption key.
  10958. //
  10959. // In order to start the instance, the disk url and its corresponding
  10960. // key must be provided.
  10961. //
  10962. // If the disk is not protected with a customer-supplied encryption key
  10963. // it should not be specified.
  10964. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  10965. // ForceSendFields is a list of field names (e.g. "Disks") to
  10966. // unconditionally include in API requests. By default, fields with
  10967. // empty values are omitted from API requests. However, any non-pointer,
  10968. // non-interface field appearing in ForceSendFields will be sent to the
  10969. // server regardless of whether the field is empty or not. This may be
  10970. // used to include empty fields in Patch requests.
  10971. ForceSendFields []string `json:"-"`
  10972. // NullFields is a list of field names (e.g. "Disks") to include in API
  10973. // requests with the JSON null value. By default, fields with empty
  10974. // values are omitted from API requests. However, any field with an
  10975. // empty value appearing in NullFields will be sent to the server as
  10976. // null. It is an error if a field in this list has a non-empty value.
  10977. // This may be used to include null fields in Patch requests.
  10978. NullFields []string `json:"-"`
  10979. }
  10980. func (s *InstancesStartWithEncryptionKeyRequest) MarshalJSON() ([]byte, error) {
  10981. type NoMethod InstancesStartWithEncryptionKeyRequest
  10982. raw := NoMethod(*s)
  10983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10984. }
  10985. // Interconnect: Represents an Interconnects resource. The Interconnects
  10986. // resource is a dedicated connection between Google's network and your
  10987. // on-premises network. For more information, see the Dedicated
  10988. // overview page. (== resource_for v1.interconnects ==) (== resource_for
  10989. // beta.interconnects ==)
  10990. type Interconnect struct {
  10991. // AdminEnabled: Administrative status of the interconnect. When this is
  10992. // set to true, the Interconnect is functional and can carry traffic.
  10993. // When set to false, no packets can be carried over the interconnect
  10994. // and no BGP routes are exchanged over it. By default, the status is
  10995. // set to true.
  10996. AdminEnabled bool `json:"adminEnabled,omitempty"`
  10997. // CircuitInfos: [Output Only] A list of CircuitInfo objects, that
  10998. // describe the individual circuits in this LAG.
  10999. CircuitInfos []*InterconnectCircuitInfo `json:"circuitInfos,omitempty"`
  11000. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11001. // format.
  11002. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11003. // CustomerName: Customer name, to put in the Letter of Authorization as
  11004. // the party authorized to request a crossconnect.
  11005. CustomerName string `json:"customerName,omitempty"`
  11006. // Description: An optional description of this resource. Provide this
  11007. // property when you create the resource.
  11008. Description string `json:"description,omitempty"`
  11009. // ExpectedOutages: [Output Only] A list of outages expected for this
  11010. // Interconnect.
  11011. ExpectedOutages []*InterconnectOutageNotification `json:"expectedOutages,omitempty"`
  11012. // GoogleIpAddress: [Output Only] IP address configured on the Google
  11013. // side of the Interconnect link. This can be used only for ping tests.
  11014. GoogleIpAddress string `json:"googleIpAddress,omitempty"`
  11015. // GoogleReferenceId: [Output Only] Google reference ID to be used when
  11016. // raising support tickets with Google or otherwise to debug backend
  11017. // connectivity issues.
  11018. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  11019. // Id: [Output Only] The unique identifier for the resource. This
  11020. // identifier is defined by the server.
  11021. Id uint64 `json:"id,omitempty,string"`
  11022. // InterconnectAttachments: [Output Only] A list of the URLs of all
  11023. // InterconnectAttachments configured to use this Interconnect.
  11024. InterconnectAttachments []string `json:"interconnectAttachments,omitempty"`
  11025. // InterconnectType: Type of interconnect. Note that "IT_PRIVATE" has
  11026. // been deprecated in favor of "DEDICATED"
  11027. //
  11028. // Possible values:
  11029. // "DEDICATED"
  11030. // "IT_PRIVATE"
  11031. // "PARTNER"
  11032. InterconnectType string `json:"interconnectType,omitempty"`
  11033. // Kind: [Output Only] Type of the resource. Always compute#interconnect
  11034. // for interconnects.
  11035. Kind string `json:"kind,omitempty"`
  11036. // LinkType: Type of link requested. This field indicates speed of each
  11037. // of the links in the bundle, not the entire bundle.
  11038. //
  11039. // Possible values:
  11040. // "LINK_TYPE_ETHERNET_10G_LR"
  11041. LinkType string `json:"linkType,omitempty"`
  11042. // Location: URL of the InterconnectLocation object that represents
  11043. // where this connection is to be provisioned.
  11044. Location string `json:"location,omitempty"`
  11045. // Name: Name of the resource. Provided by the client when the resource
  11046. // is created. The name must be 1-63 characters long, and comply with
  11047. // RFC1035. Specifically, the name must be 1-63 characters long and
  11048. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  11049. // the first character must be a lowercase letter, and all following
  11050. // characters must be a dash, lowercase letter, or digit, except the
  11051. // last character, which cannot be a dash.
  11052. Name string `json:"name,omitempty"`
  11053. // NocContactEmail: Email address to contact the customer NOC for
  11054. // operations and maintenance notifications regarding this Interconnect.
  11055. // If specified, this will be used for notifications in addition to all
  11056. // other forms described, such as Stackdriver logs alerting and Cloud
  11057. // Notifications.
  11058. NocContactEmail string `json:"nocContactEmail,omitempty"`
  11059. // OperationalStatus: [Output Only] The current status of whether or not
  11060. // this Interconnect is functional.
  11061. //
  11062. // Possible values:
  11063. // "OS_ACTIVE"
  11064. // "OS_UNPROVISIONED"
  11065. OperationalStatus string `json:"operationalStatus,omitempty"`
  11066. // PeerIpAddress: [Output Only] IP address configured on the customer
  11067. // side of the Interconnect link. The customer should configure this IP
  11068. // address during turnup when prompted by Google NOC. This can be used
  11069. // only for ping tests.
  11070. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  11071. // ProvisionedLinkCount: [Output Only] Number of links actually
  11072. // provisioned in this interconnect.
  11073. ProvisionedLinkCount int64 `json:"provisionedLinkCount,omitempty"`
  11074. // RequestedLinkCount: Target number of physical links in the link
  11075. // bundle, as requested by the customer.
  11076. RequestedLinkCount int64 `json:"requestedLinkCount,omitempty"`
  11077. // SelfLink: [Output Only] Server-defined URL for the resource.
  11078. SelfLink string `json:"selfLink,omitempty"`
  11079. // State: [Output Only] The current state of whether or not this
  11080. // Interconnect is functional.
  11081. //
  11082. // Possible values:
  11083. // "ACTIVE"
  11084. // "UNPROVISIONED"
  11085. State string `json:"state,omitempty"`
  11086. // ServerResponse contains the HTTP response code and headers from the
  11087. // server.
  11088. googleapi.ServerResponse `json:"-"`
  11089. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  11090. // unconditionally include in API requests. By default, fields with
  11091. // empty values are omitted from API requests. However, any non-pointer,
  11092. // non-interface field appearing in ForceSendFields will be sent to the
  11093. // server regardless of whether the field is empty or not. This may be
  11094. // used to include empty fields in Patch requests.
  11095. ForceSendFields []string `json:"-"`
  11096. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  11097. // in API requests with the JSON null value. By default, fields with
  11098. // empty values are omitted from API requests. However, any field with
  11099. // an empty value appearing in NullFields will be sent to the server as
  11100. // null. It is an error if a field in this list has a non-empty value.
  11101. // This may be used to include null fields in Patch requests.
  11102. NullFields []string `json:"-"`
  11103. }
  11104. func (s *Interconnect) MarshalJSON() ([]byte, error) {
  11105. type NoMethod Interconnect
  11106. raw := NoMethod(*s)
  11107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11108. }
  11109. // InterconnectAttachment: Represents an InterconnectAttachment (VLAN
  11110. // attachment) resource. For more information, see Creating VLAN
  11111. // Attachments. (== resource_for beta.interconnectAttachments ==) (==
  11112. // resource_for v1.interconnectAttachments ==)
  11113. type InterconnectAttachment struct {
  11114. // AdminEnabled: Determines whether this Attachment will carry packets.
  11115. // Not present for PARTNER_PROVIDER.
  11116. AdminEnabled bool `json:"adminEnabled,omitempty"`
  11117. // Bandwidth: Provisioned bandwidth capacity for the
  11118. // interconnectAttachment. Can be set by the partner to update the
  11119. // customer's provisioned bandwidth. Output only for PARTNER type,
  11120. // mutable for PARTNER_PROVIDER and DEDICATED.
  11121. //
  11122. // Possible values:
  11123. // "BPS_100M"
  11124. // "BPS_10G"
  11125. // "BPS_1G"
  11126. // "BPS_200M"
  11127. // "BPS_2G"
  11128. // "BPS_300M"
  11129. // "BPS_400M"
  11130. // "BPS_500M"
  11131. // "BPS_50M"
  11132. // "BPS_5G"
  11133. Bandwidth string `json:"bandwidth,omitempty"`
  11134. // CandidateSubnets: Up to 16 candidate prefixes that can be used to
  11135. // restrict the allocation of cloudRouterIpAddress and
  11136. // customerRouterIpAddress for this attachment. All prefixes must be
  11137. // within link-local address space (169.254.0.0/16) and must be /29 or
  11138. // shorter (/28, /27, etc). Google will attempt to select an unused /29
  11139. // from the supplied candidate prefix(es). The request will fail if all
  11140. // possible /29s are in use on Google?s edge. If not supplied, Google
  11141. // will randomly select an unused /29 from all of link-local space.
  11142. CandidateSubnets []string `json:"candidateSubnets,omitempty"`
  11143. // CloudRouterIpAddress: [Output Only] IPv4 address + prefix length to
  11144. // be configured on Cloud Router Interface for this interconnect
  11145. // attachment.
  11146. CloudRouterIpAddress string `json:"cloudRouterIpAddress,omitempty"`
  11147. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11148. // format.
  11149. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11150. // CustomerRouterIpAddress: [Output Only] IPv4 address + prefix length
  11151. // to be configured on the customer router subinterface for this
  11152. // interconnect attachment.
  11153. CustomerRouterIpAddress string `json:"customerRouterIpAddress,omitempty"`
  11154. // Description: An optional description of this resource.
  11155. Description string `json:"description,omitempty"`
  11156. // EdgeAvailabilityDomain: Desired availability domain for the
  11157. // attachment. Only available for type PARTNER, at creation time. For
  11158. // improved reliability, customers should configure a pair of
  11159. // attachments with one per availability domain. The selected
  11160. // availability domain will be provided to the Partner via the pairing
  11161. // key so that the provisioned circuit will lie in the specified domain.
  11162. // If not specified, the value will default to AVAILABILITY_DOMAIN_ANY.
  11163. //
  11164. // Possible values:
  11165. // "AVAILABILITY_DOMAIN_1"
  11166. // "AVAILABILITY_DOMAIN_2"
  11167. // "AVAILABILITY_DOMAIN_ANY"
  11168. EdgeAvailabilityDomain string `json:"edgeAvailabilityDomain,omitempty"`
  11169. // GoogleReferenceId: [Output Only] Google reference ID, to be used when
  11170. // raising support tickets with Google or otherwise to debug backend
  11171. // connectivity issues.
  11172. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  11173. // Id: [Output Only] The unique identifier for the resource. This
  11174. // identifier is defined by the server.
  11175. Id uint64 `json:"id,omitempty,string"`
  11176. // Interconnect: URL of the underlying Interconnect object that this
  11177. // attachment's traffic will traverse through.
  11178. Interconnect string `json:"interconnect,omitempty"`
  11179. // Kind: [Output Only] Type of the resource. Always
  11180. // compute#interconnectAttachment for interconnect attachments.
  11181. Kind string `json:"kind,omitempty"`
  11182. // Name: Name of the resource. Provided by the client when the resource
  11183. // is created. The name must be 1-63 characters long, and comply with
  11184. // RFC1035. Specifically, the name must be 1-63 characters long and
  11185. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  11186. // the first character must be a lowercase letter, and all following
  11187. // characters must be a dash, lowercase letter, or digit, except the
  11188. // last character, which cannot be a dash.
  11189. Name string `json:"name,omitempty"`
  11190. // OperationalStatus: [Output Only] The current status of whether or not
  11191. // this interconnect attachment is functional.
  11192. //
  11193. // Possible values:
  11194. // "OS_ACTIVE"
  11195. // "OS_UNPROVISIONED"
  11196. OperationalStatus string `json:"operationalStatus,omitempty"`
  11197. // PairingKey: [Output only for type PARTNER. Input only for
  11198. // PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier
  11199. // of an PARTNER attachment used to initiate provisioning with a
  11200. // selected partner. Of the form "XXXXX/region/domain"
  11201. PairingKey string `json:"pairingKey,omitempty"`
  11202. // PartnerAsn: Optional BGP ASN for the router that should be supplied
  11203. // by a layer 3 Partner if they configured BGP on behalf of the
  11204. // customer. Output only for PARTNER type, input only for
  11205. // PARTNER_PROVIDER, not available for DEDICATED.
  11206. PartnerAsn int64 `json:"partnerAsn,omitempty,string"`
  11207. // PartnerMetadata: Informational metadata about Partner attachments
  11208. // from Partners to display to customers. Output only for for PARTNER
  11209. // type, mutable for PARTNER_PROVIDER, not available for DEDICATED.
  11210. PartnerMetadata *InterconnectAttachmentPartnerMetadata `json:"partnerMetadata,omitempty"`
  11211. // PrivateInterconnectInfo: [Output Only] Information specific to an
  11212. // InterconnectAttachment. This property is populated if the
  11213. // interconnect that this is attached to is of type DEDICATED.
  11214. PrivateInterconnectInfo *InterconnectAttachmentPrivateInfo `json:"privateInterconnectInfo,omitempty"`
  11215. // Region: [Output Only] URL of the region where the regional
  11216. // interconnect attachment resides. You must specify this field as part
  11217. // of the HTTP request URL. It is not settable as a field in the request
  11218. // body.
  11219. Region string `json:"region,omitempty"`
  11220. // Router: URL of the Cloud Router to be used for dynamic routing. This
  11221. // router must be in the same region as this InterconnectAttachment. The
  11222. // InterconnectAttachment will automatically connect the Interconnect to
  11223. // the network & region within which the Cloud Router is configured.
  11224. Router string `json:"router,omitempty"`
  11225. // SelfLink: [Output Only] Server-defined URL for the resource.
  11226. SelfLink string `json:"selfLink,omitempty"`
  11227. // State: [Output Only] The current state of this attachment's
  11228. // functionality.
  11229. //
  11230. // Possible values:
  11231. // "ACTIVE"
  11232. // "DEFUNCT"
  11233. // "PARTNER_REQUEST_RECEIVED"
  11234. // "PENDING_CUSTOMER"
  11235. // "PENDING_PARTNER"
  11236. // "STATE_UNSPECIFIED"
  11237. // "UNPROVISIONED"
  11238. State string `json:"state,omitempty"`
  11239. // Possible values:
  11240. // "DEDICATED"
  11241. // "PARTNER"
  11242. // "PARTNER_PROVIDER"
  11243. Type string `json:"type,omitempty"`
  11244. // VlanTag8021q: The IEEE 802.1Q VLAN tag for this attachment, in the
  11245. // range 2-4094. Only specified at creation time.
  11246. VlanTag8021q int64 `json:"vlanTag8021q,omitempty"`
  11247. // ServerResponse contains the HTTP response code and headers from the
  11248. // server.
  11249. googleapi.ServerResponse `json:"-"`
  11250. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  11251. // unconditionally include in API requests. By default, fields with
  11252. // empty values are omitted from API requests. However, any non-pointer,
  11253. // non-interface field appearing in ForceSendFields will be sent to the
  11254. // server regardless of whether the field is empty or not. This may be
  11255. // used to include empty fields in Patch requests.
  11256. ForceSendFields []string `json:"-"`
  11257. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  11258. // in API requests with the JSON null value. By default, fields with
  11259. // empty values are omitted from API requests. However, any field with
  11260. // an empty value appearing in NullFields will be sent to the server as
  11261. // null. It is an error if a field in this list has a non-empty value.
  11262. // This may be used to include null fields in Patch requests.
  11263. NullFields []string `json:"-"`
  11264. }
  11265. func (s *InterconnectAttachment) MarshalJSON() ([]byte, error) {
  11266. type NoMethod InterconnectAttachment
  11267. raw := NoMethod(*s)
  11268. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11269. }
  11270. type InterconnectAttachmentAggregatedList struct {
  11271. // Id: [Output Only] Unique identifier for the resource; defined by the
  11272. // server.
  11273. Id string `json:"id,omitempty"`
  11274. // Items: A list of InterconnectAttachmentsScopedList resources.
  11275. Items map[string]InterconnectAttachmentsScopedList `json:"items,omitempty"`
  11276. // Kind: [Output Only] Type of resource. Always
  11277. // compute#interconnectAttachmentAggregatedList for aggregated lists of
  11278. // interconnect attachments.
  11279. Kind string `json:"kind,omitempty"`
  11280. // NextPageToken: [Output Only] This token allows you to get the next
  11281. // page of results for list requests. If the number of results is larger
  11282. // than maxResults, use the nextPageToken as a value for the query
  11283. // parameter pageToken in the next list request. Subsequent list
  11284. // requests will have their own nextPageToken to continue paging through
  11285. // the results.
  11286. NextPageToken string `json:"nextPageToken,omitempty"`
  11287. // SelfLink: [Output Only] Server-defined URL for this resource.
  11288. SelfLink string `json:"selfLink,omitempty"`
  11289. // Warning: [Output Only] Informational warning message.
  11290. Warning *InterconnectAttachmentAggregatedListWarning `json:"warning,omitempty"`
  11291. // ServerResponse contains the HTTP response code and headers from the
  11292. // server.
  11293. googleapi.ServerResponse `json:"-"`
  11294. // ForceSendFields is a list of field names (e.g. "Id") to
  11295. // unconditionally include in API requests. By default, fields with
  11296. // empty values are omitted from API requests. However, any non-pointer,
  11297. // non-interface field appearing in ForceSendFields will be sent to the
  11298. // server regardless of whether the field is empty or not. This may be
  11299. // used to include empty fields in Patch requests.
  11300. ForceSendFields []string `json:"-"`
  11301. // NullFields is a list of field names (e.g. "Id") to include in API
  11302. // requests with the JSON null value. By default, fields with empty
  11303. // values are omitted from API requests. However, any field with an
  11304. // empty value appearing in NullFields will be sent to the server as
  11305. // null. It is an error if a field in this list has a non-empty value.
  11306. // This may be used to include null fields in Patch requests.
  11307. NullFields []string `json:"-"`
  11308. }
  11309. func (s *InterconnectAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
  11310. type NoMethod InterconnectAttachmentAggregatedList
  11311. raw := NoMethod(*s)
  11312. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11313. }
  11314. // InterconnectAttachmentAggregatedListWarning: [Output Only]
  11315. // Informational warning message.
  11316. type InterconnectAttachmentAggregatedListWarning struct {
  11317. // Code: [Output Only] A warning code, if applicable. For example,
  11318. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11319. // the response.
  11320. //
  11321. // Possible values:
  11322. // "CLEANUP_FAILED"
  11323. // "DEPRECATED_RESOURCE_USED"
  11324. // "DEPRECATED_TYPE_USED"
  11325. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11326. // "EXPERIMENTAL_TYPE_USED"
  11327. // "EXTERNAL_API_WARNING"
  11328. // "FIELD_VALUE_OVERRIDEN"
  11329. // "INJECTED_KERNELS_DEPRECATED"
  11330. // "MISSING_TYPE_DEPENDENCY"
  11331. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11332. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11333. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11334. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11335. // "NEXT_HOP_NOT_RUNNING"
  11336. // "NOT_CRITICAL_ERROR"
  11337. // "NO_RESULTS_ON_PAGE"
  11338. // "REQUIRED_TOS_AGREEMENT"
  11339. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11340. // "RESOURCE_NOT_DELETED"
  11341. // "SCHEMA_VALIDATION_IGNORED"
  11342. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11343. // "UNDECLARED_PROPERTIES"
  11344. // "UNREACHABLE"
  11345. Code string `json:"code,omitempty"`
  11346. // Data: [Output Only] Metadata about this warning in key: value format.
  11347. // For example:
  11348. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11349. Data []*InterconnectAttachmentAggregatedListWarningData `json:"data,omitempty"`
  11350. // Message: [Output Only] A human-readable description of the warning
  11351. // code.
  11352. Message string `json:"message,omitempty"`
  11353. // ForceSendFields is a list of field names (e.g. "Code") to
  11354. // unconditionally include in API requests. By default, fields with
  11355. // empty values are omitted from API requests. However, any non-pointer,
  11356. // non-interface field appearing in ForceSendFields will be sent to the
  11357. // server regardless of whether the field is empty or not. This may be
  11358. // used to include empty fields in Patch requests.
  11359. ForceSendFields []string `json:"-"`
  11360. // NullFields is a list of field names (e.g. "Code") to include in API
  11361. // requests with the JSON null value. By default, fields with empty
  11362. // values are omitted from API requests. However, any field with an
  11363. // empty value appearing in NullFields will be sent to the server as
  11364. // null. It is an error if a field in this list has a non-empty value.
  11365. // This may be used to include null fields in Patch requests.
  11366. NullFields []string `json:"-"`
  11367. }
  11368. func (s *InterconnectAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  11369. type NoMethod InterconnectAttachmentAggregatedListWarning
  11370. raw := NoMethod(*s)
  11371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11372. }
  11373. type InterconnectAttachmentAggregatedListWarningData struct {
  11374. // Key: [Output Only] A key that provides more detail on the warning
  11375. // being returned. For example, for warnings where there are no results
  11376. // in a list request for a particular zone, this key might be scope and
  11377. // the key value might be the zone name. Other examples might be a key
  11378. // indicating a deprecated resource and a suggested replacement, or a
  11379. // warning about invalid network settings (for example, if an instance
  11380. // attempts to perform IP forwarding but is not enabled for IP
  11381. // forwarding).
  11382. Key string `json:"key,omitempty"`
  11383. // Value: [Output Only] A warning data value corresponding to the key.
  11384. Value string `json:"value,omitempty"`
  11385. // ForceSendFields is a list of field names (e.g. "Key") to
  11386. // unconditionally include in API requests. By default, fields with
  11387. // empty values are omitted from API requests. However, any non-pointer,
  11388. // non-interface field appearing in ForceSendFields will be sent to the
  11389. // server regardless of whether the field is empty or not. This may be
  11390. // used to include empty fields in Patch requests.
  11391. ForceSendFields []string `json:"-"`
  11392. // NullFields is a list of field names (e.g. "Key") to include in API
  11393. // requests with the JSON null value. By default, fields with empty
  11394. // values are omitted from API requests. However, any field with an
  11395. // empty value appearing in NullFields will be sent to the server as
  11396. // null. It is an error if a field in this list has a non-empty value.
  11397. // This may be used to include null fields in Patch requests.
  11398. NullFields []string `json:"-"`
  11399. }
  11400. func (s *InterconnectAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  11401. type NoMethod InterconnectAttachmentAggregatedListWarningData
  11402. raw := NoMethod(*s)
  11403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11404. }
  11405. // InterconnectAttachmentList: Response to the list request, and
  11406. // contains a list of interconnect attachments.
  11407. type InterconnectAttachmentList struct {
  11408. // Id: [Output Only] Unique identifier for the resource; defined by the
  11409. // server.
  11410. Id string `json:"id,omitempty"`
  11411. // Items: A list of InterconnectAttachment resources.
  11412. Items []*InterconnectAttachment `json:"items,omitempty"`
  11413. // Kind: [Output Only] Type of resource. Always
  11414. // compute#interconnectAttachmentList for lists of interconnect
  11415. // attachments.
  11416. Kind string `json:"kind,omitempty"`
  11417. // NextPageToken: [Output Only] This token allows you to get the next
  11418. // page of results for list requests. If the number of results is larger
  11419. // than maxResults, use the nextPageToken as a value for the query
  11420. // parameter pageToken in the next list request. Subsequent list
  11421. // requests will have their own nextPageToken to continue paging through
  11422. // the results.
  11423. NextPageToken string `json:"nextPageToken,omitempty"`
  11424. // SelfLink: [Output Only] Server-defined URL for this resource.
  11425. SelfLink string `json:"selfLink,omitempty"`
  11426. // Warning: [Output Only] Informational warning message.
  11427. Warning *InterconnectAttachmentListWarning `json:"warning,omitempty"`
  11428. // ServerResponse contains the HTTP response code and headers from the
  11429. // server.
  11430. googleapi.ServerResponse `json:"-"`
  11431. // ForceSendFields is a list of field names (e.g. "Id") to
  11432. // unconditionally include in API requests. By default, fields with
  11433. // empty values are omitted from API requests. However, any non-pointer,
  11434. // non-interface field appearing in ForceSendFields will be sent to the
  11435. // server regardless of whether the field is empty or not. This may be
  11436. // used to include empty fields in Patch requests.
  11437. ForceSendFields []string `json:"-"`
  11438. // NullFields is a list of field names (e.g. "Id") to include in API
  11439. // requests with the JSON null value. By default, fields with empty
  11440. // values are omitted from API requests. However, any field with an
  11441. // empty value appearing in NullFields will be sent to the server as
  11442. // null. It is an error if a field in this list has a non-empty value.
  11443. // This may be used to include null fields in Patch requests.
  11444. NullFields []string `json:"-"`
  11445. }
  11446. func (s *InterconnectAttachmentList) MarshalJSON() ([]byte, error) {
  11447. type NoMethod InterconnectAttachmentList
  11448. raw := NoMethod(*s)
  11449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11450. }
  11451. // InterconnectAttachmentListWarning: [Output Only] Informational
  11452. // warning message.
  11453. type InterconnectAttachmentListWarning struct {
  11454. // Code: [Output Only] A warning code, if applicable. For example,
  11455. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11456. // the response.
  11457. //
  11458. // Possible values:
  11459. // "CLEANUP_FAILED"
  11460. // "DEPRECATED_RESOURCE_USED"
  11461. // "DEPRECATED_TYPE_USED"
  11462. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11463. // "EXPERIMENTAL_TYPE_USED"
  11464. // "EXTERNAL_API_WARNING"
  11465. // "FIELD_VALUE_OVERRIDEN"
  11466. // "INJECTED_KERNELS_DEPRECATED"
  11467. // "MISSING_TYPE_DEPENDENCY"
  11468. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11469. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11470. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11471. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11472. // "NEXT_HOP_NOT_RUNNING"
  11473. // "NOT_CRITICAL_ERROR"
  11474. // "NO_RESULTS_ON_PAGE"
  11475. // "REQUIRED_TOS_AGREEMENT"
  11476. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11477. // "RESOURCE_NOT_DELETED"
  11478. // "SCHEMA_VALIDATION_IGNORED"
  11479. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11480. // "UNDECLARED_PROPERTIES"
  11481. // "UNREACHABLE"
  11482. Code string `json:"code,omitempty"`
  11483. // Data: [Output Only] Metadata about this warning in key: value format.
  11484. // For example:
  11485. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11486. Data []*InterconnectAttachmentListWarningData `json:"data,omitempty"`
  11487. // Message: [Output Only] A human-readable description of the warning
  11488. // code.
  11489. Message string `json:"message,omitempty"`
  11490. // ForceSendFields is a list of field names (e.g. "Code") to
  11491. // unconditionally include in API requests. By default, fields with
  11492. // empty values are omitted from API requests. However, any non-pointer,
  11493. // non-interface field appearing in ForceSendFields will be sent to the
  11494. // server regardless of whether the field is empty or not. This may be
  11495. // used to include empty fields in Patch requests.
  11496. ForceSendFields []string `json:"-"`
  11497. // NullFields is a list of field names (e.g. "Code") to include in API
  11498. // requests with the JSON null value. By default, fields with empty
  11499. // values are omitted from API requests. However, any field with an
  11500. // empty value appearing in NullFields will be sent to the server as
  11501. // null. It is an error if a field in this list has a non-empty value.
  11502. // This may be used to include null fields in Patch requests.
  11503. NullFields []string `json:"-"`
  11504. }
  11505. func (s *InterconnectAttachmentListWarning) MarshalJSON() ([]byte, error) {
  11506. type NoMethod InterconnectAttachmentListWarning
  11507. raw := NoMethod(*s)
  11508. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11509. }
  11510. type InterconnectAttachmentListWarningData struct {
  11511. // Key: [Output Only] A key that provides more detail on the warning
  11512. // being returned. For example, for warnings where there are no results
  11513. // in a list request for a particular zone, this key might be scope and
  11514. // the key value might be the zone name. Other examples might be a key
  11515. // indicating a deprecated resource and a suggested replacement, or a
  11516. // warning about invalid network settings (for example, if an instance
  11517. // attempts to perform IP forwarding but is not enabled for IP
  11518. // forwarding).
  11519. Key string `json:"key,omitempty"`
  11520. // Value: [Output Only] A warning data value corresponding to the key.
  11521. Value string `json:"value,omitempty"`
  11522. // ForceSendFields is a list of field names (e.g. "Key") to
  11523. // unconditionally include in API requests. By default, fields with
  11524. // empty values are omitted from API requests. However, any non-pointer,
  11525. // non-interface field appearing in ForceSendFields will be sent to the
  11526. // server regardless of whether the field is empty or not. This may be
  11527. // used to include empty fields in Patch requests.
  11528. ForceSendFields []string `json:"-"`
  11529. // NullFields is a list of field names (e.g. "Key") to include in API
  11530. // requests with the JSON null value. By default, fields with empty
  11531. // values are omitted from API requests. However, any field with an
  11532. // empty value appearing in NullFields will be sent to the server as
  11533. // null. It is an error if a field in this list has a non-empty value.
  11534. // This may be used to include null fields in Patch requests.
  11535. NullFields []string `json:"-"`
  11536. }
  11537. func (s *InterconnectAttachmentListWarningData) MarshalJSON() ([]byte, error) {
  11538. type NoMethod InterconnectAttachmentListWarningData
  11539. raw := NoMethod(*s)
  11540. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11541. }
  11542. // InterconnectAttachmentPartnerMetadata: Informational metadata about
  11543. // Partner attachments from Partners to display to customers. These
  11544. // fields are propagated from PARTNER_PROVIDER attachments to their
  11545. // corresponding PARTNER attachments.
  11546. type InterconnectAttachmentPartnerMetadata struct {
  11547. // InterconnectName: Plain text name of the Interconnect this attachment
  11548. // is connected to, as displayed in the Partner?s portal. For instance
  11549. // "Chicago 1". This value may be validated to match approved Partner
  11550. // values.
  11551. InterconnectName string `json:"interconnectName,omitempty"`
  11552. // PartnerName: Plain text name of the Partner providing this
  11553. // attachment. This value may be validated to match approved Partner
  11554. // values.
  11555. PartnerName string `json:"partnerName,omitempty"`
  11556. // PortalUrl: URL of the Partner?s portal for this Attachment. Partners
  11557. // may customise this to be a deep-link to the specific resource on the
  11558. // Partner portal. This value may be validated to match approved Partner
  11559. // values.
  11560. PortalUrl string `json:"portalUrl,omitempty"`
  11561. // ForceSendFields is a list of field names (e.g. "InterconnectName") to
  11562. // unconditionally include in API requests. By default, fields with
  11563. // empty values are omitted from API requests. However, any non-pointer,
  11564. // non-interface field appearing in ForceSendFields will be sent to the
  11565. // server regardless of whether the field is empty or not. This may be
  11566. // used to include empty fields in Patch requests.
  11567. ForceSendFields []string `json:"-"`
  11568. // NullFields is a list of field names (e.g. "InterconnectName") to
  11569. // include in API requests with the JSON null value. By default, fields
  11570. // with empty values are omitted from API requests. However, any field
  11571. // with an empty value appearing in NullFields will be sent to the
  11572. // server as null. It is an error if a field in this list has a
  11573. // non-empty value. This may be used to include null fields in Patch
  11574. // requests.
  11575. NullFields []string `json:"-"`
  11576. }
  11577. func (s *InterconnectAttachmentPartnerMetadata) MarshalJSON() ([]byte, error) {
  11578. type NoMethod InterconnectAttachmentPartnerMetadata
  11579. raw := NoMethod(*s)
  11580. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11581. }
  11582. // InterconnectAttachmentPrivateInfo: Information for an interconnect
  11583. // attachment when this belongs to an interconnect of type DEDICATED.
  11584. type InterconnectAttachmentPrivateInfo struct {
  11585. // Tag8021q: [Output Only] 802.1q encapsulation tag to be used for
  11586. // traffic between Google and the customer, going to and from this
  11587. // network and region.
  11588. Tag8021q int64 `json:"tag8021q,omitempty"`
  11589. // ForceSendFields is a list of field names (e.g. "Tag8021q") to
  11590. // unconditionally include in API requests. By default, fields with
  11591. // empty values are omitted from API requests. However, any non-pointer,
  11592. // non-interface field appearing in ForceSendFields will be sent to the
  11593. // server regardless of whether the field is empty or not. This may be
  11594. // used to include empty fields in Patch requests.
  11595. ForceSendFields []string `json:"-"`
  11596. // NullFields is a list of field names (e.g. "Tag8021q") to include in
  11597. // API requests with the JSON null value. By default, fields with empty
  11598. // values are omitted from API requests. However, any field with an
  11599. // empty value appearing in NullFields will be sent to the server as
  11600. // null. It is an error if a field in this list has a non-empty value.
  11601. // This may be used to include null fields in Patch requests.
  11602. NullFields []string `json:"-"`
  11603. }
  11604. func (s *InterconnectAttachmentPrivateInfo) MarshalJSON() ([]byte, error) {
  11605. type NoMethod InterconnectAttachmentPrivateInfo
  11606. raw := NoMethod(*s)
  11607. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11608. }
  11609. type InterconnectAttachmentsScopedList struct {
  11610. // InterconnectAttachments: A list of interconnect attachments contained
  11611. // in this scope.
  11612. InterconnectAttachments []*InterconnectAttachment `json:"interconnectAttachments,omitempty"`
  11613. // Warning: Informational warning which replaces the list of addresses
  11614. // when the list is empty.
  11615. Warning *InterconnectAttachmentsScopedListWarning `json:"warning,omitempty"`
  11616. // ForceSendFields is a list of field names (e.g.
  11617. // "InterconnectAttachments") to unconditionally include in API
  11618. // requests. By default, fields with empty values are omitted from API
  11619. // requests. However, any non-pointer, non-interface field appearing in
  11620. // ForceSendFields will be sent to the server regardless of whether the
  11621. // field is empty or not. This may be used to include empty fields in
  11622. // Patch requests.
  11623. ForceSendFields []string `json:"-"`
  11624. // NullFields is a list of field names (e.g. "InterconnectAttachments")
  11625. // to include in API requests with the JSON null value. By default,
  11626. // fields with empty values are omitted from API requests. However, any
  11627. // field with an empty value appearing in NullFields will be sent to the
  11628. // server as null. It is an error if a field in this list has a
  11629. // non-empty value. This may be used to include null fields in Patch
  11630. // requests.
  11631. NullFields []string `json:"-"`
  11632. }
  11633. func (s *InterconnectAttachmentsScopedList) MarshalJSON() ([]byte, error) {
  11634. type NoMethod InterconnectAttachmentsScopedList
  11635. raw := NoMethod(*s)
  11636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11637. }
  11638. // InterconnectAttachmentsScopedListWarning: Informational warning which
  11639. // replaces the list of addresses when the list is empty.
  11640. type InterconnectAttachmentsScopedListWarning struct {
  11641. // Code: [Output Only] A warning code, if applicable. For example,
  11642. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11643. // the response.
  11644. //
  11645. // Possible values:
  11646. // "CLEANUP_FAILED"
  11647. // "DEPRECATED_RESOURCE_USED"
  11648. // "DEPRECATED_TYPE_USED"
  11649. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11650. // "EXPERIMENTAL_TYPE_USED"
  11651. // "EXTERNAL_API_WARNING"
  11652. // "FIELD_VALUE_OVERRIDEN"
  11653. // "INJECTED_KERNELS_DEPRECATED"
  11654. // "MISSING_TYPE_DEPENDENCY"
  11655. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11656. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11657. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11658. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11659. // "NEXT_HOP_NOT_RUNNING"
  11660. // "NOT_CRITICAL_ERROR"
  11661. // "NO_RESULTS_ON_PAGE"
  11662. // "REQUIRED_TOS_AGREEMENT"
  11663. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11664. // "RESOURCE_NOT_DELETED"
  11665. // "SCHEMA_VALIDATION_IGNORED"
  11666. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11667. // "UNDECLARED_PROPERTIES"
  11668. // "UNREACHABLE"
  11669. Code string `json:"code,omitempty"`
  11670. // Data: [Output Only] Metadata about this warning in key: value format.
  11671. // For example:
  11672. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11673. Data []*InterconnectAttachmentsScopedListWarningData `json:"data,omitempty"`
  11674. // Message: [Output Only] A human-readable description of the warning
  11675. // code.
  11676. Message string `json:"message,omitempty"`
  11677. // ForceSendFields is a list of field names (e.g. "Code") to
  11678. // unconditionally include in API requests. By default, fields with
  11679. // empty values are omitted from API requests. However, any non-pointer,
  11680. // non-interface field appearing in ForceSendFields will be sent to the
  11681. // server regardless of whether the field is empty or not. This may be
  11682. // used to include empty fields in Patch requests.
  11683. ForceSendFields []string `json:"-"`
  11684. // NullFields is a list of field names (e.g. "Code") to include in API
  11685. // requests with the JSON null value. By default, fields with empty
  11686. // values are omitted from API requests. However, any field with an
  11687. // empty value appearing in NullFields will be sent to the server as
  11688. // null. It is an error if a field in this list has a non-empty value.
  11689. // This may be used to include null fields in Patch requests.
  11690. NullFields []string `json:"-"`
  11691. }
  11692. func (s *InterconnectAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  11693. type NoMethod InterconnectAttachmentsScopedListWarning
  11694. raw := NoMethod(*s)
  11695. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11696. }
  11697. type InterconnectAttachmentsScopedListWarningData struct {
  11698. // Key: [Output Only] A key that provides more detail on the warning
  11699. // being returned. For example, for warnings where there are no results
  11700. // in a list request for a particular zone, this key might be scope and
  11701. // the key value might be the zone name. Other examples might be a key
  11702. // indicating a deprecated resource and a suggested replacement, or a
  11703. // warning about invalid network settings (for example, if an instance
  11704. // attempts to perform IP forwarding but is not enabled for IP
  11705. // forwarding).
  11706. Key string `json:"key,omitempty"`
  11707. // Value: [Output Only] A warning data value corresponding to the key.
  11708. Value string `json:"value,omitempty"`
  11709. // ForceSendFields is a list of field names (e.g. "Key") to
  11710. // unconditionally include in API requests. By default, fields with
  11711. // empty values are omitted from API requests. However, any non-pointer,
  11712. // non-interface field appearing in ForceSendFields will be sent to the
  11713. // server regardless of whether the field is empty or not. This may be
  11714. // used to include empty fields in Patch requests.
  11715. ForceSendFields []string `json:"-"`
  11716. // NullFields is a list of field names (e.g. "Key") to include in API
  11717. // requests with the JSON null value. By default, fields with empty
  11718. // values are omitted from API requests. However, any field with an
  11719. // empty value appearing in NullFields will be sent to the server as
  11720. // null. It is an error if a field in this list has a non-empty value.
  11721. // This may be used to include null fields in Patch requests.
  11722. NullFields []string `json:"-"`
  11723. }
  11724. func (s *InterconnectAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  11725. type NoMethod InterconnectAttachmentsScopedListWarningData
  11726. raw := NoMethod(*s)
  11727. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11728. }
  11729. // InterconnectCircuitInfo: Describes a single physical circuit between
  11730. // the Customer and Google. CircuitInfo objects are created by Google,
  11731. // so all fields are output only. Next id: 4
  11732. type InterconnectCircuitInfo struct {
  11733. // CustomerDemarcId: Customer-side demarc ID for this circuit.
  11734. CustomerDemarcId string `json:"customerDemarcId,omitempty"`
  11735. // GoogleCircuitId: Google-assigned unique ID for this circuit. Assigned
  11736. // at circuit turn-up.
  11737. GoogleCircuitId string `json:"googleCircuitId,omitempty"`
  11738. // GoogleDemarcId: Google-side demarc ID for this circuit. Assigned at
  11739. // circuit turn-up and provided by Google to the customer in the LOA.
  11740. GoogleDemarcId string `json:"googleDemarcId,omitempty"`
  11741. // ForceSendFields is a list of field names (e.g. "CustomerDemarcId") to
  11742. // unconditionally include in API requests. By default, fields with
  11743. // empty values are omitted from API requests. However, any non-pointer,
  11744. // non-interface field appearing in ForceSendFields will be sent to the
  11745. // server regardless of whether the field is empty or not. This may be
  11746. // used to include empty fields in Patch requests.
  11747. ForceSendFields []string `json:"-"`
  11748. // NullFields is a list of field names (e.g. "CustomerDemarcId") to
  11749. // include in API requests with the JSON null value. By default, fields
  11750. // with empty values are omitted from API requests. However, any field
  11751. // with an empty value appearing in NullFields will be sent to the
  11752. // server as null. It is an error if a field in this list has a
  11753. // non-empty value. This may be used to include null fields in Patch
  11754. // requests.
  11755. NullFields []string `json:"-"`
  11756. }
  11757. func (s *InterconnectCircuitInfo) MarshalJSON() ([]byte, error) {
  11758. type NoMethod InterconnectCircuitInfo
  11759. raw := NoMethod(*s)
  11760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11761. }
  11762. // InterconnectDiagnostics: Diagnostics information about interconnect,
  11763. // contains detailed and current technical information about Google?s
  11764. // side of the connection.
  11765. type InterconnectDiagnostics struct {
  11766. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  11767. // describing individual neighbors currently seen by the Google router
  11768. // in the ARP cache for the Interconnect. This will be empty when the
  11769. // Interconnect is not bundled.
  11770. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  11771. // Links: A list of InterconnectDiagnostics.LinkStatus objects,
  11772. // describing the status for each link on the Interconnect.
  11773. Links []*InterconnectDiagnosticsLinkStatus `json:"links,omitempty"`
  11774. // MacAddress: The MAC address of the Interconnect's bundle interface.
  11775. MacAddress string `json:"macAddress,omitempty"`
  11776. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  11777. // unconditionally include in API requests. By default, fields with
  11778. // empty values are omitted from API requests. However, any non-pointer,
  11779. // non-interface field appearing in ForceSendFields will be sent to the
  11780. // server regardless of whether the field is empty or not. This may be
  11781. // used to include empty fields in Patch requests.
  11782. ForceSendFields []string `json:"-"`
  11783. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  11784. // API requests with the JSON null value. By default, fields with empty
  11785. // values are omitted from API requests. However, any field with an
  11786. // empty value appearing in NullFields will be sent to the server as
  11787. // null. It is an error if a field in this list has a non-empty value.
  11788. // This may be used to include null fields in Patch requests.
  11789. NullFields []string `json:"-"`
  11790. }
  11791. func (s *InterconnectDiagnostics) MarshalJSON() ([]byte, error) {
  11792. type NoMethod InterconnectDiagnostics
  11793. raw := NoMethod(*s)
  11794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11795. }
  11796. // InterconnectDiagnosticsARPEntry: Describing the ARP neighbor entries
  11797. // seen on this link
  11798. type InterconnectDiagnosticsARPEntry struct {
  11799. // IpAddress: The IP address of this ARP neighbor.
  11800. IpAddress string `json:"ipAddress,omitempty"`
  11801. // MacAddress: The MAC address of this ARP neighbor.
  11802. MacAddress string `json:"macAddress,omitempty"`
  11803. // ForceSendFields is a list of field names (e.g. "IpAddress") to
  11804. // unconditionally include in API requests. By default, fields with
  11805. // empty values are omitted from API requests. However, any non-pointer,
  11806. // non-interface field appearing in ForceSendFields will be sent to the
  11807. // server regardless of whether the field is empty or not. This may be
  11808. // used to include empty fields in Patch requests.
  11809. ForceSendFields []string `json:"-"`
  11810. // NullFields is a list of field names (e.g. "IpAddress") to include in
  11811. // API requests with the JSON null value. By default, fields with empty
  11812. // values are omitted from API requests. However, any field with an
  11813. // empty value appearing in NullFields will be sent to the server as
  11814. // null. It is an error if a field in this list has a non-empty value.
  11815. // This may be used to include null fields in Patch requests.
  11816. NullFields []string `json:"-"`
  11817. }
  11818. func (s *InterconnectDiagnosticsARPEntry) MarshalJSON() ([]byte, error) {
  11819. type NoMethod InterconnectDiagnosticsARPEntry
  11820. raw := NoMethod(*s)
  11821. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11822. }
  11823. type InterconnectDiagnosticsLinkLACPStatus struct {
  11824. // GoogleSystemId: System ID of the port on Google?s side of the LACP
  11825. // exchange.
  11826. GoogleSystemId string `json:"googleSystemId,omitempty"`
  11827. // NeighborSystemId: System ID of the port on the neighbor?s side of the
  11828. // LACP exchange.
  11829. NeighborSystemId string `json:"neighborSystemId,omitempty"`
  11830. // Possible values:
  11831. // "ACTIVE"
  11832. // "DETACHED"
  11833. State string `json:"state,omitempty"`
  11834. // ForceSendFields is a list of field names (e.g. "GoogleSystemId") to
  11835. // unconditionally include in API requests. By default, fields with
  11836. // empty values are omitted from API requests. However, any non-pointer,
  11837. // non-interface field appearing in ForceSendFields will be sent to the
  11838. // server regardless of whether the field is empty or not. This may be
  11839. // used to include empty fields in Patch requests.
  11840. ForceSendFields []string `json:"-"`
  11841. // NullFields is a list of field names (e.g. "GoogleSystemId") to
  11842. // include in API requests with the JSON null value. By default, fields
  11843. // with empty values are omitted from API requests. However, any field
  11844. // with an empty value appearing in NullFields will be sent to the
  11845. // server as null. It is an error if a field in this list has a
  11846. // non-empty value. This may be used to include null fields in Patch
  11847. // requests.
  11848. NullFields []string `json:"-"`
  11849. }
  11850. func (s *InterconnectDiagnosticsLinkLACPStatus) MarshalJSON() ([]byte, error) {
  11851. type NoMethod InterconnectDiagnosticsLinkLACPStatus
  11852. raw := NoMethod(*s)
  11853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11854. }
  11855. type InterconnectDiagnosticsLinkOpticalPower struct {
  11856. // State: The status of the current value when compared to the warning
  11857. // and alarm levels for the receiving or transmitting transceiver.
  11858. // Possible states include:
  11859. // - OK: The value has not crossed a warning threshold.
  11860. // - LOW_WARNING: The value has crossed below the low warning threshold.
  11861. //
  11862. // - HIGH_WARNING: The value has crossed above the high warning
  11863. // threshold.
  11864. // - LOW_ALARM: The value has crossed below the low alarm threshold.
  11865. // - HIGH_ALARM: The value has crossed above the high alarm threshold.
  11866. //
  11867. // Possible values:
  11868. // "HIGH_ALARM"
  11869. // "HIGH_WARNING"
  11870. // "LOW_ALARM"
  11871. // "LOW_WARNING"
  11872. // "OK"
  11873. State string `json:"state,omitempty"`
  11874. // Value: Value of the current receiving or transmitting optical power,
  11875. // read in dBm. Take a known good optical value, give it a 10% margin
  11876. // and trigger warnings relative to that value. In general, a -7dBm
  11877. // warning and a -11dBm alarm are good optical value estimates for most
  11878. // links.
  11879. Value float64 `json:"value,omitempty"`
  11880. // ForceSendFields is a list of field names (e.g. "State") to
  11881. // unconditionally include in API requests. By default, fields with
  11882. // empty values are omitted from API requests. However, any non-pointer,
  11883. // non-interface field appearing in ForceSendFields will be sent to the
  11884. // server regardless of whether the field is empty or not. This may be
  11885. // used to include empty fields in Patch requests.
  11886. ForceSendFields []string `json:"-"`
  11887. // NullFields is a list of field names (e.g. "State") to include in API
  11888. // requests with the JSON null value. By default, fields with empty
  11889. // values are omitted from API requests. However, any field with an
  11890. // empty value appearing in NullFields will be sent to the server as
  11891. // null. It is an error if a field in this list has a non-empty value.
  11892. // This may be used to include null fields in Patch requests.
  11893. NullFields []string `json:"-"`
  11894. }
  11895. func (s *InterconnectDiagnosticsLinkOpticalPower) MarshalJSON() ([]byte, error) {
  11896. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  11897. raw := NoMethod(*s)
  11898. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11899. }
  11900. func (s *InterconnectDiagnosticsLinkOpticalPower) UnmarshalJSON(data []byte) error {
  11901. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  11902. var s1 struct {
  11903. Value gensupport.JSONFloat64 `json:"value"`
  11904. *NoMethod
  11905. }
  11906. s1.NoMethod = (*NoMethod)(s)
  11907. if err := json.Unmarshal(data, &s1); err != nil {
  11908. return err
  11909. }
  11910. s.Value = float64(s1.Value)
  11911. return nil
  11912. }
  11913. type InterconnectDiagnosticsLinkStatus struct {
  11914. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  11915. // describing the ARP neighbor entries seen on this link. This will be
  11916. // empty if the link is bundled
  11917. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  11918. // CircuitId: The unique ID for this link assigned during turn up by
  11919. // Google.
  11920. CircuitId string `json:"circuitId,omitempty"`
  11921. // GoogleDemarc: The Demarc address assigned by Google and provided in
  11922. // the LoA.
  11923. GoogleDemarc string `json:"googleDemarc,omitempty"`
  11924. LacpStatus *InterconnectDiagnosticsLinkLACPStatus `json:"lacpStatus,omitempty"`
  11925. // ReceivingOpticalPower: An InterconnectDiagnostics.LinkOpticalPower
  11926. // object, describing the current value and status of the received light
  11927. // level.
  11928. ReceivingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"receivingOpticalPower,omitempty"`
  11929. // TransmittingOpticalPower: An InterconnectDiagnostics.LinkOpticalPower
  11930. // object, describing the current value and status of the transmitted
  11931. // light level.
  11932. TransmittingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"transmittingOpticalPower,omitempty"`
  11933. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  11934. // unconditionally include in API requests. By default, fields with
  11935. // empty values are omitted from API requests. However, any non-pointer,
  11936. // non-interface field appearing in ForceSendFields will be sent to the
  11937. // server regardless of whether the field is empty or not. This may be
  11938. // used to include empty fields in Patch requests.
  11939. ForceSendFields []string `json:"-"`
  11940. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  11941. // API requests with the JSON null value. By default, fields with empty
  11942. // values are omitted from API requests. However, any field with an
  11943. // empty value appearing in NullFields will be sent to the server as
  11944. // null. It is an error if a field in this list has a non-empty value.
  11945. // This may be used to include null fields in Patch requests.
  11946. NullFields []string `json:"-"`
  11947. }
  11948. func (s *InterconnectDiagnosticsLinkStatus) MarshalJSON() ([]byte, error) {
  11949. type NoMethod InterconnectDiagnosticsLinkStatus
  11950. raw := NoMethod(*s)
  11951. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11952. }
  11953. // InterconnectList: Response to the list request, and contains a list
  11954. // of interconnects.
  11955. type InterconnectList struct {
  11956. // Id: [Output Only] Unique identifier for the resource; defined by the
  11957. // server.
  11958. Id string `json:"id,omitempty"`
  11959. // Items: A list of Interconnect resources.
  11960. Items []*Interconnect `json:"items,omitempty"`
  11961. // Kind: [Output Only] Type of resource. Always compute#interconnectList
  11962. // for lists of interconnects.
  11963. Kind string `json:"kind,omitempty"`
  11964. // NextPageToken: [Output Only] This token allows you to get the next
  11965. // page of results for list requests. If the number of results is larger
  11966. // than maxResults, use the nextPageToken as a value for the query
  11967. // parameter pageToken in the next list request. Subsequent list
  11968. // requests will have their own nextPageToken to continue paging through
  11969. // the results.
  11970. NextPageToken string `json:"nextPageToken,omitempty"`
  11971. // SelfLink: [Output Only] Server-defined URL for this resource.
  11972. SelfLink string `json:"selfLink,omitempty"`
  11973. // Warning: [Output Only] Informational warning message.
  11974. Warning *InterconnectListWarning `json:"warning,omitempty"`
  11975. // ServerResponse contains the HTTP response code and headers from the
  11976. // server.
  11977. googleapi.ServerResponse `json:"-"`
  11978. // ForceSendFields is a list of field names (e.g. "Id") to
  11979. // unconditionally include in API requests. By default, fields with
  11980. // empty values are omitted from API requests. However, any non-pointer,
  11981. // non-interface field appearing in ForceSendFields will be sent to the
  11982. // server regardless of whether the field is empty or not. This may be
  11983. // used to include empty fields in Patch requests.
  11984. ForceSendFields []string `json:"-"`
  11985. // NullFields is a list of field names (e.g. "Id") to include in API
  11986. // requests with the JSON null value. By default, fields with empty
  11987. // values are omitted from API requests. However, any field with an
  11988. // empty value appearing in NullFields will be sent to the server as
  11989. // null. It is an error if a field in this list has a non-empty value.
  11990. // This may be used to include null fields in Patch requests.
  11991. NullFields []string `json:"-"`
  11992. }
  11993. func (s *InterconnectList) MarshalJSON() ([]byte, error) {
  11994. type NoMethod InterconnectList
  11995. raw := NoMethod(*s)
  11996. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11997. }
  11998. // InterconnectListWarning: [Output Only] Informational warning message.
  11999. type InterconnectListWarning struct {
  12000. // Code: [Output Only] A warning code, if applicable. For example,
  12001. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12002. // the response.
  12003. //
  12004. // Possible values:
  12005. // "CLEANUP_FAILED"
  12006. // "DEPRECATED_RESOURCE_USED"
  12007. // "DEPRECATED_TYPE_USED"
  12008. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12009. // "EXPERIMENTAL_TYPE_USED"
  12010. // "EXTERNAL_API_WARNING"
  12011. // "FIELD_VALUE_OVERRIDEN"
  12012. // "INJECTED_KERNELS_DEPRECATED"
  12013. // "MISSING_TYPE_DEPENDENCY"
  12014. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12015. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12016. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12017. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12018. // "NEXT_HOP_NOT_RUNNING"
  12019. // "NOT_CRITICAL_ERROR"
  12020. // "NO_RESULTS_ON_PAGE"
  12021. // "REQUIRED_TOS_AGREEMENT"
  12022. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12023. // "RESOURCE_NOT_DELETED"
  12024. // "SCHEMA_VALIDATION_IGNORED"
  12025. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12026. // "UNDECLARED_PROPERTIES"
  12027. // "UNREACHABLE"
  12028. Code string `json:"code,omitempty"`
  12029. // Data: [Output Only] Metadata about this warning in key: value format.
  12030. // For example:
  12031. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12032. Data []*InterconnectListWarningData `json:"data,omitempty"`
  12033. // Message: [Output Only] A human-readable description of the warning
  12034. // code.
  12035. Message string `json:"message,omitempty"`
  12036. // ForceSendFields is a list of field names (e.g. "Code") to
  12037. // unconditionally include in API requests. By default, fields with
  12038. // empty values are omitted from API requests. However, any non-pointer,
  12039. // non-interface field appearing in ForceSendFields will be sent to the
  12040. // server regardless of whether the field is empty or not. This may be
  12041. // used to include empty fields in Patch requests.
  12042. ForceSendFields []string `json:"-"`
  12043. // NullFields is a list of field names (e.g. "Code") to include in API
  12044. // requests with the JSON null value. By default, fields with empty
  12045. // values are omitted from API requests. However, any field with an
  12046. // empty value appearing in NullFields will be sent to the server as
  12047. // null. It is an error if a field in this list has a non-empty value.
  12048. // This may be used to include null fields in Patch requests.
  12049. NullFields []string `json:"-"`
  12050. }
  12051. func (s *InterconnectListWarning) MarshalJSON() ([]byte, error) {
  12052. type NoMethod InterconnectListWarning
  12053. raw := NoMethod(*s)
  12054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12055. }
  12056. type InterconnectListWarningData struct {
  12057. // Key: [Output Only] A key that provides more detail on the warning
  12058. // being returned. For example, for warnings where there are no results
  12059. // in a list request for a particular zone, this key might be scope and
  12060. // the key value might be the zone name. Other examples might be a key
  12061. // indicating a deprecated resource and a suggested replacement, or a
  12062. // warning about invalid network settings (for example, if an instance
  12063. // attempts to perform IP forwarding but is not enabled for IP
  12064. // forwarding).
  12065. Key string `json:"key,omitempty"`
  12066. // Value: [Output Only] A warning data value corresponding to the key.
  12067. Value string `json:"value,omitempty"`
  12068. // ForceSendFields is a list of field names (e.g. "Key") to
  12069. // unconditionally include in API requests. By default, fields with
  12070. // empty values are omitted from API requests. However, any non-pointer,
  12071. // non-interface field appearing in ForceSendFields will be sent to the
  12072. // server regardless of whether the field is empty or not. This may be
  12073. // used to include empty fields in Patch requests.
  12074. ForceSendFields []string `json:"-"`
  12075. // NullFields is a list of field names (e.g. "Key") to include in API
  12076. // requests with the JSON null value. By default, fields with empty
  12077. // values are omitted from API requests. However, any field with an
  12078. // empty value appearing in NullFields will be sent to the server as
  12079. // null. It is an error if a field in this list has a non-empty value.
  12080. // This may be used to include null fields in Patch requests.
  12081. NullFields []string `json:"-"`
  12082. }
  12083. func (s *InterconnectListWarningData) MarshalJSON() ([]byte, error) {
  12084. type NoMethod InterconnectListWarningData
  12085. raw := NoMethod(*s)
  12086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12087. }
  12088. // InterconnectLocation: Represents an InterconnectLocations resource.
  12089. // The InterconnectLocations resource describes the locations where you
  12090. // can connect to Google's networks. For more information, see
  12091. // Colocation Facilities.
  12092. type InterconnectLocation struct {
  12093. // Address: [Output Only] The postal address of the Point of Presence,
  12094. // each line in the address is separated by a newline character.
  12095. Address string `json:"address,omitempty"`
  12096. // AvailabilityZone: [Output Only] Availability zone for this
  12097. // InterconnectLocation. Within a metropolitan area (metro), maintenance
  12098. // will not be simultaneously scheduled in more than one availability
  12099. // zone. Example: "zone1" or "zone2".
  12100. AvailabilityZone string `json:"availabilityZone,omitempty"`
  12101. // City: [Output Only] Metropolitan area designator that indicates which
  12102. // city an interconnect is located. For example: "Chicago, IL",
  12103. // "Amsterdam, Netherlands".
  12104. City string `json:"city,omitempty"`
  12105. // Continent: [Output Only] Continent for this location.
  12106. //
  12107. // Possible values:
  12108. // "AFRICA"
  12109. // "ASIA_PAC"
  12110. // "C_AFRICA"
  12111. // "C_ASIA_PAC"
  12112. // "C_EUROPE"
  12113. // "C_NORTH_AMERICA"
  12114. // "C_SOUTH_AMERICA"
  12115. // "EUROPE"
  12116. // "NORTH_AMERICA"
  12117. // "SOUTH_AMERICA"
  12118. Continent string `json:"continent,omitempty"`
  12119. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12120. // format.
  12121. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12122. // Description: [Output Only] An optional description of the resource.
  12123. Description string `json:"description,omitempty"`
  12124. // FacilityProvider: [Output Only] The name of the provider for this
  12125. // facility (e.g., EQUINIX).
  12126. FacilityProvider string `json:"facilityProvider,omitempty"`
  12127. // FacilityProviderFacilityId: [Output Only] A provider-assigned
  12128. // Identifier for this facility (e.g., Ashburn-DC1).
  12129. FacilityProviderFacilityId string `json:"facilityProviderFacilityId,omitempty"`
  12130. // Id: [Output Only] The unique identifier for the resource. This
  12131. // identifier is defined by the server.
  12132. Id uint64 `json:"id,omitempty,string"`
  12133. // Kind: [Output Only] Type of the resource. Always
  12134. // compute#interconnectLocation for interconnect locations.
  12135. Kind string `json:"kind,omitempty"`
  12136. // Name: [Output Only] Name of the resource.
  12137. Name string `json:"name,omitempty"`
  12138. // PeeringdbFacilityId: [Output Only] The peeringdb identifier for this
  12139. // facility (corresponding with a netfac type in peeringdb).
  12140. PeeringdbFacilityId string `json:"peeringdbFacilityId,omitempty"`
  12141. // RegionInfos: [Output Only] A list of InterconnectLocation.RegionInfo
  12142. // objects, that describe parameters pertaining to the relation between
  12143. // this InterconnectLocation and various Google Cloud regions.
  12144. RegionInfos []*InterconnectLocationRegionInfo `json:"regionInfos,omitempty"`
  12145. // SelfLink: [Output Only] Server-defined URL for the resource.
  12146. SelfLink string `json:"selfLink,omitempty"`
  12147. // Status: [Output Only] The status of this InterconnectLocation. If the
  12148. // status is AVAILABLE, new Interconnects may be provisioned in this
  12149. // InterconnectLocation. Otherwise, no new Interconnects may be
  12150. // provisioned.
  12151. //
  12152. // Possible values:
  12153. // "AVAILABLE"
  12154. // "CLOSED"
  12155. Status string `json:"status,omitempty"`
  12156. // ServerResponse contains the HTTP response code and headers from the
  12157. // server.
  12158. googleapi.ServerResponse `json:"-"`
  12159. // ForceSendFields is a list of field names (e.g. "Address") to
  12160. // unconditionally include in API requests. By default, fields with
  12161. // empty values are omitted from API requests. However, any non-pointer,
  12162. // non-interface field appearing in ForceSendFields will be sent to the
  12163. // server regardless of whether the field is empty or not. This may be
  12164. // used to include empty fields in Patch requests.
  12165. ForceSendFields []string `json:"-"`
  12166. // NullFields is a list of field names (e.g. "Address") to include in
  12167. // API requests with the JSON null value. By default, fields with empty
  12168. // values are omitted from API requests. However, any field with an
  12169. // empty value appearing in NullFields will be sent to the server as
  12170. // null. It is an error if a field in this list has a non-empty value.
  12171. // This may be used to include null fields in Patch requests.
  12172. NullFields []string `json:"-"`
  12173. }
  12174. func (s *InterconnectLocation) MarshalJSON() ([]byte, error) {
  12175. type NoMethod InterconnectLocation
  12176. raw := NoMethod(*s)
  12177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12178. }
  12179. // InterconnectLocationList: Response to the list request, and contains
  12180. // a list of interconnect locations.
  12181. type InterconnectLocationList struct {
  12182. // Id: [Output Only] Unique identifier for the resource; defined by the
  12183. // server.
  12184. Id string `json:"id,omitempty"`
  12185. // Items: A list of InterconnectLocation resources.
  12186. Items []*InterconnectLocation `json:"items,omitempty"`
  12187. // Kind: [Output Only] Type of resource. Always
  12188. // compute#interconnectLocationList for lists of interconnect locations.
  12189. Kind string `json:"kind,omitempty"`
  12190. // NextPageToken: [Output Only] This token allows you to get the next
  12191. // page of results for list requests. If the number of results is larger
  12192. // than maxResults, use the nextPageToken as a value for the query
  12193. // parameter pageToken in the next list request. Subsequent list
  12194. // requests will have their own nextPageToken to continue paging through
  12195. // the results.
  12196. NextPageToken string `json:"nextPageToken,omitempty"`
  12197. // SelfLink: [Output Only] Server-defined URL for this resource.
  12198. SelfLink string `json:"selfLink,omitempty"`
  12199. // Warning: [Output Only] Informational warning message.
  12200. Warning *InterconnectLocationListWarning `json:"warning,omitempty"`
  12201. // ServerResponse contains the HTTP response code and headers from the
  12202. // server.
  12203. googleapi.ServerResponse `json:"-"`
  12204. // ForceSendFields is a list of field names (e.g. "Id") to
  12205. // unconditionally include in API requests. By default, fields with
  12206. // empty values are omitted from API requests. However, any non-pointer,
  12207. // non-interface field appearing in ForceSendFields will be sent to the
  12208. // server regardless of whether the field is empty or not. This may be
  12209. // used to include empty fields in Patch requests.
  12210. ForceSendFields []string `json:"-"`
  12211. // NullFields is a list of field names (e.g. "Id") to include in API
  12212. // requests with the JSON null value. By default, fields with empty
  12213. // values are omitted from API requests. However, any field with an
  12214. // empty value appearing in NullFields will be sent to the server as
  12215. // null. It is an error if a field in this list has a non-empty value.
  12216. // This may be used to include null fields in Patch requests.
  12217. NullFields []string `json:"-"`
  12218. }
  12219. func (s *InterconnectLocationList) MarshalJSON() ([]byte, error) {
  12220. type NoMethod InterconnectLocationList
  12221. raw := NoMethod(*s)
  12222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12223. }
  12224. // InterconnectLocationListWarning: [Output Only] Informational warning
  12225. // message.
  12226. type InterconnectLocationListWarning struct {
  12227. // Code: [Output Only] A warning code, if applicable. For example,
  12228. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12229. // the response.
  12230. //
  12231. // Possible values:
  12232. // "CLEANUP_FAILED"
  12233. // "DEPRECATED_RESOURCE_USED"
  12234. // "DEPRECATED_TYPE_USED"
  12235. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12236. // "EXPERIMENTAL_TYPE_USED"
  12237. // "EXTERNAL_API_WARNING"
  12238. // "FIELD_VALUE_OVERRIDEN"
  12239. // "INJECTED_KERNELS_DEPRECATED"
  12240. // "MISSING_TYPE_DEPENDENCY"
  12241. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12242. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12243. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12244. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12245. // "NEXT_HOP_NOT_RUNNING"
  12246. // "NOT_CRITICAL_ERROR"
  12247. // "NO_RESULTS_ON_PAGE"
  12248. // "REQUIRED_TOS_AGREEMENT"
  12249. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12250. // "RESOURCE_NOT_DELETED"
  12251. // "SCHEMA_VALIDATION_IGNORED"
  12252. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12253. // "UNDECLARED_PROPERTIES"
  12254. // "UNREACHABLE"
  12255. Code string `json:"code,omitempty"`
  12256. // Data: [Output Only] Metadata about this warning in key: value format.
  12257. // For example:
  12258. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12259. Data []*InterconnectLocationListWarningData `json:"data,omitempty"`
  12260. // Message: [Output Only] A human-readable description of the warning
  12261. // code.
  12262. Message string `json:"message,omitempty"`
  12263. // ForceSendFields is a list of field names (e.g. "Code") to
  12264. // unconditionally include in API requests. By default, fields with
  12265. // empty values are omitted from API requests. However, any non-pointer,
  12266. // non-interface field appearing in ForceSendFields will be sent to the
  12267. // server regardless of whether the field is empty or not. This may be
  12268. // used to include empty fields in Patch requests.
  12269. ForceSendFields []string `json:"-"`
  12270. // NullFields is a list of field names (e.g. "Code") to include in API
  12271. // requests with the JSON null value. By default, fields with empty
  12272. // values are omitted from API requests. However, any field with an
  12273. // empty value appearing in NullFields will be sent to the server as
  12274. // null. It is an error if a field in this list has a non-empty value.
  12275. // This may be used to include null fields in Patch requests.
  12276. NullFields []string `json:"-"`
  12277. }
  12278. func (s *InterconnectLocationListWarning) MarshalJSON() ([]byte, error) {
  12279. type NoMethod InterconnectLocationListWarning
  12280. raw := NoMethod(*s)
  12281. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12282. }
  12283. type InterconnectLocationListWarningData struct {
  12284. // Key: [Output Only] A key that provides more detail on the warning
  12285. // being returned. For example, for warnings where there are no results
  12286. // in a list request for a particular zone, this key might be scope and
  12287. // the key value might be the zone name. Other examples might be a key
  12288. // indicating a deprecated resource and a suggested replacement, or a
  12289. // warning about invalid network settings (for example, if an instance
  12290. // attempts to perform IP forwarding but is not enabled for IP
  12291. // forwarding).
  12292. Key string `json:"key,omitempty"`
  12293. // Value: [Output Only] A warning data value corresponding to the key.
  12294. Value string `json:"value,omitempty"`
  12295. // ForceSendFields is a list of field names (e.g. "Key") to
  12296. // unconditionally include in API requests. By default, fields with
  12297. // empty values are omitted from API requests. However, any non-pointer,
  12298. // non-interface field appearing in ForceSendFields will be sent to the
  12299. // server regardless of whether the field is empty or not. This may be
  12300. // used to include empty fields in Patch requests.
  12301. ForceSendFields []string `json:"-"`
  12302. // NullFields is a list of field names (e.g. "Key") to include in API
  12303. // requests with the JSON null value. By default, fields with empty
  12304. // values are omitted from API requests. However, any field with an
  12305. // empty value appearing in NullFields will be sent to the server as
  12306. // null. It is an error if a field in this list has a non-empty value.
  12307. // This may be used to include null fields in Patch requests.
  12308. NullFields []string `json:"-"`
  12309. }
  12310. func (s *InterconnectLocationListWarningData) MarshalJSON() ([]byte, error) {
  12311. type NoMethod InterconnectLocationListWarningData
  12312. raw := NoMethod(*s)
  12313. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12314. }
  12315. // InterconnectLocationRegionInfo: Information about any potential
  12316. // InterconnectAttachments between an Interconnect at a specific
  12317. // InterconnectLocation, and a specific Cloud Region.
  12318. type InterconnectLocationRegionInfo struct {
  12319. // ExpectedRttMs: Expected round-trip time in milliseconds, from this
  12320. // InterconnectLocation to a VM in this region.
  12321. ExpectedRttMs int64 `json:"expectedRttMs,omitempty,string"`
  12322. // LocationPresence: Identifies the network presence of this location.
  12323. //
  12324. // Possible values:
  12325. // "GLOBAL"
  12326. // "LOCAL_REGION"
  12327. // "LP_GLOBAL"
  12328. // "LP_LOCAL_REGION"
  12329. LocationPresence string `json:"locationPresence,omitempty"`
  12330. // Region: URL for the region of this location.
  12331. Region string `json:"region,omitempty"`
  12332. // ForceSendFields is a list of field names (e.g. "ExpectedRttMs") to
  12333. // unconditionally include in API requests. By default, fields with
  12334. // empty values are omitted from API requests. However, any non-pointer,
  12335. // non-interface field appearing in ForceSendFields will be sent to the
  12336. // server regardless of whether the field is empty or not. This may be
  12337. // used to include empty fields in Patch requests.
  12338. ForceSendFields []string `json:"-"`
  12339. // NullFields is a list of field names (e.g. "ExpectedRttMs") to include
  12340. // in API requests with the JSON null value. By default, fields with
  12341. // empty values are omitted from API requests. However, any field with
  12342. // an empty value appearing in NullFields will be sent to the server as
  12343. // null. It is an error if a field in this list has a non-empty value.
  12344. // This may be used to include null fields in Patch requests.
  12345. NullFields []string `json:"-"`
  12346. }
  12347. func (s *InterconnectLocationRegionInfo) MarshalJSON() ([]byte, error) {
  12348. type NoMethod InterconnectLocationRegionInfo
  12349. raw := NoMethod(*s)
  12350. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12351. }
  12352. // InterconnectOutageNotification: Description of a planned outage on
  12353. // this Interconnect. Next id: 9
  12354. type InterconnectOutageNotification struct {
  12355. // AffectedCircuits: If issue_type is IT_PARTIAL_OUTAGE, a list of the
  12356. // Google-side circuit IDs that will be affected.
  12357. AffectedCircuits []string `json:"affectedCircuits,omitempty"`
  12358. // Description: A description about the purpose of the outage.
  12359. Description string `json:"description,omitempty"`
  12360. // EndTime: Scheduled end time for the outage (milliseconds since Unix
  12361. // epoch).
  12362. EndTime int64 `json:"endTime,omitempty,string"`
  12363. // IssueType: Form this outage is expected to take. Note that the "IT_"
  12364. // versions of this enum have been deprecated in favor of the unprefixed
  12365. // values.
  12366. //
  12367. // Possible values:
  12368. // "IT_OUTAGE"
  12369. // "IT_PARTIAL_OUTAGE"
  12370. // "OUTAGE"
  12371. // "PARTIAL_OUTAGE"
  12372. IssueType string `json:"issueType,omitempty"`
  12373. // Name: Unique identifier for this outage notification.
  12374. Name string `json:"name,omitempty"`
  12375. // Source: The party that generated this notification. Note that
  12376. // "NSRC_GOOGLE" has been deprecated in favor of "GOOGLE"
  12377. //
  12378. // Possible values:
  12379. // "GOOGLE"
  12380. // "NSRC_GOOGLE"
  12381. Source string `json:"source,omitempty"`
  12382. // StartTime: Scheduled start time for the outage (milliseconds since
  12383. // Unix epoch).
  12384. StartTime int64 `json:"startTime,omitempty,string"`
  12385. // State: State of this notification. Note that the "NS_" versions of
  12386. // this enum have been deprecated in favor of the unprefixed values.
  12387. //
  12388. // Possible values:
  12389. // "ACTIVE"
  12390. // "CANCELLED"
  12391. // "NS_ACTIVE"
  12392. // "NS_CANCELED"
  12393. State string `json:"state,omitempty"`
  12394. // ForceSendFields is a list of field names (e.g. "AffectedCircuits") to
  12395. // unconditionally include in API requests. By default, fields with
  12396. // empty values are omitted from API requests. However, any non-pointer,
  12397. // non-interface field appearing in ForceSendFields will be sent to the
  12398. // server regardless of whether the field is empty or not. This may be
  12399. // used to include empty fields in Patch requests.
  12400. ForceSendFields []string `json:"-"`
  12401. // NullFields is a list of field names (e.g. "AffectedCircuits") to
  12402. // include in API requests with the JSON null value. By default, fields
  12403. // with empty values are omitted from API requests. However, any field
  12404. // with an empty value appearing in NullFields will be sent to the
  12405. // server as null. It is an error if a field in this list has a
  12406. // non-empty value. This may be used to include null fields in Patch
  12407. // requests.
  12408. NullFields []string `json:"-"`
  12409. }
  12410. func (s *InterconnectOutageNotification) MarshalJSON() ([]byte, error) {
  12411. type NoMethod InterconnectOutageNotification
  12412. raw := NoMethod(*s)
  12413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12414. }
  12415. // InterconnectsGetDiagnosticsResponse: Response for the
  12416. // InterconnectsGetDiagnosticsRequest.
  12417. type InterconnectsGetDiagnosticsResponse struct {
  12418. Result *InterconnectDiagnostics `json:"result,omitempty"`
  12419. // ServerResponse contains the HTTP response code and headers from the
  12420. // server.
  12421. googleapi.ServerResponse `json:"-"`
  12422. // ForceSendFields is a list of field names (e.g. "Result") to
  12423. // unconditionally include in API requests. By default, fields with
  12424. // empty values are omitted from API requests. However, any non-pointer,
  12425. // non-interface field appearing in ForceSendFields will be sent to the
  12426. // server regardless of whether the field is empty or not. This may be
  12427. // used to include empty fields in Patch requests.
  12428. ForceSendFields []string `json:"-"`
  12429. // NullFields is a list of field names (e.g. "Result") to include in API
  12430. // requests with the JSON null value. By default, fields with empty
  12431. // values are omitted from API requests. However, any field with an
  12432. // empty value appearing in NullFields will be sent to the server as
  12433. // null. It is an error if a field in this list has a non-empty value.
  12434. // This may be used to include null fields in Patch requests.
  12435. NullFields []string `json:"-"`
  12436. }
  12437. func (s *InterconnectsGetDiagnosticsResponse) MarshalJSON() ([]byte, error) {
  12438. type NoMethod InterconnectsGetDiagnosticsResponse
  12439. raw := NoMethod(*s)
  12440. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12441. }
  12442. // License: A license resource.
  12443. type License struct {
  12444. // ChargesUseFee: [Output Only] Deprecated. This field no longer
  12445. // reflects whether a license charges a usage fee.
  12446. ChargesUseFee bool `json:"chargesUseFee,omitempty"`
  12447. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12448. // format.
  12449. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12450. // Description: An optional textual description of the resource;
  12451. // provided by the client when the resource is created.
  12452. Description string `json:"description,omitempty"`
  12453. // Id: [Output Only] The unique identifier for the resource. This
  12454. // identifier is defined by the server.
  12455. Id uint64 `json:"id,omitempty,string"`
  12456. // Kind: [Output Only] Type of resource. Always compute#license for
  12457. // licenses.
  12458. Kind string `json:"kind,omitempty"`
  12459. // LicenseCode: [Output Only] The unique code used to attach this
  12460. // license to images, snapshots, and disks.
  12461. LicenseCode uint64 `json:"licenseCode,omitempty,string"`
  12462. // Name: Name of the resource. The name must be 1-63 characters long and
  12463. // comply with RFC1035.
  12464. Name string `json:"name,omitempty"`
  12465. ResourceRequirements *LicenseResourceRequirements `json:"resourceRequirements,omitempty"`
  12466. // SelfLink: [Output Only] Server-defined URL for the resource.
  12467. SelfLink string `json:"selfLink,omitempty"`
  12468. // Transferable: If false, licenses will not be copied from the source
  12469. // resource when creating an image from a disk, disk from snapshot, or
  12470. // snapshot from disk.
  12471. Transferable bool `json:"transferable,omitempty"`
  12472. // ServerResponse contains the HTTP response code and headers from the
  12473. // server.
  12474. googleapi.ServerResponse `json:"-"`
  12475. // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to
  12476. // unconditionally include in API requests. By default, fields with
  12477. // empty values are omitted from API requests. However, any non-pointer,
  12478. // non-interface field appearing in ForceSendFields will be sent to the
  12479. // server regardless of whether the field is empty or not. This may be
  12480. // used to include empty fields in Patch requests.
  12481. ForceSendFields []string `json:"-"`
  12482. // NullFields is a list of field names (e.g. "ChargesUseFee") to include
  12483. // in API requests with the JSON null value. By default, fields with
  12484. // empty values are omitted from API requests. However, any field with
  12485. // an empty value appearing in NullFields will be sent to the server as
  12486. // null. It is an error if a field in this list has a non-empty value.
  12487. // This may be used to include null fields in Patch requests.
  12488. NullFields []string `json:"-"`
  12489. }
  12490. func (s *License) MarshalJSON() ([]byte, error) {
  12491. type NoMethod License
  12492. raw := NoMethod(*s)
  12493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12494. }
  12495. type LicenseCode struct {
  12496. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12497. // format.
  12498. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12499. // Description: [Output Only] Description of this License Code.
  12500. Description string `json:"description,omitempty"`
  12501. // Id: [Output Only] The unique identifier for the resource. This
  12502. // identifier is defined by the server.
  12503. Id uint64 `json:"id,omitempty,string"`
  12504. // Kind: [Output Only] Type of resource. Always compute#licenseCode for
  12505. // licenses.
  12506. Kind string `json:"kind,omitempty"`
  12507. // LicenseAlias: [Output Only] URL and description aliases of Licenses
  12508. // with the same License Code.
  12509. LicenseAlias []*LicenseCodeLicenseAlias `json:"licenseAlias,omitempty"`
  12510. // Name: [Output Only] Name of the resource. The name is 1-20 characters
  12511. // long and must be a valid 64 bit integer.
  12512. Name string `json:"name,omitempty"`
  12513. // SelfLink: [Output Only] Server-defined URL for the resource.
  12514. SelfLink string `json:"selfLink,omitempty"`
  12515. // State: [Output Only] Current state of this License Code.
  12516. //
  12517. // Possible values:
  12518. // "DISABLED"
  12519. // "ENABLED"
  12520. // "RESTRICTED"
  12521. // "STATE_UNSPECIFIED"
  12522. // "TERMINATED"
  12523. State string `json:"state,omitempty"`
  12524. // Transferable: [Output Only] If true, the license will remain attached
  12525. // when creating images or snapshots from disks. Otherwise, the license
  12526. // is not transferred.
  12527. Transferable bool `json:"transferable,omitempty"`
  12528. // ServerResponse contains the HTTP response code and headers from the
  12529. // server.
  12530. googleapi.ServerResponse `json:"-"`
  12531. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  12532. // to unconditionally include in API requests. By default, fields with
  12533. // empty values are omitted from API requests. However, any non-pointer,
  12534. // non-interface field appearing in ForceSendFields will be sent to the
  12535. // server regardless of whether the field is empty or not. This may be
  12536. // used to include empty fields in Patch requests.
  12537. ForceSendFields []string `json:"-"`
  12538. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  12539. // include in API requests with the JSON null value. By default, fields
  12540. // with empty values are omitted from API requests. However, any field
  12541. // with an empty value appearing in NullFields will be sent to the
  12542. // server as null. It is an error if a field in this list has a
  12543. // non-empty value. This may be used to include null fields in Patch
  12544. // requests.
  12545. NullFields []string `json:"-"`
  12546. }
  12547. func (s *LicenseCode) MarshalJSON() ([]byte, error) {
  12548. type NoMethod LicenseCode
  12549. raw := NoMethod(*s)
  12550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12551. }
  12552. type LicenseCodeLicenseAlias struct {
  12553. // Description: [Output Only] Description of this License Code.
  12554. Description string `json:"description,omitempty"`
  12555. // SelfLink: [Output Only] URL of license corresponding to this License
  12556. // Code.
  12557. SelfLink string `json:"selfLink,omitempty"`
  12558. // ForceSendFields is a list of field names (e.g. "Description") to
  12559. // unconditionally include in API requests. By default, fields with
  12560. // empty values are omitted from API requests. However, any non-pointer,
  12561. // non-interface field appearing in ForceSendFields will be sent to the
  12562. // server regardless of whether the field is empty or not. This may be
  12563. // used to include empty fields in Patch requests.
  12564. ForceSendFields []string `json:"-"`
  12565. // NullFields is a list of field names (e.g. "Description") to include
  12566. // in API requests with the JSON null value. By default, fields with
  12567. // empty values are omitted from API requests. However, any field with
  12568. // an empty value appearing in NullFields will be sent to the server as
  12569. // null. It is an error if a field in this list has a non-empty value.
  12570. // This may be used to include null fields in Patch requests.
  12571. NullFields []string `json:"-"`
  12572. }
  12573. func (s *LicenseCodeLicenseAlias) MarshalJSON() ([]byte, error) {
  12574. type NoMethod LicenseCodeLicenseAlias
  12575. raw := NoMethod(*s)
  12576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12577. }
  12578. type LicenseResourceRequirements struct {
  12579. // MinGuestCpuCount: Minimum number of guest cpus required to use the
  12580. // Instance. Enforced at Instance creation and Instance start.
  12581. MinGuestCpuCount int64 `json:"minGuestCpuCount,omitempty"`
  12582. // MinMemoryMb: Minimum memory required to use the Instance. Enforced at
  12583. // Instance creation and Instance start.
  12584. MinMemoryMb int64 `json:"minMemoryMb,omitempty"`
  12585. // ForceSendFields is a list of field names (e.g. "MinGuestCpuCount") to
  12586. // unconditionally include in API requests. By default, fields with
  12587. // empty values are omitted from API requests. However, any non-pointer,
  12588. // non-interface field appearing in ForceSendFields will be sent to the
  12589. // server regardless of whether the field is empty or not. This may be
  12590. // used to include empty fields in Patch requests.
  12591. ForceSendFields []string `json:"-"`
  12592. // NullFields is a list of field names (e.g. "MinGuestCpuCount") to
  12593. // include in API requests with the JSON null value. By default, fields
  12594. // with empty values are omitted from API requests. However, any field
  12595. // with an empty value appearing in NullFields will be sent to the
  12596. // server as null. It is an error if a field in this list has a
  12597. // non-empty value. This may be used to include null fields in Patch
  12598. // requests.
  12599. NullFields []string `json:"-"`
  12600. }
  12601. func (s *LicenseResourceRequirements) MarshalJSON() ([]byte, error) {
  12602. type NoMethod LicenseResourceRequirements
  12603. raw := NoMethod(*s)
  12604. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12605. }
  12606. type LicensesListResponse struct {
  12607. // Id: [Output Only] Unique identifier for the resource; defined by the
  12608. // server.
  12609. Id string `json:"id,omitempty"`
  12610. // Items: A list of License resources.
  12611. Items []*License `json:"items,omitempty"`
  12612. // NextPageToken: [Output Only] This token allows you to get the next
  12613. // page of results for list requests. If the number of results is larger
  12614. // than maxResults, use the nextPageToken as a value for the query
  12615. // parameter pageToken in the next list request. Subsequent list
  12616. // requests will have their own nextPageToken to continue paging through
  12617. // the results.
  12618. NextPageToken string `json:"nextPageToken,omitempty"`
  12619. // SelfLink: [Output Only] Server-defined URL for this resource.
  12620. SelfLink string `json:"selfLink,omitempty"`
  12621. // Warning: [Output Only] Informational warning message.
  12622. Warning *LicensesListResponseWarning `json:"warning,omitempty"`
  12623. // ServerResponse contains the HTTP response code and headers from the
  12624. // server.
  12625. googleapi.ServerResponse `json:"-"`
  12626. // ForceSendFields is a list of field names (e.g. "Id") to
  12627. // unconditionally include in API requests. By default, fields with
  12628. // empty values are omitted from API requests. However, any non-pointer,
  12629. // non-interface field appearing in ForceSendFields will be sent to the
  12630. // server regardless of whether the field is empty or not. This may be
  12631. // used to include empty fields in Patch requests.
  12632. ForceSendFields []string `json:"-"`
  12633. // NullFields is a list of field names (e.g. "Id") to include in API
  12634. // requests with the JSON null value. By default, fields with empty
  12635. // values are omitted from API requests. However, any field with an
  12636. // empty value appearing in NullFields will be sent to the server as
  12637. // null. It is an error if a field in this list has a non-empty value.
  12638. // This may be used to include null fields in Patch requests.
  12639. NullFields []string `json:"-"`
  12640. }
  12641. func (s *LicensesListResponse) MarshalJSON() ([]byte, error) {
  12642. type NoMethod LicensesListResponse
  12643. raw := NoMethod(*s)
  12644. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12645. }
  12646. // LicensesListResponseWarning: [Output Only] Informational warning
  12647. // message.
  12648. type LicensesListResponseWarning struct {
  12649. // Code: [Output Only] A warning code, if applicable. For example,
  12650. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12651. // the response.
  12652. //
  12653. // Possible values:
  12654. // "CLEANUP_FAILED"
  12655. // "DEPRECATED_RESOURCE_USED"
  12656. // "DEPRECATED_TYPE_USED"
  12657. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12658. // "EXPERIMENTAL_TYPE_USED"
  12659. // "EXTERNAL_API_WARNING"
  12660. // "FIELD_VALUE_OVERRIDEN"
  12661. // "INJECTED_KERNELS_DEPRECATED"
  12662. // "MISSING_TYPE_DEPENDENCY"
  12663. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12664. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12665. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12666. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12667. // "NEXT_HOP_NOT_RUNNING"
  12668. // "NOT_CRITICAL_ERROR"
  12669. // "NO_RESULTS_ON_PAGE"
  12670. // "REQUIRED_TOS_AGREEMENT"
  12671. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12672. // "RESOURCE_NOT_DELETED"
  12673. // "SCHEMA_VALIDATION_IGNORED"
  12674. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12675. // "UNDECLARED_PROPERTIES"
  12676. // "UNREACHABLE"
  12677. Code string `json:"code,omitempty"`
  12678. // Data: [Output Only] Metadata about this warning in key: value format.
  12679. // For example:
  12680. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12681. Data []*LicensesListResponseWarningData `json:"data,omitempty"`
  12682. // Message: [Output Only] A human-readable description of the warning
  12683. // code.
  12684. Message string `json:"message,omitempty"`
  12685. // ForceSendFields is a list of field names (e.g. "Code") to
  12686. // unconditionally include in API requests. By default, fields with
  12687. // empty values are omitted from API requests. However, any non-pointer,
  12688. // non-interface field appearing in ForceSendFields will be sent to the
  12689. // server regardless of whether the field is empty or not. This may be
  12690. // used to include empty fields in Patch requests.
  12691. ForceSendFields []string `json:"-"`
  12692. // NullFields is a list of field names (e.g. "Code") to include in API
  12693. // requests with the JSON null value. By default, fields with empty
  12694. // values are omitted from API requests. However, any field with an
  12695. // empty value appearing in NullFields will be sent to the server as
  12696. // null. It is an error if a field in this list has a non-empty value.
  12697. // This may be used to include null fields in Patch requests.
  12698. NullFields []string `json:"-"`
  12699. }
  12700. func (s *LicensesListResponseWarning) MarshalJSON() ([]byte, error) {
  12701. type NoMethod LicensesListResponseWarning
  12702. raw := NoMethod(*s)
  12703. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12704. }
  12705. type LicensesListResponseWarningData struct {
  12706. // Key: [Output Only] A key that provides more detail on the warning
  12707. // being returned. For example, for warnings where there are no results
  12708. // in a list request for a particular zone, this key might be scope and
  12709. // the key value might be the zone name. Other examples might be a key
  12710. // indicating a deprecated resource and a suggested replacement, or a
  12711. // warning about invalid network settings (for example, if an instance
  12712. // attempts to perform IP forwarding but is not enabled for IP
  12713. // forwarding).
  12714. Key string `json:"key,omitempty"`
  12715. // Value: [Output Only] A warning data value corresponding to the key.
  12716. Value string `json:"value,omitempty"`
  12717. // ForceSendFields is a list of field names (e.g. "Key") to
  12718. // unconditionally include in API requests. By default, fields with
  12719. // empty values are omitted from API requests. However, any non-pointer,
  12720. // non-interface field appearing in ForceSendFields will be sent to the
  12721. // server regardless of whether the field is empty or not. This may be
  12722. // used to include empty fields in Patch requests.
  12723. ForceSendFields []string `json:"-"`
  12724. // NullFields is a list of field names (e.g. "Key") to include in API
  12725. // requests with the JSON null value. By default, fields with empty
  12726. // values are omitted from API requests. However, any field with an
  12727. // empty value appearing in NullFields will be sent to the server as
  12728. // null. It is an error if a field in this list has a non-empty value.
  12729. // This may be used to include null fields in Patch requests.
  12730. NullFields []string `json:"-"`
  12731. }
  12732. func (s *LicensesListResponseWarningData) MarshalJSON() ([]byte, error) {
  12733. type NoMethod LicensesListResponseWarningData
  12734. raw := NoMethod(*s)
  12735. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12736. }
  12737. // LogConfig: Specifies what kind of log the caller must write
  12738. type LogConfig struct {
  12739. // CloudAudit: Cloud audit options.
  12740. CloudAudit *LogConfigCloudAuditOptions `json:"cloudAudit,omitempty"`
  12741. // Counter: Counter options.
  12742. Counter *LogConfigCounterOptions `json:"counter,omitempty"`
  12743. // DataAccess: Data access options.
  12744. DataAccess *LogConfigDataAccessOptions `json:"dataAccess,omitempty"`
  12745. // ForceSendFields is a list of field names (e.g. "CloudAudit") to
  12746. // unconditionally include in API requests. By default, fields with
  12747. // empty values are omitted from API requests. However, any non-pointer,
  12748. // non-interface field appearing in ForceSendFields will be sent to the
  12749. // server regardless of whether the field is empty or not. This may be
  12750. // used to include empty fields in Patch requests.
  12751. ForceSendFields []string `json:"-"`
  12752. // NullFields is a list of field names (e.g. "CloudAudit") to include in
  12753. // API requests with the JSON null value. By default, fields with empty
  12754. // values are omitted from API requests. However, any field with an
  12755. // empty value appearing in NullFields will be sent to the server as
  12756. // null. It is an error if a field in this list has a non-empty value.
  12757. // This may be used to include null fields in Patch requests.
  12758. NullFields []string `json:"-"`
  12759. }
  12760. func (s *LogConfig) MarshalJSON() ([]byte, error) {
  12761. type NoMethod LogConfig
  12762. raw := NoMethod(*s)
  12763. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12764. }
  12765. // LogConfigCloudAuditOptions: Write a Cloud Audit log
  12766. type LogConfigCloudAuditOptions struct {
  12767. // AuthorizationLoggingOptions: Information used by the Cloud Audit
  12768. // Logging pipeline.
  12769. AuthorizationLoggingOptions *AuthorizationLoggingOptions `json:"authorizationLoggingOptions,omitempty"`
  12770. // LogName: The log_name to populate in the Cloud Audit Record.
  12771. //
  12772. // Possible values:
  12773. // "ADMIN_ACTIVITY"
  12774. // "DATA_ACCESS"
  12775. // "UNSPECIFIED_LOG_NAME"
  12776. LogName string `json:"logName,omitempty"`
  12777. // ForceSendFields is a list of field names (e.g.
  12778. // "AuthorizationLoggingOptions") to unconditionally include in API
  12779. // requests. By default, fields with empty values are omitted from API
  12780. // requests. However, any non-pointer, non-interface field appearing in
  12781. // ForceSendFields will be sent to the server regardless of whether the
  12782. // field is empty or not. This may be used to include empty fields in
  12783. // Patch requests.
  12784. ForceSendFields []string `json:"-"`
  12785. // NullFields is a list of field names (e.g.
  12786. // "AuthorizationLoggingOptions") to include in API requests with the
  12787. // JSON null value. By default, fields with empty values are omitted
  12788. // from API requests. However, any field with an empty value appearing
  12789. // in NullFields will be sent to the server as null. It is an error if a
  12790. // field in this list has a non-empty value. This may be used to include
  12791. // null fields in Patch requests.
  12792. NullFields []string `json:"-"`
  12793. }
  12794. func (s *LogConfigCloudAuditOptions) MarshalJSON() ([]byte, error) {
  12795. type NoMethod LogConfigCloudAuditOptions
  12796. raw := NoMethod(*s)
  12797. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12798. }
  12799. // LogConfigCounterOptions: Increment a streamz counter with the
  12800. // specified metric and field names.
  12801. //
  12802. // Metric names should start with a '/', generally be lowercase-only,
  12803. // and end in "_count". Field names should not contain an initial slash.
  12804. // The actual exported metric names will have "/iam/policy"
  12805. // prepended.
  12806. //
  12807. // Field names correspond to IAM request parameters and field values are
  12808. // their respective values.
  12809. //
  12810. // Supported field names: - "authority", which is "[token]" if
  12811. // IAMContext.token is present, otherwise the value of
  12812. // IAMContext.authority_selector if present, and otherwise a
  12813. // representation of IAMContext.principal; or - "iam_principal", a
  12814. // representation of IAMContext.principal even if a token or authority
  12815. // selector is present; or - "" (empty string), resulting in a counter
  12816. // with no fields.
  12817. //
  12818. // Examples: counter { metric: "/debug_access_count" field:
  12819. // "iam_principal" } ==> increment counter
  12820. // /iam/policy/backend_debug_access_count {iam_principal=[value of
  12821. // IAMContext.principal]}
  12822. //
  12823. // At this time we do not support multiple field names (though this may
  12824. // be supported in the future).
  12825. type LogConfigCounterOptions struct {
  12826. // Field: The field value to attribute.
  12827. Field string `json:"field,omitempty"`
  12828. // Metric: The metric to update.
  12829. Metric string `json:"metric,omitempty"`
  12830. // ForceSendFields is a list of field names (e.g. "Field") to
  12831. // unconditionally include in API requests. By default, fields with
  12832. // empty values are omitted from API requests. However, any non-pointer,
  12833. // non-interface field appearing in ForceSendFields will be sent to the
  12834. // server regardless of whether the field is empty or not. This may be
  12835. // used to include empty fields in Patch requests.
  12836. ForceSendFields []string `json:"-"`
  12837. // NullFields is a list of field names (e.g. "Field") to include in API
  12838. // requests with the JSON null value. By default, fields with empty
  12839. // values are omitted from API requests. However, any field with an
  12840. // empty value appearing in NullFields will be sent to the server as
  12841. // null. It is an error if a field in this list has a non-empty value.
  12842. // This may be used to include null fields in Patch requests.
  12843. NullFields []string `json:"-"`
  12844. }
  12845. func (s *LogConfigCounterOptions) MarshalJSON() ([]byte, error) {
  12846. type NoMethod LogConfigCounterOptions
  12847. raw := NoMethod(*s)
  12848. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12849. }
  12850. // LogConfigDataAccessOptions: Write a Data Access (Gin) log
  12851. type LogConfigDataAccessOptions struct {
  12852. // LogMode: Whether Gin logging should happen in a fail-closed manner at
  12853. // the caller. This is relevant only in the LocalIAM implementation, for
  12854. // now.
  12855. //
  12856. // NOTE: Logging to Gin in a fail-closed manner is currently unsupported
  12857. // while work is being done to satisfy the requirements of go/345.
  12858. // Currently, setting LOG_FAIL_CLOSED mode will have no effect, but
  12859. // still exists because there is active work being done to support it
  12860. // (b/115874152).
  12861. //
  12862. // Possible values:
  12863. // "LOG_FAIL_CLOSED"
  12864. // "LOG_MODE_UNSPECIFIED"
  12865. LogMode string `json:"logMode,omitempty"`
  12866. // ForceSendFields is a list of field names (e.g. "LogMode") to
  12867. // unconditionally include in API requests. By default, fields with
  12868. // empty values are omitted from API requests. However, any non-pointer,
  12869. // non-interface field appearing in ForceSendFields will be sent to the
  12870. // server regardless of whether the field is empty or not. This may be
  12871. // used to include empty fields in Patch requests.
  12872. ForceSendFields []string `json:"-"`
  12873. // NullFields is a list of field names (e.g. "LogMode") to include in
  12874. // API requests with the JSON null value. By default, fields with empty
  12875. // values are omitted from API requests. However, any field with an
  12876. // empty value appearing in NullFields will be sent to the server as
  12877. // null. It is an error if a field in this list has a non-empty value.
  12878. // This may be used to include null fields in Patch requests.
  12879. NullFields []string `json:"-"`
  12880. }
  12881. func (s *LogConfigDataAccessOptions) MarshalJSON() ([]byte, error) {
  12882. type NoMethod LogConfigDataAccessOptions
  12883. raw := NoMethod(*s)
  12884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12885. }
  12886. // MachineType: A Machine Type resource. (== resource_for
  12887. // v1.machineTypes ==) (== resource_for beta.machineTypes ==)
  12888. type MachineType struct {
  12889. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12890. // format.
  12891. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12892. // Deprecated: [Output Only] The deprecation status associated with this
  12893. // machine type.
  12894. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  12895. // Description: [Output Only] An optional textual description of the
  12896. // resource.
  12897. Description string `json:"description,omitempty"`
  12898. // GuestCpus: [Output Only] The number of virtual CPUs that are
  12899. // available to the instance.
  12900. GuestCpus int64 `json:"guestCpus,omitempty"`
  12901. // Id: [Output Only] The unique identifier for the resource. This
  12902. // identifier is defined by the server.
  12903. Id uint64 `json:"id,omitempty,string"`
  12904. // ImageSpaceGb: [Deprecated] This property is deprecated and will never
  12905. // be populated with any relevant values.
  12906. ImageSpaceGb int64 `json:"imageSpaceGb,omitempty"`
  12907. // IsSharedCpu: [Output Only] Whether this machine type has a shared
  12908. // CPU. See Shared-core machine types for more information.
  12909. IsSharedCpu bool `json:"isSharedCpu,omitempty"`
  12910. // Kind: [Output Only] The type of the resource. Always
  12911. // compute#machineType for machine types.
  12912. Kind string `json:"kind,omitempty"`
  12913. // MaximumPersistentDisks: [Output Only] Maximum persistent disks
  12914. // allowed.
  12915. MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"`
  12916. // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent
  12917. // disks size (GB) allowed.
  12918. MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"`
  12919. // MemoryMb: [Output Only] The amount of physical memory available to
  12920. // the instance, defined in MB.
  12921. MemoryMb int64 `json:"memoryMb,omitempty"`
  12922. // Name: [Output Only] Name of the resource.
  12923. Name string `json:"name,omitempty"`
  12924. // ScratchDisks: [Output Only] A list of extended scratch disks assigned
  12925. // to the instance.
  12926. ScratchDisks []*MachineTypeScratchDisks `json:"scratchDisks,omitempty"`
  12927. // SelfLink: [Output Only] Server-defined URL for the resource.
  12928. SelfLink string `json:"selfLink,omitempty"`
  12929. // Zone: [Output Only] The name of the zone where the machine type
  12930. // resides, such as us-central1-a.
  12931. Zone string `json:"zone,omitempty"`
  12932. // ServerResponse contains the HTTP response code and headers from the
  12933. // server.
  12934. googleapi.ServerResponse `json:"-"`
  12935. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  12936. // to unconditionally include in API requests. By default, fields with
  12937. // empty values are omitted from API requests. However, any non-pointer,
  12938. // non-interface field appearing in ForceSendFields will be sent to the
  12939. // server regardless of whether the field is empty or not. This may be
  12940. // used to include empty fields in Patch requests.
  12941. ForceSendFields []string `json:"-"`
  12942. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  12943. // include in API requests with the JSON null value. By default, fields
  12944. // with empty values are omitted from API requests. However, any field
  12945. // with an empty value appearing in NullFields will be sent to the
  12946. // server as null. It is an error if a field in this list has a
  12947. // non-empty value. This may be used to include null fields in Patch
  12948. // requests.
  12949. NullFields []string `json:"-"`
  12950. }
  12951. func (s *MachineType) MarshalJSON() ([]byte, error) {
  12952. type NoMethod MachineType
  12953. raw := NoMethod(*s)
  12954. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12955. }
  12956. type MachineTypeScratchDisks struct {
  12957. // DiskGb: Size of the scratch disk, defined in GB.
  12958. DiskGb int64 `json:"diskGb,omitempty"`
  12959. // ForceSendFields is a list of field names (e.g. "DiskGb") to
  12960. // unconditionally include in API requests. By default, fields with
  12961. // empty values are omitted from API requests. However, any non-pointer,
  12962. // non-interface field appearing in ForceSendFields will be sent to the
  12963. // server regardless of whether the field is empty or not. This may be
  12964. // used to include empty fields in Patch requests.
  12965. ForceSendFields []string `json:"-"`
  12966. // NullFields is a list of field names (e.g. "DiskGb") to include in API
  12967. // requests with the JSON null value. By default, fields with empty
  12968. // values are omitted from API requests. However, any field with an
  12969. // empty value appearing in NullFields will be sent to the server as
  12970. // null. It is an error if a field in this list has a non-empty value.
  12971. // This may be used to include null fields in Patch requests.
  12972. NullFields []string `json:"-"`
  12973. }
  12974. func (s *MachineTypeScratchDisks) MarshalJSON() ([]byte, error) {
  12975. type NoMethod MachineTypeScratchDisks
  12976. raw := NoMethod(*s)
  12977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12978. }
  12979. type MachineTypeAggregatedList struct {
  12980. // Id: [Output Only] Unique identifier for the resource; defined by the
  12981. // server.
  12982. Id string `json:"id,omitempty"`
  12983. // Items: A list of MachineTypesScopedList resources.
  12984. Items map[string]MachineTypesScopedList `json:"items,omitempty"`
  12985. // Kind: [Output Only] Type of resource. Always
  12986. // compute#machineTypeAggregatedList for aggregated lists of machine
  12987. // types.
  12988. Kind string `json:"kind,omitempty"`
  12989. // NextPageToken: [Output Only] This token allows you to get the next
  12990. // page of results for list requests. If the number of results is larger
  12991. // than maxResults, use the nextPageToken as a value for the query
  12992. // parameter pageToken in the next list request. Subsequent list
  12993. // requests will have their own nextPageToken to continue paging through
  12994. // the results.
  12995. NextPageToken string `json:"nextPageToken,omitempty"`
  12996. // SelfLink: [Output Only] Server-defined URL for this resource.
  12997. SelfLink string `json:"selfLink,omitempty"`
  12998. // Warning: [Output Only] Informational warning message.
  12999. Warning *MachineTypeAggregatedListWarning `json:"warning,omitempty"`
  13000. // ServerResponse contains the HTTP response code and headers from the
  13001. // server.
  13002. googleapi.ServerResponse `json:"-"`
  13003. // ForceSendFields is a list of field names (e.g. "Id") to
  13004. // unconditionally include in API requests. By default, fields with
  13005. // empty values are omitted from API requests. However, any non-pointer,
  13006. // non-interface field appearing in ForceSendFields will be sent to the
  13007. // server regardless of whether the field is empty or not. This may be
  13008. // used to include empty fields in Patch requests.
  13009. ForceSendFields []string `json:"-"`
  13010. // NullFields is a list of field names (e.g. "Id") to include in API
  13011. // requests with the JSON null value. By default, fields with empty
  13012. // values are omitted from API requests. However, any field with an
  13013. // empty value appearing in NullFields will be sent to the server as
  13014. // null. It is an error if a field in this list has a non-empty value.
  13015. // This may be used to include null fields in Patch requests.
  13016. NullFields []string `json:"-"`
  13017. }
  13018. func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
  13019. type NoMethod MachineTypeAggregatedList
  13020. raw := NoMethod(*s)
  13021. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13022. }
  13023. // MachineTypeAggregatedListWarning: [Output Only] Informational warning
  13024. // message.
  13025. type MachineTypeAggregatedListWarning struct {
  13026. // Code: [Output Only] A warning code, if applicable. For example,
  13027. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13028. // the response.
  13029. //
  13030. // Possible values:
  13031. // "CLEANUP_FAILED"
  13032. // "DEPRECATED_RESOURCE_USED"
  13033. // "DEPRECATED_TYPE_USED"
  13034. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13035. // "EXPERIMENTAL_TYPE_USED"
  13036. // "EXTERNAL_API_WARNING"
  13037. // "FIELD_VALUE_OVERRIDEN"
  13038. // "INJECTED_KERNELS_DEPRECATED"
  13039. // "MISSING_TYPE_DEPENDENCY"
  13040. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13041. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13042. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13043. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13044. // "NEXT_HOP_NOT_RUNNING"
  13045. // "NOT_CRITICAL_ERROR"
  13046. // "NO_RESULTS_ON_PAGE"
  13047. // "REQUIRED_TOS_AGREEMENT"
  13048. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13049. // "RESOURCE_NOT_DELETED"
  13050. // "SCHEMA_VALIDATION_IGNORED"
  13051. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13052. // "UNDECLARED_PROPERTIES"
  13053. // "UNREACHABLE"
  13054. Code string `json:"code,omitempty"`
  13055. // Data: [Output Only] Metadata about this warning in key: value format.
  13056. // For example:
  13057. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13058. Data []*MachineTypeAggregatedListWarningData `json:"data,omitempty"`
  13059. // Message: [Output Only] A human-readable description of the warning
  13060. // code.
  13061. Message string `json:"message,omitempty"`
  13062. // ForceSendFields is a list of field names (e.g. "Code") to
  13063. // unconditionally include in API requests. By default, fields with
  13064. // empty values are omitted from API requests. However, any non-pointer,
  13065. // non-interface field appearing in ForceSendFields will be sent to the
  13066. // server regardless of whether the field is empty or not. This may be
  13067. // used to include empty fields in Patch requests.
  13068. ForceSendFields []string `json:"-"`
  13069. // NullFields is a list of field names (e.g. "Code") to include in API
  13070. // requests with the JSON null value. By default, fields with empty
  13071. // values are omitted from API requests. However, any field with an
  13072. // empty value appearing in NullFields will be sent to the server as
  13073. // null. It is an error if a field in this list has a non-empty value.
  13074. // This may be used to include null fields in Patch requests.
  13075. NullFields []string `json:"-"`
  13076. }
  13077. func (s *MachineTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  13078. type NoMethod MachineTypeAggregatedListWarning
  13079. raw := NoMethod(*s)
  13080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13081. }
  13082. type MachineTypeAggregatedListWarningData struct {
  13083. // Key: [Output Only] A key that provides more detail on the warning
  13084. // being returned. For example, for warnings where there are no results
  13085. // in a list request for a particular zone, this key might be scope and
  13086. // the key value might be the zone name. Other examples might be a key
  13087. // indicating a deprecated resource and a suggested replacement, or a
  13088. // warning about invalid network settings (for example, if an instance
  13089. // attempts to perform IP forwarding but is not enabled for IP
  13090. // forwarding).
  13091. Key string `json:"key,omitempty"`
  13092. // Value: [Output Only] A warning data value corresponding to the key.
  13093. Value string `json:"value,omitempty"`
  13094. // ForceSendFields is a list of field names (e.g. "Key") to
  13095. // unconditionally include in API requests. By default, fields with
  13096. // empty values are omitted from API requests. However, any non-pointer,
  13097. // non-interface field appearing in ForceSendFields will be sent to the
  13098. // server regardless of whether the field is empty or not. This may be
  13099. // used to include empty fields in Patch requests.
  13100. ForceSendFields []string `json:"-"`
  13101. // NullFields is a list of field names (e.g. "Key") to include in API
  13102. // requests with the JSON null value. By default, fields with empty
  13103. // values are omitted from API requests. However, any field with an
  13104. // empty value appearing in NullFields will be sent to the server as
  13105. // null. It is an error if a field in this list has a non-empty value.
  13106. // This may be used to include null fields in Patch requests.
  13107. NullFields []string `json:"-"`
  13108. }
  13109. func (s *MachineTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  13110. type NoMethod MachineTypeAggregatedListWarningData
  13111. raw := NoMethod(*s)
  13112. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13113. }
  13114. // MachineTypeList: Contains a list of machine types.
  13115. type MachineTypeList struct {
  13116. // Id: [Output Only] Unique identifier for the resource; defined by the
  13117. // server.
  13118. Id string `json:"id,omitempty"`
  13119. // Items: A list of MachineType resources.
  13120. Items []*MachineType `json:"items,omitempty"`
  13121. // Kind: [Output Only] Type of resource. Always compute#machineTypeList
  13122. // for lists of machine types.
  13123. Kind string `json:"kind,omitempty"`
  13124. // NextPageToken: [Output Only] This token allows you to get the next
  13125. // page of results for list requests. If the number of results is larger
  13126. // than maxResults, use the nextPageToken as a value for the query
  13127. // parameter pageToken in the next list request. Subsequent list
  13128. // requests will have their own nextPageToken to continue paging through
  13129. // the results.
  13130. NextPageToken string `json:"nextPageToken,omitempty"`
  13131. // SelfLink: [Output Only] Server-defined URL for this resource.
  13132. SelfLink string `json:"selfLink,omitempty"`
  13133. // Warning: [Output Only] Informational warning message.
  13134. Warning *MachineTypeListWarning `json:"warning,omitempty"`
  13135. // ServerResponse contains the HTTP response code and headers from the
  13136. // server.
  13137. googleapi.ServerResponse `json:"-"`
  13138. // ForceSendFields is a list of field names (e.g. "Id") to
  13139. // unconditionally include in API requests. By default, fields with
  13140. // empty values are omitted from API requests. However, any non-pointer,
  13141. // non-interface field appearing in ForceSendFields will be sent to the
  13142. // server regardless of whether the field is empty or not. This may be
  13143. // used to include empty fields in Patch requests.
  13144. ForceSendFields []string `json:"-"`
  13145. // NullFields is a list of field names (e.g. "Id") to include in API
  13146. // requests with the JSON null value. By default, fields with empty
  13147. // values are omitted from API requests. However, any field with an
  13148. // empty value appearing in NullFields will be sent to the server as
  13149. // null. It is an error if a field in this list has a non-empty value.
  13150. // This may be used to include null fields in Patch requests.
  13151. NullFields []string `json:"-"`
  13152. }
  13153. func (s *MachineTypeList) MarshalJSON() ([]byte, error) {
  13154. type NoMethod MachineTypeList
  13155. raw := NoMethod(*s)
  13156. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13157. }
  13158. // MachineTypeListWarning: [Output Only] Informational warning message.
  13159. type MachineTypeListWarning struct {
  13160. // Code: [Output Only] A warning code, if applicable. For example,
  13161. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13162. // the response.
  13163. //
  13164. // Possible values:
  13165. // "CLEANUP_FAILED"
  13166. // "DEPRECATED_RESOURCE_USED"
  13167. // "DEPRECATED_TYPE_USED"
  13168. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13169. // "EXPERIMENTAL_TYPE_USED"
  13170. // "EXTERNAL_API_WARNING"
  13171. // "FIELD_VALUE_OVERRIDEN"
  13172. // "INJECTED_KERNELS_DEPRECATED"
  13173. // "MISSING_TYPE_DEPENDENCY"
  13174. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13175. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13176. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13177. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13178. // "NEXT_HOP_NOT_RUNNING"
  13179. // "NOT_CRITICAL_ERROR"
  13180. // "NO_RESULTS_ON_PAGE"
  13181. // "REQUIRED_TOS_AGREEMENT"
  13182. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13183. // "RESOURCE_NOT_DELETED"
  13184. // "SCHEMA_VALIDATION_IGNORED"
  13185. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13186. // "UNDECLARED_PROPERTIES"
  13187. // "UNREACHABLE"
  13188. Code string `json:"code,omitempty"`
  13189. // Data: [Output Only] Metadata about this warning in key: value format.
  13190. // For example:
  13191. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13192. Data []*MachineTypeListWarningData `json:"data,omitempty"`
  13193. // Message: [Output Only] A human-readable description of the warning
  13194. // code.
  13195. Message string `json:"message,omitempty"`
  13196. // ForceSendFields is a list of field names (e.g. "Code") to
  13197. // unconditionally include in API requests. By default, fields with
  13198. // empty values are omitted from API requests. However, any non-pointer,
  13199. // non-interface field appearing in ForceSendFields will be sent to the
  13200. // server regardless of whether the field is empty or not. This may be
  13201. // used to include empty fields in Patch requests.
  13202. ForceSendFields []string `json:"-"`
  13203. // NullFields is a list of field names (e.g. "Code") to include in API
  13204. // requests with the JSON null value. By default, fields with empty
  13205. // values are omitted from API requests. However, any field with an
  13206. // empty value appearing in NullFields will be sent to the server as
  13207. // null. It is an error if a field in this list has a non-empty value.
  13208. // This may be used to include null fields in Patch requests.
  13209. NullFields []string `json:"-"`
  13210. }
  13211. func (s *MachineTypeListWarning) MarshalJSON() ([]byte, error) {
  13212. type NoMethod MachineTypeListWarning
  13213. raw := NoMethod(*s)
  13214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13215. }
  13216. type MachineTypeListWarningData struct {
  13217. // Key: [Output Only] A key that provides more detail on the warning
  13218. // being returned. For example, for warnings where there are no results
  13219. // in a list request for a particular zone, this key might be scope and
  13220. // the key value might be the zone name. Other examples might be a key
  13221. // indicating a deprecated resource and a suggested replacement, or a
  13222. // warning about invalid network settings (for example, if an instance
  13223. // attempts to perform IP forwarding but is not enabled for IP
  13224. // forwarding).
  13225. Key string `json:"key,omitempty"`
  13226. // Value: [Output Only] A warning data value corresponding to the key.
  13227. Value string `json:"value,omitempty"`
  13228. // ForceSendFields is a list of field names (e.g. "Key") to
  13229. // unconditionally include in API requests. By default, fields with
  13230. // empty values are omitted from API requests. However, any non-pointer,
  13231. // non-interface field appearing in ForceSendFields will be sent to the
  13232. // server regardless of whether the field is empty or not. This may be
  13233. // used to include empty fields in Patch requests.
  13234. ForceSendFields []string `json:"-"`
  13235. // NullFields is a list of field names (e.g. "Key") to include in API
  13236. // requests with the JSON null value. By default, fields with empty
  13237. // values are omitted from API requests. However, any field with an
  13238. // empty value appearing in NullFields will be sent to the server as
  13239. // null. It is an error if a field in this list has a non-empty value.
  13240. // This may be used to include null fields in Patch requests.
  13241. NullFields []string `json:"-"`
  13242. }
  13243. func (s *MachineTypeListWarningData) MarshalJSON() ([]byte, error) {
  13244. type NoMethod MachineTypeListWarningData
  13245. raw := NoMethod(*s)
  13246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13247. }
  13248. type MachineTypesScopedList struct {
  13249. // MachineTypes: [Output Only] A list of machine types contained in this
  13250. // scope.
  13251. MachineTypes []*MachineType `json:"machineTypes,omitempty"`
  13252. // Warning: [Output Only] An informational warning that appears when the
  13253. // machine types list is empty.
  13254. Warning *MachineTypesScopedListWarning `json:"warning,omitempty"`
  13255. // ForceSendFields is a list of field names (e.g. "MachineTypes") to
  13256. // unconditionally include in API requests. By default, fields with
  13257. // empty values are omitted from API requests. However, any non-pointer,
  13258. // non-interface field appearing in ForceSendFields will be sent to the
  13259. // server regardless of whether the field is empty or not. This may be
  13260. // used to include empty fields in Patch requests.
  13261. ForceSendFields []string `json:"-"`
  13262. // NullFields is a list of field names (e.g. "MachineTypes") to include
  13263. // in API requests with the JSON null value. By default, fields with
  13264. // empty values are omitted from API requests. However, any field with
  13265. // an empty value appearing in NullFields will be sent to the server as
  13266. // null. It is an error if a field in this list has a non-empty value.
  13267. // This may be used to include null fields in Patch requests.
  13268. NullFields []string `json:"-"`
  13269. }
  13270. func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) {
  13271. type NoMethod MachineTypesScopedList
  13272. raw := NoMethod(*s)
  13273. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13274. }
  13275. // MachineTypesScopedListWarning: [Output Only] An informational warning
  13276. // that appears when the machine types list is empty.
  13277. type MachineTypesScopedListWarning struct {
  13278. // Code: [Output Only] A warning code, if applicable. For example,
  13279. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13280. // the response.
  13281. //
  13282. // Possible values:
  13283. // "CLEANUP_FAILED"
  13284. // "DEPRECATED_RESOURCE_USED"
  13285. // "DEPRECATED_TYPE_USED"
  13286. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13287. // "EXPERIMENTAL_TYPE_USED"
  13288. // "EXTERNAL_API_WARNING"
  13289. // "FIELD_VALUE_OVERRIDEN"
  13290. // "INJECTED_KERNELS_DEPRECATED"
  13291. // "MISSING_TYPE_DEPENDENCY"
  13292. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13293. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13294. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13295. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13296. // "NEXT_HOP_NOT_RUNNING"
  13297. // "NOT_CRITICAL_ERROR"
  13298. // "NO_RESULTS_ON_PAGE"
  13299. // "REQUIRED_TOS_AGREEMENT"
  13300. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13301. // "RESOURCE_NOT_DELETED"
  13302. // "SCHEMA_VALIDATION_IGNORED"
  13303. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13304. // "UNDECLARED_PROPERTIES"
  13305. // "UNREACHABLE"
  13306. Code string `json:"code,omitempty"`
  13307. // Data: [Output Only] Metadata about this warning in key: value format.
  13308. // For example:
  13309. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13310. Data []*MachineTypesScopedListWarningData `json:"data,omitempty"`
  13311. // Message: [Output Only] A human-readable description of the warning
  13312. // code.
  13313. Message string `json:"message,omitempty"`
  13314. // ForceSendFields is a list of field names (e.g. "Code") to
  13315. // unconditionally include in API requests. By default, fields with
  13316. // empty values are omitted from API requests. However, any non-pointer,
  13317. // non-interface field appearing in ForceSendFields will be sent to the
  13318. // server regardless of whether the field is empty or not. This may be
  13319. // used to include empty fields in Patch requests.
  13320. ForceSendFields []string `json:"-"`
  13321. // NullFields is a list of field names (e.g. "Code") to include in API
  13322. // requests with the JSON null value. By default, fields with empty
  13323. // values are omitted from API requests. However, any field with an
  13324. // empty value appearing in NullFields will be sent to the server as
  13325. // null. It is an error if a field in this list has a non-empty value.
  13326. // This may be used to include null fields in Patch requests.
  13327. NullFields []string `json:"-"`
  13328. }
  13329. func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  13330. type NoMethod MachineTypesScopedListWarning
  13331. raw := NoMethod(*s)
  13332. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13333. }
  13334. type MachineTypesScopedListWarningData struct {
  13335. // Key: [Output Only] A key that provides more detail on the warning
  13336. // being returned. For example, for warnings where there are no results
  13337. // in a list request for a particular zone, this key might be scope and
  13338. // the key value might be the zone name. Other examples might be a key
  13339. // indicating a deprecated resource and a suggested replacement, or a
  13340. // warning about invalid network settings (for example, if an instance
  13341. // attempts to perform IP forwarding but is not enabled for IP
  13342. // forwarding).
  13343. Key string `json:"key,omitempty"`
  13344. // Value: [Output Only] A warning data value corresponding to the key.
  13345. Value string `json:"value,omitempty"`
  13346. // ForceSendFields is a list of field names (e.g. "Key") to
  13347. // unconditionally include in API requests. By default, fields with
  13348. // empty values are omitted from API requests. However, any non-pointer,
  13349. // non-interface field appearing in ForceSendFields will be sent to the
  13350. // server regardless of whether the field is empty or not. This may be
  13351. // used to include empty fields in Patch requests.
  13352. ForceSendFields []string `json:"-"`
  13353. // NullFields is a list of field names (e.g. "Key") to include in API
  13354. // requests with the JSON null value. By default, fields with empty
  13355. // values are omitted from API requests. However, any field with an
  13356. // empty value appearing in NullFields will be sent to the server as
  13357. // null. It is an error if a field in this list has a non-empty value.
  13358. // This may be used to include null fields in Patch requests.
  13359. NullFields []string `json:"-"`
  13360. }
  13361. func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  13362. type NoMethod MachineTypesScopedListWarningData
  13363. raw := NoMethod(*s)
  13364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13365. }
  13366. // ManagedInstance: A Managed Instance resource.
  13367. type ManagedInstance struct {
  13368. // CurrentAction: [Output Only] The current action that the managed
  13369. // instance group has scheduled for the instance. Possible values:
  13370. // - NONE The instance is running, and the managed instance group does
  13371. // not have any scheduled actions for this instance.
  13372. // - CREATING The managed instance group is creating this instance. If
  13373. // the group fails to create this instance, it will try again until it
  13374. // is successful.
  13375. // - CREATING_WITHOUT_RETRIES The managed instance group is attempting
  13376. // to create this instance only once. If the group fails to create this
  13377. // instance, it does not try again and the group's targetSize value is
  13378. // decreased instead.
  13379. // - RECREATING The managed instance group is recreating this instance.
  13380. //
  13381. // - DELETING The managed instance group is permanently deleting this
  13382. // instance.
  13383. // - ABANDONING The managed instance group is abandoning this instance.
  13384. // The instance will be removed from the instance group and from any
  13385. // target pools that are associated with this group.
  13386. // - RESTARTING The managed instance group is restarting the instance.
  13387. //
  13388. // - REFRESHING The managed instance group is applying configuration
  13389. // changes to the instance without stopping it. For example, the group
  13390. // can update the target pool list for an instance without stopping that
  13391. // instance.
  13392. // - VERIFYING The managed instance group has created the instance and
  13393. // it is in the process of being verified.
  13394. //
  13395. // Possible values:
  13396. // "ABANDONING"
  13397. // "CREATING"
  13398. // "CREATING_WITHOUT_RETRIES"
  13399. // "DELETING"
  13400. // "NONE"
  13401. // "RECREATING"
  13402. // "REFRESHING"
  13403. // "RESTARTING"
  13404. // "VERIFYING"
  13405. CurrentAction string `json:"currentAction,omitempty"`
  13406. // Id: [Output only] The unique identifier for this resource. This field
  13407. // is empty when instance does not exist.
  13408. Id uint64 `json:"id,omitempty,string"`
  13409. // Instance: [Output Only] The URL of the instance. The URL can exist
  13410. // even if the instance has not yet been created.
  13411. Instance string `json:"instance,omitempty"`
  13412. // InstanceStatus: [Output Only] The status of the instance. This field
  13413. // is empty when the instance does not exist.
  13414. //
  13415. // Possible values:
  13416. // "PROVISIONING"
  13417. // "REPAIRING"
  13418. // "RUNNING"
  13419. // "STAGING"
  13420. // "STOPPED"
  13421. // "STOPPING"
  13422. // "SUSPENDED"
  13423. // "SUSPENDING"
  13424. // "TERMINATED"
  13425. InstanceStatus string `json:"instanceStatus,omitempty"`
  13426. // LastAttempt: [Output Only] Information about the last attempt to
  13427. // create or delete the instance.
  13428. LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"`
  13429. // Version: [Output Only] Intended version of this instance.
  13430. Version *ManagedInstanceVersion `json:"version,omitempty"`
  13431. // ForceSendFields is a list of field names (e.g. "CurrentAction") to
  13432. // unconditionally include in API requests. By default, fields with
  13433. // empty values are omitted from API requests. However, any non-pointer,
  13434. // non-interface field appearing in ForceSendFields will be sent to the
  13435. // server regardless of whether the field is empty or not. This may be
  13436. // used to include empty fields in Patch requests.
  13437. ForceSendFields []string `json:"-"`
  13438. // NullFields is a list of field names (e.g. "CurrentAction") to include
  13439. // in API requests with the JSON null value. By default, fields with
  13440. // empty values are omitted from API requests. However, any field with
  13441. // an empty value appearing in NullFields will be sent to the server as
  13442. // null. It is an error if a field in this list has a non-empty value.
  13443. // This may be used to include null fields in Patch requests.
  13444. NullFields []string `json:"-"`
  13445. }
  13446. func (s *ManagedInstance) MarshalJSON() ([]byte, error) {
  13447. type NoMethod ManagedInstance
  13448. raw := NoMethod(*s)
  13449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13450. }
  13451. type ManagedInstanceLastAttempt struct {
  13452. // Errors: [Output Only] Encountered errors during the last attempt to
  13453. // create or delete the instance.
  13454. Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"`
  13455. // ForceSendFields is a list of field names (e.g. "Errors") to
  13456. // unconditionally include in API requests. By default, fields with
  13457. // empty values are omitted from API requests. However, any non-pointer,
  13458. // non-interface field appearing in ForceSendFields will be sent to the
  13459. // server regardless of whether the field is empty or not. This may be
  13460. // used to include empty fields in Patch requests.
  13461. ForceSendFields []string `json:"-"`
  13462. // NullFields is a list of field names (e.g. "Errors") to include in API
  13463. // requests with the JSON null value. By default, fields with empty
  13464. // values are omitted from API requests. However, any field with an
  13465. // empty value appearing in NullFields will be sent to the server as
  13466. // null. It is an error if a field in this list has a non-empty value.
  13467. // This may be used to include null fields in Patch requests.
  13468. NullFields []string `json:"-"`
  13469. }
  13470. func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
  13471. type NoMethod ManagedInstanceLastAttempt
  13472. raw := NoMethod(*s)
  13473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13474. }
  13475. // ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors
  13476. // during the last attempt to create or delete the instance.
  13477. type ManagedInstanceLastAttemptErrors struct {
  13478. // Errors: [Output Only] The array of errors encountered while
  13479. // processing this operation.
  13480. Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"`
  13481. // ForceSendFields is a list of field names (e.g. "Errors") to
  13482. // unconditionally include in API requests. By default, fields with
  13483. // empty values are omitted from API requests. However, any non-pointer,
  13484. // non-interface field appearing in ForceSendFields will be sent to the
  13485. // server regardless of whether the field is empty or not. This may be
  13486. // used to include empty fields in Patch requests.
  13487. ForceSendFields []string `json:"-"`
  13488. // NullFields is a list of field names (e.g. "Errors") to include in API
  13489. // requests with the JSON null value. By default, fields with empty
  13490. // values are omitted from API requests. However, any field with an
  13491. // empty value appearing in NullFields will be sent to the server as
  13492. // null. It is an error if a field in this list has a non-empty value.
  13493. // This may be used to include null fields in Patch requests.
  13494. NullFields []string `json:"-"`
  13495. }
  13496. func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
  13497. type NoMethod ManagedInstanceLastAttemptErrors
  13498. raw := NoMethod(*s)
  13499. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13500. }
  13501. type ManagedInstanceLastAttemptErrorsErrors struct {
  13502. // Code: [Output Only] The error type identifier for this error.
  13503. Code string `json:"code,omitempty"`
  13504. // Location: [Output Only] Indicates the field in the request that
  13505. // caused the error. This property is optional.
  13506. Location string `json:"location,omitempty"`
  13507. // Message: [Output Only] An optional, human-readable error message.
  13508. Message string `json:"message,omitempty"`
  13509. // ForceSendFields is a list of field names (e.g. "Code") to
  13510. // unconditionally include in API requests. By default, fields with
  13511. // empty values are omitted from API requests. However, any non-pointer,
  13512. // non-interface field appearing in ForceSendFields will be sent to the
  13513. // server regardless of whether the field is empty or not. This may be
  13514. // used to include empty fields in Patch requests.
  13515. ForceSendFields []string `json:"-"`
  13516. // NullFields is a list of field names (e.g. "Code") to include in API
  13517. // requests with the JSON null value. By default, fields with empty
  13518. // values are omitted from API requests. However, any field with an
  13519. // empty value appearing in NullFields will be sent to the server as
  13520. // null. It is an error if a field in this list has a non-empty value.
  13521. // This may be used to include null fields in Patch requests.
  13522. NullFields []string `json:"-"`
  13523. }
  13524. func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
  13525. type NoMethod ManagedInstanceLastAttemptErrorsErrors
  13526. raw := NoMethod(*s)
  13527. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13528. }
  13529. type ManagedInstanceVersion struct {
  13530. // InstanceTemplate: [Output Only] The intended template of the
  13531. // instance. This field is empty when current_action is one of {
  13532. // DELETING, ABANDONING }.
  13533. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  13534. // Name: [Output Only] Name of the version.
  13535. Name string `json:"name,omitempty"`
  13536. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  13537. // unconditionally include in API requests. By default, fields with
  13538. // empty values are omitted from API requests. However, any non-pointer,
  13539. // non-interface field appearing in ForceSendFields will be sent to the
  13540. // server regardless of whether the field is empty or not. This may be
  13541. // used to include empty fields in Patch requests.
  13542. ForceSendFields []string `json:"-"`
  13543. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  13544. // include in API requests with the JSON null value. By default, fields
  13545. // with empty values are omitted from API requests. However, any field
  13546. // with an empty value appearing in NullFields will be sent to the
  13547. // server as null. It is an error if a field in this list has a
  13548. // non-empty value. This may be used to include null fields in Patch
  13549. // requests.
  13550. NullFields []string `json:"-"`
  13551. }
  13552. func (s *ManagedInstanceVersion) MarshalJSON() ([]byte, error) {
  13553. type NoMethod ManagedInstanceVersion
  13554. raw := NoMethod(*s)
  13555. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13556. }
  13557. // Metadata: A metadata key/value entry.
  13558. type Metadata struct {
  13559. // Fingerprint: Specifies a fingerprint for this request, which is
  13560. // essentially a hash of the metadata's contents and used for optimistic
  13561. // locking. The fingerprint is initially generated by Compute Engine and
  13562. // changes after every request to modify or update metadata. You must
  13563. // always provide an up-to-date fingerprint hash in order to update or
  13564. // change metadata, otherwise the request will fail with error 412
  13565. // conditionNotMet.
  13566. //
  13567. // To see the latest fingerprint, make a get() request to retrieve the
  13568. // resource.
  13569. Fingerprint string `json:"fingerprint,omitempty"`
  13570. // Items: Array of key/value pairs. The total size of all keys and
  13571. // values must be less than 512 KB.
  13572. Items []*MetadataItems `json:"items,omitempty"`
  13573. // Kind: [Output Only] Type of the resource. Always compute#metadata for
  13574. // metadata.
  13575. Kind string `json:"kind,omitempty"`
  13576. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  13577. // unconditionally include in API requests. By default, fields with
  13578. // empty values are omitted from API requests. However, any non-pointer,
  13579. // non-interface field appearing in ForceSendFields will be sent to the
  13580. // server regardless of whether the field is empty or not. This may be
  13581. // used to include empty fields in Patch requests.
  13582. ForceSendFields []string `json:"-"`
  13583. // NullFields is a list of field names (e.g. "Fingerprint") to include
  13584. // in API requests with the JSON null value. By default, fields with
  13585. // empty values are omitted from API requests. However, any field with
  13586. // an empty value appearing in NullFields will be sent to the server as
  13587. // null. It is an error if a field in this list has a non-empty value.
  13588. // This may be used to include null fields in Patch requests.
  13589. NullFields []string `json:"-"`
  13590. }
  13591. func (s *Metadata) MarshalJSON() ([]byte, error) {
  13592. type NoMethod Metadata
  13593. raw := NoMethod(*s)
  13594. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13595. }
  13596. type MetadataItems struct {
  13597. // Key: Key for the metadata entry. Keys must conform to the following
  13598. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  13599. // reflected as part of a URL in the metadata server. Additionally, to
  13600. // avoid ambiguity, keys must not conflict with any other metadata keys
  13601. // for the project.
  13602. Key string `json:"key,omitempty"`
  13603. // Value: Value for the metadata entry. These are free-form strings, and
  13604. // only have meaning as interpreted by the image running in the
  13605. // instance. The only restriction placed on values is that their size
  13606. // must be less than or equal to 262144 bytes (256 KiB).
  13607. Value *string `json:"value,omitempty"`
  13608. // ForceSendFields is a list of field names (e.g. "Key") to
  13609. // unconditionally include in API requests. By default, fields with
  13610. // empty values are omitted from API requests. However, any non-pointer,
  13611. // non-interface field appearing in ForceSendFields will be sent to the
  13612. // server regardless of whether the field is empty or not. This may be
  13613. // used to include empty fields in Patch requests.
  13614. ForceSendFields []string `json:"-"`
  13615. // NullFields is a list of field names (e.g. "Key") to include in API
  13616. // requests with the JSON null value. By default, fields with empty
  13617. // values are omitted from API requests. However, any field with an
  13618. // empty value appearing in NullFields will be sent to the server as
  13619. // null. It is an error if a field in this list has a non-empty value.
  13620. // This may be used to include null fields in Patch requests.
  13621. NullFields []string `json:"-"`
  13622. }
  13623. func (s *MetadataItems) MarshalJSON() ([]byte, error) {
  13624. type NoMethod MetadataItems
  13625. raw := NoMethod(*s)
  13626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13627. }
  13628. // NamedPort: The named port. For example: .
  13629. type NamedPort struct {
  13630. // Name: The name for this named port. The name must be 1-63 characters
  13631. // long, and comply with RFC1035.
  13632. Name string `json:"name,omitempty"`
  13633. // Port: The port number, which can be a value between 1 and 65535.
  13634. Port int64 `json:"port,omitempty"`
  13635. // ForceSendFields is a list of field names (e.g. "Name") to
  13636. // unconditionally include in API requests. By default, fields with
  13637. // empty values are omitted from API requests. However, any non-pointer,
  13638. // non-interface field appearing in ForceSendFields will be sent to the
  13639. // server regardless of whether the field is empty or not. This may be
  13640. // used to include empty fields in Patch requests.
  13641. ForceSendFields []string `json:"-"`
  13642. // NullFields is a list of field names (e.g. "Name") to include in API
  13643. // requests with the JSON null value. By default, fields with empty
  13644. // values are omitted from API requests. However, any field with an
  13645. // empty value appearing in NullFields will be sent to the server as
  13646. // null. It is an error if a field in this list has a non-empty value.
  13647. // This may be used to include null fields in Patch requests.
  13648. NullFields []string `json:"-"`
  13649. }
  13650. func (s *NamedPort) MarshalJSON() ([]byte, error) {
  13651. type NoMethod NamedPort
  13652. raw := NoMethod(*s)
  13653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13654. }
  13655. // Network: Represents a Network resource. Read Virtual Private Cloud
  13656. // (VPC) Network Overview for more information. (== resource_for
  13657. // v1.networks ==) (== resource_for beta.networks ==)
  13658. type Network struct {
  13659. // IPv4Range: Deprecated in favor of subnet mode networks. The range of
  13660. // internal addresses that are legal on this network. This range is a
  13661. // CIDR specification, for example: 192.168.0.0/16. Provided by the
  13662. // client when the network is created.
  13663. IPv4Range string `json:"IPv4Range,omitempty"`
  13664. // AutoCreateSubnetworks: When set to true, the VPC network is created
  13665. // in "auto" mode. When set to false, the VPC network is created in
  13666. // "custom" mode.
  13667. //
  13668. // An auto mode VPC network starts with one subnet per region. Each
  13669. // subnet has a predetermined range as described in Auto mode VPC
  13670. // network IP ranges.
  13671. AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"`
  13672. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13673. // format.
  13674. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13675. // Description: An optional description of this resource. Provide this
  13676. // property when you create the resource.
  13677. Description string `json:"description,omitempty"`
  13678. // GatewayIPv4: [Output Only] The gateway address for default routing
  13679. // out of the network. This value is read only and is selected by GCP.
  13680. GatewayIPv4 string `json:"gatewayIPv4,omitempty"`
  13681. // Id: [Output Only] The unique identifier for the resource. This
  13682. // identifier is defined by the server.
  13683. Id uint64 `json:"id,omitempty,string"`
  13684. // Kind: [Output Only] Type of the resource. Always compute#network for
  13685. // networks.
  13686. Kind string `json:"kind,omitempty"`
  13687. // Name: Name of the resource. Provided by the client when the resource
  13688. // is created. The name must be 1-63 characters long, and comply with
  13689. // RFC1035. Specifically, the name must be 1-63 characters long and
  13690. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  13691. // the first character must be a lowercase letter, and all following
  13692. // characters must be a dash, lowercase letter, or digit, except the
  13693. // last character, which cannot be a dash.
  13694. Name string `json:"name,omitempty"`
  13695. // Peerings: [Output Only] A list of network peerings for the resource.
  13696. Peerings []*NetworkPeering `json:"peerings,omitempty"`
  13697. // RoutingConfig: The network-level routing configuration for this
  13698. // network. Used by Cloud Router to determine what type of network-wide
  13699. // routing behavior to enforce.
  13700. RoutingConfig *NetworkRoutingConfig `json:"routingConfig,omitempty"`
  13701. // SelfLink: [Output Only] Server-defined URL for the resource.
  13702. SelfLink string `json:"selfLink,omitempty"`
  13703. // Subnetworks: [Output Only] Server-defined fully-qualified URLs for
  13704. // all subnetworks in this VPC network.
  13705. Subnetworks []string `json:"subnetworks,omitempty"`
  13706. // ServerResponse contains the HTTP response code and headers from the
  13707. // server.
  13708. googleapi.ServerResponse `json:"-"`
  13709. // ForceSendFields is a list of field names (e.g. "IPv4Range") to
  13710. // unconditionally include in API requests. By default, fields with
  13711. // empty values are omitted from API requests. However, any non-pointer,
  13712. // non-interface field appearing in ForceSendFields will be sent to the
  13713. // server regardless of whether the field is empty or not. This may be
  13714. // used to include empty fields in Patch requests.
  13715. ForceSendFields []string `json:"-"`
  13716. // NullFields is a list of field names (e.g. "IPv4Range") to include in
  13717. // API requests with the JSON null value. By default, fields with empty
  13718. // values are omitted from API requests. However, any field with an
  13719. // empty value appearing in NullFields will be sent to the server as
  13720. // null. It is an error if a field in this list has a non-empty value.
  13721. // This may be used to include null fields in Patch requests.
  13722. NullFields []string `json:"-"`
  13723. }
  13724. func (s *Network) MarshalJSON() ([]byte, error) {
  13725. type NoMethod Network
  13726. raw := NoMethod(*s)
  13727. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13728. }
  13729. // NetworkInterface: A network interface resource attached to an
  13730. // instance.
  13731. type NetworkInterface struct {
  13732. // AccessConfigs: An array of configurations for this interface.
  13733. // Currently, only one access config, ONE_TO_ONE_NAT, is supported. If
  13734. // there are no accessConfigs specified, then this instance will have no
  13735. // external internet access.
  13736. AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"`
  13737. // AliasIpRanges: An array of alias IP ranges for this network
  13738. // interface. Can only be specified for network interfaces on
  13739. // subnet-mode networks.
  13740. AliasIpRanges []*AliasIpRange `json:"aliasIpRanges,omitempty"`
  13741. // Fingerprint: Fingerprint hash of contents stored in this network
  13742. // interface. This field will be ignored when inserting an Instance or
  13743. // adding a NetworkInterface. An up-to-date fingerprint must be provided
  13744. // in order to update the NetworkInterface, otherwise the request will
  13745. // fail with error 412 conditionNotMet.
  13746. Fingerprint string `json:"fingerprint,omitempty"`
  13747. // Kind: [Output Only] Type of the resource. Always
  13748. // compute#networkInterface for network interfaces.
  13749. Kind string `json:"kind,omitempty"`
  13750. // Name: [Output Only] The name of the network interface, generated by
  13751. // the server. For network devices, these are eth0, eth1, etc.
  13752. Name string `json:"name,omitempty"`
  13753. // Network: URL of the network resource for this instance. When creating
  13754. // an instance, if neither the network nor the subnetwork is specified,
  13755. // the default network global/networks/default is used; if the network
  13756. // is not specified but the subnetwork is specified, the network is
  13757. // inferred.
  13758. //
  13759. // This field is optional when creating a firewall rule. If not
  13760. // specified when creating a firewall rule, the default network
  13761. // global/networks/default is used.
  13762. //
  13763. // If you specify this property, you can specify the network as a full
  13764. // or partial URL. For example, the following are all valid URLs:
  13765. // -
  13766. // https://www.googleapis.com/compute/v1/projects/project/global/networks/network
  13767. // - projects/project/global/networks/network
  13768. // - global/networks/default
  13769. Network string `json:"network,omitempty"`
  13770. // NetworkIP: An IPv4 internal network address to assign to the instance
  13771. // for this network interface. If not specified by the user, an unused
  13772. // internal IP is assigned by the system.
  13773. NetworkIP string `json:"networkIP,omitempty"`
  13774. // Subnetwork: The URL of the Subnetwork resource for this instance. If
  13775. // the network resource is in legacy mode, do not provide this property.
  13776. // If the network is in auto subnet mode, providing the subnetwork is
  13777. // optional. If the network is in custom subnet mode, then this field
  13778. // should be specified. If you specify this property, you can specify
  13779. // the subnetwork as a full or partial URL. For example, the following
  13780. // are all valid URLs:
  13781. // -
  13782. // https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
  13783. // - regions/region/subnetworks/subnetwork
  13784. Subnetwork string `json:"subnetwork,omitempty"`
  13785. // ForceSendFields is a list of field names (e.g. "AccessConfigs") to
  13786. // unconditionally include in API requests. By default, fields with
  13787. // empty values are omitted from API requests. However, any non-pointer,
  13788. // non-interface field appearing in ForceSendFields will be sent to the
  13789. // server regardless of whether the field is empty or not. This may be
  13790. // used to include empty fields in Patch requests.
  13791. ForceSendFields []string `json:"-"`
  13792. // NullFields is a list of field names (e.g. "AccessConfigs") to include
  13793. // in API requests with the JSON null value. By default, fields with
  13794. // empty values are omitted from API requests. However, any field with
  13795. // an empty value appearing in NullFields will be sent to the server as
  13796. // null. It is an error if a field in this list has a non-empty value.
  13797. // This may be used to include null fields in Patch requests.
  13798. NullFields []string `json:"-"`
  13799. }
  13800. func (s *NetworkInterface) MarshalJSON() ([]byte, error) {
  13801. type NoMethod NetworkInterface
  13802. raw := NoMethod(*s)
  13803. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13804. }
  13805. // NetworkList: Contains a list of networks.
  13806. type NetworkList struct {
  13807. // Id: [Output Only] Unique identifier for the resource; defined by the
  13808. // server.
  13809. Id string `json:"id,omitempty"`
  13810. // Items: A list of Network resources.
  13811. Items []*Network `json:"items,omitempty"`
  13812. // Kind: [Output Only] Type of resource. Always compute#networkList for
  13813. // lists of networks.
  13814. Kind string `json:"kind,omitempty"`
  13815. // NextPageToken: [Output Only] This token allows you to get the next
  13816. // page of results for list requests. If the number of results is larger
  13817. // than maxResults, use the nextPageToken as a value for the query
  13818. // parameter pageToken in the next list request. Subsequent list
  13819. // requests will have their own nextPageToken to continue paging through
  13820. // the results.
  13821. NextPageToken string `json:"nextPageToken,omitempty"`
  13822. // SelfLink: [Output Only] Server-defined URL for this resource.
  13823. SelfLink string `json:"selfLink,omitempty"`
  13824. // Warning: [Output Only] Informational warning message.
  13825. Warning *NetworkListWarning `json:"warning,omitempty"`
  13826. // ServerResponse contains the HTTP response code and headers from the
  13827. // server.
  13828. googleapi.ServerResponse `json:"-"`
  13829. // ForceSendFields is a list of field names (e.g. "Id") to
  13830. // unconditionally include in API requests. By default, fields with
  13831. // empty values are omitted from API requests. However, any non-pointer,
  13832. // non-interface field appearing in ForceSendFields will be sent to the
  13833. // server regardless of whether the field is empty or not. This may be
  13834. // used to include empty fields in Patch requests.
  13835. ForceSendFields []string `json:"-"`
  13836. // NullFields is a list of field names (e.g. "Id") to include in API
  13837. // requests with the JSON null value. By default, fields with empty
  13838. // values are omitted from API requests. However, any field with an
  13839. // empty value appearing in NullFields will be sent to the server as
  13840. // null. It is an error if a field in this list has a non-empty value.
  13841. // This may be used to include null fields in Patch requests.
  13842. NullFields []string `json:"-"`
  13843. }
  13844. func (s *NetworkList) MarshalJSON() ([]byte, error) {
  13845. type NoMethod NetworkList
  13846. raw := NoMethod(*s)
  13847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13848. }
  13849. // NetworkListWarning: [Output Only] Informational warning message.
  13850. type NetworkListWarning struct {
  13851. // Code: [Output Only] A warning code, if applicable. For example,
  13852. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13853. // the response.
  13854. //
  13855. // Possible values:
  13856. // "CLEANUP_FAILED"
  13857. // "DEPRECATED_RESOURCE_USED"
  13858. // "DEPRECATED_TYPE_USED"
  13859. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13860. // "EXPERIMENTAL_TYPE_USED"
  13861. // "EXTERNAL_API_WARNING"
  13862. // "FIELD_VALUE_OVERRIDEN"
  13863. // "INJECTED_KERNELS_DEPRECATED"
  13864. // "MISSING_TYPE_DEPENDENCY"
  13865. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13866. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13867. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13868. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13869. // "NEXT_HOP_NOT_RUNNING"
  13870. // "NOT_CRITICAL_ERROR"
  13871. // "NO_RESULTS_ON_PAGE"
  13872. // "REQUIRED_TOS_AGREEMENT"
  13873. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13874. // "RESOURCE_NOT_DELETED"
  13875. // "SCHEMA_VALIDATION_IGNORED"
  13876. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13877. // "UNDECLARED_PROPERTIES"
  13878. // "UNREACHABLE"
  13879. Code string `json:"code,omitempty"`
  13880. // Data: [Output Only] Metadata about this warning in key: value format.
  13881. // For example:
  13882. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13883. Data []*NetworkListWarningData `json:"data,omitempty"`
  13884. // Message: [Output Only] A human-readable description of the warning
  13885. // code.
  13886. Message string `json:"message,omitempty"`
  13887. // ForceSendFields is a list of field names (e.g. "Code") to
  13888. // unconditionally include in API requests. By default, fields with
  13889. // empty values are omitted from API requests. However, any non-pointer,
  13890. // non-interface field appearing in ForceSendFields will be sent to the
  13891. // server regardless of whether the field is empty or not. This may be
  13892. // used to include empty fields in Patch requests.
  13893. ForceSendFields []string `json:"-"`
  13894. // NullFields is a list of field names (e.g. "Code") to include in API
  13895. // requests with the JSON null value. By default, fields with empty
  13896. // values are omitted from API requests. However, any field with an
  13897. // empty value appearing in NullFields will be sent to the server as
  13898. // null. It is an error if a field in this list has a non-empty value.
  13899. // This may be used to include null fields in Patch requests.
  13900. NullFields []string `json:"-"`
  13901. }
  13902. func (s *NetworkListWarning) MarshalJSON() ([]byte, error) {
  13903. type NoMethod NetworkListWarning
  13904. raw := NoMethod(*s)
  13905. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13906. }
  13907. type NetworkListWarningData struct {
  13908. // Key: [Output Only] A key that provides more detail on the warning
  13909. // being returned. For example, for warnings where there are no results
  13910. // in a list request for a particular zone, this key might be scope and
  13911. // the key value might be the zone name. Other examples might be a key
  13912. // indicating a deprecated resource and a suggested replacement, or a
  13913. // warning about invalid network settings (for example, if an instance
  13914. // attempts to perform IP forwarding but is not enabled for IP
  13915. // forwarding).
  13916. Key string `json:"key,omitempty"`
  13917. // Value: [Output Only] A warning data value corresponding to the key.
  13918. Value string `json:"value,omitempty"`
  13919. // ForceSendFields is a list of field names (e.g. "Key") to
  13920. // unconditionally include in API requests. By default, fields with
  13921. // empty values are omitted from API requests. However, any non-pointer,
  13922. // non-interface field appearing in ForceSendFields will be sent to the
  13923. // server regardless of whether the field is empty or not. This may be
  13924. // used to include empty fields in Patch requests.
  13925. ForceSendFields []string `json:"-"`
  13926. // NullFields is a list of field names (e.g. "Key") to include in API
  13927. // requests with the JSON null value. By default, fields with empty
  13928. // values are omitted from API requests. However, any field with an
  13929. // empty value appearing in NullFields will be sent to the server as
  13930. // null. It is an error if a field in this list has a non-empty value.
  13931. // This may be used to include null fields in Patch requests.
  13932. NullFields []string `json:"-"`
  13933. }
  13934. func (s *NetworkListWarningData) MarshalJSON() ([]byte, error) {
  13935. type NoMethod NetworkListWarningData
  13936. raw := NoMethod(*s)
  13937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13938. }
  13939. // NetworkPeering: A network peering attached to a network resource. The
  13940. // message includes the peering name, peer network, peering state, and a
  13941. // flag indicating whether Google Compute Engine should automatically
  13942. // create routes for the peering.
  13943. type NetworkPeering struct {
  13944. // AutoCreateRoutes: This field will be deprecated soon. Prefer using
  13945. // exchange_subnet_routes instead. Indicates whether full mesh
  13946. // connectivity is created and managed automatically. When it is set to
  13947. // true, Google Compute Engine will automatically create and manage the
  13948. // routes between two networks when the state is ACTIVE. Otherwise, user
  13949. // needs to create routes manually to route packets to peer network.
  13950. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  13951. // ExchangeSubnetRoutes: Whether full mesh connectivity is created and
  13952. // managed automatically. When it is set to true, Google Compute Engine
  13953. // will automatically create and manage the routes between two networks
  13954. // when the peering state is ACTIVE. Otherwise, user needs to create
  13955. // routes manually to route packets to peer network.
  13956. ExchangeSubnetRoutes bool `json:"exchangeSubnetRoutes,omitempty"`
  13957. // Name: Name of this peering. Provided by the client when the peering
  13958. // is created. The name must comply with RFC1035. Specifically, the name
  13959. // must be 1-63 characters long and match regular expression
  13960. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  13961. // a lowercase letter, and all the following characters must be a dash,
  13962. // lowercase letter, or digit, except the last character, which cannot
  13963. // be a dash.
  13964. Name string `json:"name,omitempty"`
  13965. // Network: The URL of the peer network. It can be either full URL or
  13966. // partial URL. The peer network may belong to a different project. If
  13967. // the partial URL does not contain project, it is assumed that the peer
  13968. // network is in the same project as the current network.
  13969. Network string `json:"network,omitempty"`
  13970. // State: [Output Only] State for the peering.
  13971. //
  13972. // Possible values:
  13973. // "ACTIVE"
  13974. // "INACTIVE"
  13975. State string `json:"state,omitempty"`
  13976. // StateDetails: [Output Only] Details about the current state of the
  13977. // peering.
  13978. StateDetails string `json:"stateDetails,omitempty"`
  13979. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  13980. // unconditionally include in API requests. By default, fields with
  13981. // empty values are omitted from API requests. However, any non-pointer,
  13982. // non-interface field appearing in ForceSendFields will be sent to the
  13983. // server regardless of whether the field is empty or not. This may be
  13984. // used to include empty fields in Patch requests.
  13985. ForceSendFields []string `json:"-"`
  13986. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  13987. // include in API requests with the JSON null value. By default, fields
  13988. // with empty values are omitted from API requests. However, any field
  13989. // with an empty value appearing in NullFields will be sent to the
  13990. // server as null. It is an error if a field in this list has a
  13991. // non-empty value. This may be used to include null fields in Patch
  13992. // requests.
  13993. NullFields []string `json:"-"`
  13994. }
  13995. func (s *NetworkPeering) MarshalJSON() ([]byte, error) {
  13996. type NoMethod NetworkPeering
  13997. raw := NoMethod(*s)
  13998. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13999. }
  14000. // NetworkRoutingConfig: A routing configuration attached to a network
  14001. // resource. The message includes the list of routers associated with
  14002. // the network, and a flag indicating the type of routing behavior to
  14003. // enforce network-wide.
  14004. type NetworkRoutingConfig struct {
  14005. // RoutingMode: The network-wide routing mode to use. If set to
  14006. // REGIONAL, this network's cloud routers will only advertise routes
  14007. // with subnets of this network in the same region as the router. If set
  14008. // to GLOBAL, this network's cloud routers will advertise routes with
  14009. // all subnets of this network, across regions.
  14010. //
  14011. // Possible values:
  14012. // "GLOBAL"
  14013. // "REGIONAL"
  14014. RoutingMode string `json:"routingMode,omitempty"`
  14015. // ForceSendFields is a list of field names (e.g. "RoutingMode") to
  14016. // unconditionally include in API requests. By default, fields with
  14017. // empty values are omitted from API requests. However, any non-pointer,
  14018. // non-interface field appearing in ForceSendFields will be sent to the
  14019. // server regardless of whether the field is empty or not. This may be
  14020. // used to include empty fields in Patch requests.
  14021. ForceSendFields []string `json:"-"`
  14022. // NullFields is a list of field names (e.g. "RoutingMode") to include
  14023. // in API requests with the JSON null value. By default, fields with
  14024. // empty values are omitted from API requests. However, any field with
  14025. // an empty value appearing in NullFields will be sent to the server as
  14026. // null. It is an error if a field in this list has a non-empty value.
  14027. // This may be used to include null fields in Patch requests.
  14028. NullFields []string `json:"-"`
  14029. }
  14030. func (s *NetworkRoutingConfig) MarshalJSON() ([]byte, error) {
  14031. type NoMethod NetworkRoutingConfig
  14032. raw := NoMethod(*s)
  14033. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14034. }
  14035. type NetworksAddPeeringRequest struct {
  14036. // AutoCreateRoutes: This field will be deprecated soon. Prefer using
  14037. // exchange_subnet_routes in network_peering instead. Whether Google
  14038. // Compute Engine manages the routes automatically.
  14039. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  14040. // Name: Name of the peering, which should conform to RFC1035.
  14041. Name string `json:"name,omitempty"`
  14042. // NetworkPeering: Network peering parameters. In order to specify route
  14043. // policies for peering using import/export custom routes, you will have
  14044. // to fill all peering related parameters (name, peer network,
  14045. // exchange_subnet_routes) in network_peeringfield. Corresponding fields
  14046. // in NetworksAddPeeringRequest will be deprecated soon.
  14047. NetworkPeering *NetworkPeering `json:"networkPeering,omitempty"`
  14048. // PeerNetwork: URL of the peer network. It can be either full URL or
  14049. // partial URL. The peer network may belong to a different project. If
  14050. // the partial URL does not contain project, it is assumed that the peer
  14051. // network is in the same project as the current network.
  14052. PeerNetwork string `json:"peerNetwork,omitempty"`
  14053. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  14054. // unconditionally include in API requests. By default, fields with
  14055. // empty values are omitted from API requests. However, any non-pointer,
  14056. // non-interface field appearing in ForceSendFields will be sent to the
  14057. // server regardless of whether the field is empty or not. This may be
  14058. // used to include empty fields in Patch requests.
  14059. ForceSendFields []string `json:"-"`
  14060. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  14061. // include in API requests with the JSON null value. By default, fields
  14062. // with empty values are omitted from API requests. However, any field
  14063. // with an empty value appearing in NullFields will be sent to the
  14064. // server as null. It is an error if a field in this list has a
  14065. // non-empty value. This may be used to include null fields in Patch
  14066. // requests.
  14067. NullFields []string `json:"-"`
  14068. }
  14069. func (s *NetworksAddPeeringRequest) MarshalJSON() ([]byte, error) {
  14070. type NoMethod NetworksAddPeeringRequest
  14071. raw := NoMethod(*s)
  14072. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14073. }
  14074. type NetworksRemovePeeringRequest struct {
  14075. // Name: Name of the peering, which should conform to RFC1035.
  14076. Name string `json:"name,omitempty"`
  14077. // ForceSendFields is a list of field names (e.g. "Name") to
  14078. // unconditionally include in API requests. By default, fields with
  14079. // empty values are omitted from API requests. However, any non-pointer,
  14080. // non-interface field appearing in ForceSendFields will be sent to the
  14081. // server regardless of whether the field is empty or not. This may be
  14082. // used to include empty fields in Patch requests.
  14083. ForceSendFields []string `json:"-"`
  14084. // NullFields is a list of field names (e.g. "Name") to include in API
  14085. // requests with the JSON null value. By default, fields with empty
  14086. // values are omitted from API requests. However, any field with an
  14087. // empty value appearing in NullFields will be sent to the server as
  14088. // null. It is an error if a field in this list has a non-empty value.
  14089. // This may be used to include null fields in Patch requests.
  14090. NullFields []string `json:"-"`
  14091. }
  14092. func (s *NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
  14093. type NoMethod NetworksRemovePeeringRequest
  14094. raw := NoMethod(*s)
  14095. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14096. }
  14097. // NodeGroup: A NodeGroup resource.
  14098. type NodeGroup struct {
  14099. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14100. // format.
  14101. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14102. // Description: An optional description of this resource. Provide this
  14103. // property when you create the resource.
  14104. Description string `json:"description,omitempty"`
  14105. // Id: [Output Only] The unique identifier for the resource. This
  14106. // identifier is defined by the server.
  14107. Id uint64 `json:"id,omitempty,string"`
  14108. // Kind: [Output Only] The type of the resource. Always
  14109. // compute#nodeGroup for node group.
  14110. Kind string `json:"kind,omitempty"`
  14111. // Name: The name of the resource, provided by the client when initially
  14112. // creating the resource. The resource name must be 1-63 characters
  14113. // long, and comply with RFC1035. Specifically, the name must be 1-63
  14114. // characters long and match the regular expression
  14115. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  14116. // a lowercase letter, and all following characters must be a dash,
  14117. // lowercase letter, or digit, except the last character, which cannot
  14118. // be a dash.
  14119. Name string `json:"name,omitempty"`
  14120. // NodeTemplate: The URL of the node template to which this node group
  14121. // belongs.
  14122. NodeTemplate string `json:"nodeTemplate,omitempty"`
  14123. // SelfLink: [Output Only] Server-defined URL for the resource.
  14124. SelfLink string `json:"selfLink,omitempty"`
  14125. // Size: [Output Only] The total number of nodes in the node group.
  14126. Size int64 `json:"size,omitempty"`
  14127. // Possible values:
  14128. // "CREATING"
  14129. // "DELETING"
  14130. // "INVALID"
  14131. // "READY"
  14132. Status string `json:"status,omitempty"`
  14133. // Zone: [Output Only] The name of the zone where the node group
  14134. // resides, such as us-central1-a.
  14135. Zone string `json:"zone,omitempty"`
  14136. // ServerResponse contains the HTTP response code and headers from the
  14137. // server.
  14138. googleapi.ServerResponse `json:"-"`
  14139. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  14140. // to unconditionally include in API requests. By default, fields with
  14141. // empty values are omitted from API requests. However, any non-pointer,
  14142. // non-interface field appearing in ForceSendFields will be sent to the
  14143. // server regardless of whether the field is empty or not. This may be
  14144. // used to include empty fields in Patch requests.
  14145. ForceSendFields []string `json:"-"`
  14146. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  14147. // include in API requests with the JSON null value. By default, fields
  14148. // with empty values are omitted from API requests. However, any field
  14149. // with an empty value appearing in NullFields will be sent to the
  14150. // server as null. It is an error if a field in this list has a
  14151. // non-empty value. This may be used to include null fields in Patch
  14152. // requests.
  14153. NullFields []string `json:"-"`
  14154. }
  14155. func (s *NodeGroup) MarshalJSON() ([]byte, error) {
  14156. type NoMethod NodeGroup
  14157. raw := NoMethod(*s)
  14158. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14159. }
  14160. type NodeGroupAggregatedList struct {
  14161. // Id: [Output Only] Unique identifier for the resource; defined by the
  14162. // server.
  14163. Id string `json:"id,omitempty"`
  14164. // Items: A list of NodeGroupsScopedList resources.
  14165. Items map[string]NodeGroupsScopedList `json:"items,omitempty"`
  14166. // Kind: [Output Only] Type of resource.Always
  14167. // compute#nodeGroupAggregatedList for aggregated lists of node groups.
  14168. Kind string `json:"kind,omitempty"`
  14169. // NextPageToken: [Output Only] This token allows you to get the next
  14170. // page of results for list requests. If the number of results is larger
  14171. // than maxResults, use the nextPageToken as a value for the query
  14172. // parameter pageToken in the next list request. Subsequent list
  14173. // requests will have their own nextPageToken to continue paging through
  14174. // the results.
  14175. NextPageToken string `json:"nextPageToken,omitempty"`
  14176. // SelfLink: [Output Only] Server-defined URL for this resource.
  14177. SelfLink string `json:"selfLink,omitempty"`
  14178. // Warning: [Output Only] Informational warning message.
  14179. Warning *NodeGroupAggregatedListWarning `json:"warning,omitempty"`
  14180. // ServerResponse contains the HTTP response code and headers from the
  14181. // server.
  14182. googleapi.ServerResponse `json:"-"`
  14183. // ForceSendFields is a list of field names (e.g. "Id") to
  14184. // unconditionally include in API requests. By default, fields with
  14185. // empty values are omitted from API requests. However, any non-pointer,
  14186. // non-interface field appearing in ForceSendFields will be sent to the
  14187. // server regardless of whether the field is empty or not. This may be
  14188. // used to include empty fields in Patch requests.
  14189. ForceSendFields []string `json:"-"`
  14190. // NullFields is a list of field names (e.g. "Id") to include in API
  14191. // requests with the JSON null value. By default, fields with empty
  14192. // values are omitted from API requests. However, any field with an
  14193. // empty value appearing in NullFields will be sent to the server as
  14194. // null. It is an error if a field in this list has a non-empty value.
  14195. // This may be used to include null fields in Patch requests.
  14196. NullFields []string `json:"-"`
  14197. }
  14198. func (s *NodeGroupAggregatedList) MarshalJSON() ([]byte, error) {
  14199. type NoMethod NodeGroupAggregatedList
  14200. raw := NoMethod(*s)
  14201. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14202. }
  14203. // NodeGroupAggregatedListWarning: [Output Only] Informational warning
  14204. // message.
  14205. type NodeGroupAggregatedListWarning struct {
  14206. // Code: [Output Only] A warning code, if applicable. For example,
  14207. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14208. // the response.
  14209. //
  14210. // Possible values:
  14211. // "CLEANUP_FAILED"
  14212. // "DEPRECATED_RESOURCE_USED"
  14213. // "DEPRECATED_TYPE_USED"
  14214. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14215. // "EXPERIMENTAL_TYPE_USED"
  14216. // "EXTERNAL_API_WARNING"
  14217. // "FIELD_VALUE_OVERRIDEN"
  14218. // "INJECTED_KERNELS_DEPRECATED"
  14219. // "MISSING_TYPE_DEPENDENCY"
  14220. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14221. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14222. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14223. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14224. // "NEXT_HOP_NOT_RUNNING"
  14225. // "NOT_CRITICAL_ERROR"
  14226. // "NO_RESULTS_ON_PAGE"
  14227. // "REQUIRED_TOS_AGREEMENT"
  14228. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14229. // "RESOURCE_NOT_DELETED"
  14230. // "SCHEMA_VALIDATION_IGNORED"
  14231. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14232. // "UNDECLARED_PROPERTIES"
  14233. // "UNREACHABLE"
  14234. Code string `json:"code,omitempty"`
  14235. // Data: [Output Only] Metadata about this warning in key: value format.
  14236. // For example:
  14237. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14238. Data []*NodeGroupAggregatedListWarningData `json:"data,omitempty"`
  14239. // Message: [Output Only] A human-readable description of the warning
  14240. // code.
  14241. Message string `json:"message,omitempty"`
  14242. // ForceSendFields is a list of field names (e.g. "Code") to
  14243. // unconditionally include in API requests. By default, fields with
  14244. // empty values are omitted from API requests. However, any non-pointer,
  14245. // non-interface field appearing in ForceSendFields will be sent to the
  14246. // server regardless of whether the field is empty or not. This may be
  14247. // used to include empty fields in Patch requests.
  14248. ForceSendFields []string `json:"-"`
  14249. // NullFields is a list of field names (e.g. "Code") to include in API
  14250. // requests with the JSON null value. By default, fields with empty
  14251. // values are omitted from API requests. However, any field with an
  14252. // empty value appearing in NullFields will be sent to the server as
  14253. // null. It is an error if a field in this list has a non-empty value.
  14254. // This may be used to include null fields in Patch requests.
  14255. NullFields []string `json:"-"`
  14256. }
  14257. func (s *NodeGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  14258. type NoMethod NodeGroupAggregatedListWarning
  14259. raw := NoMethod(*s)
  14260. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14261. }
  14262. type NodeGroupAggregatedListWarningData struct {
  14263. // Key: [Output Only] A key that provides more detail on the warning
  14264. // being returned. For example, for warnings where there are no results
  14265. // in a list request for a particular zone, this key might be scope and
  14266. // the key value might be the zone name. Other examples might be a key
  14267. // indicating a deprecated resource and a suggested replacement, or a
  14268. // warning about invalid network settings (for example, if an instance
  14269. // attempts to perform IP forwarding but is not enabled for IP
  14270. // forwarding).
  14271. Key string `json:"key,omitempty"`
  14272. // Value: [Output Only] A warning data value corresponding to the key.
  14273. Value string `json:"value,omitempty"`
  14274. // ForceSendFields is a list of field names (e.g. "Key") to
  14275. // unconditionally include in API requests. By default, fields with
  14276. // empty values are omitted from API requests. However, any non-pointer,
  14277. // non-interface field appearing in ForceSendFields will be sent to the
  14278. // server regardless of whether the field is empty or not. This may be
  14279. // used to include empty fields in Patch requests.
  14280. ForceSendFields []string `json:"-"`
  14281. // NullFields is a list of field names (e.g. "Key") to include in API
  14282. // requests with the JSON null value. By default, fields with empty
  14283. // values are omitted from API requests. However, any field with an
  14284. // empty value appearing in NullFields will be sent to the server as
  14285. // null. It is an error if a field in this list has a non-empty value.
  14286. // This may be used to include null fields in Patch requests.
  14287. NullFields []string `json:"-"`
  14288. }
  14289. func (s *NodeGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  14290. type NoMethod NodeGroupAggregatedListWarningData
  14291. raw := NoMethod(*s)
  14292. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14293. }
  14294. // NodeGroupList: Contains a list of nodeGroups.
  14295. type NodeGroupList struct {
  14296. // Id: [Output Only] Unique identifier for the resource; defined by the
  14297. // server.
  14298. Id string `json:"id,omitempty"`
  14299. // Items: A list of NodeGroup resources.
  14300. Items []*NodeGroup `json:"items,omitempty"`
  14301. // Kind: [Output Only] Type of resource.Always compute#nodeGroupList for
  14302. // lists of node groups.
  14303. Kind string `json:"kind,omitempty"`
  14304. // NextPageToken: [Output Only] This token allows you to get the next
  14305. // page of results for list requests. If the number of results is larger
  14306. // than maxResults, use the nextPageToken as a value for the query
  14307. // parameter pageToken in the next list request. Subsequent list
  14308. // requests will have their own nextPageToken to continue paging through
  14309. // the results.
  14310. NextPageToken string `json:"nextPageToken,omitempty"`
  14311. // SelfLink: [Output Only] Server-defined URL for this resource.
  14312. SelfLink string `json:"selfLink,omitempty"`
  14313. // Warning: [Output Only] Informational warning message.
  14314. Warning *NodeGroupListWarning `json:"warning,omitempty"`
  14315. // ServerResponse contains the HTTP response code and headers from the
  14316. // server.
  14317. googleapi.ServerResponse `json:"-"`
  14318. // ForceSendFields is a list of field names (e.g. "Id") to
  14319. // unconditionally include in API requests. By default, fields with
  14320. // empty values are omitted from API requests. However, any non-pointer,
  14321. // non-interface field appearing in ForceSendFields will be sent to the
  14322. // server regardless of whether the field is empty or not. This may be
  14323. // used to include empty fields in Patch requests.
  14324. ForceSendFields []string `json:"-"`
  14325. // NullFields is a list of field names (e.g. "Id") to include in API
  14326. // requests with the JSON null value. By default, fields with empty
  14327. // values are omitted from API requests. However, any field with an
  14328. // empty value appearing in NullFields will be sent to the server as
  14329. // null. It is an error if a field in this list has a non-empty value.
  14330. // This may be used to include null fields in Patch requests.
  14331. NullFields []string `json:"-"`
  14332. }
  14333. func (s *NodeGroupList) MarshalJSON() ([]byte, error) {
  14334. type NoMethod NodeGroupList
  14335. raw := NoMethod(*s)
  14336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14337. }
  14338. // NodeGroupListWarning: [Output Only] Informational warning message.
  14339. type NodeGroupListWarning struct {
  14340. // Code: [Output Only] A warning code, if applicable. For example,
  14341. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14342. // the response.
  14343. //
  14344. // Possible values:
  14345. // "CLEANUP_FAILED"
  14346. // "DEPRECATED_RESOURCE_USED"
  14347. // "DEPRECATED_TYPE_USED"
  14348. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14349. // "EXPERIMENTAL_TYPE_USED"
  14350. // "EXTERNAL_API_WARNING"
  14351. // "FIELD_VALUE_OVERRIDEN"
  14352. // "INJECTED_KERNELS_DEPRECATED"
  14353. // "MISSING_TYPE_DEPENDENCY"
  14354. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14355. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14356. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14357. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14358. // "NEXT_HOP_NOT_RUNNING"
  14359. // "NOT_CRITICAL_ERROR"
  14360. // "NO_RESULTS_ON_PAGE"
  14361. // "REQUIRED_TOS_AGREEMENT"
  14362. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14363. // "RESOURCE_NOT_DELETED"
  14364. // "SCHEMA_VALIDATION_IGNORED"
  14365. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14366. // "UNDECLARED_PROPERTIES"
  14367. // "UNREACHABLE"
  14368. Code string `json:"code,omitempty"`
  14369. // Data: [Output Only] Metadata about this warning in key: value format.
  14370. // For example:
  14371. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14372. Data []*NodeGroupListWarningData `json:"data,omitempty"`
  14373. // Message: [Output Only] A human-readable description of the warning
  14374. // code.
  14375. Message string `json:"message,omitempty"`
  14376. // ForceSendFields is a list of field names (e.g. "Code") to
  14377. // unconditionally include in API requests. By default, fields with
  14378. // empty values are omitted from API requests. However, any non-pointer,
  14379. // non-interface field appearing in ForceSendFields will be sent to the
  14380. // server regardless of whether the field is empty or not. This may be
  14381. // used to include empty fields in Patch requests.
  14382. ForceSendFields []string `json:"-"`
  14383. // NullFields is a list of field names (e.g. "Code") to include in API
  14384. // requests with the JSON null value. By default, fields with empty
  14385. // values are omitted from API requests. However, any field with an
  14386. // empty value appearing in NullFields will be sent to the server as
  14387. // null. It is an error if a field in this list has a non-empty value.
  14388. // This may be used to include null fields in Patch requests.
  14389. NullFields []string `json:"-"`
  14390. }
  14391. func (s *NodeGroupListWarning) MarshalJSON() ([]byte, error) {
  14392. type NoMethod NodeGroupListWarning
  14393. raw := NoMethod(*s)
  14394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14395. }
  14396. type NodeGroupListWarningData struct {
  14397. // Key: [Output Only] A key that provides more detail on the warning
  14398. // being returned. For example, for warnings where there are no results
  14399. // in a list request for a particular zone, this key might be scope and
  14400. // the key value might be the zone name. Other examples might be a key
  14401. // indicating a deprecated resource and a suggested replacement, or a
  14402. // warning about invalid network settings (for example, if an instance
  14403. // attempts to perform IP forwarding but is not enabled for IP
  14404. // forwarding).
  14405. Key string `json:"key,omitempty"`
  14406. // Value: [Output Only] A warning data value corresponding to the key.
  14407. Value string `json:"value,omitempty"`
  14408. // ForceSendFields is a list of field names (e.g. "Key") to
  14409. // unconditionally include in API requests. By default, fields with
  14410. // empty values are omitted from API requests. However, any non-pointer,
  14411. // non-interface field appearing in ForceSendFields will be sent to the
  14412. // server regardless of whether the field is empty or not. This may be
  14413. // used to include empty fields in Patch requests.
  14414. ForceSendFields []string `json:"-"`
  14415. // NullFields is a list of field names (e.g. "Key") to include in API
  14416. // requests with the JSON null value. By default, fields with empty
  14417. // values are omitted from API requests. However, any field with an
  14418. // empty value appearing in NullFields will be sent to the server as
  14419. // null. It is an error if a field in this list has a non-empty value.
  14420. // This may be used to include null fields in Patch requests.
  14421. NullFields []string `json:"-"`
  14422. }
  14423. func (s *NodeGroupListWarningData) MarshalJSON() ([]byte, error) {
  14424. type NoMethod NodeGroupListWarningData
  14425. raw := NoMethod(*s)
  14426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14427. }
  14428. type NodeGroupNode struct {
  14429. // Instances: Instances scheduled on this node.
  14430. Instances []string `json:"instances,omitempty"`
  14431. // Name: The name of the node.
  14432. Name string `json:"name,omitempty"`
  14433. // NodeType: The type of this node.
  14434. NodeType string `json:"nodeType,omitempty"`
  14435. // Possible values:
  14436. // "CREATING"
  14437. // "DELETING"
  14438. // "INVALID"
  14439. // "READY"
  14440. // "REPAIRING"
  14441. Status string `json:"status,omitempty"`
  14442. // ForceSendFields is a list of field names (e.g. "Instances") to
  14443. // unconditionally include in API requests. By default, fields with
  14444. // empty values are omitted from API requests. However, any non-pointer,
  14445. // non-interface field appearing in ForceSendFields will be sent to the
  14446. // server regardless of whether the field is empty or not. This may be
  14447. // used to include empty fields in Patch requests.
  14448. ForceSendFields []string `json:"-"`
  14449. // NullFields is a list of field names (e.g. "Instances") to include in
  14450. // API requests with the JSON null value. By default, fields with empty
  14451. // values are omitted from API requests. However, any field with an
  14452. // empty value appearing in NullFields will be sent to the server as
  14453. // null. It is an error if a field in this list has a non-empty value.
  14454. // This may be used to include null fields in Patch requests.
  14455. NullFields []string `json:"-"`
  14456. }
  14457. func (s *NodeGroupNode) MarshalJSON() ([]byte, error) {
  14458. type NoMethod NodeGroupNode
  14459. raw := NoMethod(*s)
  14460. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14461. }
  14462. type NodeGroupsAddNodesRequest struct {
  14463. // AdditionalNodeCount: Count of additional nodes to be added to the
  14464. // node group.
  14465. AdditionalNodeCount int64 `json:"additionalNodeCount,omitempty"`
  14466. // ForceSendFields is a list of field names (e.g. "AdditionalNodeCount")
  14467. // to unconditionally include in API requests. By default, fields with
  14468. // empty values are omitted from API requests. However, any non-pointer,
  14469. // non-interface field appearing in ForceSendFields will be sent to the
  14470. // server regardless of whether the field is empty or not. This may be
  14471. // used to include empty fields in Patch requests.
  14472. ForceSendFields []string `json:"-"`
  14473. // NullFields is a list of field names (e.g. "AdditionalNodeCount") to
  14474. // include in API requests with the JSON null value. By default, fields
  14475. // with empty values are omitted from API requests. However, any field
  14476. // with an empty value appearing in NullFields will be sent to the
  14477. // server as null. It is an error if a field in this list has a
  14478. // non-empty value. This may be used to include null fields in Patch
  14479. // requests.
  14480. NullFields []string `json:"-"`
  14481. }
  14482. func (s *NodeGroupsAddNodesRequest) MarshalJSON() ([]byte, error) {
  14483. type NoMethod NodeGroupsAddNodesRequest
  14484. raw := NoMethod(*s)
  14485. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14486. }
  14487. type NodeGroupsDeleteNodesRequest struct {
  14488. Nodes []string `json:"nodes,omitempty"`
  14489. // ForceSendFields is a list of field names (e.g. "Nodes") to
  14490. // unconditionally include in API requests. By default, fields with
  14491. // empty values are omitted from API requests. However, any non-pointer,
  14492. // non-interface field appearing in ForceSendFields will be sent to the
  14493. // server regardless of whether the field is empty or not. This may be
  14494. // used to include empty fields in Patch requests.
  14495. ForceSendFields []string `json:"-"`
  14496. // NullFields is a list of field names (e.g. "Nodes") to include in API
  14497. // requests with the JSON null value. By default, fields with empty
  14498. // values are omitted from API requests. However, any field with an
  14499. // empty value appearing in NullFields will be sent to the server as
  14500. // null. It is an error if a field in this list has a non-empty value.
  14501. // This may be used to include null fields in Patch requests.
  14502. NullFields []string `json:"-"`
  14503. }
  14504. func (s *NodeGroupsDeleteNodesRequest) MarshalJSON() ([]byte, error) {
  14505. type NoMethod NodeGroupsDeleteNodesRequest
  14506. raw := NoMethod(*s)
  14507. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14508. }
  14509. type NodeGroupsListNodes struct {
  14510. // Id: [Output Only] Unique identifier for the resource; defined by the
  14511. // server.
  14512. Id string `json:"id,omitempty"`
  14513. // Items: A list of Node resources.
  14514. Items []*NodeGroupNode `json:"items,omitempty"`
  14515. // Kind: [Output Only] The resource type, which is always
  14516. // compute.nodeGroupsListNodes for the list of nodes in the specified
  14517. // node group.
  14518. Kind string `json:"kind,omitempty"`
  14519. // NextPageToken: [Output Only] This token allows you to get the next
  14520. // page of results for list requests. If the number of results is larger
  14521. // than maxResults, use the nextPageToken as a value for the query
  14522. // parameter pageToken in the next list request. Subsequent list
  14523. // requests will have their own nextPageToken to continue paging through
  14524. // the results.
  14525. NextPageToken string `json:"nextPageToken,omitempty"`
  14526. // SelfLink: [Output Only] Server-defined URL for this resource.
  14527. SelfLink string `json:"selfLink,omitempty"`
  14528. // Warning: [Output Only] Informational warning message.
  14529. Warning *NodeGroupsListNodesWarning `json:"warning,omitempty"`
  14530. // ServerResponse contains the HTTP response code and headers from the
  14531. // server.
  14532. googleapi.ServerResponse `json:"-"`
  14533. // ForceSendFields is a list of field names (e.g. "Id") to
  14534. // unconditionally include in API requests. By default, fields with
  14535. // empty values are omitted from API requests. However, any non-pointer,
  14536. // non-interface field appearing in ForceSendFields will be sent to the
  14537. // server regardless of whether the field is empty or not. This may be
  14538. // used to include empty fields in Patch requests.
  14539. ForceSendFields []string `json:"-"`
  14540. // NullFields is a list of field names (e.g. "Id") to include in API
  14541. // requests with the JSON null value. By default, fields with empty
  14542. // values are omitted from API requests. However, any field with an
  14543. // empty value appearing in NullFields will be sent to the server as
  14544. // null. It is an error if a field in this list has a non-empty value.
  14545. // This may be used to include null fields in Patch requests.
  14546. NullFields []string `json:"-"`
  14547. }
  14548. func (s *NodeGroupsListNodes) MarshalJSON() ([]byte, error) {
  14549. type NoMethod NodeGroupsListNodes
  14550. raw := NoMethod(*s)
  14551. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14552. }
  14553. // NodeGroupsListNodesWarning: [Output Only] Informational warning
  14554. // message.
  14555. type NodeGroupsListNodesWarning struct {
  14556. // Code: [Output Only] A warning code, if applicable. For example,
  14557. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14558. // the response.
  14559. //
  14560. // Possible values:
  14561. // "CLEANUP_FAILED"
  14562. // "DEPRECATED_RESOURCE_USED"
  14563. // "DEPRECATED_TYPE_USED"
  14564. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14565. // "EXPERIMENTAL_TYPE_USED"
  14566. // "EXTERNAL_API_WARNING"
  14567. // "FIELD_VALUE_OVERRIDEN"
  14568. // "INJECTED_KERNELS_DEPRECATED"
  14569. // "MISSING_TYPE_DEPENDENCY"
  14570. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14571. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14572. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14573. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14574. // "NEXT_HOP_NOT_RUNNING"
  14575. // "NOT_CRITICAL_ERROR"
  14576. // "NO_RESULTS_ON_PAGE"
  14577. // "REQUIRED_TOS_AGREEMENT"
  14578. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14579. // "RESOURCE_NOT_DELETED"
  14580. // "SCHEMA_VALIDATION_IGNORED"
  14581. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14582. // "UNDECLARED_PROPERTIES"
  14583. // "UNREACHABLE"
  14584. Code string `json:"code,omitempty"`
  14585. // Data: [Output Only] Metadata about this warning in key: value format.
  14586. // For example:
  14587. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14588. Data []*NodeGroupsListNodesWarningData `json:"data,omitempty"`
  14589. // Message: [Output Only] A human-readable description of the warning
  14590. // code.
  14591. Message string `json:"message,omitempty"`
  14592. // ForceSendFields is a list of field names (e.g. "Code") to
  14593. // unconditionally include in API requests. By default, fields with
  14594. // empty values are omitted from API requests. However, any non-pointer,
  14595. // non-interface field appearing in ForceSendFields will be sent to the
  14596. // server regardless of whether the field is empty or not. This may be
  14597. // used to include empty fields in Patch requests.
  14598. ForceSendFields []string `json:"-"`
  14599. // NullFields is a list of field names (e.g. "Code") to include in API
  14600. // requests with the JSON null value. By default, fields with empty
  14601. // values are omitted from API requests. However, any field with an
  14602. // empty value appearing in NullFields will be sent to the server as
  14603. // null. It is an error if a field in this list has a non-empty value.
  14604. // This may be used to include null fields in Patch requests.
  14605. NullFields []string `json:"-"`
  14606. }
  14607. func (s *NodeGroupsListNodesWarning) MarshalJSON() ([]byte, error) {
  14608. type NoMethod NodeGroupsListNodesWarning
  14609. raw := NoMethod(*s)
  14610. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14611. }
  14612. type NodeGroupsListNodesWarningData struct {
  14613. // Key: [Output Only] A key that provides more detail on the warning
  14614. // being returned. For example, for warnings where there are no results
  14615. // in a list request for a particular zone, this key might be scope and
  14616. // the key value might be the zone name. Other examples might be a key
  14617. // indicating a deprecated resource and a suggested replacement, or a
  14618. // warning about invalid network settings (for example, if an instance
  14619. // attempts to perform IP forwarding but is not enabled for IP
  14620. // forwarding).
  14621. Key string `json:"key,omitempty"`
  14622. // Value: [Output Only] A warning data value corresponding to the key.
  14623. Value string `json:"value,omitempty"`
  14624. // ForceSendFields is a list of field names (e.g. "Key") to
  14625. // unconditionally include in API requests. By default, fields with
  14626. // empty values are omitted from API requests. However, any non-pointer,
  14627. // non-interface field appearing in ForceSendFields will be sent to the
  14628. // server regardless of whether the field is empty or not. This may be
  14629. // used to include empty fields in Patch requests.
  14630. ForceSendFields []string `json:"-"`
  14631. // NullFields is a list of field names (e.g. "Key") to include in API
  14632. // requests with the JSON null value. By default, fields with empty
  14633. // values are omitted from API requests. However, any field with an
  14634. // empty value appearing in NullFields will be sent to the server as
  14635. // null. It is an error if a field in this list has a non-empty value.
  14636. // This may be used to include null fields in Patch requests.
  14637. NullFields []string `json:"-"`
  14638. }
  14639. func (s *NodeGroupsListNodesWarningData) MarshalJSON() ([]byte, error) {
  14640. type NoMethod NodeGroupsListNodesWarningData
  14641. raw := NoMethod(*s)
  14642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14643. }
  14644. type NodeGroupsScopedList struct {
  14645. // NodeGroups: [Output Only] A list of node groups contained in this
  14646. // scope.
  14647. NodeGroups []*NodeGroup `json:"nodeGroups,omitempty"`
  14648. // Warning: [Output Only] An informational warning that appears when the
  14649. // nodeGroup list is empty.
  14650. Warning *NodeGroupsScopedListWarning `json:"warning,omitempty"`
  14651. // ForceSendFields is a list of field names (e.g. "NodeGroups") to
  14652. // unconditionally include in API requests. By default, fields with
  14653. // empty values are omitted from API requests. However, any non-pointer,
  14654. // non-interface field appearing in ForceSendFields will be sent to the
  14655. // server regardless of whether the field is empty or not. This may be
  14656. // used to include empty fields in Patch requests.
  14657. ForceSendFields []string `json:"-"`
  14658. // NullFields is a list of field names (e.g. "NodeGroups") to include in
  14659. // API requests with the JSON null value. By default, fields with empty
  14660. // values are omitted from API requests. However, any field with an
  14661. // empty value appearing in NullFields will be sent to the server as
  14662. // null. It is an error if a field in this list has a non-empty value.
  14663. // This may be used to include null fields in Patch requests.
  14664. NullFields []string `json:"-"`
  14665. }
  14666. func (s *NodeGroupsScopedList) MarshalJSON() ([]byte, error) {
  14667. type NoMethod NodeGroupsScopedList
  14668. raw := NoMethod(*s)
  14669. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14670. }
  14671. // NodeGroupsScopedListWarning: [Output Only] An informational warning
  14672. // that appears when the nodeGroup list is empty.
  14673. type NodeGroupsScopedListWarning struct {
  14674. // Code: [Output Only] A warning code, if applicable. For example,
  14675. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14676. // the response.
  14677. //
  14678. // Possible values:
  14679. // "CLEANUP_FAILED"
  14680. // "DEPRECATED_RESOURCE_USED"
  14681. // "DEPRECATED_TYPE_USED"
  14682. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14683. // "EXPERIMENTAL_TYPE_USED"
  14684. // "EXTERNAL_API_WARNING"
  14685. // "FIELD_VALUE_OVERRIDEN"
  14686. // "INJECTED_KERNELS_DEPRECATED"
  14687. // "MISSING_TYPE_DEPENDENCY"
  14688. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14689. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14690. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14691. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14692. // "NEXT_HOP_NOT_RUNNING"
  14693. // "NOT_CRITICAL_ERROR"
  14694. // "NO_RESULTS_ON_PAGE"
  14695. // "REQUIRED_TOS_AGREEMENT"
  14696. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14697. // "RESOURCE_NOT_DELETED"
  14698. // "SCHEMA_VALIDATION_IGNORED"
  14699. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14700. // "UNDECLARED_PROPERTIES"
  14701. // "UNREACHABLE"
  14702. Code string `json:"code,omitempty"`
  14703. // Data: [Output Only] Metadata about this warning in key: value format.
  14704. // For example:
  14705. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14706. Data []*NodeGroupsScopedListWarningData `json:"data,omitempty"`
  14707. // Message: [Output Only] A human-readable description of the warning
  14708. // code.
  14709. Message string `json:"message,omitempty"`
  14710. // ForceSendFields is a list of field names (e.g. "Code") to
  14711. // unconditionally include in API requests. By default, fields with
  14712. // empty values are omitted from API requests. However, any non-pointer,
  14713. // non-interface field appearing in ForceSendFields will be sent to the
  14714. // server regardless of whether the field is empty or not. This may be
  14715. // used to include empty fields in Patch requests.
  14716. ForceSendFields []string `json:"-"`
  14717. // NullFields is a list of field names (e.g. "Code") to include in API
  14718. // requests with the JSON null value. By default, fields with empty
  14719. // values are omitted from API requests. However, any field with an
  14720. // empty value appearing in NullFields will be sent to the server as
  14721. // null. It is an error if a field in this list has a non-empty value.
  14722. // This may be used to include null fields in Patch requests.
  14723. NullFields []string `json:"-"`
  14724. }
  14725. func (s *NodeGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  14726. type NoMethod NodeGroupsScopedListWarning
  14727. raw := NoMethod(*s)
  14728. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14729. }
  14730. type NodeGroupsScopedListWarningData struct {
  14731. // Key: [Output Only] A key that provides more detail on the warning
  14732. // being returned. For example, for warnings where there are no results
  14733. // in a list request for a particular zone, this key might be scope and
  14734. // the key value might be the zone name. Other examples might be a key
  14735. // indicating a deprecated resource and a suggested replacement, or a
  14736. // warning about invalid network settings (for example, if an instance
  14737. // attempts to perform IP forwarding but is not enabled for IP
  14738. // forwarding).
  14739. Key string `json:"key,omitempty"`
  14740. // Value: [Output Only] A warning data value corresponding to the key.
  14741. Value string `json:"value,omitempty"`
  14742. // ForceSendFields is a list of field names (e.g. "Key") to
  14743. // unconditionally include in API requests. By default, fields with
  14744. // empty values are omitted from API requests. However, any non-pointer,
  14745. // non-interface field appearing in ForceSendFields will be sent to the
  14746. // server regardless of whether the field is empty or not. This may be
  14747. // used to include empty fields in Patch requests.
  14748. ForceSendFields []string `json:"-"`
  14749. // NullFields is a list of field names (e.g. "Key") to include in API
  14750. // requests with the JSON null value. By default, fields with empty
  14751. // values are omitted from API requests. However, any field with an
  14752. // empty value appearing in NullFields will be sent to the server as
  14753. // null. It is an error if a field in this list has a non-empty value.
  14754. // This may be used to include null fields in Patch requests.
  14755. NullFields []string `json:"-"`
  14756. }
  14757. func (s *NodeGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  14758. type NoMethod NodeGroupsScopedListWarningData
  14759. raw := NoMethod(*s)
  14760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14761. }
  14762. type NodeGroupsSetNodeTemplateRequest struct {
  14763. // NodeTemplate: Full or partial URL of the node template resource to be
  14764. // updated for this node group.
  14765. NodeTemplate string `json:"nodeTemplate,omitempty"`
  14766. // ForceSendFields is a list of field names (e.g. "NodeTemplate") to
  14767. // unconditionally include in API requests. By default, fields with
  14768. // empty values are omitted from API requests. However, any non-pointer,
  14769. // non-interface field appearing in ForceSendFields will be sent to the
  14770. // server regardless of whether the field is empty or not. This may be
  14771. // used to include empty fields in Patch requests.
  14772. ForceSendFields []string `json:"-"`
  14773. // NullFields is a list of field names (e.g. "NodeTemplate") to include
  14774. // in API requests with the JSON null value. By default, fields with
  14775. // empty values are omitted from API requests. However, any field with
  14776. // an empty value appearing in NullFields will be sent to the server as
  14777. // null. It is an error if a field in this list has a non-empty value.
  14778. // This may be used to include null fields in Patch requests.
  14779. NullFields []string `json:"-"`
  14780. }
  14781. func (s *NodeGroupsSetNodeTemplateRequest) MarshalJSON() ([]byte, error) {
  14782. type NoMethod NodeGroupsSetNodeTemplateRequest
  14783. raw := NoMethod(*s)
  14784. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14785. }
  14786. // NodeTemplate: A Node Template resource.
  14787. type NodeTemplate struct {
  14788. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14789. // format.
  14790. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14791. // Description: An optional description of this resource. Provide this
  14792. // property when you create the resource.
  14793. Description string `json:"description,omitempty"`
  14794. // Id: [Output Only] The unique identifier for the resource. This
  14795. // identifier is defined by the server.
  14796. Id uint64 `json:"id,omitempty,string"`
  14797. // Kind: [Output Only] The type of the resource. Always
  14798. // compute#nodeTemplate for node templates.
  14799. Kind string `json:"kind,omitempty"`
  14800. // Name: The name of the resource, provided by the client when initially
  14801. // creating the resource. The resource name must be 1-63 characters
  14802. // long, and comply with RFC1035. Specifically, the name must be 1-63
  14803. // characters long and match the regular expression
  14804. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  14805. // a lowercase letter, and all following characters must be a dash,
  14806. // lowercase letter, or digit, except the last character, which cannot
  14807. // be a dash.
  14808. Name string `json:"name,omitempty"`
  14809. // NodeAffinityLabels: Labels to use for node affinity, which will be
  14810. // used in instance scheduling.
  14811. NodeAffinityLabels map[string]string `json:"nodeAffinityLabels,omitempty"`
  14812. // NodeType: The node type to use for nodes group that are created from
  14813. // this template.
  14814. NodeType string `json:"nodeType,omitempty"`
  14815. // NodeTypeFlexibility: The flexible properties of the desired node
  14816. // type. Node groups that use this node template will create nodes of a
  14817. // type that matches these properties.
  14818. //
  14819. // This field is mutually exclusive with the node_type property; you can
  14820. // only define one or the other, but not both.
  14821. NodeTypeFlexibility *NodeTemplateNodeTypeFlexibility `json:"nodeTypeFlexibility,omitempty"`
  14822. // Region: [Output Only] The name of the region where the node template
  14823. // resides, such as us-central1.
  14824. Region string `json:"region,omitempty"`
  14825. // SelfLink: [Output Only] Server-defined URL for the resource.
  14826. SelfLink string `json:"selfLink,omitempty"`
  14827. // Status: [Output Only] The status of the node template. One of the
  14828. // following values: CREATING, READY, and DELETING.
  14829. //
  14830. // Possible values:
  14831. // "CREATING"
  14832. // "DELETING"
  14833. // "INVALID"
  14834. // "READY"
  14835. Status string `json:"status,omitempty"`
  14836. // StatusMessage: [Output Only] An optional, human-readable explanation
  14837. // of the status.
  14838. StatusMessage string `json:"statusMessage,omitempty"`
  14839. // ServerResponse contains the HTTP response code and headers from the
  14840. // server.
  14841. googleapi.ServerResponse `json:"-"`
  14842. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  14843. // to unconditionally include in API requests. By default, fields with
  14844. // empty values are omitted from API requests. However, any non-pointer,
  14845. // non-interface field appearing in ForceSendFields will be sent to the
  14846. // server regardless of whether the field is empty or not. This may be
  14847. // used to include empty fields in Patch requests.
  14848. ForceSendFields []string `json:"-"`
  14849. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  14850. // include in API requests with the JSON null value. By default, fields
  14851. // with empty values are omitted from API requests. However, any field
  14852. // with an empty value appearing in NullFields will be sent to the
  14853. // server as null. It is an error if a field in this list has a
  14854. // non-empty value. This may be used to include null fields in Patch
  14855. // requests.
  14856. NullFields []string `json:"-"`
  14857. }
  14858. func (s *NodeTemplate) MarshalJSON() ([]byte, error) {
  14859. type NoMethod NodeTemplate
  14860. raw := NoMethod(*s)
  14861. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14862. }
  14863. type NodeTemplateAggregatedList struct {
  14864. // Id: [Output Only] Unique identifier for the resource; defined by the
  14865. // server.
  14866. Id string `json:"id,omitempty"`
  14867. // Items: A list of NodeTemplatesScopedList resources.
  14868. Items map[string]NodeTemplatesScopedList `json:"items,omitempty"`
  14869. // Kind: [Output Only] Type of resource.Always
  14870. // compute#nodeTemplateAggregatedList for aggregated lists of node
  14871. // templates.
  14872. Kind string `json:"kind,omitempty"`
  14873. // NextPageToken: [Output Only] This token allows you to get the next
  14874. // page of results for list requests. If the number of results is larger
  14875. // than maxResults, use the nextPageToken as a value for the query
  14876. // parameter pageToken in the next list request. Subsequent list
  14877. // requests will have their own nextPageToken to continue paging through
  14878. // the results.
  14879. NextPageToken string `json:"nextPageToken,omitempty"`
  14880. // SelfLink: [Output Only] Server-defined URL for this resource.
  14881. SelfLink string `json:"selfLink,omitempty"`
  14882. // Warning: [Output Only] Informational warning message.
  14883. Warning *NodeTemplateAggregatedListWarning `json:"warning,omitempty"`
  14884. // ServerResponse contains the HTTP response code and headers from the
  14885. // server.
  14886. googleapi.ServerResponse `json:"-"`
  14887. // ForceSendFields is a list of field names (e.g. "Id") to
  14888. // unconditionally include in API requests. By default, fields with
  14889. // empty values are omitted from API requests. However, any non-pointer,
  14890. // non-interface field appearing in ForceSendFields will be sent to the
  14891. // server regardless of whether the field is empty or not. This may be
  14892. // used to include empty fields in Patch requests.
  14893. ForceSendFields []string `json:"-"`
  14894. // NullFields is a list of field names (e.g. "Id") to include in API
  14895. // requests with the JSON null value. By default, fields with empty
  14896. // values are omitted from API requests. However, any field with an
  14897. // empty value appearing in NullFields will be sent to the server as
  14898. // null. It is an error if a field in this list has a non-empty value.
  14899. // This may be used to include null fields in Patch requests.
  14900. NullFields []string `json:"-"`
  14901. }
  14902. func (s *NodeTemplateAggregatedList) MarshalJSON() ([]byte, error) {
  14903. type NoMethod NodeTemplateAggregatedList
  14904. raw := NoMethod(*s)
  14905. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14906. }
  14907. // NodeTemplateAggregatedListWarning: [Output Only] Informational
  14908. // warning message.
  14909. type NodeTemplateAggregatedListWarning struct {
  14910. // Code: [Output Only] A warning code, if applicable. For example,
  14911. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14912. // the response.
  14913. //
  14914. // Possible values:
  14915. // "CLEANUP_FAILED"
  14916. // "DEPRECATED_RESOURCE_USED"
  14917. // "DEPRECATED_TYPE_USED"
  14918. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14919. // "EXPERIMENTAL_TYPE_USED"
  14920. // "EXTERNAL_API_WARNING"
  14921. // "FIELD_VALUE_OVERRIDEN"
  14922. // "INJECTED_KERNELS_DEPRECATED"
  14923. // "MISSING_TYPE_DEPENDENCY"
  14924. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14925. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14926. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14927. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14928. // "NEXT_HOP_NOT_RUNNING"
  14929. // "NOT_CRITICAL_ERROR"
  14930. // "NO_RESULTS_ON_PAGE"
  14931. // "REQUIRED_TOS_AGREEMENT"
  14932. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14933. // "RESOURCE_NOT_DELETED"
  14934. // "SCHEMA_VALIDATION_IGNORED"
  14935. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14936. // "UNDECLARED_PROPERTIES"
  14937. // "UNREACHABLE"
  14938. Code string `json:"code,omitempty"`
  14939. // Data: [Output Only] Metadata about this warning in key: value format.
  14940. // For example:
  14941. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14942. Data []*NodeTemplateAggregatedListWarningData `json:"data,omitempty"`
  14943. // Message: [Output Only] A human-readable description of the warning
  14944. // code.
  14945. Message string `json:"message,omitempty"`
  14946. // ForceSendFields is a list of field names (e.g. "Code") to
  14947. // unconditionally include in API requests. By default, fields with
  14948. // empty values are omitted from API requests. However, any non-pointer,
  14949. // non-interface field appearing in ForceSendFields will be sent to the
  14950. // server regardless of whether the field is empty or not. This may be
  14951. // used to include empty fields in Patch requests.
  14952. ForceSendFields []string `json:"-"`
  14953. // NullFields is a list of field names (e.g. "Code") to include in API
  14954. // requests with the JSON null value. By default, fields with empty
  14955. // values are omitted from API requests. However, any field with an
  14956. // empty value appearing in NullFields will be sent to the server as
  14957. // null. It is an error if a field in this list has a non-empty value.
  14958. // This may be used to include null fields in Patch requests.
  14959. NullFields []string `json:"-"`
  14960. }
  14961. func (s *NodeTemplateAggregatedListWarning) MarshalJSON() ([]byte, error) {
  14962. type NoMethod NodeTemplateAggregatedListWarning
  14963. raw := NoMethod(*s)
  14964. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14965. }
  14966. type NodeTemplateAggregatedListWarningData struct {
  14967. // Key: [Output Only] A key that provides more detail on the warning
  14968. // being returned. For example, for warnings where there are no results
  14969. // in a list request for a particular zone, this key might be scope and
  14970. // the key value might be the zone name. Other examples might be a key
  14971. // indicating a deprecated resource and a suggested replacement, or a
  14972. // warning about invalid network settings (for example, if an instance
  14973. // attempts to perform IP forwarding but is not enabled for IP
  14974. // forwarding).
  14975. Key string `json:"key,omitempty"`
  14976. // Value: [Output Only] A warning data value corresponding to the key.
  14977. Value string `json:"value,omitempty"`
  14978. // ForceSendFields is a list of field names (e.g. "Key") to
  14979. // unconditionally include in API requests. By default, fields with
  14980. // empty values are omitted from API requests. However, any non-pointer,
  14981. // non-interface field appearing in ForceSendFields will be sent to the
  14982. // server regardless of whether the field is empty or not. This may be
  14983. // used to include empty fields in Patch requests.
  14984. ForceSendFields []string `json:"-"`
  14985. // NullFields is a list of field names (e.g. "Key") to include in API
  14986. // requests with the JSON null value. By default, fields with empty
  14987. // values are omitted from API requests. However, any field with an
  14988. // empty value appearing in NullFields will be sent to the server as
  14989. // null. It is an error if a field in this list has a non-empty value.
  14990. // This may be used to include null fields in Patch requests.
  14991. NullFields []string `json:"-"`
  14992. }
  14993. func (s *NodeTemplateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  14994. type NoMethod NodeTemplateAggregatedListWarningData
  14995. raw := NoMethod(*s)
  14996. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14997. }
  14998. // NodeTemplateList: Contains a list of node templates.
  14999. type NodeTemplateList struct {
  15000. // Id: [Output Only] Unique identifier for the resource; defined by the
  15001. // server.
  15002. Id string `json:"id,omitempty"`
  15003. // Items: A list of NodeTemplate resources.
  15004. Items []*NodeTemplate `json:"items,omitempty"`
  15005. // Kind: [Output Only] Type of resource.Always compute#nodeTemplateList
  15006. // for lists of node templates.
  15007. Kind string `json:"kind,omitempty"`
  15008. // NextPageToken: [Output Only] This token allows you to get the next
  15009. // page of results for list requests. If the number of results is larger
  15010. // than maxResults, use the nextPageToken as a value for the query
  15011. // parameter pageToken in the next list request. Subsequent list
  15012. // requests will have their own nextPageToken to continue paging through
  15013. // the results.
  15014. NextPageToken string `json:"nextPageToken,omitempty"`
  15015. // SelfLink: [Output Only] Server-defined URL for this resource.
  15016. SelfLink string `json:"selfLink,omitempty"`
  15017. // Warning: [Output Only] Informational warning message.
  15018. Warning *NodeTemplateListWarning `json:"warning,omitempty"`
  15019. // ServerResponse contains the HTTP response code and headers from the
  15020. // server.
  15021. googleapi.ServerResponse `json:"-"`
  15022. // ForceSendFields is a list of field names (e.g. "Id") to
  15023. // unconditionally include in API requests. By default, fields with
  15024. // empty values are omitted from API requests. However, any non-pointer,
  15025. // non-interface field appearing in ForceSendFields will be sent to the
  15026. // server regardless of whether the field is empty or not. This may be
  15027. // used to include empty fields in Patch requests.
  15028. ForceSendFields []string `json:"-"`
  15029. // NullFields is a list of field names (e.g. "Id") to include in API
  15030. // requests with the JSON null value. By default, fields with empty
  15031. // values are omitted from API requests. However, any field with an
  15032. // empty value appearing in NullFields will be sent to the server as
  15033. // null. It is an error if a field in this list has a non-empty value.
  15034. // This may be used to include null fields in Patch requests.
  15035. NullFields []string `json:"-"`
  15036. }
  15037. func (s *NodeTemplateList) MarshalJSON() ([]byte, error) {
  15038. type NoMethod NodeTemplateList
  15039. raw := NoMethod(*s)
  15040. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15041. }
  15042. // NodeTemplateListWarning: [Output Only] Informational warning message.
  15043. type NodeTemplateListWarning struct {
  15044. // Code: [Output Only] A warning code, if applicable. For example,
  15045. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15046. // the response.
  15047. //
  15048. // Possible values:
  15049. // "CLEANUP_FAILED"
  15050. // "DEPRECATED_RESOURCE_USED"
  15051. // "DEPRECATED_TYPE_USED"
  15052. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15053. // "EXPERIMENTAL_TYPE_USED"
  15054. // "EXTERNAL_API_WARNING"
  15055. // "FIELD_VALUE_OVERRIDEN"
  15056. // "INJECTED_KERNELS_DEPRECATED"
  15057. // "MISSING_TYPE_DEPENDENCY"
  15058. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15059. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15060. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15061. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15062. // "NEXT_HOP_NOT_RUNNING"
  15063. // "NOT_CRITICAL_ERROR"
  15064. // "NO_RESULTS_ON_PAGE"
  15065. // "REQUIRED_TOS_AGREEMENT"
  15066. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15067. // "RESOURCE_NOT_DELETED"
  15068. // "SCHEMA_VALIDATION_IGNORED"
  15069. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15070. // "UNDECLARED_PROPERTIES"
  15071. // "UNREACHABLE"
  15072. Code string `json:"code,omitempty"`
  15073. // Data: [Output Only] Metadata about this warning in key: value format.
  15074. // For example:
  15075. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15076. Data []*NodeTemplateListWarningData `json:"data,omitempty"`
  15077. // Message: [Output Only] A human-readable description of the warning
  15078. // code.
  15079. Message string `json:"message,omitempty"`
  15080. // ForceSendFields is a list of field names (e.g. "Code") to
  15081. // unconditionally include in API requests. By default, fields with
  15082. // empty values are omitted from API requests. However, any non-pointer,
  15083. // non-interface field appearing in ForceSendFields will be sent to the
  15084. // server regardless of whether the field is empty or not. This may be
  15085. // used to include empty fields in Patch requests.
  15086. ForceSendFields []string `json:"-"`
  15087. // NullFields is a list of field names (e.g. "Code") to include in API
  15088. // requests with the JSON null value. By default, fields with empty
  15089. // values are omitted from API requests. However, any field with an
  15090. // empty value appearing in NullFields will be sent to the server as
  15091. // null. It is an error if a field in this list has a non-empty value.
  15092. // This may be used to include null fields in Patch requests.
  15093. NullFields []string `json:"-"`
  15094. }
  15095. func (s *NodeTemplateListWarning) MarshalJSON() ([]byte, error) {
  15096. type NoMethod NodeTemplateListWarning
  15097. raw := NoMethod(*s)
  15098. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15099. }
  15100. type NodeTemplateListWarningData struct {
  15101. // Key: [Output Only] A key that provides more detail on the warning
  15102. // being returned. For example, for warnings where there are no results
  15103. // in a list request for a particular zone, this key might be scope and
  15104. // the key value might be the zone name. Other examples might be a key
  15105. // indicating a deprecated resource and a suggested replacement, or a
  15106. // warning about invalid network settings (for example, if an instance
  15107. // attempts to perform IP forwarding but is not enabled for IP
  15108. // forwarding).
  15109. Key string `json:"key,omitempty"`
  15110. // Value: [Output Only] A warning data value corresponding to the key.
  15111. Value string `json:"value,omitempty"`
  15112. // ForceSendFields is a list of field names (e.g. "Key") to
  15113. // unconditionally include in API requests. By default, fields with
  15114. // empty values are omitted from API requests. However, any non-pointer,
  15115. // non-interface field appearing in ForceSendFields will be sent to the
  15116. // server regardless of whether the field is empty or not. This may be
  15117. // used to include empty fields in Patch requests.
  15118. ForceSendFields []string `json:"-"`
  15119. // NullFields is a list of field names (e.g. "Key") to include in API
  15120. // requests with the JSON null value. By default, fields with empty
  15121. // values are omitted from API requests. However, any field with an
  15122. // empty value appearing in NullFields will be sent to the server as
  15123. // null. It is an error if a field in this list has a non-empty value.
  15124. // This may be used to include null fields in Patch requests.
  15125. NullFields []string `json:"-"`
  15126. }
  15127. func (s *NodeTemplateListWarningData) MarshalJSON() ([]byte, error) {
  15128. type NoMethod NodeTemplateListWarningData
  15129. raw := NoMethod(*s)
  15130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15131. }
  15132. type NodeTemplateNodeTypeFlexibility struct {
  15133. Cpus string `json:"cpus,omitempty"`
  15134. LocalSsd string `json:"localSsd,omitempty"`
  15135. Memory string `json:"memory,omitempty"`
  15136. // ForceSendFields is a list of field names (e.g. "Cpus") to
  15137. // unconditionally include in API requests. By default, fields with
  15138. // empty values are omitted from API requests. However, any non-pointer,
  15139. // non-interface field appearing in ForceSendFields will be sent to the
  15140. // server regardless of whether the field is empty or not. This may be
  15141. // used to include empty fields in Patch requests.
  15142. ForceSendFields []string `json:"-"`
  15143. // NullFields is a list of field names (e.g. "Cpus") to include in API
  15144. // requests with the JSON null value. By default, fields with empty
  15145. // values are omitted from API requests. However, any field with an
  15146. // empty value appearing in NullFields will be sent to the server as
  15147. // null. It is an error if a field in this list has a non-empty value.
  15148. // This may be used to include null fields in Patch requests.
  15149. NullFields []string `json:"-"`
  15150. }
  15151. func (s *NodeTemplateNodeTypeFlexibility) MarshalJSON() ([]byte, error) {
  15152. type NoMethod NodeTemplateNodeTypeFlexibility
  15153. raw := NoMethod(*s)
  15154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15155. }
  15156. type NodeTemplatesScopedList struct {
  15157. // NodeTemplates: [Output Only] A list of node templates contained in
  15158. // this scope.
  15159. NodeTemplates []*NodeTemplate `json:"nodeTemplates,omitempty"`
  15160. // Warning: [Output Only] An informational warning that appears when the
  15161. // node templates list is empty.
  15162. Warning *NodeTemplatesScopedListWarning `json:"warning,omitempty"`
  15163. // ForceSendFields is a list of field names (e.g. "NodeTemplates") to
  15164. // unconditionally include in API requests. By default, fields with
  15165. // empty values are omitted from API requests. However, any non-pointer,
  15166. // non-interface field appearing in ForceSendFields will be sent to the
  15167. // server regardless of whether the field is empty or not. This may be
  15168. // used to include empty fields in Patch requests.
  15169. ForceSendFields []string `json:"-"`
  15170. // NullFields is a list of field names (e.g. "NodeTemplates") to include
  15171. // in API requests with the JSON null value. By default, fields with
  15172. // empty values are omitted from API requests. However, any field with
  15173. // an empty value appearing in NullFields will be sent to the server as
  15174. // null. It is an error if a field in this list has a non-empty value.
  15175. // This may be used to include null fields in Patch requests.
  15176. NullFields []string `json:"-"`
  15177. }
  15178. func (s *NodeTemplatesScopedList) MarshalJSON() ([]byte, error) {
  15179. type NoMethod NodeTemplatesScopedList
  15180. raw := NoMethod(*s)
  15181. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15182. }
  15183. // NodeTemplatesScopedListWarning: [Output Only] An informational
  15184. // warning that appears when the node templates list is empty.
  15185. type NodeTemplatesScopedListWarning struct {
  15186. // Code: [Output Only] A warning code, if applicable. For example,
  15187. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15188. // the response.
  15189. //
  15190. // Possible values:
  15191. // "CLEANUP_FAILED"
  15192. // "DEPRECATED_RESOURCE_USED"
  15193. // "DEPRECATED_TYPE_USED"
  15194. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15195. // "EXPERIMENTAL_TYPE_USED"
  15196. // "EXTERNAL_API_WARNING"
  15197. // "FIELD_VALUE_OVERRIDEN"
  15198. // "INJECTED_KERNELS_DEPRECATED"
  15199. // "MISSING_TYPE_DEPENDENCY"
  15200. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15201. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15202. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15203. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15204. // "NEXT_HOP_NOT_RUNNING"
  15205. // "NOT_CRITICAL_ERROR"
  15206. // "NO_RESULTS_ON_PAGE"
  15207. // "REQUIRED_TOS_AGREEMENT"
  15208. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15209. // "RESOURCE_NOT_DELETED"
  15210. // "SCHEMA_VALIDATION_IGNORED"
  15211. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15212. // "UNDECLARED_PROPERTIES"
  15213. // "UNREACHABLE"
  15214. Code string `json:"code,omitempty"`
  15215. // Data: [Output Only] Metadata about this warning in key: value format.
  15216. // For example:
  15217. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15218. Data []*NodeTemplatesScopedListWarningData `json:"data,omitempty"`
  15219. // Message: [Output Only] A human-readable description of the warning
  15220. // code.
  15221. Message string `json:"message,omitempty"`
  15222. // ForceSendFields is a list of field names (e.g. "Code") to
  15223. // unconditionally include in API requests. By default, fields with
  15224. // empty values are omitted from API requests. However, any non-pointer,
  15225. // non-interface field appearing in ForceSendFields will be sent to the
  15226. // server regardless of whether the field is empty or not. This may be
  15227. // used to include empty fields in Patch requests.
  15228. ForceSendFields []string `json:"-"`
  15229. // NullFields is a list of field names (e.g. "Code") to include in API
  15230. // requests with the JSON null value. By default, fields with empty
  15231. // values are omitted from API requests. However, any field with an
  15232. // empty value appearing in NullFields will be sent to the server as
  15233. // null. It is an error if a field in this list has a non-empty value.
  15234. // This may be used to include null fields in Patch requests.
  15235. NullFields []string `json:"-"`
  15236. }
  15237. func (s *NodeTemplatesScopedListWarning) MarshalJSON() ([]byte, error) {
  15238. type NoMethod NodeTemplatesScopedListWarning
  15239. raw := NoMethod(*s)
  15240. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15241. }
  15242. type NodeTemplatesScopedListWarningData struct {
  15243. // Key: [Output Only] A key that provides more detail on the warning
  15244. // being returned. For example, for warnings where there are no results
  15245. // in a list request for a particular zone, this key might be scope and
  15246. // the key value might be the zone name. Other examples might be a key
  15247. // indicating a deprecated resource and a suggested replacement, or a
  15248. // warning about invalid network settings (for example, if an instance
  15249. // attempts to perform IP forwarding but is not enabled for IP
  15250. // forwarding).
  15251. Key string `json:"key,omitempty"`
  15252. // Value: [Output Only] A warning data value corresponding to the key.
  15253. Value string `json:"value,omitempty"`
  15254. // ForceSendFields is a list of field names (e.g. "Key") to
  15255. // unconditionally include in API requests. By default, fields with
  15256. // empty values are omitted from API requests. However, any non-pointer,
  15257. // non-interface field appearing in ForceSendFields will be sent to the
  15258. // server regardless of whether the field is empty or not. This may be
  15259. // used to include empty fields in Patch requests.
  15260. ForceSendFields []string `json:"-"`
  15261. // NullFields is a list of field names (e.g. "Key") to include in API
  15262. // requests with the JSON null value. By default, fields with empty
  15263. // values are omitted from API requests. However, any field with an
  15264. // empty value appearing in NullFields will be sent to the server as
  15265. // null. It is an error if a field in this list has a non-empty value.
  15266. // This may be used to include null fields in Patch requests.
  15267. NullFields []string `json:"-"`
  15268. }
  15269. func (s *NodeTemplatesScopedListWarningData) MarshalJSON() ([]byte, error) {
  15270. type NoMethod NodeTemplatesScopedListWarningData
  15271. raw := NoMethod(*s)
  15272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15273. }
  15274. // NodeType: A Node Type resource.
  15275. type NodeType struct {
  15276. // CpuPlatform: [Output Only] The CPU platform used by this node type.
  15277. CpuPlatform string `json:"cpuPlatform,omitempty"`
  15278. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15279. // format.
  15280. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15281. // Deprecated: [Output Only] The deprecation status associated with this
  15282. // node type.
  15283. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  15284. // Description: [Output Only] An optional textual description of the
  15285. // resource.
  15286. Description string `json:"description,omitempty"`
  15287. // GuestCpus: [Output Only] The number of virtual CPUs that are
  15288. // available to the node type.
  15289. GuestCpus int64 `json:"guestCpus,omitempty"`
  15290. // Id: [Output Only] The unique identifier for the resource. This
  15291. // identifier is defined by the server.
  15292. Id uint64 `json:"id,omitempty,string"`
  15293. // Kind: [Output Only] The type of the resource. Always compute#nodeType
  15294. // for node types.
  15295. Kind string `json:"kind,omitempty"`
  15296. // LocalSsdGb: [Output Only] Local SSD available to the node type,
  15297. // defined in GB.
  15298. LocalSsdGb int64 `json:"localSsdGb,omitempty"`
  15299. // MemoryMb: [Output Only] The amount of physical memory available to
  15300. // the node type, defined in MB.
  15301. MemoryMb int64 `json:"memoryMb,omitempty"`
  15302. // Name: [Output Only] Name of the resource.
  15303. Name string `json:"name,omitempty"`
  15304. // SelfLink: [Output Only] Server-defined URL for the resource.
  15305. SelfLink string `json:"selfLink,omitempty"`
  15306. // Zone: [Output Only] The name of the zone where the node type resides,
  15307. // such as us-central1-a.
  15308. Zone string `json:"zone,omitempty"`
  15309. // ServerResponse contains the HTTP response code and headers from the
  15310. // server.
  15311. googleapi.ServerResponse `json:"-"`
  15312. // ForceSendFields is a list of field names (e.g. "CpuPlatform") to
  15313. // unconditionally include in API requests. By default, fields with
  15314. // empty values are omitted from API requests. However, any non-pointer,
  15315. // non-interface field appearing in ForceSendFields will be sent to the
  15316. // server regardless of whether the field is empty or not. This may be
  15317. // used to include empty fields in Patch requests.
  15318. ForceSendFields []string `json:"-"`
  15319. // NullFields is a list of field names (e.g. "CpuPlatform") to include
  15320. // in API requests with the JSON null value. By default, fields with
  15321. // empty values are omitted from API requests. However, any field with
  15322. // an empty value appearing in NullFields will be sent to the server as
  15323. // null. It is an error if a field in this list has a non-empty value.
  15324. // This may be used to include null fields in Patch requests.
  15325. NullFields []string `json:"-"`
  15326. }
  15327. func (s *NodeType) MarshalJSON() ([]byte, error) {
  15328. type NoMethod NodeType
  15329. raw := NoMethod(*s)
  15330. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15331. }
  15332. type NodeTypeAggregatedList struct {
  15333. // Id: [Output Only] Unique identifier for the resource; defined by the
  15334. // server.
  15335. Id string `json:"id,omitempty"`
  15336. // Items: A list of NodeTypesScopedList resources.
  15337. Items map[string]NodeTypesScopedList `json:"items,omitempty"`
  15338. // Kind: [Output Only] Type of resource.Always
  15339. // compute#nodeTypeAggregatedList for aggregated lists of node types.
  15340. Kind string `json:"kind,omitempty"`
  15341. // NextPageToken: [Output Only] This token allows you to get the next
  15342. // page of results for list requests. If the number of results is larger
  15343. // than maxResults, use the nextPageToken as a value for the query
  15344. // parameter pageToken in the next list request. Subsequent list
  15345. // requests will have their own nextPageToken to continue paging through
  15346. // the results.
  15347. NextPageToken string `json:"nextPageToken,omitempty"`
  15348. // SelfLink: [Output Only] Server-defined URL for this resource.
  15349. SelfLink string `json:"selfLink,omitempty"`
  15350. // Warning: [Output Only] Informational warning message.
  15351. Warning *NodeTypeAggregatedListWarning `json:"warning,omitempty"`
  15352. // ServerResponse contains the HTTP response code and headers from the
  15353. // server.
  15354. googleapi.ServerResponse `json:"-"`
  15355. // ForceSendFields is a list of field names (e.g. "Id") to
  15356. // unconditionally include in API requests. By default, fields with
  15357. // empty values are omitted from API requests. However, any non-pointer,
  15358. // non-interface field appearing in ForceSendFields will be sent to the
  15359. // server regardless of whether the field is empty or not. This may be
  15360. // used to include empty fields in Patch requests.
  15361. ForceSendFields []string `json:"-"`
  15362. // NullFields is a list of field names (e.g. "Id") to include in API
  15363. // requests with the JSON null value. By default, fields with empty
  15364. // values are omitted from API requests. However, any field with an
  15365. // empty value appearing in NullFields will be sent to the server as
  15366. // null. It is an error if a field in this list has a non-empty value.
  15367. // This may be used to include null fields in Patch requests.
  15368. NullFields []string `json:"-"`
  15369. }
  15370. func (s *NodeTypeAggregatedList) MarshalJSON() ([]byte, error) {
  15371. type NoMethod NodeTypeAggregatedList
  15372. raw := NoMethod(*s)
  15373. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15374. }
  15375. // NodeTypeAggregatedListWarning: [Output Only] Informational warning
  15376. // message.
  15377. type NodeTypeAggregatedListWarning struct {
  15378. // Code: [Output Only] A warning code, if applicable. For example,
  15379. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15380. // the response.
  15381. //
  15382. // Possible values:
  15383. // "CLEANUP_FAILED"
  15384. // "DEPRECATED_RESOURCE_USED"
  15385. // "DEPRECATED_TYPE_USED"
  15386. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15387. // "EXPERIMENTAL_TYPE_USED"
  15388. // "EXTERNAL_API_WARNING"
  15389. // "FIELD_VALUE_OVERRIDEN"
  15390. // "INJECTED_KERNELS_DEPRECATED"
  15391. // "MISSING_TYPE_DEPENDENCY"
  15392. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15393. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15394. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15395. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15396. // "NEXT_HOP_NOT_RUNNING"
  15397. // "NOT_CRITICAL_ERROR"
  15398. // "NO_RESULTS_ON_PAGE"
  15399. // "REQUIRED_TOS_AGREEMENT"
  15400. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15401. // "RESOURCE_NOT_DELETED"
  15402. // "SCHEMA_VALIDATION_IGNORED"
  15403. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15404. // "UNDECLARED_PROPERTIES"
  15405. // "UNREACHABLE"
  15406. Code string `json:"code,omitempty"`
  15407. // Data: [Output Only] Metadata about this warning in key: value format.
  15408. // For example:
  15409. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15410. Data []*NodeTypeAggregatedListWarningData `json:"data,omitempty"`
  15411. // Message: [Output Only] A human-readable description of the warning
  15412. // code.
  15413. Message string `json:"message,omitempty"`
  15414. // ForceSendFields is a list of field names (e.g. "Code") to
  15415. // unconditionally include in API requests. By default, fields with
  15416. // empty values are omitted from API requests. However, any non-pointer,
  15417. // non-interface field appearing in ForceSendFields will be sent to the
  15418. // server regardless of whether the field is empty or not. This may be
  15419. // used to include empty fields in Patch requests.
  15420. ForceSendFields []string `json:"-"`
  15421. // NullFields is a list of field names (e.g. "Code") to include in API
  15422. // requests with the JSON null value. By default, fields with empty
  15423. // values are omitted from API requests. However, any field with an
  15424. // empty value appearing in NullFields will be sent to the server as
  15425. // null. It is an error if a field in this list has a non-empty value.
  15426. // This may be used to include null fields in Patch requests.
  15427. NullFields []string `json:"-"`
  15428. }
  15429. func (s *NodeTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  15430. type NoMethod NodeTypeAggregatedListWarning
  15431. raw := NoMethod(*s)
  15432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15433. }
  15434. type NodeTypeAggregatedListWarningData struct {
  15435. // Key: [Output Only] A key that provides more detail on the warning
  15436. // being returned. For example, for warnings where there are no results
  15437. // in a list request for a particular zone, this key might be scope and
  15438. // the key value might be the zone name. Other examples might be a key
  15439. // indicating a deprecated resource and a suggested replacement, or a
  15440. // warning about invalid network settings (for example, if an instance
  15441. // attempts to perform IP forwarding but is not enabled for IP
  15442. // forwarding).
  15443. Key string `json:"key,omitempty"`
  15444. // Value: [Output Only] A warning data value corresponding to the key.
  15445. Value string `json:"value,omitempty"`
  15446. // ForceSendFields is a list of field names (e.g. "Key") to
  15447. // unconditionally include in API requests. By default, fields with
  15448. // empty values are omitted from API requests. However, any non-pointer,
  15449. // non-interface field appearing in ForceSendFields will be sent to the
  15450. // server regardless of whether the field is empty or not. This may be
  15451. // used to include empty fields in Patch requests.
  15452. ForceSendFields []string `json:"-"`
  15453. // NullFields is a list of field names (e.g. "Key") to include in API
  15454. // requests with the JSON null value. By default, fields with empty
  15455. // values are omitted from API requests. However, any field with an
  15456. // empty value appearing in NullFields will be sent to the server as
  15457. // null. It is an error if a field in this list has a non-empty value.
  15458. // This may be used to include null fields in Patch requests.
  15459. NullFields []string `json:"-"`
  15460. }
  15461. func (s *NodeTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  15462. type NoMethod NodeTypeAggregatedListWarningData
  15463. raw := NoMethod(*s)
  15464. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15465. }
  15466. // NodeTypeList: Contains a list of node types.
  15467. type NodeTypeList struct {
  15468. // Id: [Output Only] Unique identifier for the resource; defined by the
  15469. // server.
  15470. Id string `json:"id,omitempty"`
  15471. // Items: A list of NodeType resources.
  15472. Items []*NodeType `json:"items,omitempty"`
  15473. // Kind: [Output Only] Type of resource.Always compute#nodeTypeList for
  15474. // lists of node types.
  15475. Kind string `json:"kind,omitempty"`
  15476. // NextPageToken: [Output Only] This token allows you to get the next
  15477. // page of results for list requests. If the number of results is larger
  15478. // than maxResults, use the nextPageToken as a value for the query
  15479. // parameter pageToken in the next list request. Subsequent list
  15480. // requests will have their own nextPageToken to continue paging through
  15481. // the results.
  15482. NextPageToken string `json:"nextPageToken,omitempty"`
  15483. // SelfLink: [Output Only] Server-defined URL for this resource.
  15484. SelfLink string `json:"selfLink,omitempty"`
  15485. // Warning: [Output Only] Informational warning message.
  15486. Warning *NodeTypeListWarning `json:"warning,omitempty"`
  15487. // ServerResponse contains the HTTP response code and headers from the
  15488. // server.
  15489. googleapi.ServerResponse `json:"-"`
  15490. // ForceSendFields is a list of field names (e.g. "Id") to
  15491. // unconditionally include in API requests. By default, fields with
  15492. // empty values are omitted from API requests. However, any non-pointer,
  15493. // non-interface field appearing in ForceSendFields will be sent to the
  15494. // server regardless of whether the field is empty or not. This may be
  15495. // used to include empty fields in Patch requests.
  15496. ForceSendFields []string `json:"-"`
  15497. // NullFields is a list of field names (e.g. "Id") to include in API
  15498. // requests with the JSON null value. By default, fields with empty
  15499. // values are omitted from API requests. However, any field with an
  15500. // empty value appearing in NullFields will be sent to the server as
  15501. // null. It is an error if a field in this list has a non-empty value.
  15502. // This may be used to include null fields in Patch requests.
  15503. NullFields []string `json:"-"`
  15504. }
  15505. func (s *NodeTypeList) MarshalJSON() ([]byte, error) {
  15506. type NoMethod NodeTypeList
  15507. raw := NoMethod(*s)
  15508. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15509. }
  15510. // NodeTypeListWarning: [Output Only] Informational warning message.
  15511. type NodeTypeListWarning struct {
  15512. // Code: [Output Only] A warning code, if applicable. For example,
  15513. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15514. // the response.
  15515. //
  15516. // Possible values:
  15517. // "CLEANUP_FAILED"
  15518. // "DEPRECATED_RESOURCE_USED"
  15519. // "DEPRECATED_TYPE_USED"
  15520. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15521. // "EXPERIMENTAL_TYPE_USED"
  15522. // "EXTERNAL_API_WARNING"
  15523. // "FIELD_VALUE_OVERRIDEN"
  15524. // "INJECTED_KERNELS_DEPRECATED"
  15525. // "MISSING_TYPE_DEPENDENCY"
  15526. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15527. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15528. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15529. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15530. // "NEXT_HOP_NOT_RUNNING"
  15531. // "NOT_CRITICAL_ERROR"
  15532. // "NO_RESULTS_ON_PAGE"
  15533. // "REQUIRED_TOS_AGREEMENT"
  15534. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15535. // "RESOURCE_NOT_DELETED"
  15536. // "SCHEMA_VALIDATION_IGNORED"
  15537. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15538. // "UNDECLARED_PROPERTIES"
  15539. // "UNREACHABLE"
  15540. Code string `json:"code,omitempty"`
  15541. // Data: [Output Only] Metadata about this warning in key: value format.
  15542. // For example:
  15543. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15544. Data []*NodeTypeListWarningData `json:"data,omitempty"`
  15545. // Message: [Output Only] A human-readable description of the warning
  15546. // code.
  15547. Message string `json:"message,omitempty"`
  15548. // ForceSendFields is a list of field names (e.g. "Code") to
  15549. // unconditionally include in API requests. By default, fields with
  15550. // empty values are omitted from API requests. However, any non-pointer,
  15551. // non-interface field appearing in ForceSendFields will be sent to the
  15552. // server regardless of whether the field is empty or not. This may be
  15553. // used to include empty fields in Patch requests.
  15554. ForceSendFields []string `json:"-"`
  15555. // NullFields is a list of field names (e.g. "Code") to include in API
  15556. // requests with the JSON null value. By default, fields with empty
  15557. // values are omitted from API requests. However, any field with an
  15558. // empty value appearing in NullFields will be sent to the server as
  15559. // null. It is an error if a field in this list has a non-empty value.
  15560. // This may be used to include null fields in Patch requests.
  15561. NullFields []string `json:"-"`
  15562. }
  15563. func (s *NodeTypeListWarning) MarshalJSON() ([]byte, error) {
  15564. type NoMethod NodeTypeListWarning
  15565. raw := NoMethod(*s)
  15566. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15567. }
  15568. type NodeTypeListWarningData struct {
  15569. // Key: [Output Only] A key that provides more detail on the warning
  15570. // being returned. For example, for warnings where there are no results
  15571. // in a list request for a particular zone, this key might be scope and
  15572. // the key value might be the zone name. Other examples might be a key
  15573. // indicating a deprecated resource and a suggested replacement, or a
  15574. // warning about invalid network settings (for example, if an instance
  15575. // attempts to perform IP forwarding but is not enabled for IP
  15576. // forwarding).
  15577. Key string `json:"key,omitempty"`
  15578. // Value: [Output Only] A warning data value corresponding to the key.
  15579. Value string `json:"value,omitempty"`
  15580. // ForceSendFields is a list of field names (e.g. "Key") to
  15581. // unconditionally include in API requests. By default, fields with
  15582. // empty values are omitted from API requests. However, any non-pointer,
  15583. // non-interface field appearing in ForceSendFields will be sent to the
  15584. // server regardless of whether the field is empty or not. This may be
  15585. // used to include empty fields in Patch requests.
  15586. ForceSendFields []string `json:"-"`
  15587. // NullFields is a list of field names (e.g. "Key") to include in API
  15588. // requests with the JSON null value. By default, fields with empty
  15589. // values are omitted from API requests. However, any field with an
  15590. // empty value appearing in NullFields will be sent to the server as
  15591. // null. It is an error if a field in this list has a non-empty value.
  15592. // This may be used to include null fields in Patch requests.
  15593. NullFields []string `json:"-"`
  15594. }
  15595. func (s *NodeTypeListWarningData) MarshalJSON() ([]byte, error) {
  15596. type NoMethod NodeTypeListWarningData
  15597. raw := NoMethod(*s)
  15598. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15599. }
  15600. type NodeTypesScopedList struct {
  15601. // NodeTypes: [Output Only] A list of node types contained in this
  15602. // scope.
  15603. NodeTypes []*NodeType `json:"nodeTypes,omitempty"`
  15604. // Warning: [Output Only] An informational warning that appears when the
  15605. // node types list is empty.
  15606. Warning *NodeTypesScopedListWarning `json:"warning,omitempty"`
  15607. // ForceSendFields is a list of field names (e.g. "NodeTypes") to
  15608. // unconditionally include in API requests. By default, fields with
  15609. // empty values are omitted from API requests. However, any non-pointer,
  15610. // non-interface field appearing in ForceSendFields will be sent to the
  15611. // server regardless of whether the field is empty or not. This may be
  15612. // used to include empty fields in Patch requests.
  15613. ForceSendFields []string `json:"-"`
  15614. // NullFields is a list of field names (e.g. "NodeTypes") to include in
  15615. // API requests with the JSON null value. By default, fields with empty
  15616. // values are omitted from API requests. However, any field with an
  15617. // empty value appearing in NullFields will be sent to the server as
  15618. // null. It is an error if a field in this list has a non-empty value.
  15619. // This may be used to include null fields in Patch requests.
  15620. NullFields []string `json:"-"`
  15621. }
  15622. func (s *NodeTypesScopedList) MarshalJSON() ([]byte, error) {
  15623. type NoMethod NodeTypesScopedList
  15624. raw := NoMethod(*s)
  15625. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15626. }
  15627. // NodeTypesScopedListWarning: [Output Only] An informational warning
  15628. // that appears when the node types list is empty.
  15629. type NodeTypesScopedListWarning struct {
  15630. // Code: [Output Only] A warning code, if applicable. For example,
  15631. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15632. // the response.
  15633. //
  15634. // Possible values:
  15635. // "CLEANUP_FAILED"
  15636. // "DEPRECATED_RESOURCE_USED"
  15637. // "DEPRECATED_TYPE_USED"
  15638. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15639. // "EXPERIMENTAL_TYPE_USED"
  15640. // "EXTERNAL_API_WARNING"
  15641. // "FIELD_VALUE_OVERRIDEN"
  15642. // "INJECTED_KERNELS_DEPRECATED"
  15643. // "MISSING_TYPE_DEPENDENCY"
  15644. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15645. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15646. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15647. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15648. // "NEXT_HOP_NOT_RUNNING"
  15649. // "NOT_CRITICAL_ERROR"
  15650. // "NO_RESULTS_ON_PAGE"
  15651. // "REQUIRED_TOS_AGREEMENT"
  15652. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15653. // "RESOURCE_NOT_DELETED"
  15654. // "SCHEMA_VALIDATION_IGNORED"
  15655. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15656. // "UNDECLARED_PROPERTIES"
  15657. // "UNREACHABLE"
  15658. Code string `json:"code,omitempty"`
  15659. // Data: [Output Only] Metadata about this warning in key: value format.
  15660. // For example:
  15661. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15662. Data []*NodeTypesScopedListWarningData `json:"data,omitempty"`
  15663. // Message: [Output Only] A human-readable description of the warning
  15664. // code.
  15665. Message string `json:"message,omitempty"`
  15666. // ForceSendFields is a list of field names (e.g. "Code") to
  15667. // unconditionally include in API requests. By default, fields with
  15668. // empty values are omitted from API requests. However, any non-pointer,
  15669. // non-interface field appearing in ForceSendFields will be sent to the
  15670. // server regardless of whether the field is empty or not. This may be
  15671. // used to include empty fields in Patch requests.
  15672. ForceSendFields []string `json:"-"`
  15673. // NullFields is a list of field names (e.g. "Code") to include in API
  15674. // requests with the JSON null value. By default, fields with empty
  15675. // values are omitted from API requests. However, any field with an
  15676. // empty value appearing in NullFields will be sent to the server as
  15677. // null. It is an error if a field in this list has a non-empty value.
  15678. // This may be used to include null fields in Patch requests.
  15679. NullFields []string `json:"-"`
  15680. }
  15681. func (s *NodeTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  15682. type NoMethod NodeTypesScopedListWarning
  15683. raw := NoMethod(*s)
  15684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15685. }
  15686. type NodeTypesScopedListWarningData struct {
  15687. // Key: [Output Only] A key that provides more detail on the warning
  15688. // being returned. For example, for warnings where there are no results
  15689. // in a list request for a particular zone, this key might be scope and
  15690. // the key value might be the zone name. Other examples might be a key
  15691. // indicating a deprecated resource and a suggested replacement, or a
  15692. // warning about invalid network settings (for example, if an instance
  15693. // attempts to perform IP forwarding but is not enabled for IP
  15694. // forwarding).
  15695. Key string `json:"key,omitempty"`
  15696. // Value: [Output Only] A warning data value corresponding to the key.
  15697. Value string `json:"value,omitempty"`
  15698. // ForceSendFields is a list of field names (e.g. "Key") to
  15699. // unconditionally include in API requests. By default, fields with
  15700. // empty values are omitted from API requests. However, any non-pointer,
  15701. // non-interface field appearing in ForceSendFields will be sent to the
  15702. // server regardless of whether the field is empty or not. This may be
  15703. // used to include empty fields in Patch requests.
  15704. ForceSendFields []string `json:"-"`
  15705. // NullFields is a list of field names (e.g. "Key") to include in API
  15706. // requests with the JSON null value. By default, fields with empty
  15707. // values are omitted from API requests. However, any field with an
  15708. // empty value appearing in NullFields will be sent to the server as
  15709. // null. It is an error if a field in this list has a non-empty value.
  15710. // This may be used to include null fields in Patch requests.
  15711. NullFields []string `json:"-"`
  15712. }
  15713. func (s *NodeTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  15714. type NoMethod NodeTypesScopedListWarningData
  15715. raw := NoMethod(*s)
  15716. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15717. }
  15718. // Operation: An Operation resource, used to manage asynchronous API
  15719. // requests. (== resource_for v1.globalOperations ==) (== resource_for
  15720. // beta.globalOperations ==) (== resource_for v1.regionOperations ==)
  15721. // (== resource_for beta.regionOperations ==) (== resource_for
  15722. // v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
  15723. type Operation struct {
  15724. // ClientOperationId: [Output Only] The value of `requestId` if you
  15725. // provided it in the request. Not present otherwise.
  15726. ClientOperationId string `json:"clientOperationId,omitempty"`
  15727. // CreationTimestamp: [Deprecated] This field is deprecated.
  15728. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15729. // Description: [Output Only] A textual description of the operation,
  15730. // which is set when the operation is created.
  15731. Description string `json:"description,omitempty"`
  15732. // EndTime: [Output Only] The time that this operation was completed.
  15733. // This value is in RFC3339 text format.
  15734. EndTime string `json:"endTime,omitempty"`
  15735. // Error: [Output Only] If errors are generated during processing of the
  15736. // operation, this field will be populated.
  15737. Error *OperationError `json:"error,omitempty"`
  15738. // HttpErrorMessage: [Output Only] If the operation fails, this field
  15739. // contains the HTTP error message that was returned, such as NOT FOUND.
  15740. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  15741. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  15742. // contains the HTTP error status code that was returned. For example, a
  15743. // 404 means the resource was not found.
  15744. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  15745. // Id: [Output Only] The unique identifier for the resource. This
  15746. // identifier is defined by the server.
  15747. Id uint64 `json:"id,omitempty,string"`
  15748. // InsertTime: [Output Only] The time that this operation was requested.
  15749. // This value is in RFC3339 text format.
  15750. InsertTime string `json:"insertTime,omitempty"`
  15751. // Kind: [Output Only] Type of the resource. Always compute#operation
  15752. // for Operation resources.
  15753. Kind string `json:"kind,omitempty"`
  15754. // Name: [Output Only] Name of the resource.
  15755. Name string `json:"name,omitempty"`
  15756. // OperationType: [Output Only] The type of operation, such as insert,
  15757. // update, or delete, and so on.
  15758. OperationType string `json:"operationType,omitempty"`
  15759. // Progress: [Output Only] An optional progress indicator that ranges
  15760. // from 0 to 100. There is no requirement that this be linear or support
  15761. // any granularity of operations. This should not be used to guess when
  15762. // the operation will be complete. This number should monotonically
  15763. // increase as the operation progresses.
  15764. Progress int64 `json:"progress,omitempty"`
  15765. // Region: [Output Only] The URL of the region where the operation
  15766. // resides. Only available when performing regional operations. You must
  15767. // specify this field as part of the HTTP request URL. It is not
  15768. // settable as a field in the request body.
  15769. Region string `json:"region,omitempty"`
  15770. // SelfLink: [Output Only] Server-defined URL for the resource.
  15771. SelfLink string `json:"selfLink,omitempty"`
  15772. // StartTime: [Output Only] The time that this operation was started by
  15773. // the server. This value is in RFC3339 text format.
  15774. StartTime string `json:"startTime,omitempty"`
  15775. // Status: [Output Only] The status of the operation, which can be one
  15776. // of the following: PENDING, RUNNING, or DONE.
  15777. //
  15778. // Possible values:
  15779. // "DONE"
  15780. // "PENDING"
  15781. // "RUNNING"
  15782. Status string `json:"status,omitempty"`
  15783. // StatusMessage: [Output Only] An optional textual description of the
  15784. // current status of the operation.
  15785. StatusMessage string `json:"statusMessage,omitempty"`
  15786. // TargetId: [Output Only] The unique target ID, which identifies a
  15787. // specific incarnation of the target resource.
  15788. TargetId uint64 `json:"targetId,omitempty,string"`
  15789. // TargetLink: [Output Only] The URL of the resource that the operation
  15790. // modifies. For operations related to creating a snapshot, this points
  15791. // to the persistent disk that the snapshot was created from.
  15792. TargetLink string `json:"targetLink,omitempty"`
  15793. // User: [Output Only] User who requested the operation, for example:
  15794. // user@example.com.
  15795. User string `json:"user,omitempty"`
  15796. // Warnings: [Output Only] If warning messages are generated during
  15797. // processing of the operation, this field will be populated.
  15798. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  15799. // Zone: [Output Only] The URL of the zone where the operation resides.
  15800. // Only available when performing per-zone operations. You must specify
  15801. // this field as part of the HTTP request URL. It is not settable as a
  15802. // field in the request body.
  15803. Zone string `json:"zone,omitempty"`
  15804. // ServerResponse contains the HTTP response code and headers from the
  15805. // server.
  15806. googleapi.ServerResponse `json:"-"`
  15807. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  15808. // to unconditionally include in API requests. By default, fields with
  15809. // empty values are omitted from API requests. However, any non-pointer,
  15810. // non-interface field appearing in ForceSendFields will be sent to the
  15811. // server regardless of whether the field is empty or not. This may be
  15812. // used to include empty fields in Patch requests.
  15813. ForceSendFields []string `json:"-"`
  15814. // NullFields is a list of field names (e.g. "ClientOperationId") to
  15815. // include in API requests with the JSON null value. By default, fields
  15816. // with empty values are omitted from API requests. However, any field
  15817. // with an empty value appearing in NullFields will be sent to the
  15818. // server as null. It is an error if a field in this list has a
  15819. // non-empty value. This may be used to include null fields in Patch
  15820. // requests.
  15821. NullFields []string `json:"-"`
  15822. }
  15823. func (s *Operation) MarshalJSON() ([]byte, error) {
  15824. type NoMethod Operation
  15825. raw := NoMethod(*s)
  15826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15827. }
  15828. // OperationError: [Output Only] If errors are generated during
  15829. // processing of the operation, this field will be populated.
  15830. type OperationError struct {
  15831. // Errors: [Output Only] The array of errors encountered while
  15832. // processing this operation.
  15833. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  15834. // ForceSendFields is a list of field names (e.g. "Errors") to
  15835. // unconditionally include in API requests. By default, fields with
  15836. // empty values are omitted from API requests. However, any non-pointer,
  15837. // non-interface field appearing in ForceSendFields will be sent to the
  15838. // server regardless of whether the field is empty or not. This may be
  15839. // used to include empty fields in Patch requests.
  15840. ForceSendFields []string `json:"-"`
  15841. // NullFields is a list of field names (e.g. "Errors") to include in API
  15842. // requests with the JSON null value. By default, fields with empty
  15843. // values are omitted from API requests. However, any field with an
  15844. // empty value appearing in NullFields will be sent to the server as
  15845. // null. It is an error if a field in this list has a non-empty value.
  15846. // This may be used to include null fields in Patch requests.
  15847. NullFields []string `json:"-"`
  15848. }
  15849. func (s *OperationError) MarshalJSON() ([]byte, error) {
  15850. type NoMethod OperationError
  15851. raw := NoMethod(*s)
  15852. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15853. }
  15854. type OperationErrorErrors struct {
  15855. // Code: [Output Only] The error type identifier for this error.
  15856. Code string `json:"code,omitempty"`
  15857. // Location: [Output Only] Indicates the field in the request that
  15858. // caused the error. This property is optional.
  15859. Location string `json:"location,omitempty"`
  15860. // Message: [Output Only] An optional, human-readable error message.
  15861. Message string `json:"message,omitempty"`
  15862. // ForceSendFields is a list of field names (e.g. "Code") to
  15863. // unconditionally include in API requests. By default, fields with
  15864. // empty values are omitted from API requests. However, any non-pointer,
  15865. // non-interface field appearing in ForceSendFields will be sent to the
  15866. // server regardless of whether the field is empty or not. This may be
  15867. // used to include empty fields in Patch requests.
  15868. ForceSendFields []string `json:"-"`
  15869. // NullFields is a list of field names (e.g. "Code") to include in API
  15870. // requests with the JSON null value. By default, fields with empty
  15871. // values are omitted from API requests. However, any field with an
  15872. // empty value appearing in NullFields will be sent to the server as
  15873. // null. It is an error if a field in this list has a non-empty value.
  15874. // This may be used to include null fields in Patch requests.
  15875. NullFields []string `json:"-"`
  15876. }
  15877. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  15878. type NoMethod OperationErrorErrors
  15879. raw := NoMethod(*s)
  15880. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15881. }
  15882. type OperationWarnings struct {
  15883. // Code: [Output Only] A warning code, if applicable. For example,
  15884. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15885. // the response.
  15886. //
  15887. // Possible values:
  15888. // "CLEANUP_FAILED"
  15889. // "DEPRECATED_RESOURCE_USED"
  15890. // "DEPRECATED_TYPE_USED"
  15891. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15892. // "EXPERIMENTAL_TYPE_USED"
  15893. // "EXTERNAL_API_WARNING"
  15894. // "FIELD_VALUE_OVERRIDEN"
  15895. // "INJECTED_KERNELS_DEPRECATED"
  15896. // "MISSING_TYPE_DEPENDENCY"
  15897. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15898. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15899. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15900. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15901. // "NEXT_HOP_NOT_RUNNING"
  15902. // "NOT_CRITICAL_ERROR"
  15903. // "NO_RESULTS_ON_PAGE"
  15904. // "REQUIRED_TOS_AGREEMENT"
  15905. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15906. // "RESOURCE_NOT_DELETED"
  15907. // "SCHEMA_VALIDATION_IGNORED"
  15908. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15909. // "UNDECLARED_PROPERTIES"
  15910. // "UNREACHABLE"
  15911. Code string `json:"code,omitempty"`
  15912. // Data: [Output Only] Metadata about this warning in key: value format.
  15913. // For example:
  15914. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15915. Data []*OperationWarningsData `json:"data,omitempty"`
  15916. // Message: [Output Only] A human-readable description of the warning
  15917. // code.
  15918. Message string `json:"message,omitempty"`
  15919. // ForceSendFields is a list of field names (e.g. "Code") to
  15920. // unconditionally include in API requests. By default, fields with
  15921. // empty values are omitted from API requests. However, any non-pointer,
  15922. // non-interface field appearing in ForceSendFields will be sent to the
  15923. // server regardless of whether the field is empty or not. This may be
  15924. // used to include empty fields in Patch requests.
  15925. ForceSendFields []string `json:"-"`
  15926. // NullFields is a list of field names (e.g. "Code") to include in API
  15927. // requests with the JSON null value. By default, fields with empty
  15928. // values are omitted from API requests. However, any field with an
  15929. // empty value appearing in NullFields will be sent to the server as
  15930. // null. It is an error if a field in this list has a non-empty value.
  15931. // This may be used to include null fields in Patch requests.
  15932. NullFields []string `json:"-"`
  15933. }
  15934. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  15935. type NoMethod OperationWarnings
  15936. raw := NoMethod(*s)
  15937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15938. }
  15939. type OperationWarningsData struct {
  15940. // Key: [Output Only] A key that provides more detail on the warning
  15941. // being returned. For example, for warnings where there are no results
  15942. // in a list request for a particular zone, this key might be scope and
  15943. // the key value might be the zone name. Other examples might be a key
  15944. // indicating a deprecated resource and a suggested replacement, or a
  15945. // warning about invalid network settings (for example, if an instance
  15946. // attempts to perform IP forwarding but is not enabled for IP
  15947. // forwarding).
  15948. Key string `json:"key,omitempty"`
  15949. // Value: [Output Only] A warning data value corresponding to the key.
  15950. Value string `json:"value,omitempty"`
  15951. // ForceSendFields is a list of field names (e.g. "Key") to
  15952. // unconditionally include in API requests. By default, fields with
  15953. // empty values are omitted from API requests. However, any non-pointer,
  15954. // non-interface field appearing in ForceSendFields will be sent to the
  15955. // server regardless of whether the field is empty or not. This may be
  15956. // used to include empty fields in Patch requests.
  15957. ForceSendFields []string `json:"-"`
  15958. // NullFields is a list of field names (e.g. "Key") to include in API
  15959. // requests with the JSON null value. By default, fields with empty
  15960. // values are omitted from API requests. However, any field with an
  15961. // empty value appearing in NullFields will be sent to the server as
  15962. // null. It is an error if a field in this list has a non-empty value.
  15963. // This may be used to include null fields in Patch requests.
  15964. NullFields []string `json:"-"`
  15965. }
  15966. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  15967. type NoMethod OperationWarningsData
  15968. raw := NoMethod(*s)
  15969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15970. }
  15971. type OperationAggregatedList struct {
  15972. // Id: [Output Only] The unique identifier for the resource. This
  15973. // identifier is defined by the server.
  15974. Id string `json:"id,omitempty"`
  15975. // Items: [Output Only] A map of scoped operation lists.
  15976. Items map[string]OperationsScopedList `json:"items,omitempty"`
  15977. // Kind: [Output Only] Type of resource. Always
  15978. // compute#operationAggregatedList for aggregated lists of operations.
  15979. Kind string `json:"kind,omitempty"`
  15980. // NextPageToken: [Output Only] This token allows you to get the next
  15981. // page of results for list requests. If the number of results is larger
  15982. // than maxResults, use the nextPageToken as a value for the query
  15983. // parameter pageToken in the next list request. Subsequent list
  15984. // requests will have their own nextPageToken to continue paging through
  15985. // the results.
  15986. NextPageToken string `json:"nextPageToken,omitempty"`
  15987. // SelfLink: [Output Only] Server-defined URL for this resource.
  15988. SelfLink string `json:"selfLink,omitempty"`
  15989. // Warning: [Output Only] Informational warning message.
  15990. Warning *OperationAggregatedListWarning `json:"warning,omitempty"`
  15991. // ServerResponse contains the HTTP response code and headers from the
  15992. // server.
  15993. googleapi.ServerResponse `json:"-"`
  15994. // ForceSendFields is a list of field names (e.g. "Id") to
  15995. // unconditionally include in API requests. By default, fields with
  15996. // empty values are omitted from API requests. However, any non-pointer,
  15997. // non-interface field appearing in ForceSendFields will be sent to the
  15998. // server regardless of whether the field is empty or not. This may be
  15999. // used to include empty fields in Patch requests.
  16000. ForceSendFields []string `json:"-"`
  16001. // NullFields is a list of field names (e.g. "Id") to include in API
  16002. // requests with the JSON null value. By default, fields with empty
  16003. // values are omitted from API requests. However, any field with an
  16004. // empty value appearing in NullFields will be sent to the server as
  16005. // null. It is an error if a field in this list has a non-empty value.
  16006. // This may be used to include null fields in Patch requests.
  16007. NullFields []string `json:"-"`
  16008. }
  16009. func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) {
  16010. type NoMethod OperationAggregatedList
  16011. raw := NoMethod(*s)
  16012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16013. }
  16014. // OperationAggregatedListWarning: [Output Only] Informational warning
  16015. // message.
  16016. type OperationAggregatedListWarning struct {
  16017. // Code: [Output Only] A warning code, if applicable. For example,
  16018. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16019. // the response.
  16020. //
  16021. // Possible values:
  16022. // "CLEANUP_FAILED"
  16023. // "DEPRECATED_RESOURCE_USED"
  16024. // "DEPRECATED_TYPE_USED"
  16025. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16026. // "EXPERIMENTAL_TYPE_USED"
  16027. // "EXTERNAL_API_WARNING"
  16028. // "FIELD_VALUE_OVERRIDEN"
  16029. // "INJECTED_KERNELS_DEPRECATED"
  16030. // "MISSING_TYPE_DEPENDENCY"
  16031. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16032. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16033. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16034. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16035. // "NEXT_HOP_NOT_RUNNING"
  16036. // "NOT_CRITICAL_ERROR"
  16037. // "NO_RESULTS_ON_PAGE"
  16038. // "REQUIRED_TOS_AGREEMENT"
  16039. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16040. // "RESOURCE_NOT_DELETED"
  16041. // "SCHEMA_VALIDATION_IGNORED"
  16042. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16043. // "UNDECLARED_PROPERTIES"
  16044. // "UNREACHABLE"
  16045. Code string `json:"code,omitempty"`
  16046. // Data: [Output Only] Metadata about this warning in key: value format.
  16047. // For example:
  16048. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16049. Data []*OperationAggregatedListWarningData `json:"data,omitempty"`
  16050. // Message: [Output Only] A human-readable description of the warning
  16051. // code.
  16052. Message string `json:"message,omitempty"`
  16053. // ForceSendFields is a list of field names (e.g. "Code") to
  16054. // unconditionally include in API requests. By default, fields with
  16055. // empty values are omitted from API requests. However, any non-pointer,
  16056. // non-interface field appearing in ForceSendFields will be sent to the
  16057. // server regardless of whether the field is empty or not. This may be
  16058. // used to include empty fields in Patch requests.
  16059. ForceSendFields []string `json:"-"`
  16060. // NullFields is a list of field names (e.g. "Code") to include in API
  16061. // requests with the JSON null value. By default, fields with empty
  16062. // values are omitted from API requests. However, any field with an
  16063. // empty value appearing in NullFields will be sent to the server as
  16064. // null. It is an error if a field in this list has a non-empty value.
  16065. // This may be used to include null fields in Patch requests.
  16066. NullFields []string `json:"-"`
  16067. }
  16068. func (s *OperationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  16069. type NoMethod OperationAggregatedListWarning
  16070. raw := NoMethod(*s)
  16071. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16072. }
  16073. type OperationAggregatedListWarningData struct {
  16074. // Key: [Output Only] A key that provides more detail on the warning
  16075. // being returned. For example, for warnings where there are no results
  16076. // in a list request for a particular zone, this key might be scope and
  16077. // the key value might be the zone name. Other examples might be a key
  16078. // indicating a deprecated resource and a suggested replacement, or a
  16079. // warning about invalid network settings (for example, if an instance
  16080. // attempts to perform IP forwarding but is not enabled for IP
  16081. // forwarding).
  16082. Key string `json:"key,omitempty"`
  16083. // Value: [Output Only] A warning data value corresponding to the key.
  16084. Value string `json:"value,omitempty"`
  16085. // ForceSendFields is a list of field names (e.g. "Key") to
  16086. // unconditionally include in API requests. By default, fields with
  16087. // empty values are omitted from API requests. However, any non-pointer,
  16088. // non-interface field appearing in ForceSendFields will be sent to the
  16089. // server regardless of whether the field is empty or not. This may be
  16090. // used to include empty fields in Patch requests.
  16091. ForceSendFields []string `json:"-"`
  16092. // NullFields is a list of field names (e.g. "Key") to include in API
  16093. // requests with the JSON null value. By default, fields with empty
  16094. // values are omitted from API requests. However, any field with an
  16095. // empty value appearing in NullFields will be sent to the server as
  16096. // null. It is an error if a field in this list has a non-empty value.
  16097. // This may be used to include null fields in Patch requests.
  16098. NullFields []string `json:"-"`
  16099. }
  16100. func (s *OperationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  16101. type NoMethod OperationAggregatedListWarningData
  16102. raw := NoMethod(*s)
  16103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16104. }
  16105. // OperationList: Contains a list of Operation resources.
  16106. type OperationList struct {
  16107. // Id: [Output Only] The unique identifier for the resource. This
  16108. // identifier is defined by the server.
  16109. Id string `json:"id,omitempty"`
  16110. // Items: [Output Only] A list of Operation resources.
  16111. Items []*Operation `json:"items,omitempty"`
  16112. // Kind: [Output Only] Type of resource. Always compute#operations for
  16113. // Operations resource.
  16114. Kind string `json:"kind,omitempty"`
  16115. // NextPageToken: [Output Only] This token allows you to get the next
  16116. // page of results for list requests. If the number of results is larger
  16117. // than maxResults, use the nextPageToken as a value for the query
  16118. // parameter pageToken in the next list request. Subsequent list
  16119. // requests will have their own nextPageToken to continue paging through
  16120. // the results.
  16121. NextPageToken string `json:"nextPageToken,omitempty"`
  16122. // SelfLink: [Output Only] Server-defined URL for this resource.
  16123. SelfLink string `json:"selfLink,omitempty"`
  16124. // Warning: [Output Only] Informational warning message.
  16125. Warning *OperationListWarning `json:"warning,omitempty"`
  16126. // ServerResponse contains the HTTP response code and headers from the
  16127. // server.
  16128. googleapi.ServerResponse `json:"-"`
  16129. // ForceSendFields is a list of field names (e.g. "Id") to
  16130. // unconditionally include in API requests. By default, fields with
  16131. // empty values are omitted from API requests. However, any non-pointer,
  16132. // non-interface field appearing in ForceSendFields will be sent to the
  16133. // server regardless of whether the field is empty or not. This may be
  16134. // used to include empty fields in Patch requests.
  16135. ForceSendFields []string `json:"-"`
  16136. // NullFields is a list of field names (e.g. "Id") to include in API
  16137. // requests with the JSON null value. By default, fields with empty
  16138. // values are omitted from API requests. However, any field with an
  16139. // empty value appearing in NullFields will be sent to the server as
  16140. // null. It is an error if a field in this list has a non-empty value.
  16141. // This may be used to include null fields in Patch requests.
  16142. NullFields []string `json:"-"`
  16143. }
  16144. func (s *OperationList) MarshalJSON() ([]byte, error) {
  16145. type NoMethod OperationList
  16146. raw := NoMethod(*s)
  16147. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16148. }
  16149. // OperationListWarning: [Output Only] Informational warning message.
  16150. type OperationListWarning struct {
  16151. // Code: [Output Only] A warning code, if applicable. For example,
  16152. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16153. // the response.
  16154. //
  16155. // Possible values:
  16156. // "CLEANUP_FAILED"
  16157. // "DEPRECATED_RESOURCE_USED"
  16158. // "DEPRECATED_TYPE_USED"
  16159. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16160. // "EXPERIMENTAL_TYPE_USED"
  16161. // "EXTERNAL_API_WARNING"
  16162. // "FIELD_VALUE_OVERRIDEN"
  16163. // "INJECTED_KERNELS_DEPRECATED"
  16164. // "MISSING_TYPE_DEPENDENCY"
  16165. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16166. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16167. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16168. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16169. // "NEXT_HOP_NOT_RUNNING"
  16170. // "NOT_CRITICAL_ERROR"
  16171. // "NO_RESULTS_ON_PAGE"
  16172. // "REQUIRED_TOS_AGREEMENT"
  16173. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16174. // "RESOURCE_NOT_DELETED"
  16175. // "SCHEMA_VALIDATION_IGNORED"
  16176. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16177. // "UNDECLARED_PROPERTIES"
  16178. // "UNREACHABLE"
  16179. Code string `json:"code,omitempty"`
  16180. // Data: [Output Only] Metadata about this warning in key: value format.
  16181. // For example:
  16182. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16183. Data []*OperationListWarningData `json:"data,omitempty"`
  16184. // Message: [Output Only] A human-readable description of the warning
  16185. // code.
  16186. Message string `json:"message,omitempty"`
  16187. // ForceSendFields is a list of field names (e.g. "Code") to
  16188. // unconditionally include in API requests. By default, fields with
  16189. // empty values are omitted from API requests. However, any non-pointer,
  16190. // non-interface field appearing in ForceSendFields will be sent to the
  16191. // server regardless of whether the field is empty or not. This may be
  16192. // used to include empty fields in Patch requests.
  16193. ForceSendFields []string `json:"-"`
  16194. // NullFields is a list of field names (e.g. "Code") to include in API
  16195. // requests with the JSON null value. By default, fields with empty
  16196. // values are omitted from API requests. However, any field with an
  16197. // empty value appearing in NullFields will be sent to the server as
  16198. // null. It is an error if a field in this list has a non-empty value.
  16199. // This may be used to include null fields in Patch requests.
  16200. NullFields []string `json:"-"`
  16201. }
  16202. func (s *OperationListWarning) MarshalJSON() ([]byte, error) {
  16203. type NoMethod OperationListWarning
  16204. raw := NoMethod(*s)
  16205. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16206. }
  16207. type OperationListWarningData struct {
  16208. // Key: [Output Only] A key that provides more detail on the warning
  16209. // being returned. For example, for warnings where there are no results
  16210. // in a list request for a particular zone, this key might be scope and
  16211. // the key value might be the zone name. Other examples might be a key
  16212. // indicating a deprecated resource and a suggested replacement, or a
  16213. // warning about invalid network settings (for example, if an instance
  16214. // attempts to perform IP forwarding but is not enabled for IP
  16215. // forwarding).
  16216. Key string `json:"key,omitempty"`
  16217. // Value: [Output Only] A warning data value corresponding to the key.
  16218. Value string `json:"value,omitempty"`
  16219. // ForceSendFields is a list of field names (e.g. "Key") to
  16220. // unconditionally include in API requests. By default, fields with
  16221. // empty values are omitted from API requests. However, any non-pointer,
  16222. // non-interface field appearing in ForceSendFields will be sent to the
  16223. // server regardless of whether the field is empty or not. This may be
  16224. // used to include empty fields in Patch requests.
  16225. ForceSendFields []string `json:"-"`
  16226. // NullFields is a list of field names (e.g. "Key") to include in API
  16227. // requests with the JSON null value. By default, fields with empty
  16228. // values are omitted from API requests. However, any field with an
  16229. // empty value appearing in NullFields will be sent to the server as
  16230. // null. It is an error if a field in this list has a non-empty value.
  16231. // This may be used to include null fields in Patch requests.
  16232. NullFields []string `json:"-"`
  16233. }
  16234. func (s *OperationListWarningData) MarshalJSON() ([]byte, error) {
  16235. type NoMethod OperationListWarningData
  16236. raw := NoMethod(*s)
  16237. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16238. }
  16239. type OperationsScopedList struct {
  16240. // Operations: [Output Only] A list of operations contained in this
  16241. // scope.
  16242. Operations []*Operation `json:"operations,omitempty"`
  16243. // Warning: [Output Only] Informational warning which replaces the list
  16244. // of operations when the list is empty.
  16245. Warning *OperationsScopedListWarning `json:"warning,omitempty"`
  16246. // ForceSendFields is a list of field names (e.g. "Operations") to
  16247. // unconditionally include in API requests. By default, fields with
  16248. // empty values are omitted from API requests. However, any non-pointer,
  16249. // non-interface field appearing in ForceSendFields will be sent to the
  16250. // server regardless of whether the field is empty or not. This may be
  16251. // used to include empty fields in Patch requests.
  16252. ForceSendFields []string `json:"-"`
  16253. // NullFields is a list of field names (e.g. "Operations") to include in
  16254. // API requests with the JSON null value. By default, fields with empty
  16255. // values are omitted from API requests. However, any field with an
  16256. // empty value appearing in NullFields will be sent to the server as
  16257. // null. It is an error if a field in this list has a non-empty value.
  16258. // This may be used to include null fields in Patch requests.
  16259. NullFields []string `json:"-"`
  16260. }
  16261. func (s *OperationsScopedList) MarshalJSON() ([]byte, error) {
  16262. type NoMethod OperationsScopedList
  16263. raw := NoMethod(*s)
  16264. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16265. }
  16266. // OperationsScopedListWarning: [Output Only] Informational warning
  16267. // which replaces the list of operations when the list is empty.
  16268. type OperationsScopedListWarning struct {
  16269. // Code: [Output Only] A warning code, if applicable. For example,
  16270. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16271. // the response.
  16272. //
  16273. // Possible values:
  16274. // "CLEANUP_FAILED"
  16275. // "DEPRECATED_RESOURCE_USED"
  16276. // "DEPRECATED_TYPE_USED"
  16277. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16278. // "EXPERIMENTAL_TYPE_USED"
  16279. // "EXTERNAL_API_WARNING"
  16280. // "FIELD_VALUE_OVERRIDEN"
  16281. // "INJECTED_KERNELS_DEPRECATED"
  16282. // "MISSING_TYPE_DEPENDENCY"
  16283. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16284. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16285. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16286. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16287. // "NEXT_HOP_NOT_RUNNING"
  16288. // "NOT_CRITICAL_ERROR"
  16289. // "NO_RESULTS_ON_PAGE"
  16290. // "REQUIRED_TOS_AGREEMENT"
  16291. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16292. // "RESOURCE_NOT_DELETED"
  16293. // "SCHEMA_VALIDATION_IGNORED"
  16294. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16295. // "UNDECLARED_PROPERTIES"
  16296. // "UNREACHABLE"
  16297. Code string `json:"code,omitempty"`
  16298. // Data: [Output Only] Metadata about this warning in key: value format.
  16299. // For example:
  16300. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16301. Data []*OperationsScopedListWarningData `json:"data,omitempty"`
  16302. // Message: [Output Only] A human-readable description of the warning
  16303. // code.
  16304. Message string `json:"message,omitempty"`
  16305. // ForceSendFields is a list of field names (e.g. "Code") to
  16306. // unconditionally include in API requests. By default, fields with
  16307. // empty values are omitted from API requests. However, any non-pointer,
  16308. // non-interface field appearing in ForceSendFields will be sent to the
  16309. // server regardless of whether the field is empty or not. This may be
  16310. // used to include empty fields in Patch requests.
  16311. ForceSendFields []string `json:"-"`
  16312. // NullFields is a list of field names (e.g. "Code") to include in API
  16313. // requests with the JSON null value. By default, fields with empty
  16314. // values are omitted from API requests. However, any field with an
  16315. // empty value appearing in NullFields will be sent to the server as
  16316. // null. It is an error if a field in this list has a non-empty value.
  16317. // This may be used to include null fields in Patch requests.
  16318. NullFields []string `json:"-"`
  16319. }
  16320. func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
  16321. type NoMethod OperationsScopedListWarning
  16322. raw := NoMethod(*s)
  16323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16324. }
  16325. type OperationsScopedListWarningData struct {
  16326. // Key: [Output Only] A key that provides more detail on the warning
  16327. // being returned. For example, for warnings where there are no results
  16328. // in a list request for a particular zone, this key might be scope and
  16329. // the key value might be the zone name. Other examples might be a key
  16330. // indicating a deprecated resource and a suggested replacement, or a
  16331. // warning about invalid network settings (for example, if an instance
  16332. // attempts to perform IP forwarding but is not enabled for IP
  16333. // forwarding).
  16334. Key string `json:"key,omitempty"`
  16335. // Value: [Output Only] A warning data value corresponding to the key.
  16336. Value string `json:"value,omitempty"`
  16337. // ForceSendFields is a list of field names (e.g. "Key") to
  16338. // unconditionally include in API requests. By default, fields with
  16339. // empty values are omitted from API requests. However, any non-pointer,
  16340. // non-interface field appearing in ForceSendFields will be sent to the
  16341. // server regardless of whether the field is empty or not. This may be
  16342. // used to include empty fields in Patch requests.
  16343. ForceSendFields []string `json:"-"`
  16344. // NullFields is a list of field names (e.g. "Key") to include in API
  16345. // requests with the JSON null value. By default, fields with empty
  16346. // values are omitted from API requests. However, any field with an
  16347. // empty value appearing in NullFields will be sent to the server as
  16348. // null. It is an error if a field in this list has a non-empty value.
  16349. // This may be used to include null fields in Patch requests.
  16350. NullFields []string `json:"-"`
  16351. }
  16352. func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  16353. type NoMethod OperationsScopedListWarningData
  16354. raw := NoMethod(*s)
  16355. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16356. }
  16357. // PathMatcher: A matcher for the path portion of the URL. The
  16358. // BackendService from the longest-matched rule will serve the URL. If
  16359. // no rule was matched, the default service will be used.
  16360. type PathMatcher struct {
  16361. // DefaultService: The full or partial URL to the BackendService
  16362. // resource. This will be used if none of the pathRules or routeRules
  16363. // defined by this PathMatcher are matched. For example, the following
  16364. // are all valid URLs to a BackendService resource:
  16365. // -
  16366. // https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService
  16367. // - compute/v1/projects/project/global/backendServices/backendService
  16368. //
  16369. // - global/backendServices/backendService If defaultRouteAction is
  16370. // additionally specified, advanced routing actions like URL Rewrites,
  16371. // etc. take effect prior to sending the request to the backend.
  16372. // However, if defaultService is specified, defaultRouteAction cannot
  16373. // contain any weightedBackendServices. Conversely, if
  16374. // defaultRouteAction specifies any weightedBackendServices,
  16375. // defaultService must not be specified.
  16376. // Only one of defaultService, defaultUrlRedirect or
  16377. // defaultRouteAction.weightedBackendService must be set.
  16378. // Authorization requires one or more of the following Google IAM
  16379. // permissions on the specified resource default_service:
  16380. // - compute.backendBuckets.use
  16381. // - compute.backendServices.use
  16382. DefaultService string `json:"defaultService,omitempty"`
  16383. // Description: An optional description of this resource. Provide this
  16384. // property when you create the resource.
  16385. Description string `json:"description,omitempty"`
  16386. // Name: The name to which this PathMatcher is referred by the HostRule.
  16387. Name string `json:"name,omitempty"`
  16388. // PathRules: The list of path rules. Use this list instead of
  16389. // routeRules when routing based on simple path matching is all that's
  16390. // required. The order by which path rules are specified does not
  16391. // matter. Matches are always done on the longest-path-first basis.
  16392. // For example: a pathRule with a path /a/b/c/* will match before /a/b/*
  16393. // irrespective of the order in which those paths appear in this
  16394. // list.
  16395. // Only one of pathRules or routeRules must be set.
  16396. PathRules []*PathRule `json:"pathRules,omitempty"`
  16397. // ForceSendFields is a list of field names (e.g. "DefaultService") to
  16398. // unconditionally include in API requests. By default, fields with
  16399. // empty values are omitted from API requests. However, any non-pointer,
  16400. // non-interface field appearing in ForceSendFields will be sent to the
  16401. // server regardless of whether the field is empty or not. This may be
  16402. // used to include empty fields in Patch requests.
  16403. ForceSendFields []string `json:"-"`
  16404. // NullFields is a list of field names (e.g. "DefaultService") to
  16405. // include in API requests with the JSON null value. By default, fields
  16406. // with empty values are omitted from API requests. However, any field
  16407. // with an empty value appearing in NullFields will be sent to the
  16408. // server as null. It is an error if a field in this list has a
  16409. // non-empty value. This may be used to include null fields in Patch
  16410. // requests.
  16411. NullFields []string `json:"-"`
  16412. }
  16413. func (s *PathMatcher) MarshalJSON() ([]byte, error) {
  16414. type NoMethod PathMatcher
  16415. raw := NoMethod(*s)
  16416. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16417. }
  16418. // PathRule: A path-matching rule for a URL. If matched, will use the
  16419. // specified BackendService to handle the traffic arriving at this URL.
  16420. type PathRule struct {
  16421. // Paths: The list of path patterns to match. Each must start with / and
  16422. // the only place a * is allowed is at the end following a /. The string
  16423. // fed to the path matcher does not include any text after the first ?
  16424. // or #, and those chars are not allowed here.
  16425. Paths []string `json:"paths,omitempty"`
  16426. // Service: The full or partial URL of the backend service resource to
  16427. // which traffic is directed if this rule is matched. If routeAction is
  16428. // additionally specified, advanced routing actions like URL Rewrites,
  16429. // etc. take effect prior to sending the request to the backend.
  16430. // However, if service is specified, routeAction cannot contain any
  16431. // weightedBackendService s. Conversely, if routeAction specifies any
  16432. // weightedBackendServices, service must not be specified.
  16433. // Only one of urlRedirect, service or
  16434. // routeAction.weightedBackendService must be set.
  16435. Service string `json:"service,omitempty"`
  16436. // ForceSendFields is a list of field names (e.g. "Paths") to
  16437. // unconditionally include in API requests. By default, fields with
  16438. // empty values are omitted from API requests. However, any non-pointer,
  16439. // non-interface field appearing in ForceSendFields will be sent to the
  16440. // server regardless of whether the field is empty or not. This may be
  16441. // used to include empty fields in Patch requests.
  16442. ForceSendFields []string `json:"-"`
  16443. // NullFields is a list of field names (e.g. "Paths") to include in API
  16444. // requests with the JSON null value. By default, fields with empty
  16445. // values are omitted from API requests. However, any field with an
  16446. // empty value appearing in NullFields will be sent to the server as
  16447. // null. It is an error if a field in this list has a non-empty value.
  16448. // This may be used to include null fields in Patch requests.
  16449. NullFields []string `json:"-"`
  16450. }
  16451. func (s *PathRule) MarshalJSON() ([]byte, error) {
  16452. type NoMethod PathRule
  16453. raw := NoMethod(*s)
  16454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16455. }
  16456. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  16457. // used to specify access control policies for Cloud Platform
  16458. // resources.
  16459. //
  16460. //
  16461. //
  16462. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  16463. // of `members` to a `role`, where the members can be user accounts,
  16464. // Google groups, Google domains, and service accounts. A `role` is a
  16465. // named list of permissions defined by IAM.
  16466. //
  16467. // **JSON Example**
  16468. //
  16469. // { "bindings": [ { "role": "roles/owner", "members": [
  16470. // "user:mike@example.com", "group:admins@example.com",
  16471. // "domain:google.com",
  16472. // "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, {
  16473. // "role": "roles/viewer", "members": ["user:sean@example.com"] } ]
  16474. // }
  16475. //
  16476. // **YAML Example**
  16477. //
  16478. // bindings: - members: - user:mike@example.com -
  16479. // group:admins@example.com - domain:google.com -
  16480. // serviceAccount:my-other-app@appspot.gserviceaccount.com role:
  16481. // roles/owner - members: - user:sean@example.com role:
  16482. // roles/viewer
  16483. //
  16484. //
  16485. //
  16486. // For a description of IAM and its features, see the [IAM developer's
  16487. // guide](https://cloud.google.com/iam/docs).
  16488. type Policy struct {
  16489. // AuditConfigs: Specifies cloud audit logging configuration for this
  16490. // policy.
  16491. AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  16492. // Bindings: Associates a list of `members` to a `role`. `bindings` with
  16493. // no members will result in an error.
  16494. Bindings []*Binding `json:"bindings,omitempty"`
  16495. // Etag: `etag` is used for optimistic concurrency control as a way to
  16496. // help prevent simultaneous updates of a policy from overwriting each
  16497. // other. It is strongly suggested that systems make use of the `etag`
  16498. // in the read-modify-write cycle to perform policy updates in order to
  16499. // avoid race conditions: An `etag` is returned in the response to
  16500. // `getIamPolicy`, and systems are expected to put that etag in the
  16501. // request to `setIamPolicy` to ensure that their change will be applied
  16502. // to the same version of the policy.
  16503. //
  16504. // If no `etag` is provided in the call to `setIamPolicy`, then the
  16505. // existing policy is overwritten blindly.
  16506. Etag string `json:"etag,omitempty"`
  16507. IamOwned bool `json:"iamOwned,omitempty"`
  16508. // Rules: If more than one rule is specified, the rules are applied in
  16509. // the following manner: - All matching LOG rules are always applied. -
  16510. // If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging
  16511. // will be applied if one or more matching rule requires logging. -
  16512. // Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
  16513. // granted. Logging will be applied if one or more matching rule
  16514. // requires logging. - Otherwise, if no rule applies, permission is
  16515. // denied.
  16516. Rules []*Rule `json:"rules,omitempty"`
  16517. // Version: Deprecated.
  16518. Version int64 `json:"version,omitempty"`
  16519. // ServerResponse contains the HTTP response code and headers from the
  16520. // server.
  16521. googleapi.ServerResponse `json:"-"`
  16522. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  16523. // unconditionally include in API requests. By default, fields with
  16524. // empty values are omitted from API requests. However, any non-pointer,
  16525. // non-interface field appearing in ForceSendFields will be sent to the
  16526. // server regardless of whether the field is empty or not. This may be
  16527. // used to include empty fields in Patch requests.
  16528. ForceSendFields []string `json:"-"`
  16529. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  16530. // in API requests with the JSON null value. By default, fields with
  16531. // empty values are omitted from API requests. However, any field with
  16532. // an empty value appearing in NullFields will be sent to the server as
  16533. // null. It is an error if a field in this list has a non-empty value.
  16534. // This may be used to include null fields in Patch requests.
  16535. NullFields []string `json:"-"`
  16536. }
  16537. func (s *Policy) MarshalJSON() ([]byte, error) {
  16538. type NoMethod Policy
  16539. raw := NoMethod(*s)
  16540. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16541. }
  16542. // Project: A Project resource. For an overview of projects, see Cloud
  16543. // Platform Resource Hierarchy. (== resource_for v1.projects ==) (==
  16544. // resource_for beta.projects ==)
  16545. type Project struct {
  16546. // CommonInstanceMetadata: Metadata key/value pairs available to all
  16547. // instances contained in this project. See Custom metadata for more
  16548. // information.
  16549. CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"`
  16550. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16551. // format.
  16552. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16553. // DefaultNetworkTier: This signifies the default network tier used for
  16554. // configuring resources of the project and can only take the following
  16555. // values: PREMIUM, STANDARD. Initially the default network tier is
  16556. // PREMIUM.
  16557. //
  16558. // Possible values:
  16559. // "PREMIUM"
  16560. // "STANDARD"
  16561. DefaultNetworkTier string `json:"defaultNetworkTier,omitempty"`
  16562. // DefaultServiceAccount: [Output Only] Default service account used by
  16563. // VMs running in this project.
  16564. DefaultServiceAccount string `json:"defaultServiceAccount,omitempty"`
  16565. // Description: An optional textual description of the resource.
  16566. Description string `json:"description,omitempty"`
  16567. // EnabledFeatures: Restricted features enabled for use on this project.
  16568. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  16569. // Id: [Output Only] The unique identifier for the resource. This
  16570. // identifier is defined by the server. This is not the project ID, and
  16571. // is just a unique ID used by Compute Engine to identify resources.
  16572. Id uint64 `json:"id,omitempty,string"`
  16573. // Kind: [Output Only] Type of the resource. Always compute#project for
  16574. // projects.
  16575. Kind string `json:"kind,omitempty"`
  16576. // Name: The project ID. For example: my-example-project. Use the
  16577. // project ID to make requests to Compute Engine.
  16578. Name string `json:"name,omitempty"`
  16579. // Quotas: [Output Only] Quotas assigned to this project.
  16580. Quotas []*Quota `json:"quotas,omitempty"`
  16581. // SelfLink: [Output Only] Server-defined URL for the resource.
  16582. SelfLink string `json:"selfLink,omitempty"`
  16583. // UsageExportLocation: The naming prefix for daily usage reports and
  16584. // the Google Cloud Storage bucket where they are stored.
  16585. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"`
  16586. // XpnProjectStatus: [Output Only] The role this project has in a shared
  16587. // VPC configuration. Currently only HOST projects are differentiated.
  16588. //
  16589. // Possible values:
  16590. // "HOST"
  16591. // "UNSPECIFIED_XPN_PROJECT_STATUS"
  16592. XpnProjectStatus string `json:"xpnProjectStatus,omitempty"`
  16593. // ServerResponse contains the HTTP response code and headers from the
  16594. // server.
  16595. googleapi.ServerResponse `json:"-"`
  16596. // ForceSendFields is a list of field names (e.g.
  16597. // "CommonInstanceMetadata") to unconditionally include in API requests.
  16598. // By default, fields with empty values are omitted from API requests.
  16599. // However, any non-pointer, non-interface field appearing in
  16600. // ForceSendFields will be sent to the server regardless of whether the
  16601. // field is empty or not. This may be used to include empty fields in
  16602. // Patch requests.
  16603. ForceSendFields []string `json:"-"`
  16604. // NullFields is a list of field names (e.g. "CommonInstanceMetadata")
  16605. // to include in API requests with the JSON null value. By default,
  16606. // fields with empty values are omitted from API requests. However, any
  16607. // field with an empty value appearing in NullFields will be sent to the
  16608. // server as null. It is an error if a field in this list has a
  16609. // non-empty value. This may be used to include null fields in Patch
  16610. // requests.
  16611. NullFields []string `json:"-"`
  16612. }
  16613. func (s *Project) MarshalJSON() ([]byte, error) {
  16614. type NoMethod Project
  16615. raw := NoMethod(*s)
  16616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16617. }
  16618. type ProjectsDisableXpnResourceRequest struct {
  16619. // XpnResource: Service resource (a.k.a service project) ID.
  16620. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  16621. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  16622. // unconditionally include in API requests. By default, fields with
  16623. // empty values are omitted from API requests. However, any non-pointer,
  16624. // non-interface field appearing in ForceSendFields will be sent to the
  16625. // server regardless of whether the field is empty or not. This may be
  16626. // used to include empty fields in Patch requests.
  16627. ForceSendFields []string `json:"-"`
  16628. // NullFields is a list of field names (e.g. "XpnResource") to include
  16629. // in API requests with the JSON null value. By default, fields with
  16630. // empty values are omitted from API requests. However, any field with
  16631. // an empty value appearing in NullFields will be sent to the server as
  16632. // null. It is an error if a field in this list has a non-empty value.
  16633. // This may be used to include null fields in Patch requests.
  16634. NullFields []string `json:"-"`
  16635. }
  16636. func (s *ProjectsDisableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  16637. type NoMethod ProjectsDisableXpnResourceRequest
  16638. raw := NoMethod(*s)
  16639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16640. }
  16641. type ProjectsEnableXpnResourceRequest struct {
  16642. // XpnResource: Service resource (a.k.a service project) ID.
  16643. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  16644. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  16645. // unconditionally include in API requests. By default, fields with
  16646. // empty values are omitted from API requests. However, any non-pointer,
  16647. // non-interface field appearing in ForceSendFields will be sent to the
  16648. // server regardless of whether the field is empty or not. This may be
  16649. // used to include empty fields in Patch requests.
  16650. ForceSendFields []string `json:"-"`
  16651. // NullFields is a list of field names (e.g. "XpnResource") to include
  16652. // in API requests with the JSON null value. By default, fields with
  16653. // empty values are omitted from API requests. However, any field with
  16654. // an empty value appearing in NullFields will be sent to the server as
  16655. // null. It is an error if a field in this list has a non-empty value.
  16656. // This may be used to include null fields in Patch requests.
  16657. NullFields []string `json:"-"`
  16658. }
  16659. func (s *ProjectsEnableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  16660. type NoMethod ProjectsEnableXpnResourceRequest
  16661. raw := NoMethod(*s)
  16662. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16663. }
  16664. type ProjectsGetXpnResources struct {
  16665. // Kind: [Output Only] Type of resource. Always
  16666. // compute#projectsGetXpnResources for lists of service resources (a.k.a
  16667. // service projects)
  16668. Kind string `json:"kind,omitempty"`
  16669. // NextPageToken: [Output Only] This token allows you to get the next
  16670. // page of results for list requests. If the number of results is larger
  16671. // than maxResults, use the nextPageToken as a value for the query
  16672. // parameter pageToken in the next list request. Subsequent list
  16673. // requests will have their own nextPageToken to continue paging through
  16674. // the results.
  16675. NextPageToken string `json:"nextPageToken,omitempty"`
  16676. // Resources: Service resources (a.k.a service projects) attached to
  16677. // this project as their shared VPC host.
  16678. Resources []*XpnResourceId `json:"resources,omitempty"`
  16679. // ServerResponse contains the HTTP response code and headers from the
  16680. // server.
  16681. googleapi.ServerResponse `json:"-"`
  16682. // ForceSendFields is a list of field names (e.g. "Kind") to
  16683. // unconditionally include in API requests. By default, fields with
  16684. // empty values are omitted from API requests. However, any non-pointer,
  16685. // non-interface field appearing in ForceSendFields will be sent to the
  16686. // server regardless of whether the field is empty or not. This may be
  16687. // used to include empty fields in Patch requests.
  16688. ForceSendFields []string `json:"-"`
  16689. // NullFields is a list of field names (e.g. "Kind") to include in API
  16690. // requests with the JSON null value. By default, fields with empty
  16691. // values are omitted from API requests. However, any field with an
  16692. // empty value appearing in NullFields will be sent to the server as
  16693. // null. It is an error if a field in this list has a non-empty value.
  16694. // This may be used to include null fields in Patch requests.
  16695. NullFields []string `json:"-"`
  16696. }
  16697. func (s *ProjectsGetXpnResources) MarshalJSON() ([]byte, error) {
  16698. type NoMethod ProjectsGetXpnResources
  16699. raw := NoMethod(*s)
  16700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16701. }
  16702. type ProjectsListXpnHostsRequest struct {
  16703. // Organization: Optional organization ID managed by Cloud Resource
  16704. // Manager, for which to list shared VPC host projects. If not
  16705. // specified, the organization will be inferred from the project.
  16706. Organization string `json:"organization,omitempty"`
  16707. // ForceSendFields is a list of field names (e.g. "Organization") to
  16708. // unconditionally include in API requests. By default, fields with
  16709. // empty values are omitted from API requests. However, any non-pointer,
  16710. // non-interface field appearing in ForceSendFields will be sent to the
  16711. // server regardless of whether the field is empty or not. This may be
  16712. // used to include empty fields in Patch requests.
  16713. ForceSendFields []string `json:"-"`
  16714. // NullFields is a list of field names (e.g. "Organization") to include
  16715. // in API requests with the JSON null value. By default, fields with
  16716. // empty values are omitted from API requests. However, any field with
  16717. // an empty value appearing in NullFields will be sent to the server as
  16718. // null. It is an error if a field in this list has a non-empty value.
  16719. // This may be used to include null fields in Patch requests.
  16720. NullFields []string `json:"-"`
  16721. }
  16722. func (s *ProjectsListXpnHostsRequest) MarshalJSON() ([]byte, error) {
  16723. type NoMethod ProjectsListXpnHostsRequest
  16724. raw := NoMethod(*s)
  16725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16726. }
  16727. type ProjectsSetDefaultNetworkTierRequest struct {
  16728. // NetworkTier: Default network tier to be set.
  16729. //
  16730. // Possible values:
  16731. // "PREMIUM"
  16732. // "STANDARD"
  16733. NetworkTier string `json:"networkTier,omitempty"`
  16734. // ForceSendFields is a list of field names (e.g. "NetworkTier") to
  16735. // unconditionally include in API requests. By default, fields with
  16736. // empty values are omitted from API requests. However, any non-pointer,
  16737. // non-interface field appearing in ForceSendFields will be sent to the
  16738. // server regardless of whether the field is empty or not. This may be
  16739. // used to include empty fields in Patch requests.
  16740. ForceSendFields []string `json:"-"`
  16741. // NullFields is a list of field names (e.g. "NetworkTier") to include
  16742. // in API requests with the JSON null value. By default, fields with
  16743. // empty values are omitted from API requests. However, any field with
  16744. // an empty value appearing in NullFields will be sent to the server as
  16745. // null. It is an error if a field in this list has a non-empty value.
  16746. // This may be used to include null fields in Patch requests.
  16747. NullFields []string `json:"-"`
  16748. }
  16749. func (s *ProjectsSetDefaultNetworkTierRequest) MarshalJSON() ([]byte, error) {
  16750. type NoMethod ProjectsSetDefaultNetworkTierRequest
  16751. raw := NoMethod(*s)
  16752. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16753. }
  16754. // Quota: A quotas entry.
  16755. type Quota struct {
  16756. // Limit: [Output Only] Quota limit for this metric.
  16757. Limit float64 `json:"limit,omitempty"`
  16758. // Metric: [Output Only] Name of the quota metric.
  16759. //
  16760. // Possible values:
  16761. // "AUTOSCALERS"
  16762. // "BACKEND_BUCKETS"
  16763. // "BACKEND_SERVICES"
  16764. // "COMMITMENTS"
  16765. // "CPUS"
  16766. // "CPUS_ALL_REGIONS"
  16767. // "DISKS_TOTAL_GB"
  16768. // "FIREWALLS"
  16769. // "FORWARDING_RULES"
  16770. // "GLOBAL_INTERNAL_ADDRESSES"
  16771. // "GPUS_ALL_REGIONS"
  16772. // "HEALTH_CHECKS"
  16773. // "IMAGES"
  16774. // "INSTANCES"
  16775. // "INSTANCE_GROUPS"
  16776. // "INSTANCE_GROUP_MANAGERS"
  16777. // "INSTANCE_TEMPLATES"
  16778. // "INTERCONNECTS"
  16779. // "INTERCONNECT_ATTACHMENTS_PER_REGION"
  16780. // "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS"
  16781. // "INTERNAL_ADDRESSES"
  16782. // "IN_USE_ADDRESSES"
  16783. // "IN_USE_BACKUP_SCHEDULES"
  16784. // "IN_USE_SNAPSHOT_SCHEDULES"
  16785. // "LOCAL_SSD_TOTAL_GB"
  16786. // "NETWORKS"
  16787. // "NVIDIA_K80_GPUS"
  16788. // "NVIDIA_P100_GPUS"
  16789. // "NVIDIA_P100_VWS_GPUS"
  16790. // "NVIDIA_P4_GPUS"
  16791. // "NVIDIA_P4_VWS_GPUS"
  16792. // "NVIDIA_T4_GPUS"
  16793. // "NVIDIA_T4_VWS_GPUS"
  16794. // "NVIDIA_V100_GPUS"
  16795. // "PREEMPTIBLE_CPUS"
  16796. // "PREEMPTIBLE_LOCAL_SSD_GB"
  16797. // "PREEMPTIBLE_NVIDIA_K80_GPUS"
  16798. // "PREEMPTIBLE_NVIDIA_P100_GPUS"
  16799. // "PREEMPTIBLE_NVIDIA_P100_VWS_GPUS"
  16800. // "PREEMPTIBLE_NVIDIA_P4_GPUS"
  16801. // "PREEMPTIBLE_NVIDIA_P4_VWS_GPUS"
  16802. // "PREEMPTIBLE_NVIDIA_T4_GPUS"
  16803. // "PREEMPTIBLE_NVIDIA_T4_VWS_GPUS"
  16804. // "PREEMPTIBLE_NVIDIA_V100_GPUS"
  16805. // "REGIONAL_AUTOSCALERS"
  16806. // "REGIONAL_INSTANCE_GROUP_MANAGERS"
  16807. // "RESOURCE_POLICIES"
  16808. // "ROUTERS"
  16809. // "ROUTES"
  16810. // "SECURITY_POLICIES"
  16811. // "SECURITY_POLICY_RULES"
  16812. // "SNAPSHOTS"
  16813. // "SSD_TOTAL_GB"
  16814. // "SSL_CERTIFICATES"
  16815. // "STATIC_ADDRESSES"
  16816. // "SUBNETWORKS"
  16817. // "TARGET_HTTPS_PROXIES"
  16818. // "TARGET_HTTP_PROXIES"
  16819. // "TARGET_INSTANCES"
  16820. // "TARGET_POOLS"
  16821. // "TARGET_SSL_PROXIES"
  16822. // "TARGET_TCP_PROXIES"
  16823. // "TARGET_VPN_GATEWAYS"
  16824. // "URL_MAPS"
  16825. // "VPN_GATEWAYS"
  16826. // "VPN_TUNNELS"
  16827. Metric string `json:"metric,omitempty"`
  16828. // Owner: [Output Only] Owning resource. This is the resource on which
  16829. // this quota is applied.
  16830. Owner string `json:"owner,omitempty"`
  16831. // Usage: [Output Only] Current usage of this metric.
  16832. Usage float64 `json:"usage,omitempty"`
  16833. // ForceSendFields is a list of field names (e.g. "Limit") to
  16834. // unconditionally include in API requests. By default, fields with
  16835. // empty values are omitted from API requests. However, any non-pointer,
  16836. // non-interface field appearing in ForceSendFields will be sent to the
  16837. // server regardless of whether the field is empty or not. This may be
  16838. // used to include empty fields in Patch requests.
  16839. ForceSendFields []string `json:"-"`
  16840. // NullFields is a list of field names (e.g. "Limit") to include in API
  16841. // requests with the JSON null value. By default, fields with empty
  16842. // values are omitted from API requests. However, any field with an
  16843. // empty value appearing in NullFields will be sent to the server as
  16844. // null. It is an error if a field in this list has a non-empty value.
  16845. // This may be used to include null fields in Patch requests.
  16846. NullFields []string `json:"-"`
  16847. }
  16848. func (s *Quota) MarshalJSON() ([]byte, error) {
  16849. type NoMethod Quota
  16850. raw := NoMethod(*s)
  16851. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16852. }
  16853. func (s *Quota) UnmarshalJSON(data []byte) error {
  16854. type NoMethod Quota
  16855. var s1 struct {
  16856. Limit gensupport.JSONFloat64 `json:"limit"`
  16857. Usage gensupport.JSONFloat64 `json:"usage"`
  16858. *NoMethod
  16859. }
  16860. s1.NoMethod = (*NoMethod)(s)
  16861. if err := json.Unmarshal(data, &s1); err != nil {
  16862. return err
  16863. }
  16864. s.Limit = float64(s1.Limit)
  16865. s.Usage = float64(s1.Usage)
  16866. return nil
  16867. }
  16868. // Reference: Represents a reference to a resource.
  16869. type Reference struct {
  16870. // Kind: [Output Only] Type of the resource. Always compute#reference
  16871. // for references.
  16872. Kind string `json:"kind,omitempty"`
  16873. // ReferenceType: A description of the reference type with no implied
  16874. // semantics. Possible values include:
  16875. // - MEMBER_OF
  16876. ReferenceType string `json:"referenceType,omitempty"`
  16877. // Referrer: URL of the resource which refers to the target.
  16878. Referrer string `json:"referrer,omitempty"`
  16879. // Target: URL of the resource to which this reference points.
  16880. Target string `json:"target,omitempty"`
  16881. // ForceSendFields is a list of field names (e.g. "Kind") to
  16882. // unconditionally include in API requests. By default, fields with
  16883. // empty values are omitted from API requests. However, any non-pointer,
  16884. // non-interface field appearing in ForceSendFields will be sent to the
  16885. // server regardless of whether the field is empty or not. This may be
  16886. // used to include empty fields in Patch requests.
  16887. ForceSendFields []string `json:"-"`
  16888. // NullFields is a list of field names (e.g. "Kind") to include in API
  16889. // requests with the JSON null value. By default, fields with empty
  16890. // values are omitted from API requests. However, any field with an
  16891. // empty value appearing in NullFields will be sent to the server as
  16892. // null. It is an error if a field in this list has a non-empty value.
  16893. // This may be used to include null fields in Patch requests.
  16894. NullFields []string `json:"-"`
  16895. }
  16896. func (s *Reference) MarshalJSON() ([]byte, error) {
  16897. type NoMethod Reference
  16898. raw := NoMethod(*s)
  16899. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16900. }
  16901. // Region: Region resource. (== resource_for beta.regions ==) (==
  16902. // resource_for v1.regions ==)
  16903. type Region struct {
  16904. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16905. // format.
  16906. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16907. // Deprecated: [Output Only] The deprecation status associated with this
  16908. // region.
  16909. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  16910. // Description: [Output Only] Textual description of the resource.
  16911. Description string `json:"description,omitempty"`
  16912. // Id: [Output Only] The unique identifier for the resource. This
  16913. // identifier is defined by the server.
  16914. Id uint64 `json:"id,omitempty,string"`
  16915. // Kind: [Output Only] Type of the resource. Always compute#region for
  16916. // regions.
  16917. Kind string `json:"kind,omitempty"`
  16918. // Name: [Output Only] Name of the resource.
  16919. Name string `json:"name,omitempty"`
  16920. // Quotas: [Output Only] Quotas assigned to this region.
  16921. Quotas []*Quota `json:"quotas,omitempty"`
  16922. // SelfLink: [Output Only] Server-defined URL for the resource.
  16923. SelfLink string `json:"selfLink,omitempty"`
  16924. // Status: [Output Only] Status of the region, either UP or DOWN.
  16925. //
  16926. // Possible values:
  16927. // "DOWN"
  16928. // "UP"
  16929. Status string `json:"status,omitempty"`
  16930. // Zones: [Output Only] A list of zones available in this region, in the
  16931. // form of resource URLs.
  16932. Zones []string `json:"zones,omitempty"`
  16933. // ServerResponse contains the HTTP response code and headers from the
  16934. // server.
  16935. googleapi.ServerResponse `json:"-"`
  16936. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  16937. // to unconditionally include in API requests. By default, fields with
  16938. // empty values are omitted from API requests. However, any non-pointer,
  16939. // non-interface field appearing in ForceSendFields will be sent to the
  16940. // server regardless of whether the field is empty or not. This may be
  16941. // used to include empty fields in Patch requests.
  16942. ForceSendFields []string `json:"-"`
  16943. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  16944. // include in API requests with the JSON null value. By default, fields
  16945. // with empty values are omitted from API requests. However, any field
  16946. // with an empty value appearing in NullFields will be sent to the
  16947. // server as null. It is an error if a field in this list has a
  16948. // non-empty value. This may be used to include null fields in Patch
  16949. // requests.
  16950. NullFields []string `json:"-"`
  16951. }
  16952. func (s *Region) MarshalJSON() ([]byte, error) {
  16953. type NoMethod Region
  16954. raw := NoMethod(*s)
  16955. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16956. }
  16957. // RegionAutoscalerList: Contains a list of autoscalers.
  16958. type RegionAutoscalerList struct {
  16959. // Id: [Output Only] Unique identifier for the resource; defined by the
  16960. // server.
  16961. Id string `json:"id,omitempty"`
  16962. // Items: A list of Autoscaler resources.
  16963. Items []*Autoscaler `json:"items,omitempty"`
  16964. // Kind: Type of resource.
  16965. Kind string `json:"kind,omitempty"`
  16966. // NextPageToken: [Output Only] This token allows you to get the next
  16967. // page of results for list requests. If the number of results is larger
  16968. // than maxResults, use the nextPageToken as a value for the query
  16969. // parameter pageToken in the next list request. Subsequent list
  16970. // requests will have their own nextPageToken to continue paging through
  16971. // the results.
  16972. NextPageToken string `json:"nextPageToken,omitempty"`
  16973. // SelfLink: [Output Only] Server-defined URL for this resource.
  16974. SelfLink string `json:"selfLink,omitempty"`
  16975. // Warning: [Output Only] Informational warning message.
  16976. Warning *RegionAutoscalerListWarning `json:"warning,omitempty"`
  16977. // ServerResponse contains the HTTP response code and headers from the
  16978. // server.
  16979. googleapi.ServerResponse `json:"-"`
  16980. // ForceSendFields is a list of field names (e.g. "Id") to
  16981. // unconditionally include in API requests. By default, fields with
  16982. // empty values are omitted from API requests. However, any non-pointer,
  16983. // non-interface field appearing in ForceSendFields will be sent to the
  16984. // server regardless of whether the field is empty or not. This may be
  16985. // used to include empty fields in Patch requests.
  16986. ForceSendFields []string `json:"-"`
  16987. // NullFields is a list of field names (e.g. "Id") to include in API
  16988. // requests with the JSON null value. By default, fields with empty
  16989. // values are omitted from API requests. However, any field with an
  16990. // empty value appearing in NullFields will be sent to the server as
  16991. // null. It is an error if a field in this list has a non-empty value.
  16992. // This may be used to include null fields in Patch requests.
  16993. NullFields []string `json:"-"`
  16994. }
  16995. func (s *RegionAutoscalerList) MarshalJSON() ([]byte, error) {
  16996. type NoMethod RegionAutoscalerList
  16997. raw := NoMethod(*s)
  16998. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16999. }
  17000. // RegionAutoscalerListWarning: [Output Only] Informational warning
  17001. // message.
  17002. type RegionAutoscalerListWarning struct {
  17003. // Code: [Output Only] A warning code, if applicable. For example,
  17004. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17005. // the response.
  17006. //
  17007. // Possible values:
  17008. // "CLEANUP_FAILED"
  17009. // "DEPRECATED_RESOURCE_USED"
  17010. // "DEPRECATED_TYPE_USED"
  17011. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17012. // "EXPERIMENTAL_TYPE_USED"
  17013. // "EXTERNAL_API_WARNING"
  17014. // "FIELD_VALUE_OVERRIDEN"
  17015. // "INJECTED_KERNELS_DEPRECATED"
  17016. // "MISSING_TYPE_DEPENDENCY"
  17017. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17018. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17019. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17020. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17021. // "NEXT_HOP_NOT_RUNNING"
  17022. // "NOT_CRITICAL_ERROR"
  17023. // "NO_RESULTS_ON_PAGE"
  17024. // "REQUIRED_TOS_AGREEMENT"
  17025. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17026. // "RESOURCE_NOT_DELETED"
  17027. // "SCHEMA_VALIDATION_IGNORED"
  17028. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17029. // "UNDECLARED_PROPERTIES"
  17030. // "UNREACHABLE"
  17031. Code string `json:"code,omitempty"`
  17032. // Data: [Output Only] Metadata about this warning in key: value format.
  17033. // For example:
  17034. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17035. Data []*RegionAutoscalerListWarningData `json:"data,omitempty"`
  17036. // Message: [Output Only] A human-readable description of the warning
  17037. // code.
  17038. Message string `json:"message,omitempty"`
  17039. // ForceSendFields is a list of field names (e.g. "Code") to
  17040. // unconditionally include in API requests. By default, fields with
  17041. // empty values are omitted from API requests. However, any non-pointer,
  17042. // non-interface field appearing in ForceSendFields will be sent to the
  17043. // server regardless of whether the field is empty or not. This may be
  17044. // used to include empty fields in Patch requests.
  17045. ForceSendFields []string `json:"-"`
  17046. // NullFields is a list of field names (e.g. "Code") to include in API
  17047. // requests with the JSON null value. By default, fields with empty
  17048. // values are omitted from API requests. However, any field with an
  17049. // empty value appearing in NullFields will be sent to the server as
  17050. // null. It is an error if a field in this list has a non-empty value.
  17051. // This may be used to include null fields in Patch requests.
  17052. NullFields []string `json:"-"`
  17053. }
  17054. func (s *RegionAutoscalerListWarning) MarshalJSON() ([]byte, error) {
  17055. type NoMethod RegionAutoscalerListWarning
  17056. raw := NoMethod(*s)
  17057. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17058. }
  17059. type RegionAutoscalerListWarningData struct {
  17060. // Key: [Output Only] A key that provides more detail on the warning
  17061. // being returned. For example, for warnings where there are no results
  17062. // in a list request for a particular zone, this key might be scope and
  17063. // the key value might be the zone name. Other examples might be a key
  17064. // indicating a deprecated resource and a suggested replacement, or a
  17065. // warning about invalid network settings (for example, if an instance
  17066. // attempts to perform IP forwarding but is not enabled for IP
  17067. // forwarding).
  17068. Key string `json:"key,omitempty"`
  17069. // Value: [Output Only] A warning data value corresponding to the key.
  17070. Value string `json:"value,omitempty"`
  17071. // ForceSendFields is a list of field names (e.g. "Key") to
  17072. // unconditionally include in API requests. By default, fields with
  17073. // empty values are omitted from API requests. However, any non-pointer,
  17074. // non-interface field appearing in ForceSendFields will be sent to the
  17075. // server regardless of whether the field is empty or not. This may be
  17076. // used to include empty fields in Patch requests.
  17077. ForceSendFields []string `json:"-"`
  17078. // NullFields is a list of field names (e.g. "Key") to include in API
  17079. // requests with the JSON null value. By default, fields with empty
  17080. // values are omitted from API requests. However, any field with an
  17081. // empty value appearing in NullFields will be sent to the server as
  17082. // null. It is an error if a field in this list has a non-empty value.
  17083. // This may be used to include null fields in Patch requests.
  17084. NullFields []string `json:"-"`
  17085. }
  17086. func (s *RegionAutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  17087. type NoMethod RegionAutoscalerListWarningData
  17088. raw := NoMethod(*s)
  17089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17090. }
  17091. type RegionDiskTypeList struct {
  17092. // Id: [Output Only] Unique identifier for the resource; defined by the
  17093. // server.
  17094. Id string `json:"id,omitempty"`
  17095. // Items: A list of DiskType resources.
  17096. Items []*DiskType `json:"items,omitempty"`
  17097. // Kind: [Output Only] Type of resource. Always
  17098. // compute#regionDiskTypeList for region disk types.
  17099. Kind string `json:"kind,omitempty"`
  17100. // NextPageToken: [Output Only] This token allows you to get the next
  17101. // page of results for list requests. If the number of results is larger
  17102. // than maxResults, use the nextPageToken as a value for the query
  17103. // parameter pageToken in the next list request. Subsequent list
  17104. // requests will have their own nextPageToken to continue paging through
  17105. // the results.
  17106. NextPageToken string `json:"nextPageToken,omitempty"`
  17107. // SelfLink: [Output Only] Server-defined URL for this resource.
  17108. SelfLink string `json:"selfLink,omitempty"`
  17109. // Warning: [Output Only] Informational warning message.
  17110. Warning *RegionDiskTypeListWarning `json:"warning,omitempty"`
  17111. // ServerResponse contains the HTTP response code and headers from the
  17112. // server.
  17113. googleapi.ServerResponse `json:"-"`
  17114. // ForceSendFields is a list of field names (e.g. "Id") to
  17115. // unconditionally include in API requests. By default, fields with
  17116. // empty values are omitted from API requests. However, any non-pointer,
  17117. // non-interface field appearing in ForceSendFields will be sent to the
  17118. // server regardless of whether the field is empty or not. This may be
  17119. // used to include empty fields in Patch requests.
  17120. ForceSendFields []string `json:"-"`
  17121. // NullFields is a list of field names (e.g. "Id") to include in API
  17122. // requests with the JSON null value. By default, fields with empty
  17123. // values are omitted from API requests. However, any field with an
  17124. // empty value appearing in NullFields will be sent to the server as
  17125. // null. It is an error if a field in this list has a non-empty value.
  17126. // This may be used to include null fields in Patch requests.
  17127. NullFields []string `json:"-"`
  17128. }
  17129. func (s *RegionDiskTypeList) MarshalJSON() ([]byte, error) {
  17130. type NoMethod RegionDiskTypeList
  17131. raw := NoMethod(*s)
  17132. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17133. }
  17134. // RegionDiskTypeListWarning: [Output Only] Informational warning
  17135. // message.
  17136. type RegionDiskTypeListWarning struct {
  17137. // Code: [Output Only] A warning code, if applicable. For example,
  17138. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17139. // the response.
  17140. //
  17141. // Possible values:
  17142. // "CLEANUP_FAILED"
  17143. // "DEPRECATED_RESOURCE_USED"
  17144. // "DEPRECATED_TYPE_USED"
  17145. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17146. // "EXPERIMENTAL_TYPE_USED"
  17147. // "EXTERNAL_API_WARNING"
  17148. // "FIELD_VALUE_OVERRIDEN"
  17149. // "INJECTED_KERNELS_DEPRECATED"
  17150. // "MISSING_TYPE_DEPENDENCY"
  17151. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17152. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17153. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17154. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17155. // "NEXT_HOP_NOT_RUNNING"
  17156. // "NOT_CRITICAL_ERROR"
  17157. // "NO_RESULTS_ON_PAGE"
  17158. // "REQUIRED_TOS_AGREEMENT"
  17159. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17160. // "RESOURCE_NOT_DELETED"
  17161. // "SCHEMA_VALIDATION_IGNORED"
  17162. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17163. // "UNDECLARED_PROPERTIES"
  17164. // "UNREACHABLE"
  17165. Code string `json:"code,omitempty"`
  17166. // Data: [Output Only] Metadata about this warning in key: value format.
  17167. // For example:
  17168. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17169. Data []*RegionDiskTypeListWarningData `json:"data,omitempty"`
  17170. // Message: [Output Only] A human-readable description of the warning
  17171. // code.
  17172. Message string `json:"message,omitempty"`
  17173. // ForceSendFields is a list of field names (e.g. "Code") to
  17174. // unconditionally include in API requests. By default, fields with
  17175. // empty values are omitted from API requests. However, any non-pointer,
  17176. // non-interface field appearing in ForceSendFields will be sent to the
  17177. // server regardless of whether the field is empty or not. This may be
  17178. // used to include empty fields in Patch requests.
  17179. ForceSendFields []string `json:"-"`
  17180. // NullFields is a list of field names (e.g. "Code") to include in API
  17181. // requests with the JSON null value. By default, fields with empty
  17182. // values are omitted from API requests. However, any field with an
  17183. // empty value appearing in NullFields will be sent to the server as
  17184. // null. It is an error if a field in this list has a non-empty value.
  17185. // This may be used to include null fields in Patch requests.
  17186. NullFields []string `json:"-"`
  17187. }
  17188. func (s *RegionDiskTypeListWarning) MarshalJSON() ([]byte, error) {
  17189. type NoMethod RegionDiskTypeListWarning
  17190. raw := NoMethod(*s)
  17191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17192. }
  17193. type RegionDiskTypeListWarningData struct {
  17194. // Key: [Output Only] A key that provides more detail on the warning
  17195. // being returned. For example, for warnings where there are no results
  17196. // in a list request for a particular zone, this key might be scope and
  17197. // the key value might be the zone name. Other examples might be a key
  17198. // indicating a deprecated resource and a suggested replacement, or a
  17199. // warning about invalid network settings (for example, if an instance
  17200. // attempts to perform IP forwarding but is not enabled for IP
  17201. // forwarding).
  17202. Key string `json:"key,omitempty"`
  17203. // Value: [Output Only] A warning data value corresponding to the key.
  17204. Value string `json:"value,omitempty"`
  17205. // ForceSendFields is a list of field names (e.g. "Key") to
  17206. // unconditionally include in API requests. By default, fields with
  17207. // empty values are omitted from API requests. However, any non-pointer,
  17208. // non-interface field appearing in ForceSendFields will be sent to the
  17209. // server regardless of whether the field is empty or not. This may be
  17210. // used to include empty fields in Patch requests.
  17211. ForceSendFields []string `json:"-"`
  17212. // NullFields is a list of field names (e.g. "Key") to include in API
  17213. // requests with the JSON null value. By default, fields with empty
  17214. // values are omitted from API requests. However, any field with an
  17215. // empty value appearing in NullFields will be sent to the server as
  17216. // null. It is an error if a field in this list has a non-empty value.
  17217. // This may be used to include null fields in Patch requests.
  17218. NullFields []string `json:"-"`
  17219. }
  17220. func (s *RegionDiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  17221. type NoMethod RegionDiskTypeListWarningData
  17222. raw := NoMethod(*s)
  17223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17224. }
  17225. type RegionDisksResizeRequest struct {
  17226. // SizeGb: The new size of the regional persistent disk, which is
  17227. // specified in GB.
  17228. SizeGb int64 `json:"sizeGb,omitempty,string"`
  17229. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  17230. // unconditionally include in API requests. By default, fields with
  17231. // empty values are omitted from API requests. However, any non-pointer,
  17232. // non-interface field appearing in ForceSendFields will be sent to the
  17233. // server regardless of whether the field is empty or not. This may be
  17234. // used to include empty fields in Patch requests.
  17235. ForceSendFields []string `json:"-"`
  17236. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  17237. // requests with the JSON null value. By default, fields with empty
  17238. // values are omitted from API requests. However, any field with an
  17239. // empty value appearing in NullFields will be sent to the server as
  17240. // null. It is an error if a field in this list has a non-empty value.
  17241. // This may be used to include null fields in Patch requests.
  17242. NullFields []string `json:"-"`
  17243. }
  17244. func (s *RegionDisksResizeRequest) MarshalJSON() ([]byte, error) {
  17245. type NoMethod RegionDisksResizeRequest
  17246. raw := NoMethod(*s)
  17247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17248. }
  17249. // RegionInstanceGroupList: Contains a list of InstanceGroup resources.
  17250. type RegionInstanceGroupList struct {
  17251. // Id: [Output Only] Unique identifier for the resource; defined by the
  17252. // server.
  17253. Id string `json:"id,omitempty"`
  17254. // Items: A list of InstanceGroup resources.
  17255. Items []*InstanceGroup `json:"items,omitempty"`
  17256. // Kind: The resource type.
  17257. Kind string `json:"kind,omitempty"`
  17258. // NextPageToken: [Output Only] This token allows you to get the next
  17259. // page of results for list requests. If the number of results is larger
  17260. // than maxResults, use the nextPageToken as a value for the query
  17261. // parameter pageToken in the next list request. Subsequent list
  17262. // requests will have their own nextPageToken to continue paging through
  17263. // the results.
  17264. NextPageToken string `json:"nextPageToken,omitempty"`
  17265. // SelfLink: [Output Only] Server-defined URL for this resource.
  17266. SelfLink string `json:"selfLink,omitempty"`
  17267. // Warning: [Output Only] Informational warning message.
  17268. Warning *RegionInstanceGroupListWarning `json:"warning,omitempty"`
  17269. // ServerResponse contains the HTTP response code and headers from the
  17270. // server.
  17271. googleapi.ServerResponse `json:"-"`
  17272. // ForceSendFields is a list of field names (e.g. "Id") to
  17273. // unconditionally include in API requests. By default, fields with
  17274. // empty values are omitted from API requests. However, any non-pointer,
  17275. // non-interface field appearing in ForceSendFields will be sent to the
  17276. // server regardless of whether the field is empty or not. This may be
  17277. // used to include empty fields in Patch requests.
  17278. ForceSendFields []string `json:"-"`
  17279. // NullFields is a list of field names (e.g. "Id") to include in API
  17280. // requests with the JSON null value. By default, fields with empty
  17281. // values are omitted from API requests. However, any field with an
  17282. // empty value appearing in NullFields will be sent to the server as
  17283. // null. It is an error if a field in this list has a non-empty value.
  17284. // This may be used to include null fields in Patch requests.
  17285. NullFields []string `json:"-"`
  17286. }
  17287. func (s *RegionInstanceGroupList) MarshalJSON() ([]byte, error) {
  17288. type NoMethod RegionInstanceGroupList
  17289. raw := NoMethod(*s)
  17290. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17291. }
  17292. // RegionInstanceGroupListWarning: [Output Only] Informational warning
  17293. // message.
  17294. type RegionInstanceGroupListWarning struct {
  17295. // Code: [Output Only] A warning code, if applicable. For example,
  17296. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17297. // the response.
  17298. //
  17299. // Possible values:
  17300. // "CLEANUP_FAILED"
  17301. // "DEPRECATED_RESOURCE_USED"
  17302. // "DEPRECATED_TYPE_USED"
  17303. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17304. // "EXPERIMENTAL_TYPE_USED"
  17305. // "EXTERNAL_API_WARNING"
  17306. // "FIELD_VALUE_OVERRIDEN"
  17307. // "INJECTED_KERNELS_DEPRECATED"
  17308. // "MISSING_TYPE_DEPENDENCY"
  17309. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17310. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17311. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17312. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17313. // "NEXT_HOP_NOT_RUNNING"
  17314. // "NOT_CRITICAL_ERROR"
  17315. // "NO_RESULTS_ON_PAGE"
  17316. // "REQUIRED_TOS_AGREEMENT"
  17317. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17318. // "RESOURCE_NOT_DELETED"
  17319. // "SCHEMA_VALIDATION_IGNORED"
  17320. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17321. // "UNDECLARED_PROPERTIES"
  17322. // "UNREACHABLE"
  17323. Code string `json:"code,omitempty"`
  17324. // Data: [Output Only] Metadata about this warning in key: value format.
  17325. // For example:
  17326. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17327. Data []*RegionInstanceGroupListWarningData `json:"data,omitempty"`
  17328. // Message: [Output Only] A human-readable description of the warning
  17329. // code.
  17330. Message string `json:"message,omitempty"`
  17331. // ForceSendFields is a list of field names (e.g. "Code") to
  17332. // unconditionally include in API requests. By default, fields with
  17333. // empty values are omitted from API requests. However, any non-pointer,
  17334. // non-interface field appearing in ForceSendFields will be sent to the
  17335. // server regardless of whether the field is empty or not. This may be
  17336. // used to include empty fields in Patch requests.
  17337. ForceSendFields []string `json:"-"`
  17338. // NullFields is a list of field names (e.g. "Code") to include in API
  17339. // requests with the JSON null value. By default, fields with empty
  17340. // values are omitted from API requests. However, any field with an
  17341. // empty value appearing in NullFields will be sent to the server as
  17342. // null. It is an error if a field in this list has a non-empty value.
  17343. // This may be used to include null fields in Patch requests.
  17344. NullFields []string `json:"-"`
  17345. }
  17346. func (s *RegionInstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  17347. type NoMethod RegionInstanceGroupListWarning
  17348. raw := NoMethod(*s)
  17349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17350. }
  17351. type RegionInstanceGroupListWarningData struct {
  17352. // Key: [Output Only] A key that provides more detail on the warning
  17353. // being returned. For example, for warnings where there are no results
  17354. // in a list request for a particular zone, this key might be scope and
  17355. // the key value might be the zone name. Other examples might be a key
  17356. // indicating a deprecated resource and a suggested replacement, or a
  17357. // warning about invalid network settings (for example, if an instance
  17358. // attempts to perform IP forwarding but is not enabled for IP
  17359. // forwarding).
  17360. Key string `json:"key,omitempty"`
  17361. // Value: [Output Only] A warning data value corresponding to the key.
  17362. Value string `json:"value,omitempty"`
  17363. // ForceSendFields is a list of field names (e.g. "Key") to
  17364. // unconditionally include in API requests. By default, fields with
  17365. // empty values are omitted from API requests. However, any non-pointer,
  17366. // non-interface field appearing in ForceSendFields will be sent to the
  17367. // server regardless of whether the field is empty or not. This may be
  17368. // used to include empty fields in Patch requests.
  17369. ForceSendFields []string `json:"-"`
  17370. // NullFields is a list of field names (e.g. "Key") to include in API
  17371. // requests with the JSON null value. By default, fields with empty
  17372. // values are omitted from API requests. However, any field with an
  17373. // empty value appearing in NullFields will be sent to the server as
  17374. // null. It is an error if a field in this list has a non-empty value.
  17375. // This may be used to include null fields in Patch requests.
  17376. NullFields []string `json:"-"`
  17377. }
  17378. func (s *RegionInstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  17379. type NoMethod RegionInstanceGroupListWarningData
  17380. raw := NoMethod(*s)
  17381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17382. }
  17383. // RegionInstanceGroupManagerList: Contains a list of managed instance
  17384. // groups.
  17385. type RegionInstanceGroupManagerList struct {
  17386. // Id: [Output Only] Unique identifier for the resource; defined by the
  17387. // server.
  17388. Id string `json:"id,omitempty"`
  17389. // Items: A list of InstanceGroupManager resources.
  17390. Items []*InstanceGroupManager `json:"items,omitempty"`
  17391. // Kind: [Output Only] The resource type, which is always
  17392. // compute#instanceGroupManagerList for a list of managed instance
  17393. // groups that exist in th regional scope.
  17394. Kind string `json:"kind,omitempty"`
  17395. // NextPageToken: [Output Only] This token allows you to get the next
  17396. // page of results for list requests. If the number of results is larger
  17397. // than maxResults, use the nextPageToken as a value for the query
  17398. // parameter pageToken in the next list request. Subsequent list
  17399. // requests will have their own nextPageToken to continue paging through
  17400. // the results.
  17401. NextPageToken string `json:"nextPageToken,omitempty"`
  17402. // SelfLink: [Output Only] Server-defined URL for this resource.
  17403. SelfLink string `json:"selfLink,omitempty"`
  17404. // Warning: [Output Only] Informational warning message.
  17405. Warning *RegionInstanceGroupManagerListWarning `json:"warning,omitempty"`
  17406. // ServerResponse contains the HTTP response code and headers from the
  17407. // server.
  17408. googleapi.ServerResponse `json:"-"`
  17409. // ForceSendFields is a list of field names (e.g. "Id") to
  17410. // unconditionally include in API requests. By default, fields with
  17411. // empty values are omitted from API requests. However, any non-pointer,
  17412. // non-interface field appearing in ForceSendFields will be sent to the
  17413. // server regardless of whether the field is empty or not. This may be
  17414. // used to include empty fields in Patch requests.
  17415. ForceSendFields []string `json:"-"`
  17416. // NullFields is a list of field names (e.g. "Id") to include in API
  17417. // requests with the JSON null value. By default, fields with empty
  17418. // values are omitted from API requests. However, any field with an
  17419. // empty value appearing in NullFields will be sent to the server as
  17420. // null. It is an error if a field in this list has a non-empty value.
  17421. // This may be used to include null fields in Patch requests.
  17422. NullFields []string `json:"-"`
  17423. }
  17424. func (s *RegionInstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  17425. type NoMethod RegionInstanceGroupManagerList
  17426. raw := NoMethod(*s)
  17427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17428. }
  17429. // RegionInstanceGroupManagerListWarning: [Output Only] Informational
  17430. // warning message.
  17431. type RegionInstanceGroupManagerListWarning struct {
  17432. // Code: [Output Only] A warning code, if applicable. For example,
  17433. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17434. // the response.
  17435. //
  17436. // Possible values:
  17437. // "CLEANUP_FAILED"
  17438. // "DEPRECATED_RESOURCE_USED"
  17439. // "DEPRECATED_TYPE_USED"
  17440. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17441. // "EXPERIMENTAL_TYPE_USED"
  17442. // "EXTERNAL_API_WARNING"
  17443. // "FIELD_VALUE_OVERRIDEN"
  17444. // "INJECTED_KERNELS_DEPRECATED"
  17445. // "MISSING_TYPE_DEPENDENCY"
  17446. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17447. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17448. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17449. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17450. // "NEXT_HOP_NOT_RUNNING"
  17451. // "NOT_CRITICAL_ERROR"
  17452. // "NO_RESULTS_ON_PAGE"
  17453. // "REQUIRED_TOS_AGREEMENT"
  17454. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17455. // "RESOURCE_NOT_DELETED"
  17456. // "SCHEMA_VALIDATION_IGNORED"
  17457. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17458. // "UNDECLARED_PROPERTIES"
  17459. // "UNREACHABLE"
  17460. Code string `json:"code,omitempty"`
  17461. // Data: [Output Only] Metadata about this warning in key: value format.
  17462. // For example:
  17463. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17464. Data []*RegionInstanceGroupManagerListWarningData `json:"data,omitempty"`
  17465. // Message: [Output Only] A human-readable description of the warning
  17466. // code.
  17467. Message string `json:"message,omitempty"`
  17468. // ForceSendFields is a list of field names (e.g. "Code") to
  17469. // unconditionally include in API requests. By default, fields with
  17470. // empty values are omitted from API requests. However, any non-pointer,
  17471. // non-interface field appearing in ForceSendFields will be sent to the
  17472. // server regardless of whether the field is empty or not. This may be
  17473. // used to include empty fields in Patch requests.
  17474. ForceSendFields []string `json:"-"`
  17475. // NullFields is a list of field names (e.g. "Code") to include in API
  17476. // requests with the JSON null value. By default, fields with empty
  17477. // values are omitted from API requests. However, any field with an
  17478. // empty value appearing in NullFields will be sent to the server as
  17479. // null. It is an error if a field in this list has a non-empty value.
  17480. // This may be used to include null fields in Patch requests.
  17481. NullFields []string `json:"-"`
  17482. }
  17483. func (s *RegionInstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  17484. type NoMethod RegionInstanceGroupManagerListWarning
  17485. raw := NoMethod(*s)
  17486. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17487. }
  17488. type RegionInstanceGroupManagerListWarningData struct {
  17489. // Key: [Output Only] A key that provides more detail on the warning
  17490. // being returned. For example, for warnings where there are no results
  17491. // in a list request for a particular zone, this key might be scope and
  17492. // the key value might be the zone name. Other examples might be a key
  17493. // indicating a deprecated resource and a suggested replacement, or a
  17494. // warning about invalid network settings (for example, if an instance
  17495. // attempts to perform IP forwarding but is not enabled for IP
  17496. // forwarding).
  17497. Key string `json:"key,omitempty"`
  17498. // Value: [Output Only] A warning data value corresponding to the key.
  17499. Value string `json:"value,omitempty"`
  17500. // ForceSendFields is a list of field names (e.g. "Key") to
  17501. // unconditionally include in API requests. By default, fields with
  17502. // empty values are omitted from API requests. However, any non-pointer,
  17503. // non-interface field appearing in ForceSendFields will be sent to the
  17504. // server regardless of whether the field is empty or not. This may be
  17505. // used to include empty fields in Patch requests.
  17506. ForceSendFields []string `json:"-"`
  17507. // NullFields is a list of field names (e.g. "Key") to include in API
  17508. // requests with the JSON null value. By default, fields with empty
  17509. // values are omitted from API requests. However, any field with an
  17510. // empty value appearing in NullFields will be sent to the server as
  17511. // null. It is an error if a field in this list has a non-empty value.
  17512. // This may be used to include null fields in Patch requests.
  17513. NullFields []string `json:"-"`
  17514. }
  17515. func (s *RegionInstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  17516. type NoMethod RegionInstanceGroupManagerListWarningData
  17517. raw := NoMethod(*s)
  17518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17519. }
  17520. type RegionInstanceGroupManagersAbandonInstancesRequest struct {
  17521. // Instances: The URLs of one or more instances to abandon. This can be
  17522. // a full URL or a partial URL, such as
  17523. // zones/[ZONE]/instances/[INSTANCE_NAME].
  17524. Instances []string `json:"instances,omitempty"`
  17525. // ForceSendFields is a list of field names (e.g. "Instances") to
  17526. // unconditionally include in API requests. By default, fields with
  17527. // empty values are omitted from API requests. However, any non-pointer,
  17528. // non-interface field appearing in ForceSendFields will be sent to the
  17529. // server regardless of whether the field is empty or not. This may be
  17530. // used to include empty fields in Patch requests.
  17531. ForceSendFields []string `json:"-"`
  17532. // NullFields is a list of field names (e.g. "Instances") to include in
  17533. // API requests with the JSON null value. By default, fields with empty
  17534. // values are omitted from API requests. However, any field with an
  17535. // empty value appearing in NullFields will be sent to the server as
  17536. // null. It is an error if a field in this list has a non-empty value.
  17537. // This may be used to include null fields in Patch requests.
  17538. NullFields []string `json:"-"`
  17539. }
  17540. func (s *RegionInstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  17541. type NoMethod RegionInstanceGroupManagersAbandonInstancesRequest
  17542. raw := NoMethod(*s)
  17543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17544. }
  17545. type RegionInstanceGroupManagersDeleteInstancesRequest struct {
  17546. // Instances: The URLs of one or more instances to delete. This can be a
  17547. // full URL or a partial URL, such as
  17548. // zones/[ZONE]/instances/[INSTANCE_NAME].
  17549. Instances []string `json:"instances,omitempty"`
  17550. // ForceSendFields is a list of field names (e.g. "Instances") to
  17551. // unconditionally include in API requests. By default, fields with
  17552. // empty values are omitted from API requests. However, any non-pointer,
  17553. // non-interface field appearing in ForceSendFields will be sent to the
  17554. // server regardless of whether the field is empty or not. This may be
  17555. // used to include empty fields in Patch requests.
  17556. ForceSendFields []string `json:"-"`
  17557. // NullFields is a list of field names (e.g. "Instances") to include in
  17558. // API requests with the JSON null value. By default, fields with empty
  17559. // values are omitted from API requests. However, any field with an
  17560. // empty value appearing in NullFields will be sent to the server as
  17561. // null. It is an error if a field in this list has a non-empty value.
  17562. // This may be used to include null fields in Patch requests.
  17563. NullFields []string `json:"-"`
  17564. }
  17565. func (s *RegionInstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  17566. type NoMethod RegionInstanceGroupManagersDeleteInstancesRequest
  17567. raw := NoMethod(*s)
  17568. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17569. }
  17570. type RegionInstanceGroupManagersListInstancesResponse struct {
  17571. // ManagedInstances: A list of managed instances.
  17572. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  17573. // ServerResponse contains the HTTP response code and headers from the
  17574. // server.
  17575. googleapi.ServerResponse `json:"-"`
  17576. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  17577. // unconditionally include in API requests. By default, fields with
  17578. // empty values are omitted from API requests. However, any non-pointer,
  17579. // non-interface field appearing in ForceSendFields will be sent to the
  17580. // server regardless of whether the field is empty or not. This may be
  17581. // used to include empty fields in Patch requests.
  17582. ForceSendFields []string `json:"-"`
  17583. // NullFields is a list of field names (e.g. "ManagedInstances") to
  17584. // include in API requests with the JSON null value. By default, fields
  17585. // with empty values are omitted from API requests. However, any field
  17586. // with an empty value appearing in NullFields will be sent to the
  17587. // server as null. It is an error if a field in this list has a
  17588. // non-empty value. This may be used to include null fields in Patch
  17589. // requests.
  17590. NullFields []string `json:"-"`
  17591. }
  17592. func (s *RegionInstanceGroupManagersListInstancesResponse) MarshalJSON() ([]byte, error) {
  17593. type NoMethod RegionInstanceGroupManagersListInstancesResponse
  17594. raw := NoMethod(*s)
  17595. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17596. }
  17597. type RegionInstanceGroupManagersRecreateRequest struct {
  17598. // Instances: The URLs of one or more instances to recreate. This can be
  17599. // a full URL or a partial URL, such as
  17600. // zones/[ZONE]/instances/[INSTANCE_NAME].
  17601. Instances []string `json:"instances,omitempty"`
  17602. // ForceSendFields is a list of field names (e.g. "Instances") to
  17603. // unconditionally include in API requests. By default, fields with
  17604. // empty values are omitted from API requests. However, any non-pointer,
  17605. // non-interface field appearing in ForceSendFields will be sent to the
  17606. // server regardless of whether the field is empty or not. This may be
  17607. // used to include empty fields in Patch requests.
  17608. ForceSendFields []string `json:"-"`
  17609. // NullFields is a list of field names (e.g. "Instances") to include in
  17610. // API requests with the JSON null value. By default, fields with empty
  17611. // values are omitted from API requests. However, any field with an
  17612. // empty value appearing in NullFields will be sent to the server as
  17613. // null. It is an error if a field in this list has a non-empty value.
  17614. // This may be used to include null fields in Patch requests.
  17615. NullFields []string `json:"-"`
  17616. }
  17617. func (s *RegionInstanceGroupManagersRecreateRequest) MarshalJSON() ([]byte, error) {
  17618. type NoMethod RegionInstanceGroupManagersRecreateRequest
  17619. raw := NoMethod(*s)
  17620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17621. }
  17622. type RegionInstanceGroupManagersSetTargetPoolsRequest struct {
  17623. // Fingerprint: Fingerprint of the target pools information, which is a
  17624. // hash of the contents. This field is used for optimistic locking when
  17625. // you update the target pool entries. This field is optional.
  17626. Fingerprint string `json:"fingerprint,omitempty"`
  17627. // TargetPools: The URL of all TargetPool resources to which instances
  17628. // in the instanceGroup field are added. The target pools automatically
  17629. // apply to all of the instances in the managed instance group.
  17630. TargetPools []string `json:"targetPools,omitempty"`
  17631. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  17632. // unconditionally include in API requests. By default, fields with
  17633. // empty values are omitted from API requests. However, any non-pointer,
  17634. // non-interface field appearing in ForceSendFields will be sent to the
  17635. // server regardless of whether the field is empty or not. This may be
  17636. // used to include empty fields in Patch requests.
  17637. ForceSendFields []string `json:"-"`
  17638. // NullFields is a list of field names (e.g. "Fingerprint") to include
  17639. // in API requests with the JSON null value. By default, fields with
  17640. // empty values are omitted from API requests. However, any field with
  17641. // an empty value appearing in NullFields will be sent to the server as
  17642. // null. It is an error if a field in this list has a non-empty value.
  17643. // This may be used to include null fields in Patch requests.
  17644. NullFields []string `json:"-"`
  17645. }
  17646. func (s *RegionInstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  17647. type NoMethod RegionInstanceGroupManagersSetTargetPoolsRequest
  17648. raw := NoMethod(*s)
  17649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17650. }
  17651. type RegionInstanceGroupManagersSetTemplateRequest struct {
  17652. // InstanceTemplate: URL of the InstanceTemplate resource from which all
  17653. // new instances will be created.
  17654. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  17655. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  17656. // unconditionally include in API requests. By default, fields with
  17657. // empty values are omitted from API requests. However, any non-pointer,
  17658. // non-interface field appearing in ForceSendFields will be sent to the
  17659. // server regardless of whether the field is empty or not. This may be
  17660. // used to include empty fields in Patch requests.
  17661. ForceSendFields []string `json:"-"`
  17662. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  17663. // include in API requests with the JSON null value. By default, fields
  17664. // with empty values are omitted from API requests. However, any field
  17665. // with an empty value appearing in NullFields will be sent to the
  17666. // server as null. It is an error if a field in this list has a
  17667. // non-empty value. This may be used to include null fields in Patch
  17668. // requests.
  17669. NullFields []string `json:"-"`
  17670. }
  17671. func (s *RegionInstanceGroupManagersSetTemplateRequest) MarshalJSON() ([]byte, error) {
  17672. type NoMethod RegionInstanceGroupManagersSetTemplateRequest
  17673. raw := NoMethod(*s)
  17674. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17675. }
  17676. type RegionInstanceGroupsListInstances struct {
  17677. // Id: [Output Only] Unique identifier for the resource; defined by the
  17678. // server.
  17679. Id string `json:"id,omitempty"`
  17680. // Items: A list of InstanceWithNamedPorts resources.
  17681. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  17682. // Kind: The resource type.
  17683. Kind string `json:"kind,omitempty"`
  17684. // NextPageToken: [Output Only] This token allows you to get the next
  17685. // page of results for list requests. If the number of results is larger
  17686. // than maxResults, use the nextPageToken as a value for the query
  17687. // parameter pageToken in the next list request. Subsequent list
  17688. // requests will have their own nextPageToken to continue paging through
  17689. // the results.
  17690. NextPageToken string `json:"nextPageToken,omitempty"`
  17691. // SelfLink: [Output Only] Server-defined URL for this resource.
  17692. SelfLink string `json:"selfLink,omitempty"`
  17693. // Warning: [Output Only] Informational warning message.
  17694. Warning *RegionInstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  17695. // ServerResponse contains the HTTP response code and headers from the
  17696. // server.
  17697. googleapi.ServerResponse `json:"-"`
  17698. // ForceSendFields is a list of field names (e.g. "Id") to
  17699. // unconditionally include in API requests. By default, fields with
  17700. // empty values are omitted from API requests. However, any non-pointer,
  17701. // non-interface field appearing in ForceSendFields will be sent to the
  17702. // server regardless of whether the field is empty or not. This may be
  17703. // used to include empty fields in Patch requests.
  17704. ForceSendFields []string `json:"-"`
  17705. // NullFields is a list of field names (e.g. "Id") to include in API
  17706. // requests with the JSON null value. By default, fields with empty
  17707. // values are omitted from API requests. However, any field with an
  17708. // empty value appearing in NullFields will be sent to the server as
  17709. // null. It is an error if a field in this list has a non-empty value.
  17710. // This may be used to include null fields in Patch requests.
  17711. NullFields []string `json:"-"`
  17712. }
  17713. func (s *RegionInstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  17714. type NoMethod RegionInstanceGroupsListInstances
  17715. raw := NoMethod(*s)
  17716. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17717. }
  17718. // RegionInstanceGroupsListInstancesWarning: [Output Only] Informational
  17719. // warning message.
  17720. type RegionInstanceGroupsListInstancesWarning struct {
  17721. // Code: [Output Only] A warning code, if applicable. For example,
  17722. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17723. // the response.
  17724. //
  17725. // Possible values:
  17726. // "CLEANUP_FAILED"
  17727. // "DEPRECATED_RESOURCE_USED"
  17728. // "DEPRECATED_TYPE_USED"
  17729. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17730. // "EXPERIMENTAL_TYPE_USED"
  17731. // "EXTERNAL_API_WARNING"
  17732. // "FIELD_VALUE_OVERRIDEN"
  17733. // "INJECTED_KERNELS_DEPRECATED"
  17734. // "MISSING_TYPE_DEPENDENCY"
  17735. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17736. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17737. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17738. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17739. // "NEXT_HOP_NOT_RUNNING"
  17740. // "NOT_CRITICAL_ERROR"
  17741. // "NO_RESULTS_ON_PAGE"
  17742. // "REQUIRED_TOS_AGREEMENT"
  17743. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17744. // "RESOURCE_NOT_DELETED"
  17745. // "SCHEMA_VALIDATION_IGNORED"
  17746. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17747. // "UNDECLARED_PROPERTIES"
  17748. // "UNREACHABLE"
  17749. Code string `json:"code,omitempty"`
  17750. // Data: [Output Only] Metadata about this warning in key: value format.
  17751. // For example:
  17752. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17753. Data []*RegionInstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  17754. // Message: [Output Only] A human-readable description of the warning
  17755. // code.
  17756. Message string `json:"message,omitempty"`
  17757. // ForceSendFields is a list of field names (e.g. "Code") to
  17758. // unconditionally include in API requests. By default, fields with
  17759. // empty values are omitted from API requests. However, any non-pointer,
  17760. // non-interface field appearing in ForceSendFields will be sent to the
  17761. // server regardless of whether the field is empty or not. This may be
  17762. // used to include empty fields in Patch requests.
  17763. ForceSendFields []string `json:"-"`
  17764. // NullFields is a list of field names (e.g. "Code") to include in API
  17765. // requests with the JSON null value. By default, fields with empty
  17766. // values are omitted from API requests. However, any field with an
  17767. // empty value appearing in NullFields will be sent to the server as
  17768. // null. It is an error if a field in this list has a non-empty value.
  17769. // This may be used to include null fields in Patch requests.
  17770. NullFields []string `json:"-"`
  17771. }
  17772. func (s *RegionInstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  17773. type NoMethod RegionInstanceGroupsListInstancesWarning
  17774. raw := NoMethod(*s)
  17775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17776. }
  17777. type RegionInstanceGroupsListInstancesWarningData struct {
  17778. // Key: [Output Only] A key that provides more detail on the warning
  17779. // being returned. For example, for warnings where there are no results
  17780. // in a list request for a particular zone, this key might be scope and
  17781. // the key value might be the zone name. Other examples might be a key
  17782. // indicating a deprecated resource and a suggested replacement, or a
  17783. // warning about invalid network settings (for example, if an instance
  17784. // attempts to perform IP forwarding but is not enabled for IP
  17785. // forwarding).
  17786. Key string `json:"key,omitempty"`
  17787. // Value: [Output Only] A warning data value corresponding to the key.
  17788. Value string `json:"value,omitempty"`
  17789. // ForceSendFields is a list of field names (e.g. "Key") to
  17790. // unconditionally include in API requests. By default, fields with
  17791. // empty values are omitted from API requests. However, any non-pointer,
  17792. // non-interface field appearing in ForceSendFields will be sent to the
  17793. // server regardless of whether the field is empty or not. This may be
  17794. // used to include empty fields in Patch requests.
  17795. ForceSendFields []string `json:"-"`
  17796. // NullFields is a list of field names (e.g. "Key") to include in API
  17797. // requests with the JSON null value. By default, fields with empty
  17798. // values are omitted from API requests. However, any field with an
  17799. // empty value appearing in NullFields will be sent to the server as
  17800. // null. It is an error if a field in this list has a non-empty value.
  17801. // This may be used to include null fields in Patch requests.
  17802. NullFields []string `json:"-"`
  17803. }
  17804. func (s *RegionInstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  17805. type NoMethod RegionInstanceGroupsListInstancesWarningData
  17806. raw := NoMethod(*s)
  17807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17808. }
  17809. type RegionInstanceGroupsListInstancesRequest struct {
  17810. // InstanceState: Instances in which state should be returned. Valid
  17811. // options are: 'ALL', 'RUNNING'. By default, it lists all instances.
  17812. //
  17813. // Possible values:
  17814. // "ALL"
  17815. // "RUNNING"
  17816. InstanceState string `json:"instanceState,omitempty"`
  17817. // PortName: Name of port user is interested in. It is optional. If it
  17818. // is set, only information about this ports will be returned. If it is
  17819. // not set, all the named ports will be returned. Always lists all
  17820. // instances.
  17821. PortName string `json:"portName,omitempty"`
  17822. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  17823. // unconditionally include in API requests. By default, fields with
  17824. // empty values are omitted from API requests. However, any non-pointer,
  17825. // non-interface field appearing in ForceSendFields will be sent to the
  17826. // server regardless of whether the field is empty or not. This may be
  17827. // used to include empty fields in Patch requests.
  17828. ForceSendFields []string `json:"-"`
  17829. // NullFields is a list of field names (e.g. "InstanceState") to include
  17830. // in API requests with the JSON null value. By default, fields with
  17831. // empty values are omitted from API requests. However, any field with
  17832. // an empty value appearing in NullFields will be sent to the server as
  17833. // null. It is an error if a field in this list has a non-empty value.
  17834. // This may be used to include null fields in Patch requests.
  17835. NullFields []string `json:"-"`
  17836. }
  17837. func (s *RegionInstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  17838. type NoMethod RegionInstanceGroupsListInstancesRequest
  17839. raw := NoMethod(*s)
  17840. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17841. }
  17842. type RegionInstanceGroupsSetNamedPortsRequest struct {
  17843. // Fingerprint: The fingerprint of the named ports information for this
  17844. // instance group. Use this optional property to prevent conflicts when
  17845. // multiple users change the named ports settings concurrently. Obtain
  17846. // the fingerprint with the instanceGroups.get method. Then, include the
  17847. // fingerprint in your request to ensure that you do not overwrite
  17848. // changes that were applied from another concurrent request.
  17849. Fingerprint string `json:"fingerprint,omitempty"`
  17850. // NamedPorts: The list of named ports to set for this instance group.
  17851. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  17852. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  17853. // unconditionally include in API requests. By default, fields with
  17854. // empty values are omitted from API requests. However, any non-pointer,
  17855. // non-interface field appearing in ForceSendFields will be sent to the
  17856. // server regardless of whether the field is empty or not. This may be
  17857. // used to include empty fields in Patch requests.
  17858. ForceSendFields []string `json:"-"`
  17859. // NullFields is a list of field names (e.g. "Fingerprint") to include
  17860. // in API requests with the JSON null value. By default, fields with
  17861. // empty values are omitted from API requests. However, any field with
  17862. // an empty value appearing in NullFields will be sent to the server as
  17863. // null. It is an error if a field in this list has a non-empty value.
  17864. // This may be used to include null fields in Patch requests.
  17865. NullFields []string `json:"-"`
  17866. }
  17867. func (s *RegionInstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  17868. type NoMethod RegionInstanceGroupsSetNamedPortsRequest
  17869. raw := NoMethod(*s)
  17870. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17871. }
  17872. // RegionList: Contains a list of region resources.
  17873. type RegionList struct {
  17874. // Id: [Output Only] Unique identifier for the resource; defined by the
  17875. // server.
  17876. Id string `json:"id,omitempty"`
  17877. // Items: A list of Region resources.
  17878. Items []*Region `json:"items,omitempty"`
  17879. // Kind: [Output Only] Type of resource. Always compute#regionList for
  17880. // lists of regions.
  17881. Kind string `json:"kind,omitempty"`
  17882. // NextPageToken: [Output Only] This token allows you to get the next
  17883. // page of results for list requests. If the number of results is larger
  17884. // than maxResults, use the nextPageToken as a value for the query
  17885. // parameter pageToken in the next list request. Subsequent list
  17886. // requests will have their own nextPageToken to continue paging through
  17887. // the results.
  17888. NextPageToken string `json:"nextPageToken,omitempty"`
  17889. // SelfLink: [Output Only] Server-defined URL for this resource.
  17890. SelfLink string `json:"selfLink,omitempty"`
  17891. // Warning: [Output Only] Informational warning message.
  17892. Warning *RegionListWarning `json:"warning,omitempty"`
  17893. // ServerResponse contains the HTTP response code and headers from the
  17894. // server.
  17895. googleapi.ServerResponse `json:"-"`
  17896. // ForceSendFields is a list of field names (e.g. "Id") to
  17897. // unconditionally include in API requests. By default, fields with
  17898. // empty values are omitted from API requests. However, any non-pointer,
  17899. // non-interface field appearing in ForceSendFields will be sent to the
  17900. // server regardless of whether the field is empty or not. This may be
  17901. // used to include empty fields in Patch requests.
  17902. ForceSendFields []string `json:"-"`
  17903. // NullFields is a list of field names (e.g. "Id") to include in API
  17904. // requests with the JSON null value. By default, fields with empty
  17905. // values are omitted from API requests. However, any field with an
  17906. // empty value appearing in NullFields will be sent to the server as
  17907. // null. It is an error if a field in this list has a non-empty value.
  17908. // This may be used to include null fields in Patch requests.
  17909. NullFields []string `json:"-"`
  17910. }
  17911. func (s *RegionList) MarshalJSON() ([]byte, error) {
  17912. type NoMethod RegionList
  17913. raw := NoMethod(*s)
  17914. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17915. }
  17916. // RegionListWarning: [Output Only] Informational warning message.
  17917. type RegionListWarning struct {
  17918. // Code: [Output Only] A warning code, if applicable. For example,
  17919. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17920. // the response.
  17921. //
  17922. // Possible values:
  17923. // "CLEANUP_FAILED"
  17924. // "DEPRECATED_RESOURCE_USED"
  17925. // "DEPRECATED_TYPE_USED"
  17926. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17927. // "EXPERIMENTAL_TYPE_USED"
  17928. // "EXTERNAL_API_WARNING"
  17929. // "FIELD_VALUE_OVERRIDEN"
  17930. // "INJECTED_KERNELS_DEPRECATED"
  17931. // "MISSING_TYPE_DEPENDENCY"
  17932. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17933. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17934. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17935. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17936. // "NEXT_HOP_NOT_RUNNING"
  17937. // "NOT_CRITICAL_ERROR"
  17938. // "NO_RESULTS_ON_PAGE"
  17939. // "REQUIRED_TOS_AGREEMENT"
  17940. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17941. // "RESOURCE_NOT_DELETED"
  17942. // "SCHEMA_VALIDATION_IGNORED"
  17943. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17944. // "UNDECLARED_PROPERTIES"
  17945. // "UNREACHABLE"
  17946. Code string `json:"code,omitempty"`
  17947. // Data: [Output Only] Metadata about this warning in key: value format.
  17948. // For example:
  17949. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17950. Data []*RegionListWarningData `json:"data,omitempty"`
  17951. // Message: [Output Only] A human-readable description of the warning
  17952. // code.
  17953. Message string `json:"message,omitempty"`
  17954. // ForceSendFields is a list of field names (e.g. "Code") to
  17955. // unconditionally include in API requests. By default, fields with
  17956. // empty values are omitted from API requests. However, any non-pointer,
  17957. // non-interface field appearing in ForceSendFields will be sent to the
  17958. // server regardless of whether the field is empty or not. This may be
  17959. // used to include empty fields in Patch requests.
  17960. ForceSendFields []string `json:"-"`
  17961. // NullFields is a list of field names (e.g. "Code") to include in API
  17962. // requests with the JSON null value. By default, fields with empty
  17963. // values are omitted from API requests. However, any field with an
  17964. // empty value appearing in NullFields will be sent to the server as
  17965. // null. It is an error if a field in this list has a non-empty value.
  17966. // This may be used to include null fields in Patch requests.
  17967. NullFields []string `json:"-"`
  17968. }
  17969. func (s *RegionListWarning) MarshalJSON() ([]byte, error) {
  17970. type NoMethod RegionListWarning
  17971. raw := NoMethod(*s)
  17972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17973. }
  17974. type RegionListWarningData struct {
  17975. // Key: [Output Only] A key that provides more detail on the warning
  17976. // being returned. For example, for warnings where there are no results
  17977. // in a list request for a particular zone, this key might be scope and
  17978. // the key value might be the zone name. Other examples might be a key
  17979. // indicating a deprecated resource and a suggested replacement, or a
  17980. // warning about invalid network settings (for example, if an instance
  17981. // attempts to perform IP forwarding but is not enabled for IP
  17982. // forwarding).
  17983. Key string `json:"key,omitempty"`
  17984. // Value: [Output Only] A warning data value corresponding to the key.
  17985. Value string `json:"value,omitempty"`
  17986. // ForceSendFields is a list of field names (e.g. "Key") to
  17987. // unconditionally include in API requests. By default, fields with
  17988. // empty values are omitted from API requests. However, any non-pointer,
  17989. // non-interface field appearing in ForceSendFields will be sent to the
  17990. // server regardless of whether the field is empty or not. This may be
  17991. // used to include empty fields in Patch requests.
  17992. ForceSendFields []string `json:"-"`
  17993. // NullFields is a list of field names (e.g. "Key") to include in API
  17994. // requests with the JSON null value. By default, fields with empty
  17995. // values are omitted from API requests. However, any field with an
  17996. // empty value appearing in NullFields will be sent to the server as
  17997. // null. It is an error if a field in this list has a non-empty value.
  17998. // This may be used to include null fields in Patch requests.
  17999. NullFields []string `json:"-"`
  18000. }
  18001. func (s *RegionListWarningData) MarshalJSON() ([]byte, error) {
  18002. type NoMethod RegionListWarningData
  18003. raw := NoMethod(*s)
  18004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18005. }
  18006. type RegionSetLabelsRequest struct {
  18007. // LabelFingerprint: The fingerprint of the previous set of labels for
  18008. // this resource, used to detect conflicts. The fingerprint is initially
  18009. // generated by Compute Engine and changes after every request to modify
  18010. // or update labels. You must always provide an up-to-date fingerprint
  18011. // hash in order to update or change labels. Make a get() request to the
  18012. // resource to get the latest fingerprint.
  18013. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  18014. // Labels: The labels to set for this resource.
  18015. Labels map[string]string `json:"labels,omitempty"`
  18016. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  18017. // unconditionally include in API requests. By default, fields with
  18018. // empty values are omitted from API requests. However, any non-pointer,
  18019. // non-interface field appearing in ForceSendFields will be sent to the
  18020. // server regardless of whether the field is empty or not. This may be
  18021. // used to include empty fields in Patch requests.
  18022. ForceSendFields []string `json:"-"`
  18023. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  18024. // include in API requests with the JSON null value. By default, fields
  18025. // with empty values are omitted from API requests. However, any field
  18026. // with an empty value appearing in NullFields will be sent to the
  18027. // server as null. It is an error if a field in this list has a
  18028. // non-empty value. This may be used to include null fields in Patch
  18029. // requests.
  18030. NullFields []string `json:"-"`
  18031. }
  18032. func (s *RegionSetLabelsRequest) MarshalJSON() ([]byte, error) {
  18033. type NoMethod RegionSetLabelsRequest
  18034. raw := NoMethod(*s)
  18035. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18036. }
  18037. type RegionSetPolicyRequest struct {
  18038. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  18039. // Deprecated. Use 'policy' to specify bindings.
  18040. Bindings []*Binding `json:"bindings,omitempty"`
  18041. // Etag: Flatten Policy to create a backward compatible wire-format.
  18042. // Deprecated. Use 'policy' to specify the etag.
  18043. Etag string `json:"etag,omitempty"`
  18044. // Policy: REQUIRED: The complete policy to be applied to the
  18045. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  18046. // empty policy is in general a valid policy but certain services (like
  18047. // Projects) might reject them.
  18048. Policy *Policy `json:"policy,omitempty"`
  18049. // ForceSendFields is a list of field names (e.g. "Bindings") to
  18050. // unconditionally include in API requests. By default, fields with
  18051. // empty values are omitted from API requests. However, any non-pointer,
  18052. // non-interface field appearing in ForceSendFields will be sent to the
  18053. // server regardless of whether the field is empty or not. This may be
  18054. // used to include empty fields in Patch requests.
  18055. ForceSendFields []string `json:"-"`
  18056. // NullFields is a list of field names (e.g. "Bindings") to include in
  18057. // API requests with the JSON null value. By default, fields with empty
  18058. // values are omitted from API requests. However, any field with an
  18059. // empty value appearing in NullFields will be sent to the server as
  18060. // null. It is an error if a field in this list has a non-empty value.
  18061. // This may be used to include null fields in Patch requests.
  18062. NullFields []string `json:"-"`
  18063. }
  18064. func (s *RegionSetPolicyRequest) MarshalJSON() ([]byte, error) {
  18065. type NoMethod RegionSetPolicyRequest
  18066. raw := NoMethod(*s)
  18067. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18068. }
  18069. // ResourceCommitment: Commitment for a particular resource (a
  18070. // Commitment is composed of one or more of these).
  18071. type ResourceCommitment struct {
  18072. // Amount: The amount of the resource purchased (in a type-dependent
  18073. // unit, such as bytes). For vCPUs, this can just be an integer. For
  18074. // memory, this must be provided in MB. Memory must be a multiple of 256
  18075. // MB, with up to 6.5GB of memory per every vCPU.
  18076. Amount int64 `json:"amount,omitempty,string"`
  18077. // Type: Type of resource for which this commitment applies. Possible
  18078. // values are VCPU and MEMORY
  18079. //
  18080. // Possible values:
  18081. // "MEMORY"
  18082. // "UNSPECIFIED"
  18083. // "VCPU"
  18084. Type string `json:"type,omitempty"`
  18085. // ForceSendFields is a list of field names (e.g. "Amount") to
  18086. // unconditionally include in API requests. By default, fields with
  18087. // empty values are omitted from API requests. However, any non-pointer,
  18088. // non-interface field appearing in ForceSendFields will be sent to the
  18089. // server regardless of whether the field is empty or not. This may be
  18090. // used to include empty fields in Patch requests.
  18091. ForceSendFields []string `json:"-"`
  18092. // NullFields is a list of field names (e.g. "Amount") to include in API
  18093. // requests with the JSON null value. By default, fields with empty
  18094. // values are omitted from API requests. However, any field with an
  18095. // empty value appearing in NullFields will be sent to the server as
  18096. // null. It is an error if a field in this list has a non-empty value.
  18097. // This may be used to include null fields in Patch requests.
  18098. NullFields []string `json:"-"`
  18099. }
  18100. func (s *ResourceCommitment) MarshalJSON() ([]byte, error) {
  18101. type NoMethod ResourceCommitment
  18102. raw := NoMethod(*s)
  18103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18104. }
  18105. type ResourceGroupReference struct {
  18106. // Group: A URI referencing one of the instance groups or network
  18107. // endpoint groups listed in the backend service.
  18108. Group string `json:"group,omitempty"`
  18109. // ForceSendFields is a list of field names (e.g. "Group") to
  18110. // unconditionally include in API requests. By default, fields with
  18111. // empty values are omitted from API requests. However, any non-pointer,
  18112. // non-interface field appearing in ForceSendFields will be sent to the
  18113. // server regardless of whether the field is empty or not. This may be
  18114. // used to include empty fields in Patch requests.
  18115. ForceSendFields []string `json:"-"`
  18116. // NullFields is a list of field names (e.g. "Group") to include in API
  18117. // requests with the JSON null value. By default, fields with empty
  18118. // values are omitted from API requests. However, any field with an
  18119. // empty value appearing in NullFields will be sent to the server as
  18120. // null. It is an error if a field in this list has a non-empty value.
  18121. // This may be used to include null fields in Patch requests.
  18122. NullFields []string `json:"-"`
  18123. }
  18124. func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
  18125. type NoMethod ResourceGroupReference
  18126. raw := NoMethod(*s)
  18127. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18128. }
  18129. // Route: Represents a Route resource. A route specifies how certain
  18130. // packets should be handled by the network. Routes are associated with
  18131. // instances by tags and the set of routes for a particular instance is
  18132. // called its routing table.
  18133. //
  18134. // For each packet leaving an instance, the system searches that
  18135. // instance's routing table for a single best matching route. Routes
  18136. // match packets by destination IP address, preferring smaller or more
  18137. // specific ranges over larger ones. If there is a tie, the system
  18138. // selects the route with the smallest priority value. If there is still
  18139. // a tie, it uses the layer three and four packet headers to select just
  18140. // one of the remaining matching routes. The packet is then forwarded as
  18141. // specified by the nextHop field of the winning route - either to
  18142. // another instance destination, an instance gateway, or a Google
  18143. // Compute Engine-operated gateway.
  18144. //
  18145. // Packets that do not match any route in the sending instance's routing
  18146. // table are dropped. (== resource_for beta.routes ==) (== resource_for
  18147. // v1.routes ==)
  18148. type Route struct {
  18149. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  18150. // format.
  18151. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  18152. // Description: An optional description of this resource. Provide this
  18153. // property when you create the resource.
  18154. Description string `json:"description,omitempty"`
  18155. // DestRange: The destination range of outgoing packets that this route
  18156. // applies to. Only IPv4 is supported.
  18157. DestRange string `json:"destRange,omitempty"`
  18158. // Id: [Output Only] The unique identifier for the resource. This
  18159. // identifier is defined by the server.
  18160. Id uint64 `json:"id,omitempty,string"`
  18161. // Kind: [Output Only] Type of this resource. Always compute#routes for
  18162. // Route resources.
  18163. Kind string `json:"kind,omitempty"`
  18164. // Name: Name of the resource. Provided by the client when the resource
  18165. // is created. The name must be 1-63 characters long, and comply with
  18166. // RFC1035. Specifically, the name must be 1-63 characters long and
  18167. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  18168. // the first character must be a lowercase letter, and all following
  18169. // characters must be a dash, lowercase letter, or digit, except the
  18170. // last character, which cannot be a dash.
  18171. Name string `json:"name,omitempty"`
  18172. // Network: Fully-qualified URL of the network that this route applies
  18173. // to.
  18174. Network string `json:"network,omitempty"`
  18175. // NextHopGateway: The URL to a gateway that should handle matching
  18176. // packets. You can only specify the internet gateway using a full or
  18177. // partial valid URL:
  18178. // projects/<project-id>/global/gateways/default-internet-gateway
  18179. NextHopGateway string `json:"nextHopGateway,omitempty"`
  18180. // NextHopInstance: The URL to an instance that should handle matching
  18181. // packets. You can specify this as a full or partial URL. For
  18182. // example:
  18183. // https://www.googleapis.com/compute/v1/projects/project/zones/
  18184. // zone/instances/
  18185. NextHopInstance string `json:"nextHopInstance,omitempty"`
  18186. // NextHopIp: The network IP address of an instance that should handle
  18187. // matching packets. Only IPv4 is supported.
  18188. NextHopIp string `json:"nextHopIp,omitempty"`
  18189. // NextHopNetwork: The URL of the local network if it should handle
  18190. // matching packets.
  18191. NextHopNetwork string `json:"nextHopNetwork,omitempty"`
  18192. // NextHopPeering: [Output Only] The network peering name that should
  18193. // handle matching packets, which should conform to RFC1035.
  18194. NextHopPeering string `json:"nextHopPeering,omitempty"`
  18195. // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching
  18196. // packets.
  18197. NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"`
  18198. // Priority: The priority of this route. Priority is used to break ties
  18199. // in cases where there is more than one matching route of equal prefix
  18200. // length. In the case of two routes with equal prefix length, the one
  18201. // with the lowest-numbered priority value wins. Default value is 1000.
  18202. // Valid range is 0 through 65535.
  18203. Priority int64 `json:"priority,omitempty"`
  18204. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  18205. // resource.
  18206. SelfLink string `json:"selfLink,omitempty"`
  18207. // Tags: A list of instance tags to which this route applies.
  18208. Tags []string `json:"tags,omitempty"`
  18209. // Warnings: [Output Only] If potential misconfigurations are detected
  18210. // for this route, this field will be populated with warning messages.
  18211. Warnings []*RouteWarnings `json:"warnings,omitempty"`
  18212. // ServerResponse contains the HTTP response code and headers from the
  18213. // server.
  18214. googleapi.ServerResponse `json:"-"`
  18215. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  18216. // to unconditionally include in API requests. By default, fields with
  18217. // empty values are omitted from API requests. However, any non-pointer,
  18218. // non-interface field appearing in ForceSendFields will be sent to the
  18219. // server regardless of whether the field is empty or not. This may be
  18220. // used to include empty fields in Patch requests.
  18221. ForceSendFields []string `json:"-"`
  18222. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  18223. // include in API requests with the JSON null value. By default, fields
  18224. // with empty values are omitted from API requests. However, any field
  18225. // with an empty value appearing in NullFields will be sent to the
  18226. // server as null. It is an error if a field in this list has a
  18227. // non-empty value. This may be used to include null fields in Patch
  18228. // requests.
  18229. NullFields []string `json:"-"`
  18230. }
  18231. func (s *Route) MarshalJSON() ([]byte, error) {
  18232. type NoMethod Route
  18233. raw := NoMethod(*s)
  18234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18235. }
  18236. type RouteWarnings struct {
  18237. // Code: [Output Only] A warning code, if applicable. For example,
  18238. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18239. // the response.
  18240. //
  18241. // Possible values:
  18242. // "CLEANUP_FAILED"
  18243. // "DEPRECATED_RESOURCE_USED"
  18244. // "DEPRECATED_TYPE_USED"
  18245. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18246. // "EXPERIMENTAL_TYPE_USED"
  18247. // "EXTERNAL_API_WARNING"
  18248. // "FIELD_VALUE_OVERRIDEN"
  18249. // "INJECTED_KERNELS_DEPRECATED"
  18250. // "MISSING_TYPE_DEPENDENCY"
  18251. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18252. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18253. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18254. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18255. // "NEXT_HOP_NOT_RUNNING"
  18256. // "NOT_CRITICAL_ERROR"
  18257. // "NO_RESULTS_ON_PAGE"
  18258. // "REQUIRED_TOS_AGREEMENT"
  18259. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18260. // "RESOURCE_NOT_DELETED"
  18261. // "SCHEMA_VALIDATION_IGNORED"
  18262. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18263. // "UNDECLARED_PROPERTIES"
  18264. // "UNREACHABLE"
  18265. Code string `json:"code,omitempty"`
  18266. // Data: [Output Only] Metadata about this warning in key: value format.
  18267. // For example:
  18268. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18269. Data []*RouteWarningsData `json:"data,omitempty"`
  18270. // Message: [Output Only] A human-readable description of the warning
  18271. // code.
  18272. Message string `json:"message,omitempty"`
  18273. // ForceSendFields is a list of field names (e.g. "Code") to
  18274. // unconditionally include in API requests. By default, fields with
  18275. // empty values are omitted from API requests. However, any non-pointer,
  18276. // non-interface field appearing in ForceSendFields will be sent to the
  18277. // server regardless of whether the field is empty or not. This may be
  18278. // used to include empty fields in Patch requests.
  18279. ForceSendFields []string `json:"-"`
  18280. // NullFields is a list of field names (e.g. "Code") to include in API
  18281. // requests with the JSON null value. By default, fields with empty
  18282. // values are omitted from API requests. However, any field with an
  18283. // empty value appearing in NullFields will be sent to the server as
  18284. // null. It is an error if a field in this list has a non-empty value.
  18285. // This may be used to include null fields in Patch requests.
  18286. NullFields []string `json:"-"`
  18287. }
  18288. func (s *RouteWarnings) MarshalJSON() ([]byte, error) {
  18289. type NoMethod RouteWarnings
  18290. raw := NoMethod(*s)
  18291. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18292. }
  18293. type RouteWarningsData struct {
  18294. // Key: [Output Only] A key that provides more detail on the warning
  18295. // being returned. For example, for warnings where there are no results
  18296. // in a list request for a particular zone, this key might be scope and
  18297. // the key value might be the zone name. Other examples might be a key
  18298. // indicating a deprecated resource and a suggested replacement, or a
  18299. // warning about invalid network settings (for example, if an instance
  18300. // attempts to perform IP forwarding but is not enabled for IP
  18301. // forwarding).
  18302. Key string `json:"key,omitempty"`
  18303. // Value: [Output Only] A warning data value corresponding to the key.
  18304. Value string `json:"value,omitempty"`
  18305. // ForceSendFields is a list of field names (e.g. "Key") to
  18306. // unconditionally include in API requests. By default, fields with
  18307. // empty values are omitted from API requests. However, any non-pointer,
  18308. // non-interface field appearing in ForceSendFields will be sent to the
  18309. // server regardless of whether the field is empty or not. This may be
  18310. // used to include empty fields in Patch requests.
  18311. ForceSendFields []string `json:"-"`
  18312. // NullFields is a list of field names (e.g. "Key") to include in API
  18313. // requests with the JSON null value. By default, fields with empty
  18314. // values are omitted from API requests. However, any field with an
  18315. // empty value appearing in NullFields will be sent to the server as
  18316. // null. It is an error if a field in this list has a non-empty value.
  18317. // This may be used to include null fields in Patch requests.
  18318. NullFields []string `json:"-"`
  18319. }
  18320. func (s *RouteWarningsData) MarshalJSON() ([]byte, error) {
  18321. type NoMethod RouteWarningsData
  18322. raw := NoMethod(*s)
  18323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18324. }
  18325. // RouteList: Contains a list of Route resources.
  18326. type RouteList struct {
  18327. // Id: [Output Only] Unique identifier for the resource; defined by the
  18328. // server.
  18329. Id string `json:"id,omitempty"`
  18330. // Items: A list of Route resources.
  18331. Items []*Route `json:"items,omitempty"`
  18332. // Kind: Type of resource.
  18333. Kind string `json:"kind,omitempty"`
  18334. // NextPageToken: [Output Only] This token allows you to get the next
  18335. // page of results for list requests. If the number of results is larger
  18336. // than maxResults, use the nextPageToken as a value for the query
  18337. // parameter pageToken in the next list request. Subsequent list
  18338. // requests will have their own nextPageToken to continue paging through
  18339. // the results.
  18340. NextPageToken string `json:"nextPageToken,omitempty"`
  18341. // SelfLink: [Output Only] Server-defined URL for this resource.
  18342. SelfLink string `json:"selfLink,omitempty"`
  18343. // Warning: [Output Only] Informational warning message.
  18344. Warning *RouteListWarning `json:"warning,omitempty"`
  18345. // ServerResponse contains the HTTP response code and headers from the
  18346. // server.
  18347. googleapi.ServerResponse `json:"-"`
  18348. // ForceSendFields is a list of field names (e.g. "Id") to
  18349. // unconditionally include in API requests. By default, fields with
  18350. // empty values are omitted from API requests. However, any non-pointer,
  18351. // non-interface field appearing in ForceSendFields will be sent to the
  18352. // server regardless of whether the field is empty or not. This may be
  18353. // used to include empty fields in Patch requests.
  18354. ForceSendFields []string `json:"-"`
  18355. // NullFields is a list of field names (e.g. "Id") to include in API
  18356. // requests with the JSON null value. By default, fields with empty
  18357. // values are omitted from API requests. However, any field with an
  18358. // empty value appearing in NullFields will be sent to the server as
  18359. // null. It is an error if a field in this list has a non-empty value.
  18360. // This may be used to include null fields in Patch requests.
  18361. NullFields []string `json:"-"`
  18362. }
  18363. func (s *RouteList) MarshalJSON() ([]byte, error) {
  18364. type NoMethod RouteList
  18365. raw := NoMethod(*s)
  18366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18367. }
  18368. // RouteListWarning: [Output Only] Informational warning message.
  18369. type RouteListWarning struct {
  18370. // Code: [Output Only] A warning code, if applicable. For example,
  18371. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18372. // the response.
  18373. //
  18374. // Possible values:
  18375. // "CLEANUP_FAILED"
  18376. // "DEPRECATED_RESOURCE_USED"
  18377. // "DEPRECATED_TYPE_USED"
  18378. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18379. // "EXPERIMENTAL_TYPE_USED"
  18380. // "EXTERNAL_API_WARNING"
  18381. // "FIELD_VALUE_OVERRIDEN"
  18382. // "INJECTED_KERNELS_DEPRECATED"
  18383. // "MISSING_TYPE_DEPENDENCY"
  18384. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18385. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18386. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18387. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18388. // "NEXT_HOP_NOT_RUNNING"
  18389. // "NOT_CRITICAL_ERROR"
  18390. // "NO_RESULTS_ON_PAGE"
  18391. // "REQUIRED_TOS_AGREEMENT"
  18392. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18393. // "RESOURCE_NOT_DELETED"
  18394. // "SCHEMA_VALIDATION_IGNORED"
  18395. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18396. // "UNDECLARED_PROPERTIES"
  18397. // "UNREACHABLE"
  18398. Code string `json:"code,omitempty"`
  18399. // Data: [Output Only] Metadata about this warning in key: value format.
  18400. // For example:
  18401. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18402. Data []*RouteListWarningData `json:"data,omitempty"`
  18403. // Message: [Output Only] A human-readable description of the warning
  18404. // code.
  18405. Message string `json:"message,omitempty"`
  18406. // ForceSendFields is a list of field names (e.g. "Code") to
  18407. // unconditionally include in API requests. By default, fields with
  18408. // empty values are omitted from API requests. However, any non-pointer,
  18409. // non-interface field appearing in ForceSendFields will be sent to the
  18410. // server regardless of whether the field is empty or not. This may be
  18411. // used to include empty fields in Patch requests.
  18412. ForceSendFields []string `json:"-"`
  18413. // NullFields is a list of field names (e.g. "Code") to include in API
  18414. // requests with the JSON null value. By default, fields with empty
  18415. // values are omitted from API requests. However, any field with an
  18416. // empty value appearing in NullFields will be sent to the server as
  18417. // null. It is an error if a field in this list has a non-empty value.
  18418. // This may be used to include null fields in Patch requests.
  18419. NullFields []string `json:"-"`
  18420. }
  18421. func (s *RouteListWarning) MarshalJSON() ([]byte, error) {
  18422. type NoMethod RouteListWarning
  18423. raw := NoMethod(*s)
  18424. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18425. }
  18426. type RouteListWarningData struct {
  18427. // Key: [Output Only] A key that provides more detail on the warning
  18428. // being returned. For example, for warnings where there are no results
  18429. // in a list request for a particular zone, this key might be scope and
  18430. // the key value might be the zone name. Other examples might be a key
  18431. // indicating a deprecated resource and a suggested replacement, or a
  18432. // warning about invalid network settings (for example, if an instance
  18433. // attempts to perform IP forwarding but is not enabled for IP
  18434. // forwarding).
  18435. Key string `json:"key,omitempty"`
  18436. // Value: [Output Only] A warning data value corresponding to the key.
  18437. Value string `json:"value,omitempty"`
  18438. // ForceSendFields is a list of field names (e.g. "Key") to
  18439. // unconditionally include in API requests. By default, fields with
  18440. // empty values are omitted from API requests. However, any non-pointer,
  18441. // non-interface field appearing in ForceSendFields will be sent to the
  18442. // server regardless of whether the field is empty or not. This may be
  18443. // used to include empty fields in Patch requests.
  18444. ForceSendFields []string `json:"-"`
  18445. // NullFields is a list of field names (e.g. "Key") to include in API
  18446. // requests with the JSON null value. By default, fields with empty
  18447. // values are omitted from API requests. However, any field with an
  18448. // empty value appearing in NullFields will be sent to the server as
  18449. // null. It is an error if a field in this list has a non-empty value.
  18450. // This may be used to include null fields in Patch requests.
  18451. NullFields []string `json:"-"`
  18452. }
  18453. func (s *RouteListWarningData) MarshalJSON() ([]byte, error) {
  18454. type NoMethod RouteListWarningData
  18455. raw := NoMethod(*s)
  18456. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18457. }
  18458. // Router: Router resource.
  18459. type Router struct {
  18460. // Bgp: BGP information specific to this router.
  18461. Bgp *RouterBgp `json:"bgp,omitempty"`
  18462. // BgpPeers: BGP information that needs to be configured into the
  18463. // routing stack to establish the BGP peering. It must specify peer ASN
  18464. // and either interface name, IP, or peer IP. Please refer to RFC4273.
  18465. BgpPeers []*RouterBgpPeer `json:"bgpPeers,omitempty"`
  18466. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  18467. // format.
  18468. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  18469. // Description: An optional description of this resource. Provide this
  18470. // property when you create the resource.
  18471. Description string `json:"description,omitempty"`
  18472. // Id: [Output Only] The unique identifier for the resource. This
  18473. // identifier is defined by the server.
  18474. Id uint64 `json:"id,omitempty,string"`
  18475. // Interfaces: Router interfaces. Each interface requires either one
  18476. // linked resource (e.g. linkedVpnTunnel), or IP address and IP address
  18477. // range (e.g. ipRange), or both.
  18478. Interfaces []*RouterInterface `json:"interfaces,omitempty"`
  18479. // Kind: [Output Only] Type of resource. Always compute#router for
  18480. // routers.
  18481. Kind string `json:"kind,omitempty"`
  18482. // Name: Name of the resource. Provided by the client when the resource
  18483. // is created. The name must be 1-63 characters long, and comply with
  18484. // RFC1035. Specifically, the name must be 1-63 characters long and
  18485. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  18486. // the first character must be a lowercase letter, and all following
  18487. // characters must be a dash, lowercase letter, or digit, except the
  18488. // last character, which cannot be a dash.
  18489. Name string `json:"name,omitempty"`
  18490. // Nats: A list of Nat services created in this router.
  18491. Nats []*RouterNat `json:"nats,omitempty"`
  18492. // Network: URI of the network to which this router belongs.
  18493. Network string `json:"network,omitempty"`
  18494. // Region: [Output Only] URI of the region where the router resides. You
  18495. // must specify this field as part of the HTTP request URL. It is not
  18496. // settable as a field in the request body.
  18497. Region string `json:"region,omitempty"`
  18498. // SelfLink: [Output Only] Server-defined URL for the resource.
  18499. SelfLink string `json:"selfLink,omitempty"`
  18500. // ServerResponse contains the HTTP response code and headers from the
  18501. // server.
  18502. googleapi.ServerResponse `json:"-"`
  18503. // ForceSendFields is a list of field names (e.g. "Bgp") to
  18504. // unconditionally include in API requests. By default, fields with
  18505. // empty values are omitted from API requests. However, any non-pointer,
  18506. // non-interface field appearing in ForceSendFields will be sent to the
  18507. // server regardless of whether the field is empty or not. This may be
  18508. // used to include empty fields in Patch requests.
  18509. ForceSendFields []string `json:"-"`
  18510. // NullFields is a list of field names (e.g. "Bgp") to include in API
  18511. // requests with the JSON null value. By default, fields with empty
  18512. // values are omitted from API requests. However, any field with an
  18513. // empty value appearing in NullFields will be sent to the server as
  18514. // null. It is an error if a field in this list has a non-empty value.
  18515. // This may be used to include null fields in Patch requests.
  18516. NullFields []string `json:"-"`
  18517. }
  18518. func (s *Router) MarshalJSON() ([]byte, error) {
  18519. type NoMethod Router
  18520. raw := NoMethod(*s)
  18521. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18522. }
  18523. // RouterAdvertisedIpRange: Description-tagged IP ranges for the router
  18524. // to advertise.
  18525. type RouterAdvertisedIpRange struct {
  18526. // Description: User-specified description for the IP range.
  18527. Description string `json:"description,omitempty"`
  18528. // Range: The IP range to advertise. The value must be a CIDR-formatted
  18529. // string.
  18530. Range string `json:"range,omitempty"`
  18531. // ForceSendFields is a list of field names (e.g. "Description") to
  18532. // unconditionally include in API requests. By default, fields with
  18533. // empty values are omitted from API requests. However, any non-pointer,
  18534. // non-interface field appearing in ForceSendFields will be sent to the
  18535. // server regardless of whether the field is empty or not. This may be
  18536. // used to include empty fields in Patch requests.
  18537. ForceSendFields []string `json:"-"`
  18538. // NullFields is a list of field names (e.g. "Description") to include
  18539. // in API requests with the JSON null value. By default, fields with
  18540. // empty values are omitted from API requests. However, any field with
  18541. // an empty value appearing in NullFields will be sent to the server as
  18542. // null. It is an error if a field in this list has a non-empty value.
  18543. // This may be used to include null fields in Patch requests.
  18544. NullFields []string `json:"-"`
  18545. }
  18546. func (s *RouterAdvertisedIpRange) MarshalJSON() ([]byte, error) {
  18547. type NoMethod RouterAdvertisedIpRange
  18548. raw := NoMethod(*s)
  18549. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18550. }
  18551. // RouterAggregatedList: Contains a list of routers.
  18552. type RouterAggregatedList struct {
  18553. // Id: [Output Only] Unique identifier for the resource; defined by the
  18554. // server.
  18555. Id string `json:"id,omitempty"`
  18556. // Items: A list of Router resources.
  18557. Items map[string]RoutersScopedList `json:"items,omitempty"`
  18558. // Kind: Type of resource.
  18559. Kind string `json:"kind,omitempty"`
  18560. // NextPageToken: [Output Only] This token allows you to get the next
  18561. // page of results for list requests. If the number of results is larger
  18562. // than maxResults, use the nextPageToken as a value for the query
  18563. // parameter pageToken in the next list request. Subsequent list
  18564. // requests will have their own nextPageToken to continue paging through
  18565. // the results.
  18566. NextPageToken string `json:"nextPageToken,omitempty"`
  18567. // SelfLink: [Output Only] Server-defined URL for this resource.
  18568. SelfLink string `json:"selfLink,omitempty"`
  18569. // Warning: [Output Only] Informational warning message.
  18570. Warning *RouterAggregatedListWarning `json:"warning,omitempty"`
  18571. // ServerResponse contains the HTTP response code and headers from the
  18572. // server.
  18573. googleapi.ServerResponse `json:"-"`
  18574. // ForceSendFields is a list of field names (e.g. "Id") to
  18575. // unconditionally include in API requests. By default, fields with
  18576. // empty values are omitted from API requests. However, any non-pointer,
  18577. // non-interface field appearing in ForceSendFields will be sent to the
  18578. // server regardless of whether the field is empty or not. This may be
  18579. // used to include empty fields in Patch requests.
  18580. ForceSendFields []string `json:"-"`
  18581. // NullFields is a list of field names (e.g. "Id") to include in API
  18582. // requests with the JSON null value. By default, fields with empty
  18583. // values are omitted from API requests. However, any field with an
  18584. // empty value appearing in NullFields will be sent to the server as
  18585. // null. It is an error if a field in this list has a non-empty value.
  18586. // This may be used to include null fields in Patch requests.
  18587. NullFields []string `json:"-"`
  18588. }
  18589. func (s *RouterAggregatedList) MarshalJSON() ([]byte, error) {
  18590. type NoMethod RouterAggregatedList
  18591. raw := NoMethod(*s)
  18592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18593. }
  18594. // RouterAggregatedListWarning: [Output Only] Informational warning
  18595. // message.
  18596. type RouterAggregatedListWarning struct {
  18597. // Code: [Output Only] A warning code, if applicable. For example,
  18598. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18599. // the response.
  18600. //
  18601. // Possible values:
  18602. // "CLEANUP_FAILED"
  18603. // "DEPRECATED_RESOURCE_USED"
  18604. // "DEPRECATED_TYPE_USED"
  18605. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18606. // "EXPERIMENTAL_TYPE_USED"
  18607. // "EXTERNAL_API_WARNING"
  18608. // "FIELD_VALUE_OVERRIDEN"
  18609. // "INJECTED_KERNELS_DEPRECATED"
  18610. // "MISSING_TYPE_DEPENDENCY"
  18611. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18612. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18613. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18614. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18615. // "NEXT_HOP_NOT_RUNNING"
  18616. // "NOT_CRITICAL_ERROR"
  18617. // "NO_RESULTS_ON_PAGE"
  18618. // "REQUIRED_TOS_AGREEMENT"
  18619. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18620. // "RESOURCE_NOT_DELETED"
  18621. // "SCHEMA_VALIDATION_IGNORED"
  18622. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18623. // "UNDECLARED_PROPERTIES"
  18624. // "UNREACHABLE"
  18625. Code string `json:"code,omitempty"`
  18626. // Data: [Output Only] Metadata about this warning in key: value format.
  18627. // For example:
  18628. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18629. Data []*RouterAggregatedListWarningData `json:"data,omitempty"`
  18630. // Message: [Output Only] A human-readable description of the warning
  18631. // code.
  18632. Message string `json:"message,omitempty"`
  18633. // ForceSendFields is a list of field names (e.g. "Code") to
  18634. // unconditionally include in API requests. By default, fields with
  18635. // empty values are omitted from API requests. However, any non-pointer,
  18636. // non-interface field appearing in ForceSendFields will be sent to the
  18637. // server regardless of whether the field is empty or not. This may be
  18638. // used to include empty fields in Patch requests.
  18639. ForceSendFields []string `json:"-"`
  18640. // NullFields is a list of field names (e.g. "Code") to include in API
  18641. // requests with the JSON null value. By default, fields with empty
  18642. // values are omitted from API requests. However, any field with an
  18643. // empty value appearing in NullFields will be sent to the server as
  18644. // null. It is an error if a field in this list has a non-empty value.
  18645. // This may be used to include null fields in Patch requests.
  18646. NullFields []string `json:"-"`
  18647. }
  18648. func (s *RouterAggregatedListWarning) MarshalJSON() ([]byte, error) {
  18649. type NoMethod RouterAggregatedListWarning
  18650. raw := NoMethod(*s)
  18651. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18652. }
  18653. type RouterAggregatedListWarningData struct {
  18654. // Key: [Output Only] A key that provides more detail on the warning
  18655. // being returned. For example, for warnings where there are no results
  18656. // in a list request for a particular zone, this key might be scope and
  18657. // the key value might be the zone name. Other examples might be a key
  18658. // indicating a deprecated resource and a suggested replacement, or a
  18659. // warning about invalid network settings (for example, if an instance
  18660. // attempts to perform IP forwarding but is not enabled for IP
  18661. // forwarding).
  18662. Key string `json:"key,omitempty"`
  18663. // Value: [Output Only] A warning data value corresponding to the key.
  18664. Value string `json:"value,omitempty"`
  18665. // ForceSendFields is a list of field names (e.g. "Key") to
  18666. // unconditionally include in API requests. By default, fields with
  18667. // empty values are omitted from API requests. However, any non-pointer,
  18668. // non-interface field appearing in ForceSendFields will be sent to the
  18669. // server regardless of whether the field is empty or not. This may be
  18670. // used to include empty fields in Patch requests.
  18671. ForceSendFields []string `json:"-"`
  18672. // NullFields is a list of field names (e.g. "Key") to include in API
  18673. // requests with the JSON null value. By default, fields with empty
  18674. // values are omitted from API requests. However, any field with an
  18675. // empty value appearing in NullFields will be sent to the server as
  18676. // null. It is an error if a field in this list has a non-empty value.
  18677. // This may be used to include null fields in Patch requests.
  18678. NullFields []string `json:"-"`
  18679. }
  18680. func (s *RouterAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  18681. type NoMethod RouterAggregatedListWarningData
  18682. raw := NoMethod(*s)
  18683. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18684. }
  18685. type RouterBgp struct {
  18686. // AdvertiseMode: User-specified flag to indicate which mode to use for
  18687. // advertisement.
  18688. //
  18689. // Possible values:
  18690. // "CUSTOM"
  18691. // "DEFAULT"
  18692. AdvertiseMode string `json:"advertiseMode,omitempty"`
  18693. // AdvertisedGroups: User-specified list of prefix groups to advertise
  18694. // in custom mode. This field can only be populated if advertise_mode is
  18695. // CUSTOM and is advertised to all peers of the router. These groups
  18696. // will be advertised in addition to any specified prefixes. Leave this
  18697. // field blank to advertise no custom groups.
  18698. //
  18699. // Possible values:
  18700. // "ALL_SUBNETS"
  18701. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  18702. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  18703. // advertise in custom mode. This field can only be populated if
  18704. // advertise_mode is CUSTOM and is advertised to all peers of the
  18705. // router. These IP ranges will be advertised in addition to any
  18706. // specified groups. Leave this field blank to advertise no custom IP
  18707. // ranges.
  18708. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  18709. // Asn: Local BGP Autonomous System Number (ASN). Must be an RFC6996
  18710. // private ASN, either 16-bit or 32-bit. The value will be fixed for
  18711. // this router resource. All VPN tunnels that link to this router will
  18712. // have the same local ASN.
  18713. Asn int64 `json:"asn,omitempty"`
  18714. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  18715. // unconditionally include in API requests. By default, fields with
  18716. // empty values are omitted from API requests. However, any non-pointer,
  18717. // non-interface field appearing in ForceSendFields will be sent to the
  18718. // server regardless of whether the field is empty or not. This may be
  18719. // used to include empty fields in Patch requests.
  18720. ForceSendFields []string `json:"-"`
  18721. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  18722. // in API requests with the JSON null value. By default, fields with
  18723. // empty values are omitted from API requests. However, any field with
  18724. // an empty value appearing in NullFields will be sent to the server as
  18725. // null. It is an error if a field in this list has a non-empty value.
  18726. // This may be used to include null fields in Patch requests.
  18727. NullFields []string `json:"-"`
  18728. }
  18729. func (s *RouterBgp) MarshalJSON() ([]byte, error) {
  18730. type NoMethod RouterBgp
  18731. raw := NoMethod(*s)
  18732. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18733. }
  18734. type RouterBgpPeer struct {
  18735. // AdvertiseMode: User-specified flag to indicate which mode to use for
  18736. // advertisement.
  18737. //
  18738. // Possible values:
  18739. // "CUSTOM"
  18740. // "DEFAULT"
  18741. AdvertiseMode string `json:"advertiseMode,omitempty"`
  18742. // AdvertisedGroups: User-specified list of prefix groups to advertise
  18743. // in custom mode. This field can only be populated if advertise_mode is
  18744. // CUSTOM and overrides the list defined for the router (in Bgp
  18745. // message). These groups will be advertised in addition to any
  18746. // specified prefixes. Leave this field blank to advertise no custom
  18747. // groups.
  18748. //
  18749. // Possible values:
  18750. // "ALL_SUBNETS"
  18751. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  18752. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  18753. // advertise in custom mode. This field can only be populated if
  18754. // advertise_mode is CUSTOM and overrides the list defined for the
  18755. // router (in Bgp message). These IP ranges will be advertised in
  18756. // addition to any specified groups. Leave this field blank to advertise
  18757. // no custom IP ranges.
  18758. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  18759. // AdvertisedRoutePriority: The priority of routes advertised to this
  18760. // BGP peer. In the case where there is more than one matching route of
  18761. // maximum length, the routes with lowest priority value win.
  18762. AdvertisedRoutePriority int64 `json:"advertisedRoutePriority,omitempty"`
  18763. // InterfaceName: Name of the interface the BGP peer is associated with.
  18764. InterfaceName string `json:"interfaceName,omitempty"`
  18765. // IpAddress: IP address of the interface inside Google Cloud Platform.
  18766. // Only IPv4 is supported.
  18767. IpAddress string `json:"ipAddress,omitempty"`
  18768. // ManagementType: [Output Only] The resource that configures and
  18769. // manages this BGP peer. MANAGED_BY_USER is the default value and can
  18770. // be managed by you or other users; MANAGED_BY_ATTACHMENT is a BGP peer
  18771. // that is configured and managed by Cloud Interconnect, specifically by
  18772. // an InterconnectAttachment of type PARTNER. Google will automatically
  18773. // create, update, and delete this type of BGP peer when the PARTNER
  18774. // InterconnectAttachment is created, updated, or deleted.
  18775. //
  18776. // Possible values:
  18777. // "MANAGED_BY_ATTACHMENT"
  18778. // "MANAGED_BY_USER"
  18779. ManagementType string `json:"managementType,omitempty"`
  18780. // Name: Name of this BGP peer. The name must be 1-63 characters long
  18781. // and comply with RFC1035.
  18782. Name string `json:"name,omitempty"`
  18783. // PeerAsn: Peer BGP Autonomous System Number (ASN). For VPN use case,
  18784. // this value can be different for every tunnel.
  18785. PeerAsn int64 `json:"peerAsn,omitempty"`
  18786. // PeerIpAddress: IP address of the BGP interface outside Google cloud.
  18787. // Only IPv4 is supported.
  18788. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  18789. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  18790. // unconditionally include in API requests. By default, fields with
  18791. // empty values are omitted from API requests. However, any non-pointer,
  18792. // non-interface field appearing in ForceSendFields will be sent to the
  18793. // server regardless of whether the field is empty or not. This may be
  18794. // used to include empty fields in Patch requests.
  18795. ForceSendFields []string `json:"-"`
  18796. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  18797. // in API requests with the JSON null value. By default, fields with
  18798. // empty values are omitted from API requests. However, any field with
  18799. // an empty value appearing in NullFields will be sent to the server as
  18800. // null. It is an error if a field in this list has a non-empty value.
  18801. // This may be used to include null fields in Patch requests.
  18802. NullFields []string `json:"-"`
  18803. }
  18804. func (s *RouterBgpPeer) MarshalJSON() ([]byte, error) {
  18805. type NoMethod RouterBgpPeer
  18806. raw := NoMethod(*s)
  18807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18808. }
  18809. type RouterInterface struct {
  18810. // IpRange: IP address and range of the interface. The IP range must be
  18811. // in the RFC3927 link-local IP space. The value must be a
  18812. // CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not
  18813. // truncate the address as it represents the IP address of the
  18814. // interface.
  18815. IpRange string `json:"ipRange,omitempty"`
  18816. // LinkedInterconnectAttachment: URI of the linked interconnect
  18817. // attachment. It must be in the same region as the router. Each
  18818. // interface can have at most one linked resource and it could either be
  18819. // a VPN Tunnel or an interconnect attachment.
  18820. LinkedInterconnectAttachment string `json:"linkedInterconnectAttachment,omitempty"`
  18821. // LinkedVpnTunnel: URI of the linked VPN tunnel. It must be in the same
  18822. // region as the router. Each interface can have at most one linked
  18823. // resource and it could either be a VPN Tunnel or an interconnect
  18824. // attachment.
  18825. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  18826. // ManagementType: [Output Only] The resource that configures and
  18827. // manages this interface. MANAGED_BY_USER is the default value and can
  18828. // be managed by you or other users; MANAGED_BY_ATTACHMENT is an
  18829. // interface that is configured and managed by Cloud Interconnect,
  18830. // specifically by an InterconnectAttachment of type PARTNER. Google
  18831. // will automatically create, update, and delete this type of interface
  18832. // when the PARTNER InterconnectAttachment is created, updated, or
  18833. // deleted.
  18834. //
  18835. // Possible values:
  18836. // "MANAGED_BY_ATTACHMENT"
  18837. // "MANAGED_BY_USER"
  18838. ManagementType string `json:"managementType,omitempty"`
  18839. // Name: Name of this interface entry. The name must be 1-63 characters
  18840. // long and comply with RFC1035.
  18841. Name string `json:"name,omitempty"`
  18842. // ForceSendFields is a list of field names (e.g. "IpRange") to
  18843. // unconditionally include in API requests. By default, fields with
  18844. // empty values are omitted from API requests. However, any non-pointer,
  18845. // non-interface field appearing in ForceSendFields will be sent to the
  18846. // server regardless of whether the field is empty or not. This may be
  18847. // used to include empty fields in Patch requests.
  18848. ForceSendFields []string `json:"-"`
  18849. // NullFields is a list of field names (e.g. "IpRange") to include in
  18850. // API requests with the JSON null value. By default, fields with empty
  18851. // values are omitted from API requests. However, any field with an
  18852. // empty value appearing in NullFields will be sent to the server as
  18853. // null. It is an error if a field in this list has a non-empty value.
  18854. // This may be used to include null fields in Patch requests.
  18855. NullFields []string `json:"-"`
  18856. }
  18857. func (s *RouterInterface) MarshalJSON() ([]byte, error) {
  18858. type NoMethod RouterInterface
  18859. raw := NoMethod(*s)
  18860. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18861. }
  18862. // RouterList: Contains a list of Router resources.
  18863. type RouterList struct {
  18864. // Id: [Output Only] Unique identifier for the resource; defined by the
  18865. // server.
  18866. Id string `json:"id,omitempty"`
  18867. // Items: A list of Router resources.
  18868. Items []*Router `json:"items,omitempty"`
  18869. // Kind: [Output Only] Type of resource. Always compute#router for
  18870. // routers.
  18871. Kind string `json:"kind,omitempty"`
  18872. // NextPageToken: [Output Only] This token allows you to get the next
  18873. // page of results for list requests. If the number of results is larger
  18874. // than maxResults, use the nextPageToken as a value for the query
  18875. // parameter pageToken in the next list request. Subsequent list
  18876. // requests will have their own nextPageToken to continue paging through
  18877. // the results.
  18878. NextPageToken string `json:"nextPageToken,omitempty"`
  18879. // SelfLink: [Output Only] Server-defined URL for this resource.
  18880. SelfLink string `json:"selfLink,omitempty"`
  18881. // Warning: [Output Only] Informational warning message.
  18882. Warning *RouterListWarning `json:"warning,omitempty"`
  18883. // ServerResponse contains the HTTP response code and headers from the
  18884. // server.
  18885. googleapi.ServerResponse `json:"-"`
  18886. // ForceSendFields is a list of field names (e.g. "Id") to
  18887. // unconditionally include in API requests. By default, fields with
  18888. // empty values are omitted from API requests. However, any non-pointer,
  18889. // non-interface field appearing in ForceSendFields will be sent to the
  18890. // server regardless of whether the field is empty or not. This may be
  18891. // used to include empty fields in Patch requests.
  18892. ForceSendFields []string `json:"-"`
  18893. // NullFields is a list of field names (e.g. "Id") to include in API
  18894. // requests with the JSON null value. By default, fields with empty
  18895. // values are omitted from API requests. However, any field with an
  18896. // empty value appearing in NullFields will be sent to the server as
  18897. // null. It is an error if a field in this list has a non-empty value.
  18898. // This may be used to include null fields in Patch requests.
  18899. NullFields []string `json:"-"`
  18900. }
  18901. func (s *RouterList) MarshalJSON() ([]byte, error) {
  18902. type NoMethod RouterList
  18903. raw := NoMethod(*s)
  18904. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18905. }
  18906. // RouterListWarning: [Output Only] Informational warning message.
  18907. type RouterListWarning struct {
  18908. // Code: [Output Only] A warning code, if applicable. For example,
  18909. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18910. // the response.
  18911. //
  18912. // Possible values:
  18913. // "CLEANUP_FAILED"
  18914. // "DEPRECATED_RESOURCE_USED"
  18915. // "DEPRECATED_TYPE_USED"
  18916. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18917. // "EXPERIMENTAL_TYPE_USED"
  18918. // "EXTERNAL_API_WARNING"
  18919. // "FIELD_VALUE_OVERRIDEN"
  18920. // "INJECTED_KERNELS_DEPRECATED"
  18921. // "MISSING_TYPE_DEPENDENCY"
  18922. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18923. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18924. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18925. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18926. // "NEXT_HOP_NOT_RUNNING"
  18927. // "NOT_CRITICAL_ERROR"
  18928. // "NO_RESULTS_ON_PAGE"
  18929. // "REQUIRED_TOS_AGREEMENT"
  18930. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18931. // "RESOURCE_NOT_DELETED"
  18932. // "SCHEMA_VALIDATION_IGNORED"
  18933. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18934. // "UNDECLARED_PROPERTIES"
  18935. // "UNREACHABLE"
  18936. Code string `json:"code,omitempty"`
  18937. // Data: [Output Only] Metadata about this warning in key: value format.
  18938. // For example:
  18939. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18940. Data []*RouterListWarningData `json:"data,omitempty"`
  18941. // Message: [Output Only] A human-readable description of the warning
  18942. // code.
  18943. Message string `json:"message,omitempty"`
  18944. // ForceSendFields is a list of field names (e.g. "Code") to
  18945. // unconditionally include in API requests. By default, fields with
  18946. // empty values are omitted from API requests. However, any non-pointer,
  18947. // non-interface field appearing in ForceSendFields will be sent to the
  18948. // server regardless of whether the field is empty or not. This may be
  18949. // used to include empty fields in Patch requests.
  18950. ForceSendFields []string `json:"-"`
  18951. // NullFields is a list of field names (e.g. "Code") to include in API
  18952. // requests with the JSON null value. By default, fields with empty
  18953. // values are omitted from API requests. However, any field with an
  18954. // empty value appearing in NullFields will be sent to the server as
  18955. // null. It is an error if a field in this list has a non-empty value.
  18956. // This may be used to include null fields in Patch requests.
  18957. NullFields []string `json:"-"`
  18958. }
  18959. func (s *RouterListWarning) MarshalJSON() ([]byte, error) {
  18960. type NoMethod RouterListWarning
  18961. raw := NoMethod(*s)
  18962. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18963. }
  18964. type RouterListWarningData struct {
  18965. // Key: [Output Only] A key that provides more detail on the warning
  18966. // being returned. For example, for warnings where there are no results
  18967. // in a list request for a particular zone, this key might be scope and
  18968. // the key value might be the zone name. Other examples might be a key
  18969. // indicating a deprecated resource and a suggested replacement, or a
  18970. // warning about invalid network settings (for example, if an instance
  18971. // attempts to perform IP forwarding but is not enabled for IP
  18972. // forwarding).
  18973. Key string `json:"key,omitempty"`
  18974. // Value: [Output Only] A warning data value corresponding to the key.
  18975. Value string `json:"value,omitempty"`
  18976. // ForceSendFields is a list of field names (e.g. "Key") to
  18977. // unconditionally include in API requests. By default, fields with
  18978. // empty values are omitted from API requests. However, any non-pointer,
  18979. // non-interface field appearing in ForceSendFields will be sent to the
  18980. // server regardless of whether the field is empty or not. This may be
  18981. // used to include empty fields in Patch requests.
  18982. ForceSendFields []string `json:"-"`
  18983. // NullFields is a list of field names (e.g. "Key") to include in API
  18984. // requests with the JSON null value. By default, fields with empty
  18985. // values are omitted from API requests. However, any field with an
  18986. // empty value appearing in NullFields will be sent to the server as
  18987. // null. It is an error if a field in this list has a non-empty value.
  18988. // This may be used to include null fields in Patch requests.
  18989. NullFields []string `json:"-"`
  18990. }
  18991. func (s *RouterListWarningData) MarshalJSON() ([]byte, error) {
  18992. type NoMethod RouterListWarningData
  18993. raw := NoMethod(*s)
  18994. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18995. }
  18996. // RouterNat: Represents a Nat resource. It enables the VMs within the
  18997. // specified subnetworks to access Internet without external IP
  18998. // addresses. It specifies a list of subnetworks (and the ranges within)
  18999. // that want to use NAT. Customers can also provide the external IPs
  19000. // that would be used for NAT. GCP would auto-allocate ephemeral IPs if
  19001. // no external IPs are provided.
  19002. type RouterNat struct {
  19003. // IcmpIdleTimeoutSec: Timeout (in seconds) for ICMP connections.
  19004. // Defaults to 30s if not set.
  19005. IcmpIdleTimeoutSec int64 `json:"icmpIdleTimeoutSec,omitempty"`
  19006. // MinPortsPerVm: Minimum number of ports allocated to a VM from this
  19007. // NAT config. If not set, a default number of ports is allocated to a
  19008. // VM. This gets rounded up to the nearest power of 2. Eg. if the value
  19009. // of this field is 50, at least 64 ports will be allocated to a VM.
  19010. MinPortsPerVm int64 `json:"minPortsPerVm,omitempty"`
  19011. // Name: Unique name of this Nat service. The name must be 1-63
  19012. // characters long and comply with RFC1035.
  19013. Name string `json:"name,omitempty"`
  19014. // NatIpAllocateOption: Specify the NatIpAllocateOption. If it is
  19015. // AUTO_ONLY, then nat_ip should be empty.
  19016. //
  19017. // Possible values:
  19018. // "AUTO_ONLY"
  19019. // "MANUAL_ONLY"
  19020. NatIpAllocateOption string `json:"natIpAllocateOption,omitempty"`
  19021. // NatIps: A list of URLs of the IP resources used for this Nat service.
  19022. // These IPs must be valid static external IP addresses assigned to the
  19023. // project. max_length is subject to change post alpha.
  19024. NatIps []string `json:"natIps,omitempty"`
  19025. // SourceSubnetworkIpRangesToNat: Specify the Nat option. If this field
  19026. // contains ALL_SUBNETWORKS_ALL_IP_RANGES or
  19027. // ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any
  19028. // other Router.Nat section in any Router for this network in this
  19029. // region.
  19030. //
  19031. // Possible values:
  19032. // "ALL_SUBNETWORKS_ALL_IP_RANGES"
  19033. // "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES"
  19034. // "LIST_OF_SUBNETWORKS"
  19035. SourceSubnetworkIpRangesToNat string `json:"sourceSubnetworkIpRangesToNat,omitempty"`
  19036. // Subnetworks: A list of Subnetwork resources whose traffic should be
  19037. // translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS
  19038. // is selected for the SubnetworkIpRangeToNatOption above.
  19039. Subnetworks []*RouterNatSubnetworkToNat `json:"subnetworks,omitempty"`
  19040. // TcpEstablishedIdleTimeoutSec: Timeout (in seconds) for TCP
  19041. // established connections. Defaults to 1200s if not set.
  19042. TcpEstablishedIdleTimeoutSec int64 `json:"tcpEstablishedIdleTimeoutSec,omitempty"`
  19043. // TcpTransitoryIdleTimeoutSec: Timeout (in seconds) for TCP transitory
  19044. // connections. Defaults to 30s if not set.
  19045. TcpTransitoryIdleTimeoutSec int64 `json:"tcpTransitoryIdleTimeoutSec,omitempty"`
  19046. // UdpIdleTimeoutSec: Timeout (in seconds) for UDP connections. Defaults
  19047. // to 30s if not set.
  19048. UdpIdleTimeoutSec int64 `json:"udpIdleTimeoutSec,omitempty"`
  19049. // ForceSendFields is a list of field names (e.g. "IcmpIdleTimeoutSec")
  19050. // to unconditionally include in API requests. By default, fields with
  19051. // empty values are omitted from API requests. However, any non-pointer,
  19052. // non-interface field appearing in ForceSendFields will be sent to the
  19053. // server regardless of whether the field is empty or not. This may be
  19054. // used to include empty fields in Patch requests.
  19055. ForceSendFields []string `json:"-"`
  19056. // NullFields is a list of field names (e.g. "IcmpIdleTimeoutSec") to
  19057. // include in API requests with the JSON null value. By default, fields
  19058. // with empty values are omitted from API requests. However, any field
  19059. // with an empty value appearing in NullFields will be sent to the
  19060. // server as null. It is an error if a field in this list has a
  19061. // non-empty value. This may be used to include null fields in Patch
  19062. // requests.
  19063. NullFields []string `json:"-"`
  19064. }
  19065. func (s *RouterNat) MarshalJSON() ([]byte, error) {
  19066. type NoMethod RouterNat
  19067. raw := NoMethod(*s)
  19068. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19069. }
  19070. // RouterNatSubnetworkToNat: Defines the IP ranges that want to use NAT
  19071. // for a subnetwork.
  19072. type RouterNatSubnetworkToNat struct {
  19073. // Name: URL for the subnetwork resource to use NAT.
  19074. Name string `json:"name,omitempty"`
  19075. // SecondaryIpRangeNames: A list of the secondary ranges of the
  19076. // Subnetwork that are allowed to use NAT. This can be populated only if
  19077. // "LIST_OF_SECONDARY_IP_RANGES" is one of the values in
  19078. // source_ip_ranges_to_nat.
  19079. SecondaryIpRangeNames []string `json:"secondaryIpRangeNames,omitempty"`
  19080. // SourceIpRangesToNat: Specify the options for NAT ranges in the
  19081. // Subnetwork. All usages of single value are valid except
  19082. // NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple
  19083. // values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"]
  19084. // Default: [ALL_IP_RANGES]
  19085. //
  19086. // Possible values:
  19087. // "ALL_IP_RANGES"
  19088. // "LIST_OF_SECONDARY_IP_RANGES"
  19089. // "PRIMARY_IP_RANGE"
  19090. SourceIpRangesToNat []string `json:"sourceIpRangesToNat,omitempty"`
  19091. // ForceSendFields is a list of field names (e.g. "Name") to
  19092. // unconditionally include in API requests. By default, fields with
  19093. // empty values are omitted from API requests. However, any non-pointer,
  19094. // non-interface field appearing in ForceSendFields will be sent to the
  19095. // server regardless of whether the field is empty or not. This may be
  19096. // used to include empty fields in Patch requests.
  19097. ForceSendFields []string `json:"-"`
  19098. // NullFields is a list of field names (e.g. "Name") to include in API
  19099. // requests with the JSON null value. By default, fields with empty
  19100. // values are omitted from API requests. However, any field with an
  19101. // empty value appearing in NullFields will be sent to the server as
  19102. // null. It is an error if a field in this list has a non-empty value.
  19103. // This may be used to include null fields in Patch requests.
  19104. NullFields []string `json:"-"`
  19105. }
  19106. func (s *RouterNatSubnetworkToNat) MarshalJSON() ([]byte, error) {
  19107. type NoMethod RouterNatSubnetworkToNat
  19108. raw := NoMethod(*s)
  19109. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19110. }
  19111. type RouterStatus struct {
  19112. // BestRoutes: Best routes for this router's network.
  19113. BestRoutes []*Route `json:"bestRoutes,omitempty"`
  19114. // BestRoutesForRouter: Best routes learned by this router.
  19115. BestRoutesForRouter []*Route `json:"bestRoutesForRouter,omitempty"`
  19116. BgpPeerStatus []*RouterStatusBgpPeerStatus `json:"bgpPeerStatus,omitempty"`
  19117. NatStatus []*RouterStatusNatStatus `json:"natStatus,omitempty"`
  19118. // Network: URI of the network to which this router belongs.
  19119. Network string `json:"network,omitempty"`
  19120. // ForceSendFields is a list of field names (e.g. "BestRoutes") to
  19121. // unconditionally include in API requests. By default, fields with
  19122. // empty values are omitted from API requests. However, any non-pointer,
  19123. // non-interface field appearing in ForceSendFields will be sent to the
  19124. // server regardless of whether the field is empty or not. This may be
  19125. // used to include empty fields in Patch requests.
  19126. ForceSendFields []string `json:"-"`
  19127. // NullFields is a list of field names (e.g. "BestRoutes") to include in
  19128. // API requests with the JSON null value. By default, fields with empty
  19129. // values are omitted from API requests. However, any field with an
  19130. // empty value appearing in NullFields will be sent to the server as
  19131. // null. It is an error if a field in this list has a non-empty value.
  19132. // This may be used to include null fields in Patch requests.
  19133. NullFields []string `json:"-"`
  19134. }
  19135. func (s *RouterStatus) MarshalJSON() ([]byte, error) {
  19136. type NoMethod RouterStatus
  19137. raw := NoMethod(*s)
  19138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19139. }
  19140. type RouterStatusBgpPeerStatus struct {
  19141. // AdvertisedRoutes: Routes that were advertised to the remote BGP peer
  19142. AdvertisedRoutes []*Route `json:"advertisedRoutes,omitempty"`
  19143. // IpAddress: IP address of the local BGP interface.
  19144. IpAddress string `json:"ipAddress,omitempty"`
  19145. // LinkedVpnTunnel: URL of the VPN tunnel that this BGP peer controls.
  19146. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  19147. // Name: Name of this BGP peer. Unique within the Routers resource.
  19148. Name string `json:"name,omitempty"`
  19149. // NumLearnedRoutes: Number of routes learned from the remote BGP Peer.
  19150. NumLearnedRoutes int64 `json:"numLearnedRoutes,omitempty"`
  19151. // PeerIpAddress: IP address of the remote BGP interface.
  19152. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  19153. // State: BGP state as specified in RFC1771.
  19154. State string `json:"state,omitempty"`
  19155. // Status: Status of the BGP peer: {UP, DOWN}
  19156. //
  19157. // Possible values:
  19158. // "DOWN"
  19159. // "UNKNOWN"
  19160. // "UP"
  19161. Status string `json:"status,omitempty"`
  19162. // Uptime: Time this session has been up. Format: 14 years, 51 weeks, 6
  19163. // days, 23 hours, 59 minutes, 59 seconds
  19164. Uptime string `json:"uptime,omitempty"`
  19165. // UptimeSeconds: Time this session has been up, in seconds. Format: 145
  19166. UptimeSeconds string `json:"uptimeSeconds,omitempty"`
  19167. // ForceSendFields is a list of field names (e.g. "AdvertisedRoutes") to
  19168. // unconditionally include in API requests. By default, fields with
  19169. // empty values are omitted from API requests. However, any non-pointer,
  19170. // non-interface field appearing in ForceSendFields will be sent to the
  19171. // server regardless of whether the field is empty or not. This may be
  19172. // used to include empty fields in Patch requests.
  19173. ForceSendFields []string `json:"-"`
  19174. // NullFields is a list of field names (e.g. "AdvertisedRoutes") to
  19175. // include in API requests with the JSON null value. By default, fields
  19176. // with empty values are omitted from API requests. However, any field
  19177. // with an empty value appearing in NullFields will be sent to the
  19178. // server as null. It is an error if a field in this list has a
  19179. // non-empty value. This may be used to include null fields in Patch
  19180. // requests.
  19181. NullFields []string `json:"-"`
  19182. }
  19183. func (s *RouterStatusBgpPeerStatus) MarshalJSON() ([]byte, error) {
  19184. type NoMethod RouterStatusBgpPeerStatus
  19185. raw := NoMethod(*s)
  19186. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19187. }
  19188. // RouterStatusNatStatus: Status of a NAT contained in this router. Next
  19189. // tag: 9
  19190. type RouterStatusNatStatus struct {
  19191. // AutoAllocatedNatIps: A list of IPs auto-allocated for NAT. Example:
  19192. // ["1.1.1.1", "129.2.16.89"]
  19193. AutoAllocatedNatIps []string `json:"autoAllocatedNatIps,omitempty"`
  19194. // MinExtraNatIpsNeeded: The number of extra IPs to allocate. This will
  19195. // be greater than 0 only if user-specified IPs are NOT enough to allow
  19196. // all configured VMs to use NAT. This value is meaningful only when
  19197. // auto-allocation of NAT IPs is *not* used.
  19198. MinExtraNatIpsNeeded int64 `json:"minExtraNatIpsNeeded,omitempty"`
  19199. // Name: Unique name of this NAT.
  19200. Name string `json:"name,omitempty"`
  19201. // NumVmEndpointsWithNatMappings: Number of VM endpoints (i.e., Nics)
  19202. // that can use NAT.
  19203. NumVmEndpointsWithNatMappings int64 `json:"numVmEndpointsWithNatMappings,omitempty"`
  19204. // UserAllocatedNatIpResources: A list of fully qualified URLs of
  19205. // reserved IP address resources.
  19206. UserAllocatedNatIpResources []string `json:"userAllocatedNatIpResources,omitempty"`
  19207. // UserAllocatedNatIps: A list of IPs user-allocated for NAT. They will
  19208. // be raw IP strings like "179.12.26.133".
  19209. UserAllocatedNatIps []string `json:"userAllocatedNatIps,omitempty"`
  19210. // ForceSendFields is a list of field names (e.g. "AutoAllocatedNatIps")
  19211. // to unconditionally include in API requests. By default, fields with
  19212. // empty values are omitted from API requests. However, any non-pointer,
  19213. // non-interface field appearing in ForceSendFields will be sent to the
  19214. // server regardless of whether the field is empty or not. This may be
  19215. // used to include empty fields in Patch requests.
  19216. ForceSendFields []string `json:"-"`
  19217. // NullFields is a list of field names (e.g. "AutoAllocatedNatIps") to
  19218. // include in API requests with the JSON null value. By default, fields
  19219. // with empty values are omitted from API requests. However, any field
  19220. // with an empty value appearing in NullFields will be sent to the
  19221. // server as null. It is an error if a field in this list has a
  19222. // non-empty value. This may be used to include null fields in Patch
  19223. // requests.
  19224. NullFields []string `json:"-"`
  19225. }
  19226. func (s *RouterStatusNatStatus) MarshalJSON() ([]byte, error) {
  19227. type NoMethod RouterStatusNatStatus
  19228. raw := NoMethod(*s)
  19229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19230. }
  19231. type RouterStatusResponse struct {
  19232. // Kind: Type of resource.
  19233. Kind string `json:"kind,omitempty"`
  19234. Result *RouterStatus `json:"result,omitempty"`
  19235. // ServerResponse contains the HTTP response code and headers from the
  19236. // server.
  19237. googleapi.ServerResponse `json:"-"`
  19238. // ForceSendFields is a list of field names (e.g. "Kind") to
  19239. // unconditionally include in API requests. By default, fields with
  19240. // empty values are omitted from API requests. However, any non-pointer,
  19241. // non-interface field appearing in ForceSendFields will be sent to the
  19242. // server regardless of whether the field is empty or not. This may be
  19243. // used to include empty fields in Patch requests.
  19244. ForceSendFields []string `json:"-"`
  19245. // NullFields is a list of field names (e.g. "Kind") to include in API
  19246. // requests with the JSON null value. By default, fields with empty
  19247. // values are omitted from API requests. However, any field with an
  19248. // empty value appearing in NullFields will be sent to the server as
  19249. // null. It is an error if a field in this list has a non-empty value.
  19250. // This may be used to include null fields in Patch requests.
  19251. NullFields []string `json:"-"`
  19252. }
  19253. func (s *RouterStatusResponse) MarshalJSON() ([]byte, error) {
  19254. type NoMethod RouterStatusResponse
  19255. raw := NoMethod(*s)
  19256. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19257. }
  19258. type RoutersPreviewResponse struct {
  19259. // Resource: Preview of given router.
  19260. Resource *Router `json:"resource,omitempty"`
  19261. // ServerResponse contains the HTTP response code and headers from the
  19262. // server.
  19263. googleapi.ServerResponse `json:"-"`
  19264. // ForceSendFields is a list of field names (e.g. "Resource") to
  19265. // unconditionally include in API requests. By default, fields with
  19266. // empty values are omitted from API requests. However, any non-pointer,
  19267. // non-interface field appearing in ForceSendFields will be sent to the
  19268. // server regardless of whether the field is empty or not. This may be
  19269. // used to include empty fields in Patch requests.
  19270. ForceSendFields []string `json:"-"`
  19271. // NullFields is a list of field names (e.g. "Resource") to include in
  19272. // API requests with the JSON null value. By default, fields with empty
  19273. // values are omitted from API requests. However, any field with an
  19274. // empty value appearing in NullFields will be sent to the server as
  19275. // null. It is an error if a field in this list has a non-empty value.
  19276. // This may be used to include null fields in Patch requests.
  19277. NullFields []string `json:"-"`
  19278. }
  19279. func (s *RoutersPreviewResponse) MarshalJSON() ([]byte, error) {
  19280. type NoMethod RoutersPreviewResponse
  19281. raw := NoMethod(*s)
  19282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19283. }
  19284. type RoutersScopedList struct {
  19285. // Routers: A list of routers contained in this scope.
  19286. Routers []*Router `json:"routers,omitempty"`
  19287. // Warning: Informational warning which replaces the list of routers
  19288. // when the list is empty.
  19289. Warning *RoutersScopedListWarning `json:"warning,omitempty"`
  19290. // ForceSendFields is a list of field names (e.g. "Routers") to
  19291. // unconditionally include in API requests. By default, fields with
  19292. // empty values are omitted from API requests. However, any non-pointer,
  19293. // non-interface field appearing in ForceSendFields will be sent to the
  19294. // server regardless of whether the field is empty or not. This may be
  19295. // used to include empty fields in Patch requests.
  19296. ForceSendFields []string `json:"-"`
  19297. // NullFields is a list of field names (e.g. "Routers") to include in
  19298. // API requests with the JSON null value. By default, fields with empty
  19299. // values are omitted from API requests. However, any field with an
  19300. // empty value appearing in NullFields will be sent to the server as
  19301. // null. It is an error if a field in this list has a non-empty value.
  19302. // This may be used to include null fields in Patch requests.
  19303. NullFields []string `json:"-"`
  19304. }
  19305. func (s *RoutersScopedList) MarshalJSON() ([]byte, error) {
  19306. type NoMethod RoutersScopedList
  19307. raw := NoMethod(*s)
  19308. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19309. }
  19310. // RoutersScopedListWarning: Informational warning which replaces the
  19311. // list of routers when the list is empty.
  19312. type RoutersScopedListWarning struct {
  19313. // Code: [Output Only] A warning code, if applicable. For example,
  19314. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19315. // the response.
  19316. //
  19317. // Possible values:
  19318. // "CLEANUP_FAILED"
  19319. // "DEPRECATED_RESOURCE_USED"
  19320. // "DEPRECATED_TYPE_USED"
  19321. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19322. // "EXPERIMENTAL_TYPE_USED"
  19323. // "EXTERNAL_API_WARNING"
  19324. // "FIELD_VALUE_OVERRIDEN"
  19325. // "INJECTED_KERNELS_DEPRECATED"
  19326. // "MISSING_TYPE_DEPENDENCY"
  19327. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19328. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19329. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19330. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19331. // "NEXT_HOP_NOT_RUNNING"
  19332. // "NOT_CRITICAL_ERROR"
  19333. // "NO_RESULTS_ON_PAGE"
  19334. // "REQUIRED_TOS_AGREEMENT"
  19335. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19336. // "RESOURCE_NOT_DELETED"
  19337. // "SCHEMA_VALIDATION_IGNORED"
  19338. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19339. // "UNDECLARED_PROPERTIES"
  19340. // "UNREACHABLE"
  19341. Code string `json:"code,omitempty"`
  19342. // Data: [Output Only] Metadata about this warning in key: value format.
  19343. // For example:
  19344. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19345. Data []*RoutersScopedListWarningData `json:"data,omitempty"`
  19346. // Message: [Output Only] A human-readable description of the warning
  19347. // code.
  19348. Message string `json:"message,omitempty"`
  19349. // ForceSendFields is a list of field names (e.g. "Code") to
  19350. // unconditionally include in API requests. By default, fields with
  19351. // empty values are omitted from API requests. However, any non-pointer,
  19352. // non-interface field appearing in ForceSendFields will be sent to the
  19353. // server regardless of whether the field is empty or not. This may be
  19354. // used to include empty fields in Patch requests.
  19355. ForceSendFields []string `json:"-"`
  19356. // NullFields is a list of field names (e.g. "Code") to include in API
  19357. // requests with the JSON null value. By default, fields with empty
  19358. // values are omitted from API requests. However, any field with an
  19359. // empty value appearing in NullFields will be sent to the server as
  19360. // null. It is an error if a field in this list has a non-empty value.
  19361. // This may be used to include null fields in Patch requests.
  19362. NullFields []string `json:"-"`
  19363. }
  19364. func (s *RoutersScopedListWarning) MarshalJSON() ([]byte, error) {
  19365. type NoMethod RoutersScopedListWarning
  19366. raw := NoMethod(*s)
  19367. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19368. }
  19369. type RoutersScopedListWarningData struct {
  19370. // Key: [Output Only] A key that provides more detail on the warning
  19371. // being returned. For example, for warnings where there are no results
  19372. // in a list request for a particular zone, this key might be scope and
  19373. // the key value might be the zone name. Other examples might be a key
  19374. // indicating a deprecated resource and a suggested replacement, or a
  19375. // warning about invalid network settings (for example, if an instance
  19376. // attempts to perform IP forwarding but is not enabled for IP
  19377. // forwarding).
  19378. Key string `json:"key,omitempty"`
  19379. // Value: [Output Only] A warning data value corresponding to the key.
  19380. Value string `json:"value,omitempty"`
  19381. // ForceSendFields is a list of field names (e.g. "Key") to
  19382. // unconditionally include in API requests. By default, fields with
  19383. // empty values are omitted from API requests. However, any non-pointer,
  19384. // non-interface field appearing in ForceSendFields will be sent to the
  19385. // server regardless of whether the field is empty or not. This may be
  19386. // used to include empty fields in Patch requests.
  19387. ForceSendFields []string `json:"-"`
  19388. // NullFields is a list of field names (e.g. "Key") to include in API
  19389. // requests with the JSON null value. By default, fields with empty
  19390. // values are omitted from API requests. However, any field with an
  19391. // empty value appearing in NullFields will be sent to the server as
  19392. // null. It is an error if a field in this list has a non-empty value.
  19393. // This may be used to include null fields in Patch requests.
  19394. NullFields []string `json:"-"`
  19395. }
  19396. func (s *RoutersScopedListWarningData) MarshalJSON() ([]byte, error) {
  19397. type NoMethod RoutersScopedListWarningData
  19398. raw := NoMethod(*s)
  19399. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19400. }
  19401. // Rule: A rule to be applied in a Policy.
  19402. type Rule struct {
  19403. // Action: Required
  19404. //
  19405. // Possible values:
  19406. // "ALLOW"
  19407. // "ALLOW_WITH_LOG"
  19408. // "DENY"
  19409. // "DENY_WITH_LOG"
  19410. // "LOG"
  19411. // "NO_ACTION"
  19412. Action string `json:"action,omitempty"`
  19413. // Conditions: Additional restrictions that must be met. All conditions
  19414. // must pass for the rule to match.
  19415. Conditions []*Condition `json:"conditions,omitempty"`
  19416. // Description: Human-readable description of the rule.
  19417. Description string `json:"description,omitempty"`
  19418. // Ins: If one or more 'in' clauses are specified, the rule matches if
  19419. // the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
  19420. Ins []string `json:"ins,omitempty"`
  19421. // LogConfigs: The config returned to callers of
  19422. // tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
  19423. LogConfigs []*LogConfig `json:"logConfigs,omitempty"`
  19424. // NotIns: If one or more 'not_in' clauses are specified, the rule
  19425. // matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the
  19426. // entries.
  19427. NotIns []string `json:"notIns,omitempty"`
  19428. // Permissions: A permission is a string of form '..' (e.g.,
  19429. // 'storage.buckets.list'). A value of '*' matches all permissions, and
  19430. // a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
  19431. Permissions []string `json:"permissions,omitempty"`
  19432. // ForceSendFields is a list of field names (e.g. "Action") to
  19433. // unconditionally include in API requests. By default, fields with
  19434. // empty values are omitted from API requests. However, any non-pointer,
  19435. // non-interface field appearing in ForceSendFields will be sent to the
  19436. // server regardless of whether the field is empty or not. This may be
  19437. // used to include empty fields in Patch requests.
  19438. ForceSendFields []string `json:"-"`
  19439. // NullFields is a list of field names (e.g. "Action") to include in API
  19440. // requests with the JSON null value. By default, fields with empty
  19441. // values are omitted from API requests. However, any field with an
  19442. // empty value appearing in NullFields will be sent to the server as
  19443. // null. It is an error if a field in this list has a non-empty value.
  19444. // This may be used to include null fields in Patch requests.
  19445. NullFields []string `json:"-"`
  19446. }
  19447. func (s *Rule) MarshalJSON() ([]byte, error) {
  19448. type NoMethod Rule
  19449. raw := NoMethod(*s)
  19450. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19451. }
  19452. type SSLHealthCheck struct {
  19453. // Port: The TCP port number for the health check request. The default
  19454. // value is 443. Valid values are 1 through 65535.
  19455. Port int64 `json:"port,omitempty"`
  19456. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  19457. // both port and port_name are defined, port takes precedence.
  19458. PortName string `json:"portName,omitempty"`
  19459. // ProxyHeader: Specifies the type of proxy header to append before
  19460. // sending data to the backend, either NONE or PROXY_V1. The default is
  19461. // NONE.
  19462. //
  19463. // Possible values:
  19464. // "NONE"
  19465. // "PROXY_V1"
  19466. ProxyHeader string `json:"proxyHeader,omitempty"`
  19467. // Request: The application data to send once the SSL connection has
  19468. // been established (default value is empty). If both request and
  19469. // response are empty, the connection establishment alone will indicate
  19470. // health. The request data can only be ASCII.
  19471. Request string `json:"request,omitempty"`
  19472. // Response: The bytes to match against the beginning of the response
  19473. // data. If left empty (the default value), any response will indicate
  19474. // health. The response data can only be ASCII.
  19475. Response string `json:"response,omitempty"`
  19476. // ForceSendFields is a list of field names (e.g. "Port") to
  19477. // unconditionally include in API requests. By default, fields with
  19478. // empty values are omitted from API requests. However, any non-pointer,
  19479. // non-interface field appearing in ForceSendFields will be sent to the
  19480. // server regardless of whether the field is empty or not. This may be
  19481. // used to include empty fields in Patch requests.
  19482. ForceSendFields []string `json:"-"`
  19483. // NullFields is a list of field names (e.g. "Port") to include in API
  19484. // requests with the JSON null value. By default, fields with empty
  19485. // values are omitted from API requests. However, any field with an
  19486. // empty value appearing in NullFields will be sent to the server as
  19487. // null. It is an error if a field in this list has a non-empty value.
  19488. // This may be used to include null fields in Patch requests.
  19489. NullFields []string `json:"-"`
  19490. }
  19491. func (s *SSLHealthCheck) MarshalJSON() ([]byte, error) {
  19492. type NoMethod SSLHealthCheck
  19493. raw := NoMethod(*s)
  19494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19495. }
  19496. // Scheduling: Sets the scheduling options for an Instance.
  19497. type Scheduling struct {
  19498. // AutomaticRestart: Specifies whether the instance should be
  19499. // automatically restarted if it is terminated by Compute Engine (not
  19500. // terminated by a user). You can only set the automatic restart option
  19501. // for standard instances. Preemptible instances cannot be automatically
  19502. // restarted.
  19503. //
  19504. // By default, this is set to true so an instance is automatically
  19505. // restarted if it is terminated by Compute Engine.
  19506. AutomaticRestart *bool `json:"automaticRestart,omitempty"`
  19507. // NodeAffinities: A set of node affinity and anti-affinity.
  19508. NodeAffinities []*SchedulingNodeAffinity `json:"nodeAffinities,omitempty"`
  19509. // OnHostMaintenance: Defines the maintenance behavior for this
  19510. // instance. For standard instances, the default behavior is MIGRATE.
  19511. // For preemptible instances, the default and only possible behavior is
  19512. // TERMINATE. For more information, see Setting Instance Scheduling
  19513. // Options.
  19514. //
  19515. // Possible values:
  19516. // "MIGRATE"
  19517. // "TERMINATE"
  19518. OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
  19519. // Preemptible: Defines whether the instance is preemptible. This can
  19520. // only be set during instance creation, it cannot be set or changed
  19521. // after the instance has been created.
  19522. Preemptible bool `json:"preemptible,omitempty"`
  19523. // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to
  19524. // unconditionally include in API requests. By default, fields with
  19525. // empty values are omitted from API requests. However, any non-pointer,
  19526. // non-interface field appearing in ForceSendFields will be sent to the
  19527. // server regardless of whether the field is empty or not. This may be
  19528. // used to include empty fields in Patch requests.
  19529. ForceSendFields []string `json:"-"`
  19530. // NullFields is a list of field names (e.g. "AutomaticRestart") to
  19531. // include in API requests with the JSON null value. By default, fields
  19532. // with empty values are omitted from API requests. However, any field
  19533. // with an empty value appearing in NullFields will be sent to the
  19534. // server as null. It is an error if a field in this list has a
  19535. // non-empty value. This may be used to include null fields in Patch
  19536. // requests.
  19537. NullFields []string `json:"-"`
  19538. }
  19539. func (s *Scheduling) MarshalJSON() ([]byte, error) {
  19540. type NoMethod Scheduling
  19541. raw := NoMethod(*s)
  19542. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19543. }
  19544. // SchedulingNodeAffinity: Node Affinity: the configuration of desired
  19545. // nodes onto which this Instance could be scheduled.
  19546. type SchedulingNodeAffinity struct {
  19547. // Key: Corresponds to the label key of Node resource.
  19548. Key string `json:"key,omitempty"`
  19549. // Operator: Defines the operation of node selection.
  19550. //
  19551. // Possible values:
  19552. // "IN"
  19553. // "NOT_IN"
  19554. // "OPERATOR_UNSPECIFIED"
  19555. Operator string `json:"operator,omitempty"`
  19556. // Values: Corresponds to the label values of Node resource.
  19557. Values []string `json:"values,omitempty"`
  19558. // ForceSendFields is a list of field names (e.g. "Key") to
  19559. // unconditionally include in API requests. By default, fields with
  19560. // empty values are omitted from API requests. However, any non-pointer,
  19561. // non-interface field appearing in ForceSendFields will be sent to the
  19562. // server regardless of whether the field is empty or not. This may be
  19563. // used to include empty fields in Patch requests.
  19564. ForceSendFields []string `json:"-"`
  19565. // NullFields is a list of field names (e.g. "Key") to include in API
  19566. // requests with the JSON null value. By default, fields with empty
  19567. // values are omitted from API requests. However, any field with an
  19568. // empty value appearing in NullFields will be sent to the server as
  19569. // null. It is an error if a field in this list has a non-empty value.
  19570. // This may be used to include null fields in Patch requests.
  19571. NullFields []string `json:"-"`
  19572. }
  19573. func (s *SchedulingNodeAffinity) MarshalJSON() ([]byte, error) {
  19574. type NoMethod SchedulingNodeAffinity
  19575. raw := NoMethod(*s)
  19576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19577. }
  19578. // SecurityPolicy: A security policy is comprised of one or more rules.
  19579. // It can also be associated with one or more 'targets'. (==
  19580. // resource_for v1.securityPolicies ==) (== resource_for
  19581. // beta.securityPolicies ==)
  19582. type SecurityPolicy struct {
  19583. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19584. // format.
  19585. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19586. // Description: An optional description of this resource. Provide this
  19587. // property when you create the resource.
  19588. Description string `json:"description,omitempty"`
  19589. // Fingerprint: Specifies a fingerprint for this resource, which is
  19590. // essentially a hash of the metadata's contents and used for optimistic
  19591. // locking. The fingerprint is initially generated by Compute Engine and
  19592. // changes after every request to modify or update metadata. You must
  19593. // always provide an up-to-date fingerprint hash in order to update or
  19594. // change metadata, otherwise the request will fail with error 412
  19595. // conditionNotMet.
  19596. //
  19597. // To see the latest fingerprint, make get() request to the security
  19598. // policy.
  19599. Fingerprint string `json:"fingerprint,omitempty"`
  19600. // Id: [Output Only] The unique identifier for the resource. This
  19601. // identifier is defined by the server.
  19602. Id uint64 `json:"id,omitempty,string"`
  19603. // Kind: [Output only] Type of the resource. Always
  19604. // compute#securityPolicyfor security policies
  19605. Kind string `json:"kind,omitempty"`
  19606. // Name: Name of the resource. Provided by the client when the resource
  19607. // is created. The name must be 1-63 characters long, and comply with
  19608. // RFC1035. Specifically, the name must be 1-63 characters long and
  19609. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  19610. // the first character must be a lowercase letter, and all following
  19611. // characters must be a dash, lowercase letter, or digit, except the
  19612. // last character, which cannot be a dash.
  19613. Name string `json:"name,omitempty"`
  19614. // Rules: A list of rules that belong to this policy. There must always
  19615. // be a default rule (rule with priority 2147483647 and match "*"). If
  19616. // no rules are provided when creating a security policy, a default rule
  19617. // with action "allow" will be added.
  19618. Rules []*SecurityPolicyRule `json:"rules,omitempty"`
  19619. // SelfLink: [Output Only] Server-defined URL for the resource.
  19620. SelfLink string `json:"selfLink,omitempty"`
  19621. // ServerResponse contains the HTTP response code and headers from the
  19622. // server.
  19623. googleapi.ServerResponse `json:"-"`
  19624. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  19625. // to unconditionally include in API requests. By default, fields with
  19626. // empty values are omitted from API requests. However, any non-pointer,
  19627. // non-interface field appearing in ForceSendFields will be sent to the
  19628. // server regardless of whether the field is empty or not. This may be
  19629. // used to include empty fields in Patch requests.
  19630. ForceSendFields []string `json:"-"`
  19631. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  19632. // include in API requests with the JSON null value. By default, fields
  19633. // with empty values are omitted from API requests. However, any field
  19634. // with an empty value appearing in NullFields will be sent to the
  19635. // server as null. It is an error if a field in this list has a
  19636. // non-empty value. This may be used to include null fields in Patch
  19637. // requests.
  19638. NullFields []string `json:"-"`
  19639. }
  19640. func (s *SecurityPolicy) MarshalJSON() ([]byte, error) {
  19641. type NoMethod SecurityPolicy
  19642. raw := NoMethod(*s)
  19643. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19644. }
  19645. type SecurityPolicyList struct {
  19646. // Id: [Output Only] Unique identifier for the resource; defined by the
  19647. // server.
  19648. Id string `json:"id,omitempty"`
  19649. // Items: A list of SecurityPolicy resources.
  19650. Items []*SecurityPolicy `json:"items,omitempty"`
  19651. // Kind: [Output Only] Type of resource. Always
  19652. // compute#securityPolicyList for listsof securityPolicies
  19653. Kind string `json:"kind,omitempty"`
  19654. // NextPageToken: [Output Only] This token allows you to get the next
  19655. // page of results for list requests. If the number of results is larger
  19656. // than maxResults, use the nextPageToken as a value for the query
  19657. // parameter pageToken in the next list request. Subsequent list
  19658. // requests will have their own nextPageToken to continue paging through
  19659. // the results.
  19660. NextPageToken string `json:"nextPageToken,omitempty"`
  19661. // Warning: [Output Only] Informational warning message.
  19662. Warning *SecurityPolicyListWarning `json:"warning,omitempty"`
  19663. // ServerResponse contains the HTTP response code and headers from the
  19664. // server.
  19665. googleapi.ServerResponse `json:"-"`
  19666. // ForceSendFields is a list of field names (e.g. "Id") to
  19667. // unconditionally include in API requests. By default, fields with
  19668. // empty values are omitted from API requests. However, any non-pointer,
  19669. // non-interface field appearing in ForceSendFields will be sent to the
  19670. // server regardless of whether the field is empty or not. This may be
  19671. // used to include empty fields in Patch requests.
  19672. ForceSendFields []string `json:"-"`
  19673. // NullFields is a list of field names (e.g. "Id") to include in API
  19674. // requests with the JSON null value. By default, fields with empty
  19675. // values are omitted from API requests. However, any field with an
  19676. // empty value appearing in NullFields will be sent to the server as
  19677. // null. It is an error if a field in this list has a non-empty value.
  19678. // This may be used to include null fields in Patch requests.
  19679. NullFields []string `json:"-"`
  19680. }
  19681. func (s *SecurityPolicyList) MarshalJSON() ([]byte, error) {
  19682. type NoMethod SecurityPolicyList
  19683. raw := NoMethod(*s)
  19684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19685. }
  19686. // SecurityPolicyListWarning: [Output Only] Informational warning
  19687. // message.
  19688. type SecurityPolicyListWarning struct {
  19689. // Code: [Output Only] A warning code, if applicable. For example,
  19690. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19691. // the response.
  19692. //
  19693. // Possible values:
  19694. // "CLEANUP_FAILED"
  19695. // "DEPRECATED_RESOURCE_USED"
  19696. // "DEPRECATED_TYPE_USED"
  19697. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19698. // "EXPERIMENTAL_TYPE_USED"
  19699. // "EXTERNAL_API_WARNING"
  19700. // "FIELD_VALUE_OVERRIDEN"
  19701. // "INJECTED_KERNELS_DEPRECATED"
  19702. // "MISSING_TYPE_DEPENDENCY"
  19703. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19704. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19705. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19706. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19707. // "NEXT_HOP_NOT_RUNNING"
  19708. // "NOT_CRITICAL_ERROR"
  19709. // "NO_RESULTS_ON_PAGE"
  19710. // "REQUIRED_TOS_AGREEMENT"
  19711. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19712. // "RESOURCE_NOT_DELETED"
  19713. // "SCHEMA_VALIDATION_IGNORED"
  19714. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19715. // "UNDECLARED_PROPERTIES"
  19716. // "UNREACHABLE"
  19717. Code string `json:"code,omitempty"`
  19718. // Data: [Output Only] Metadata about this warning in key: value format.
  19719. // For example:
  19720. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19721. Data []*SecurityPolicyListWarningData `json:"data,omitempty"`
  19722. // Message: [Output Only] A human-readable description of the warning
  19723. // code.
  19724. Message string `json:"message,omitempty"`
  19725. // ForceSendFields is a list of field names (e.g. "Code") to
  19726. // unconditionally include in API requests. By default, fields with
  19727. // empty values are omitted from API requests. However, any non-pointer,
  19728. // non-interface field appearing in ForceSendFields will be sent to the
  19729. // server regardless of whether the field is empty or not. This may be
  19730. // used to include empty fields in Patch requests.
  19731. ForceSendFields []string `json:"-"`
  19732. // NullFields is a list of field names (e.g. "Code") to include in API
  19733. // requests with the JSON null value. By default, fields with empty
  19734. // values are omitted from API requests. However, any field with an
  19735. // empty value appearing in NullFields will be sent to the server as
  19736. // null. It is an error if a field in this list has a non-empty value.
  19737. // This may be used to include null fields in Patch requests.
  19738. NullFields []string `json:"-"`
  19739. }
  19740. func (s *SecurityPolicyListWarning) MarshalJSON() ([]byte, error) {
  19741. type NoMethod SecurityPolicyListWarning
  19742. raw := NoMethod(*s)
  19743. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19744. }
  19745. type SecurityPolicyListWarningData struct {
  19746. // Key: [Output Only] A key that provides more detail on the warning
  19747. // being returned. For example, for warnings where there are no results
  19748. // in a list request for a particular zone, this key might be scope and
  19749. // the key value might be the zone name. Other examples might be a key
  19750. // indicating a deprecated resource and a suggested replacement, or a
  19751. // warning about invalid network settings (for example, if an instance
  19752. // attempts to perform IP forwarding but is not enabled for IP
  19753. // forwarding).
  19754. Key string `json:"key,omitempty"`
  19755. // Value: [Output Only] A warning data value corresponding to the key.
  19756. Value string `json:"value,omitempty"`
  19757. // ForceSendFields is a list of field names (e.g. "Key") to
  19758. // unconditionally include in API requests. By default, fields with
  19759. // empty values are omitted from API requests. However, any non-pointer,
  19760. // non-interface field appearing in ForceSendFields will be sent to the
  19761. // server regardless of whether the field is empty or not. This may be
  19762. // used to include empty fields in Patch requests.
  19763. ForceSendFields []string `json:"-"`
  19764. // NullFields is a list of field names (e.g. "Key") to include in API
  19765. // requests with the JSON null value. By default, fields with empty
  19766. // values are omitted from API requests. However, any field with an
  19767. // empty value appearing in NullFields will be sent to the server as
  19768. // null. It is an error if a field in this list has a non-empty value.
  19769. // This may be used to include null fields in Patch requests.
  19770. NullFields []string `json:"-"`
  19771. }
  19772. func (s *SecurityPolicyListWarningData) MarshalJSON() ([]byte, error) {
  19773. type NoMethod SecurityPolicyListWarningData
  19774. raw := NoMethod(*s)
  19775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19776. }
  19777. type SecurityPolicyReference struct {
  19778. SecurityPolicy string `json:"securityPolicy,omitempty"`
  19779. // ForceSendFields is a list of field names (e.g. "SecurityPolicy") to
  19780. // unconditionally include in API requests. By default, fields with
  19781. // empty values are omitted from API requests. However, any non-pointer,
  19782. // non-interface field appearing in ForceSendFields will be sent to the
  19783. // server regardless of whether the field is empty or not. This may be
  19784. // used to include empty fields in Patch requests.
  19785. ForceSendFields []string `json:"-"`
  19786. // NullFields is a list of field names (e.g. "SecurityPolicy") to
  19787. // include in API requests with the JSON null value. By default, fields
  19788. // with empty values are omitted from API requests. However, any field
  19789. // with an empty value appearing in NullFields will be sent to the
  19790. // server as null. It is an error if a field in this list has a
  19791. // non-empty value. This may be used to include null fields in Patch
  19792. // requests.
  19793. NullFields []string `json:"-"`
  19794. }
  19795. func (s *SecurityPolicyReference) MarshalJSON() ([]byte, error) {
  19796. type NoMethod SecurityPolicyReference
  19797. raw := NoMethod(*s)
  19798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19799. }
  19800. // SecurityPolicyRule: Represents a rule that describes one or more
  19801. // match conditions along with the action to be taken when traffic
  19802. // matches this condition (allow or deny).
  19803. type SecurityPolicyRule struct {
  19804. // Action: The Action to preform when the client connection triggers the
  19805. // rule. Can currently be either "allow" or "deny()" where valid values
  19806. // for status are 403, 404, and 502.
  19807. Action string `json:"action,omitempty"`
  19808. // Description: An optional description of this resource. Provide this
  19809. // property when you create the resource.
  19810. Description string `json:"description,omitempty"`
  19811. // Kind: [Output only] Type of the resource. Always
  19812. // compute#securityPolicyRule for security policy rules
  19813. Kind string `json:"kind,omitempty"`
  19814. // Match: A match condition that incoming traffic is evaluated against.
  19815. // If it evaluates to true, the corresponding ?action? is enforced.
  19816. Match *SecurityPolicyRuleMatcher `json:"match,omitempty"`
  19817. // Preview: If set to true, the specified action is not enforced.
  19818. Preview bool `json:"preview,omitempty"`
  19819. // Priority: An integer indicating the priority of a rule in the list.
  19820. // The priority must be a positive value between 0 and 2147483647. Rules
  19821. // are evaluated from highest to lowest priority where 0 is the highest
  19822. // priority and 2147483647 is the lowest prority.
  19823. Priority int64 `json:"priority,omitempty"`
  19824. // ServerResponse contains the HTTP response code and headers from the
  19825. // server.
  19826. googleapi.ServerResponse `json:"-"`
  19827. // ForceSendFields is a list of field names (e.g. "Action") to
  19828. // unconditionally include in API requests. By default, fields with
  19829. // empty values are omitted from API requests. However, any non-pointer,
  19830. // non-interface field appearing in ForceSendFields will be sent to the
  19831. // server regardless of whether the field is empty or not. This may be
  19832. // used to include empty fields in Patch requests.
  19833. ForceSendFields []string `json:"-"`
  19834. // NullFields is a list of field names (e.g. "Action") to include in API
  19835. // requests with the JSON null value. By default, fields with empty
  19836. // values are omitted from API requests. However, any field with an
  19837. // empty value appearing in NullFields will be sent to the server as
  19838. // null. It is an error if a field in this list has a non-empty value.
  19839. // This may be used to include null fields in Patch requests.
  19840. NullFields []string `json:"-"`
  19841. }
  19842. func (s *SecurityPolicyRule) MarshalJSON() ([]byte, error) {
  19843. type NoMethod SecurityPolicyRule
  19844. raw := NoMethod(*s)
  19845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19846. }
  19847. // SecurityPolicyRuleMatcher: Represents a match condition that incoming
  19848. // traffic is evaluated against. Exactly one field must be specified.
  19849. type SecurityPolicyRuleMatcher struct {
  19850. // Config: The configuration options available when specifying
  19851. // versioned_expr. This field must be specified if versioned_expr is
  19852. // specified and cannot be specified if versioned_expr is not specified.
  19853. Config *SecurityPolicyRuleMatcherConfig `json:"config,omitempty"`
  19854. // VersionedExpr: Preconfigured versioned expression. If this field is
  19855. // specified, config must also be specified. Available preconfigured
  19856. // expressions along with their requirements are: SRC_IPS_V1 - must
  19857. // specify the corresponding src_ip_range field in config.
  19858. //
  19859. // Possible values:
  19860. // "SRC_IPS_V1"
  19861. VersionedExpr string `json:"versionedExpr,omitempty"`
  19862. // ForceSendFields is a list of field names (e.g. "Config") to
  19863. // unconditionally include in API requests. By default, fields with
  19864. // empty values are omitted from API requests. However, any non-pointer,
  19865. // non-interface field appearing in ForceSendFields will be sent to the
  19866. // server regardless of whether the field is empty or not. This may be
  19867. // used to include empty fields in Patch requests.
  19868. ForceSendFields []string `json:"-"`
  19869. // NullFields is a list of field names (e.g. "Config") to include in API
  19870. // requests with the JSON null value. By default, fields with empty
  19871. // values are omitted from API requests. However, any field with an
  19872. // empty value appearing in NullFields will be sent to the server as
  19873. // null. It is an error if a field in this list has a non-empty value.
  19874. // This may be used to include null fields in Patch requests.
  19875. NullFields []string `json:"-"`
  19876. }
  19877. func (s *SecurityPolicyRuleMatcher) MarshalJSON() ([]byte, error) {
  19878. type NoMethod SecurityPolicyRuleMatcher
  19879. raw := NoMethod(*s)
  19880. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19881. }
  19882. type SecurityPolicyRuleMatcherConfig struct {
  19883. // SrcIpRanges: CIDR IP address range.
  19884. SrcIpRanges []string `json:"srcIpRanges,omitempty"`
  19885. // ForceSendFields is a list of field names (e.g. "SrcIpRanges") to
  19886. // unconditionally include in API requests. By default, fields with
  19887. // empty values are omitted from API requests. However, any non-pointer,
  19888. // non-interface field appearing in ForceSendFields will be sent to the
  19889. // server regardless of whether the field is empty or not. This may be
  19890. // used to include empty fields in Patch requests.
  19891. ForceSendFields []string `json:"-"`
  19892. // NullFields is a list of field names (e.g. "SrcIpRanges") to include
  19893. // in API requests with the JSON null value. By default, fields with
  19894. // empty values are omitted from API requests. However, any field with
  19895. // an empty value appearing in NullFields will be sent to the server as
  19896. // null. It is an error if a field in this list has a non-empty value.
  19897. // This may be used to include null fields in Patch requests.
  19898. NullFields []string `json:"-"`
  19899. }
  19900. func (s *SecurityPolicyRuleMatcherConfig) MarshalJSON() ([]byte, error) {
  19901. type NoMethod SecurityPolicyRuleMatcherConfig
  19902. raw := NoMethod(*s)
  19903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19904. }
  19905. // SerialPortOutput: An instance's serial console output.
  19906. type SerialPortOutput struct {
  19907. // Contents: [Output Only] The contents of the console output.
  19908. Contents string `json:"contents,omitempty"`
  19909. // Kind: [Output Only] Type of the resource. Always
  19910. // compute#serialPortOutput for serial port output.
  19911. Kind string `json:"kind,omitempty"`
  19912. // Next: [Output Only] The position of the next byte of content from the
  19913. // serial console output. Use this value in the next request as the
  19914. // start parameter.
  19915. Next int64 `json:"next,omitempty,string"`
  19916. // SelfLink: [Output Only] Server-defined URL for this resource.
  19917. SelfLink string `json:"selfLink,omitempty"`
  19918. // Start: The starting byte position of the output that was returned.
  19919. // This should match the start parameter sent with the request. If the
  19920. // serial console output exceeds the size of the buffer, older output
  19921. // will be overwritten by newer content and the start values will be
  19922. // mismatched.
  19923. Start int64 `json:"start,omitempty,string"`
  19924. // ServerResponse contains the HTTP response code and headers from the
  19925. // server.
  19926. googleapi.ServerResponse `json:"-"`
  19927. // ForceSendFields is a list of field names (e.g. "Contents") to
  19928. // unconditionally include in API requests. By default, fields with
  19929. // empty values are omitted from API requests. However, any non-pointer,
  19930. // non-interface field appearing in ForceSendFields will be sent to the
  19931. // server regardless of whether the field is empty or not. This may be
  19932. // used to include empty fields in Patch requests.
  19933. ForceSendFields []string `json:"-"`
  19934. // NullFields is a list of field names (e.g. "Contents") to include in
  19935. // API requests with the JSON null value. By default, fields with empty
  19936. // values are omitted from API requests. However, any field with an
  19937. // empty value appearing in NullFields will be sent to the server as
  19938. // null. It is an error if a field in this list has a non-empty value.
  19939. // This may be used to include null fields in Patch requests.
  19940. NullFields []string `json:"-"`
  19941. }
  19942. func (s *SerialPortOutput) MarshalJSON() ([]byte, error) {
  19943. type NoMethod SerialPortOutput
  19944. raw := NoMethod(*s)
  19945. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19946. }
  19947. // ServiceAccount: A service account.
  19948. type ServiceAccount struct {
  19949. // Email: Email address of the service account.
  19950. Email string `json:"email,omitempty"`
  19951. // Scopes: The list of scopes to be made available for this service
  19952. // account.
  19953. Scopes []string `json:"scopes,omitempty"`
  19954. // ForceSendFields is a list of field names (e.g. "Email") to
  19955. // unconditionally include in API requests. By default, fields with
  19956. // empty values are omitted from API requests. However, any non-pointer,
  19957. // non-interface field appearing in ForceSendFields will be sent to the
  19958. // server regardless of whether the field is empty or not. This may be
  19959. // used to include empty fields in Patch requests.
  19960. ForceSendFields []string `json:"-"`
  19961. // NullFields is a list of field names (e.g. "Email") to include in API
  19962. // requests with the JSON null value. By default, fields with empty
  19963. // values are omitted from API requests. However, any field with an
  19964. // empty value appearing in NullFields will be sent to the server as
  19965. // null. It is an error if a field in this list has a non-empty value.
  19966. // This may be used to include null fields in Patch requests.
  19967. NullFields []string `json:"-"`
  19968. }
  19969. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  19970. type NoMethod ServiceAccount
  19971. raw := NoMethod(*s)
  19972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19973. }
  19974. // SignedUrlKey: Represents a customer-supplied Signing Key used by
  19975. // Cloud CDN Signed URLs
  19976. type SignedUrlKey struct {
  19977. // KeyName: Name of the key. The name must be 1-63 characters long, and
  19978. // comply with RFC1035. Specifically, the name must be 1-63 characters
  19979. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  19980. // which means the first character must be a lowercase letter, and all
  19981. // following characters must be a dash, lowercase letter, or digit,
  19982. // except the last character, which cannot be a dash.
  19983. KeyName string `json:"keyName,omitempty"`
  19984. // KeyValue: 128-bit key value used for signing the URL. The key value
  19985. // must be a valid RFC 4648 Section 5 base64url encoded string.
  19986. KeyValue string `json:"keyValue,omitempty"`
  19987. // ForceSendFields is a list of field names (e.g. "KeyName") to
  19988. // unconditionally include in API requests. By default, fields with
  19989. // empty values are omitted from API requests. However, any non-pointer,
  19990. // non-interface field appearing in ForceSendFields will be sent to the
  19991. // server regardless of whether the field is empty or not. This may be
  19992. // used to include empty fields in Patch requests.
  19993. ForceSendFields []string `json:"-"`
  19994. // NullFields is a list of field names (e.g. "KeyName") to include in
  19995. // API requests with the JSON null value. By default, fields with empty
  19996. // values are omitted from API requests. However, any field with an
  19997. // empty value appearing in NullFields will be sent to the server as
  19998. // null. It is an error if a field in this list has a non-empty value.
  19999. // This may be used to include null fields in Patch requests.
  20000. NullFields []string `json:"-"`
  20001. }
  20002. func (s *SignedUrlKey) MarshalJSON() ([]byte, error) {
  20003. type NoMethod SignedUrlKey
  20004. raw := NoMethod(*s)
  20005. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20006. }
  20007. // Snapshot: A persistent disk snapshot resource. (== resource_for
  20008. // beta.snapshots ==) (== resource_for v1.snapshots ==)
  20009. type Snapshot struct {
  20010. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20011. // format.
  20012. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20013. // Description: An optional description of this resource. Provide this
  20014. // property when you create the resource.
  20015. Description string `json:"description,omitempty"`
  20016. // DiskSizeGb: [Output Only] Size of the snapshot, specified in GB.
  20017. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  20018. // Id: [Output Only] The unique identifier for the resource. This
  20019. // identifier is defined by the server.
  20020. Id uint64 `json:"id,omitempty,string"`
  20021. // Kind: [Output Only] Type of the resource. Always compute#snapshot for
  20022. // Snapshot resources.
  20023. Kind string `json:"kind,omitempty"`
  20024. // LabelFingerprint: A fingerprint for the labels being applied to this
  20025. // snapshot, which is essentially a hash of the labels set used for
  20026. // optimistic locking. The fingerprint is initially generated by Compute
  20027. // Engine and changes after every request to modify or update labels.
  20028. // You must always provide an up-to-date fingerprint hash in order to
  20029. // update or change labels, otherwise the request will fail with error
  20030. // 412 conditionNotMet.
  20031. //
  20032. // To see the latest fingerprint, make a get() request to retrieve a
  20033. // snapshot.
  20034. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  20035. // Labels: Labels to apply to this snapshot. These can be later modified
  20036. // by the setLabels method. Label values may be empty.
  20037. Labels map[string]string `json:"labels,omitempty"`
  20038. // LicenseCodes: [Output Only] Integer license codes indicating which
  20039. // licenses are attached to this snapshot.
  20040. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  20041. // Licenses: [Output Only] A list of public visible licenses that apply
  20042. // to this snapshot. This can be because the original image had licenses
  20043. // attached (such as a Windows image).
  20044. Licenses []string `json:"licenses,omitempty"`
  20045. // Name: Name of the resource; provided by the client when the resource
  20046. // is created. The name must be 1-63 characters long, and comply with
  20047. // RFC1035. Specifically, the name must be 1-63 characters long and
  20048. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  20049. // the first character must be a lowercase letter, and all following
  20050. // characters must be a dash, lowercase letter, or digit, except the
  20051. // last character, which cannot be a dash.
  20052. Name string `json:"name,omitempty"`
  20053. // SelfLink: [Output Only] Server-defined URL for the resource.
  20054. SelfLink string `json:"selfLink,omitempty"`
  20055. // SnapshotEncryptionKey: Encrypts the snapshot using a
  20056. // customer-supplied encryption key.
  20057. //
  20058. // After you encrypt a snapshot using a customer-supplied key, you must
  20059. // provide the same key if you use the image later For example, you must
  20060. // provide the encryption key when you create a disk from the encrypted
  20061. // snapshot in a future request.
  20062. //
  20063. // Customer-supplied encryption keys do not protect access to metadata
  20064. // of the disk.
  20065. //
  20066. // If you do not provide an encryption key when creating the snapshot,
  20067. // then the snapshot will be encrypted using an automatically generated
  20068. // key and you do not need to provide a key to use the snapshot later.
  20069. SnapshotEncryptionKey *CustomerEncryptionKey `json:"snapshotEncryptionKey,omitempty"`
  20070. // SourceDisk: [Output Only] The source disk used to create this
  20071. // snapshot.
  20072. SourceDisk string `json:"sourceDisk,omitempty"`
  20073. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  20074. // source disk. Required if the source disk is protected by a
  20075. // customer-supplied encryption key.
  20076. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  20077. // SourceDiskId: [Output Only] The ID value of the disk used to create
  20078. // this snapshot. This value may be used to determine whether the
  20079. // snapshot was taken from the current or a previous instance of a given
  20080. // disk name.
  20081. SourceDiskId string `json:"sourceDiskId,omitempty"`
  20082. // Status: [Output Only] The status of the snapshot. This can be
  20083. // CREATING, DELETING, FAILED, READY, or UPLOADING.
  20084. //
  20085. // Possible values:
  20086. // "CREATING"
  20087. // "DELETING"
  20088. // "FAILED"
  20089. // "READY"
  20090. // "UPLOADING"
  20091. Status string `json:"status,omitempty"`
  20092. // StorageBytes: [Output Only] A size of the storage used by the
  20093. // snapshot. As snapshots share storage, this number is expected to
  20094. // change with snapshot creation/deletion.
  20095. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  20096. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  20097. // is in a stable state or it is being adjusted as a result of shared
  20098. // storage reallocation. This status can either be UPDATING, meaning the
  20099. // size of the snapshot is being updated, or UP_TO_DATE, meaning the
  20100. // size of the snapshot is up-to-date.
  20101. //
  20102. // Possible values:
  20103. // "UPDATING"
  20104. // "UP_TO_DATE"
  20105. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  20106. // ServerResponse contains the HTTP response code and headers from the
  20107. // server.
  20108. googleapi.ServerResponse `json:"-"`
  20109. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  20110. // to unconditionally include in API requests. By default, fields with
  20111. // empty values are omitted from API requests. However, any non-pointer,
  20112. // non-interface field appearing in ForceSendFields will be sent to the
  20113. // server regardless of whether the field is empty or not. This may be
  20114. // used to include empty fields in Patch requests.
  20115. ForceSendFields []string `json:"-"`
  20116. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  20117. // include in API requests with the JSON null value. By default, fields
  20118. // with empty values are omitted from API requests. However, any field
  20119. // with an empty value appearing in NullFields will be sent to the
  20120. // server as null. It is an error if a field in this list has a
  20121. // non-empty value. This may be used to include null fields in Patch
  20122. // requests.
  20123. NullFields []string `json:"-"`
  20124. }
  20125. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  20126. type NoMethod Snapshot
  20127. raw := NoMethod(*s)
  20128. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20129. }
  20130. // SnapshotList: Contains a list of Snapshot resources.
  20131. type SnapshotList struct {
  20132. // Id: [Output Only] Unique identifier for the resource; defined by the
  20133. // server.
  20134. Id string `json:"id,omitempty"`
  20135. // Items: A list of Snapshot resources.
  20136. Items []*Snapshot `json:"items,omitempty"`
  20137. // Kind: Type of resource.
  20138. Kind string `json:"kind,omitempty"`
  20139. // NextPageToken: [Output Only] This token allows you to get the next
  20140. // page of results for list requests. If the number of results is larger
  20141. // than maxResults, use the nextPageToken as a value for the query
  20142. // parameter pageToken in the next list request. Subsequent list
  20143. // requests will have their own nextPageToken to continue paging through
  20144. // the results.
  20145. NextPageToken string `json:"nextPageToken,omitempty"`
  20146. // SelfLink: [Output Only] Server-defined URL for this resource.
  20147. SelfLink string `json:"selfLink,omitempty"`
  20148. // Warning: [Output Only] Informational warning message.
  20149. Warning *SnapshotListWarning `json:"warning,omitempty"`
  20150. // ServerResponse contains the HTTP response code and headers from the
  20151. // server.
  20152. googleapi.ServerResponse `json:"-"`
  20153. // ForceSendFields is a list of field names (e.g. "Id") to
  20154. // unconditionally include in API requests. By default, fields with
  20155. // empty values are omitted from API requests. However, any non-pointer,
  20156. // non-interface field appearing in ForceSendFields will be sent to the
  20157. // server regardless of whether the field is empty or not. This may be
  20158. // used to include empty fields in Patch requests.
  20159. ForceSendFields []string `json:"-"`
  20160. // NullFields is a list of field names (e.g. "Id") to include in API
  20161. // requests with the JSON null value. By default, fields with empty
  20162. // values are omitted from API requests. However, any field with an
  20163. // empty value appearing in NullFields will be sent to the server as
  20164. // null. It is an error if a field in this list has a non-empty value.
  20165. // This may be used to include null fields in Patch requests.
  20166. NullFields []string `json:"-"`
  20167. }
  20168. func (s *SnapshotList) MarshalJSON() ([]byte, error) {
  20169. type NoMethod SnapshotList
  20170. raw := NoMethod(*s)
  20171. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20172. }
  20173. // SnapshotListWarning: [Output Only] Informational warning message.
  20174. type SnapshotListWarning struct {
  20175. // Code: [Output Only] A warning code, if applicable. For example,
  20176. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20177. // the response.
  20178. //
  20179. // Possible values:
  20180. // "CLEANUP_FAILED"
  20181. // "DEPRECATED_RESOURCE_USED"
  20182. // "DEPRECATED_TYPE_USED"
  20183. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20184. // "EXPERIMENTAL_TYPE_USED"
  20185. // "EXTERNAL_API_WARNING"
  20186. // "FIELD_VALUE_OVERRIDEN"
  20187. // "INJECTED_KERNELS_DEPRECATED"
  20188. // "MISSING_TYPE_DEPENDENCY"
  20189. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20190. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20191. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20192. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20193. // "NEXT_HOP_NOT_RUNNING"
  20194. // "NOT_CRITICAL_ERROR"
  20195. // "NO_RESULTS_ON_PAGE"
  20196. // "REQUIRED_TOS_AGREEMENT"
  20197. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20198. // "RESOURCE_NOT_DELETED"
  20199. // "SCHEMA_VALIDATION_IGNORED"
  20200. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20201. // "UNDECLARED_PROPERTIES"
  20202. // "UNREACHABLE"
  20203. Code string `json:"code,omitempty"`
  20204. // Data: [Output Only] Metadata about this warning in key: value format.
  20205. // For example:
  20206. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20207. Data []*SnapshotListWarningData `json:"data,omitempty"`
  20208. // Message: [Output Only] A human-readable description of the warning
  20209. // code.
  20210. Message string `json:"message,omitempty"`
  20211. // ForceSendFields is a list of field names (e.g. "Code") to
  20212. // unconditionally include in API requests. By default, fields with
  20213. // empty values are omitted from API requests. However, any non-pointer,
  20214. // non-interface field appearing in ForceSendFields will be sent to the
  20215. // server regardless of whether the field is empty or not. This may be
  20216. // used to include empty fields in Patch requests.
  20217. ForceSendFields []string `json:"-"`
  20218. // NullFields is a list of field names (e.g. "Code") to include in API
  20219. // requests with the JSON null value. By default, fields with empty
  20220. // values are omitted from API requests. However, any field with an
  20221. // empty value appearing in NullFields will be sent to the server as
  20222. // null. It is an error if a field in this list has a non-empty value.
  20223. // This may be used to include null fields in Patch requests.
  20224. NullFields []string `json:"-"`
  20225. }
  20226. func (s *SnapshotListWarning) MarshalJSON() ([]byte, error) {
  20227. type NoMethod SnapshotListWarning
  20228. raw := NoMethod(*s)
  20229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20230. }
  20231. type SnapshotListWarningData struct {
  20232. // Key: [Output Only] A key that provides more detail on the warning
  20233. // being returned. For example, for warnings where there are no results
  20234. // in a list request for a particular zone, this key might be scope and
  20235. // the key value might be the zone name. Other examples might be a key
  20236. // indicating a deprecated resource and a suggested replacement, or a
  20237. // warning about invalid network settings (for example, if an instance
  20238. // attempts to perform IP forwarding but is not enabled for IP
  20239. // forwarding).
  20240. Key string `json:"key,omitempty"`
  20241. // Value: [Output Only] A warning data value corresponding to the key.
  20242. Value string `json:"value,omitempty"`
  20243. // ForceSendFields is a list of field names (e.g. "Key") to
  20244. // unconditionally include in API requests. By default, fields with
  20245. // empty values are omitted from API requests. However, any non-pointer,
  20246. // non-interface field appearing in ForceSendFields will be sent to the
  20247. // server regardless of whether the field is empty or not. This may be
  20248. // used to include empty fields in Patch requests.
  20249. ForceSendFields []string `json:"-"`
  20250. // NullFields is a list of field names (e.g. "Key") to include in API
  20251. // requests with the JSON null value. By default, fields with empty
  20252. // values are omitted from API requests. However, any field with an
  20253. // empty value appearing in NullFields will be sent to the server as
  20254. // null. It is an error if a field in this list has a non-empty value.
  20255. // This may be used to include null fields in Patch requests.
  20256. NullFields []string `json:"-"`
  20257. }
  20258. func (s *SnapshotListWarningData) MarshalJSON() ([]byte, error) {
  20259. type NoMethod SnapshotListWarningData
  20260. raw := NoMethod(*s)
  20261. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20262. }
  20263. // SourceInstanceParams: A specification of the parameters to use when
  20264. // creating the instance template from a source instance.
  20265. type SourceInstanceParams struct {
  20266. // DiskConfigs: Attached disks configuration. If not provided, defaults
  20267. // are applied: For boot disk and any other R/W disks, new custom images
  20268. // will be created from each disk. For read-only disks, they will be
  20269. // attached in read-only mode. Local SSD disks will be created as blank
  20270. // volumes.
  20271. DiskConfigs []*DiskInstantiationConfig `json:"diskConfigs,omitempty"`
  20272. // ForceSendFields is a list of field names (e.g. "DiskConfigs") to
  20273. // unconditionally include in API requests. By default, fields with
  20274. // empty values are omitted from API requests. However, any non-pointer,
  20275. // non-interface field appearing in ForceSendFields will be sent to the
  20276. // server regardless of whether the field is empty or not. This may be
  20277. // used to include empty fields in Patch requests.
  20278. ForceSendFields []string `json:"-"`
  20279. // NullFields is a list of field names (e.g. "DiskConfigs") to include
  20280. // in API requests with the JSON null value. By default, fields with
  20281. // empty values are omitted from API requests. However, any field with
  20282. // an empty value appearing in NullFields will be sent to the server as
  20283. // null. It is an error if a field in this list has a non-empty value.
  20284. // This may be used to include null fields in Patch requests.
  20285. NullFields []string `json:"-"`
  20286. }
  20287. func (s *SourceInstanceParams) MarshalJSON() ([]byte, error) {
  20288. type NoMethod SourceInstanceParams
  20289. raw := NoMethod(*s)
  20290. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20291. }
  20292. // SslCertificate: An SslCertificate resource. This resource provides a
  20293. // mechanism to upload an SSL key and certificate to the load balancer
  20294. // to serve secure connections from the user. (== resource_for
  20295. // beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
  20296. type SslCertificate struct {
  20297. // Certificate: A local certificate file. The certificate must be in PEM
  20298. // format. The certificate chain must be no greater than 5 certs long.
  20299. // The chain must include at least one intermediate cert.
  20300. Certificate string `json:"certificate,omitempty"`
  20301. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20302. // format.
  20303. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20304. // Description: An optional description of this resource. Provide this
  20305. // property when you create the resource.
  20306. Description string `json:"description,omitempty"`
  20307. // Id: [Output Only] The unique identifier for the resource. This
  20308. // identifier is defined by the server.
  20309. Id uint64 `json:"id,omitempty,string"`
  20310. // Kind: [Output Only] Type of the resource. Always
  20311. // compute#sslCertificate for SSL certificates.
  20312. Kind string `json:"kind,omitempty"`
  20313. // Name: Name of the resource. Provided by the client when the resource
  20314. // is created. The name must be 1-63 characters long, and comply with
  20315. // RFC1035. Specifically, the name must be 1-63 characters long and
  20316. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  20317. // the first character must be a lowercase letter, and all following
  20318. // characters must be a dash, lowercase letter, or digit, except the
  20319. // last character, which cannot be a dash.
  20320. Name string `json:"name,omitempty"`
  20321. // PrivateKey: A write-only private key in PEM format. Only insert
  20322. // requests will include this field.
  20323. PrivateKey string `json:"privateKey,omitempty"`
  20324. // SelfLink: [Output only] Server-defined URL for the resource.
  20325. SelfLink string `json:"selfLink,omitempty"`
  20326. // ServerResponse contains the HTTP response code and headers from the
  20327. // server.
  20328. googleapi.ServerResponse `json:"-"`
  20329. // ForceSendFields is a list of field names (e.g. "Certificate") to
  20330. // unconditionally include in API requests. By default, fields with
  20331. // empty values are omitted from API requests. However, any non-pointer,
  20332. // non-interface field appearing in ForceSendFields will be sent to the
  20333. // server regardless of whether the field is empty or not. This may be
  20334. // used to include empty fields in Patch requests.
  20335. ForceSendFields []string `json:"-"`
  20336. // NullFields is a list of field names (e.g. "Certificate") to include
  20337. // in API requests with the JSON null value. By default, fields with
  20338. // empty values are omitted from API requests. However, any field with
  20339. // an empty value appearing in NullFields will be sent to the server as
  20340. // null. It is an error if a field in this list has a non-empty value.
  20341. // This may be used to include null fields in Patch requests.
  20342. NullFields []string `json:"-"`
  20343. }
  20344. func (s *SslCertificate) MarshalJSON() ([]byte, error) {
  20345. type NoMethod SslCertificate
  20346. raw := NoMethod(*s)
  20347. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20348. }
  20349. // SslCertificateList: Contains a list of SslCertificate resources.
  20350. type SslCertificateList struct {
  20351. // Id: [Output Only] Unique identifier for the resource; defined by the
  20352. // server.
  20353. Id string `json:"id,omitempty"`
  20354. // Items: A list of SslCertificate resources.
  20355. Items []*SslCertificate `json:"items,omitempty"`
  20356. // Kind: Type of resource.
  20357. Kind string `json:"kind,omitempty"`
  20358. // NextPageToken: [Output Only] This token allows you to get the next
  20359. // page of results for list requests. If the number of results is larger
  20360. // than maxResults, use the nextPageToken as a value for the query
  20361. // parameter pageToken in the next list request. Subsequent list
  20362. // requests will have their own nextPageToken to continue paging through
  20363. // the results.
  20364. NextPageToken string `json:"nextPageToken,omitempty"`
  20365. // SelfLink: [Output Only] Server-defined URL for this resource.
  20366. SelfLink string `json:"selfLink,omitempty"`
  20367. // Warning: [Output Only] Informational warning message.
  20368. Warning *SslCertificateListWarning `json:"warning,omitempty"`
  20369. // ServerResponse contains the HTTP response code and headers from the
  20370. // server.
  20371. googleapi.ServerResponse `json:"-"`
  20372. // ForceSendFields is a list of field names (e.g. "Id") to
  20373. // unconditionally include in API requests. By default, fields with
  20374. // empty values are omitted from API requests. However, any non-pointer,
  20375. // non-interface field appearing in ForceSendFields will be sent to the
  20376. // server regardless of whether the field is empty or not. This may be
  20377. // used to include empty fields in Patch requests.
  20378. ForceSendFields []string `json:"-"`
  20379. // NullFields is a list of field names (e.g. "Id") to include in API
  20380. // requests with the JSON null value. By default, fields with empty
  20381. // values are omitted from API requests. However, any field with an
  20382. // empty value appearing in NullFields will be sent to the server as
  20383. // null. It is an error if a field in this list has a non-empty value.
  20384. // This may be used to include null fields in Patch requests.
  20385. NullFields []string `json:"-"`
  20386. }
  20387. func (s *SslCertificateList) MarshalJSON() ([]byte, error) {
  20388. type NoMethod SslCertificateList
  20389. raw := NoMethod(*s)
  20390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20391. }
  20392. // SslCertificateListWarning: [Output Only] Informational warning
  20393. // message.
  20394. type SslCertificateListWarning struct {
  20395. // Code: [Output Only] A warning code, if applicable. For example,
  20396. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20397. // the response.
  20398. //
  20399. // Possible values:
  20400. // "CLEANUP_FAILED"
  20401. // "DEPRECATED_RESOURCE_USED"
  20402. // "DEPRECATED_TYPE_USED"
  20403. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20404. // "EXPERIMENTAL_TYPE_USED"
  20405. // "EXTERNAL_API_WARNING"
  20406. // "FIELD_VALUE_OVERRIDEN"
  20407. // "INJECTED_KERNELS_DEPRECATED"
  20408. // "MISSING_TYPE_DEPENDENCY"
  20409. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20410. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20411. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20412. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20413. // "NEXT_HOP_NOT_RUNNING"
  20414. // "NOT_CRITICAL_ERROR"
  20415. // "NO_RESULTS_ON_PAGE"
  20416. // "REQUIRED_TOS_AGREEMENT"
  20417. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20418. // "RESOURCE_NOT_DELETED"
  20419. // "SCHEMA_VALIDATION_IGNORED"
  20420. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20421. // "UNDECLARED_PROPERTIES"
  20422. // "UNREACHABLE"
  20423. Code string `json:"code,omitempty"`
  20424. // Data: [Output Only] Metadata about this warning in key: value format.
  20425. // For example:
  20426. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20427. Data []*SslCertificateListWarningData `json:"data,omitempty"`
  20428. // Message: [Output Only] A human-readable description of the warning
  20429. // code.
  20430. Message string `json:"message,omitempty"`
  20431. // ForceSendFields is a list of field names (e.g. "Code") to
  20432. // unconditionally include in API requests. By default, fields with
  20433. // empty values are omitted from API requests. However, any non-pointer,
  20434. // non-interface field appearing in ForceSendFields will be sent to the
  20435. // server regardless of whether the field is empty or not. This may be
  20436. // used to include empty fields in Patch requests.
  20437. ForceSendFields []string `json:"-"`
  20438. // NullFields is a list of field names (e.g. "Code") to include in API
  20439. // requests with the JSON null value. By default, fields with empty
  20440. // values are omitted from API requests. However, any field with an
  20441. // empty value appearing in NullFields will be sent to the server as
  20442. // null. It is an error if a field in this list has a non-empty value.
  20443. // This may be used to include null fields in Patch requests.
  20444. NullFields []string `json:"-"`
  20445. }
  20446. func (s *SslCertificateListWarning) MarshalJSON() ([]byte, error) {
  20447. type NoMethod SslCertificateListWarning
  20448. raw := NoMethod(*s)
  20449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20450. }
  20451. type SslCertificateListWarningData struct {
  20452. // Key: [Output Only] A key that provides more detail on the warning
  20453. // being returned. For example, for warnings where there are no results
  20454. // in a list request for a particular zone, this key might be scope and
  20455. // the key value might be the zone name. Other examples might be a key
  20456. // indicating a deprecated resource and a suggested replacement, or a
  20457. // warning about invalid network settings (for example, if an instance
  20458. // attempts to perform IP forwarding but is not enabled for IP
  20459. // forwarding).
  20460. Key string `json:"key,omitempty"`
  20461. // Value: [Output Only] A warning data value corresponding to the key.
  20462. Value string `json:"value,omitempty"`
  20463. // ForceSendFields is a list of field names (e.g. "Key") to
  20464. // unconditionally include in API requests. By default, fields with
  20465. // empty values are omitted from API requests. However, any non-pointer,
  20466. // non-interface field appearing in ForceSendFields will be sent to the
  20467. // server regardless of whether the field is empty or not. This may be
  20468. // used to include empty fields in Patch requests.
  20469. ForceSendFields []string `json:"-"`
  20470. // NullFields is a list of field names (e.g. "Key") to include in API
  20471. // requests with the JSON null value. By default, fields with empty
  20472. // values are omitted from API requests. However, any field with an
  20473. // empty value appearing in NullFields will be sent to the server as
  20474. // null. It is an error if a field in this list has a non-empty value.
  20475. // This may be used to include null fields in Patch requests.
  20476. NullFields []string `json:"-"`
  20477. }
  20478. func (s *SslCertificateListWarningData) MarshalJSON() ([]byte, error) {
  20479. type NoMethod SslCertificateListWarningData
  20480. raw := NoMethod(*s)
  20481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20482. }
  20483. type SslPoliciesList struct {
  20484. // Id: [Output Only] Unique identifier for the resource; defined by the
  20485. // server.
  20486. Id string `json:"id,omitempty"`
  20487. // Items: A list of SslPolicy resources.
  20488. Items []*SslPolicy `json:"items,omitempty"`
  20489. // Kind: [Output Only] Type of the resource. Always
  20490. // compute#sslPoliciesList for lists of sslPolicies.
  20491. Kind string `json:"kind,omitempty"`
  20492. // NextPageToken: [Output Only] This token allows you to get the next
  20493. // page of results for list requests. If the number of results is larger
  20494. // than maxResults, use the nextPageToken as a value for the query
  20495. // parameter pageToken in the next list request. Subsequent list
  20496. // requests will have their own nextPageToken to continue paging through
  20497. // the results.
  20498. NextPageToken string `json:"nextPageToken,omitempty"`
  20499. // SelfLink: [Output Only] Server-defined URL for this resource.
  20500. SelfLink string `json:"selfLink,omitempty"`
  20501. // Warning: [Output Only] Informational warning message.
  20502. Warning *SslPoliciesListWarning `json:"warning,omitempty"`
  20503. // ServerResponse contains the HTTP response code and headers from the
  20504. // server.
  20505. googleapi.ServerResponse `json:"-"`
  20506. // ForceSendFields is a list of field names (e.g. "Id") to
  20507. // unconditionally include in API requests. By default, fields with
  20508. // empty values are omitted from API requests. However, any non-pointer,
  20509. // non-interface field appearing in ForceSendFields will be sent to the
  20510. // server regardless of whether the field is empty or not. This may be
  20511. // used to include empty fields in Patch requests.
  20512. ForceSendFields []string `json:"-"`
  20513. // NullFields is a list of field names (e.g. "Id") to include in API
  20514. // requests with the JSON null value. By default, fields with empty
  20515. // values are omitted from API requests. However, any field with an
  20516. // empty value appearing in NullFields will be sent to the server as
  20517. // null. It is an error if a field in this list has a non-empty value.
  20518. // This may be used to include null fields in Patch requests.
  20519. NullFields []string `json:"-"`
  20520. }
  20521. func (s *SslPoliciesList) MarshalJSON() ([]byte, error) {
  20522. type NoMethod SslPoliciesList
  20523. raw := NoMethod(*s)
  20524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20525. }
  20526. // SslPoliciesListWarning: [Output Only] Informational warning message.
  20527. type SslPoliciesListWarning struct {
  20528. // Code: [Output Only] A warning code, if applicable. For example,
  20529. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20530. // the response.
  20531. //
  20532. // Possible values:
  20533. // "CLEANUP_FAILED"
  20534. // "DEPRECATED_RESOURCE_USED"
  20535. // "DEPRECATED_TYPE_USED"
  20536. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20537. // "EXPERIMENTAL_TYPE_USED"
  20538. // "EXTERNAL_API_WARNING"
  20539. // "FIELD_VALUE_OVERRIDEN"
  20540. // "INJECTED_KERNELS_DEPRECATED"
  20541. // "MISSING_TYPE_DEPENDENCY"
  20542. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20543. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20544. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20545. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20546. // "NEXT_HOP_NOT_RUNNING"
  20547. // "NOT_CRITICAL_ERROR"
  20548. // "NO_RESULTS_ON_PAGE"
  20549. // "REQUIRED_TOS_AGREEMENT"
  20550. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20551. // "RESOURCE_NOT_DELETED"
  20552. // "SCHEMA_VALIDATION_IGNORED"
  20553. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20554. // "UNDECLARED_PROPERTIES"
  20555. // "UNREACHABLE"
  20556. Code string `json:"code,omitempty"`
  20557. // Data: [Output Only] Metadata about this warning in key: value format.
  20558. // For example:
  20559. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20560. Data []*SslPoliciesListWarningData `json:"data,omitempty"`
  20561. // Message: [Output Only] A human-readable description of the warning
  20562. // code.
  20563. Message string `json:"message,omitempty"`
  20564. // ForceSendFields is a list of field names (e.g. "Code") to
  20565. // unconditionally include in API requests. By default, fields with
  20566. // empty values are omitted from API requests. However, any non-pointer,
  20567. // non-interface field appearing in ForceSendFields will be sent to the
  20568. // server regardless of whether the field is empty or not. This may be
  20569. // used to include empty fields in Patch requests.
  20570. ForceSendFields []string `json:"-"`
  20571. // NullFields is a list of field names (e.g. "Code") to include in API
  20572. // requests with the JSON null value. By default, fields with empty
  20573. // values are omitted from API requests. However, any field with an
  20574. // empty value appearing in NullFields will be sent to the server as
  20575. // null. It is an error if a field in this list has a non-empty value.
  20576. // This may be used to include null fields in Patch requests.
  20577. NullFields []string `json:"-"`
  20578. }
  20579. func (s *SslPoliciesListWarning) MarshalJSON() ([]byte, error) {
  20580. type NoMethod SslPoliciesListWarning
  20581. raw := NoMethod(*s)
  20582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20583. }
  20584. type SslPoliciesListWarningData struct {
  20585. // Key: [Output Only] A key that provides more detail on the warning
  20586. // being returned. For example, for warnings where there are no results
  20587. // in a list request for a particular zone, this key might be scope and
  20588. // the key value might be the zone name. Other examples might be a key
  20589. // indicating a deprecated resource and a suggested replacement, or a
  20590. // warning about invalid network settings (for example, if an instance
  20591. // attempts to perform IP forwarding but is not enabled for IP
  20592. // forwarding).
  20593. Key string `json:"key,omitempty"`
  20594. // Value: [Output Only] A warning data value corresponding to the key.
  20595. Value string `json:"value,omitempty"`
  20596. // ForceSendFields is a list of field names (e.g. "Key") to
  20597. // unconditionally include in API requests. By default, fields with
  20598. // empty values are omitted from API requests. However, any non-pointer,
  20599. // non-interface field appearing in ForceSendFields will be sent to the
  20600. // server regardless of whether the field is empty or not. This may be
  20601. // used to include empty fields in Patch requests.
  20602. ForceSendFields []string `json:"-"`
  20603. // NullFields is a list of field names (e.g. "Key") to include in API
  20604. // requests with the JSON null value. By default, fields with empty
  20605. // values are omitted from API requests. However, any field with an
  20606. // empty value appearing in NullFields will be sent to the server as
  20607. // null. It is an error if a field in this list has a non-empty value.
  20608. // This may be used to include null fields in Patch requests.
  20609. NullFields []string `json:"-"`
  20610. }
  20611. func (s *SslPoliciesListWarningData) MarshalJSON() ([]byte, error) {
  20612. type NoMethod SslPoliciesListWarningData
  20613. raw := NoMethod(*s)
  20614. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20615. }
  20616. type SslPoliciesListAvailableFeaturesResponse struct {
  20617. Features []string `json:"features,omitempty"`
  20618. // ServerResponse contains the HTTP response code and headers from the
  20619. // server.
  20620. googleapi.ServerResponse `json:"-"`
  20621. // ForceSendFields is a list of field names (e.g. "Features") to
  20622. // unconditionally include in API requests. By default, fields with
  20623. // empty values are omitted from API requests. However, any non-pointer,
  20624. // non-interface field appearing in ForceSendFields will be sent to the
  20625. // server regardless of whether the field is empty or not. This may be
  20626. // used to include empty fields in Patch requests.
  20627. ForceSendFields []string `json:"-"`
  20628. // NullFields is a list of field names (e.g. "Features") to include in
  20629. // API requests with the JSON null value. By default, fields with empty
  20630. // values are omitted from API requests. However, any field with an
  20631. // empty value appearing in NullFields will be sent to the server as
  20632. // null. It is an error if a field in this list has a non-empty value.
  20633. // This may be used to include null fields in Patch requests.
  20634. NullFields []string `json:"-"`
  20635. }
  20636. func (s *SslPoliciesListAvailableFeaturesResponse) MarshalJSON() ([]byte, error) {
  20637. type NoMethod SslPoliciesListAvailableFeaturesResponse
  20638. raw := NoMethod(*s)
  20639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20640. }
  20641. // SslPolicy: A SSL policy specifies the server-side support for SSL
  20642. // features. This can be attached to a TargetHttpsProxy or a
  20643. // TargetSslProxy. This affects connections between clients and the
  20644. // HTTPS or SSL proxy load balancer. They do not affect the connection
  20645. // between the load balancers and the backends.
  20646. type SslPolicy struct {
  20647. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20648. // format.
  20649. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20650. // CustomFeatures: A list of features enabled when the selected profile
  20651. // is CUSTOM. The
  20652. // - method returns the set of features that can be specified in this
  20653. // list. This field must be empty if the profile is not CUSTOM.
  20654. CustomFeatures []string `json:"customFeatures,omitempty"`
  20655. // Description: An optional description of this resource. Provide this
  20656. // property when you create the resource.
  20657. Description string `json:"description,omitempty"`
  20658. // EnabledFeatures: [Output Only] The list of features enabled in the
  20659. // SSL policy.
  20660. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  20661. // Fingerprint: Fingerprint of this resource. A hash of the contents
  20662. // stored in this object. This field is used in optimistic locking. This
  20663. // field will be ignored when inserting a SslPolicy. An up-to-date
  20664. // fingerprint must be provided in order to update the SslPolicy,
  20665. // otherwise the request will fail with error 412 conditionNotMet.
  20666. //
  20667. // To see the latest fingerprint, make a get() request to retrieve an
  20668. // SslPolicy.
  20669. Fingerprint string `json:"fingerprint,omitempty"`
  20670. // Id: [Output Only] The unique identifier for the resource. This
  20671. // identifier is defined by the server.
  20672. Id uint64 `json:"id,omitempty,string"`
  20673. // Kind: [Output only] Type of the resource. Always compute#sslPolicyfor
  20674. // SSL policies.
  20675. Kind string `json:"kind,omitempty"`
  20676. // MinTlsVersion: The minimum version of SSL protocol that can be used
  20677. // by the clients to establish a connection with the load balancer. This
  20678. // can be one of TLS_1_0, TLS_1_1, TLS_1_2.
  20679. //
  20680. // Possible values:
  20681. // "TLS_1_0"
  20682. // "TLS_1_1"
  20683. // "TLS_1_2"
  20684. MinTlsVersion string `json:"minTlsVersion,omitempty"`
  20685. // Name: Name of the resource. The name must be 1-63 characters long,
  20686. // and comply with RFC1035. Specifically, the name must be 1-63
  20687. // characters long and match the regular expression
  20688. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  20689. // a lowercase letter, and all following characters must be a dash,
  20690. // lowercase letter, or digit, except the last character, which cannot
  20691. // be a dash.
  20692. Name string `json:"name,omitempty"`
  20693. // Profile: Profile specifies the set of SSL features that can be used
  20694. // by the load balancer when negotiating SSL with clients. This can be
  20695. // one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM,
  20696. // the set of SSL features to enable must be specified in the
  20697. // customFeatures field.
  20698. //
  20699. // Possible values:
  20700. // "COMPATIBLE"
  20701. // "CUSTOM"
  20702. // "MODERN"
  20703. // "RESTRICTED"
  20704. Profile string `json:"profile,omitempty"`
  20705. // SelfLink: [Output Only] Server-defined URL for the resource.
  20706. SelfLink string `json:"selfLink,omitempty"`
  20707. // Warnings: [Output Only] If potential misconfigurations are detected
  20708. // for this SSL policy, this field will be populated with warning
  20709. // messages.
  20710. Warnings []*SslPolicyWarnings `json:"warnings,omitempty"`
  20711. // ServerResponse contains the HTTP response code and headers from the
  20712. // server.
  20713. googleapi.ServerResponse `json:"-"`
  20714. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  20715. // to unconditionally include in API requests. By default, fields with
  20716. // empty values are omitted from API requests. However, any non-pointer,
  20717. // non-interface field appearing in ForceSendFields will be sent to the
  20718. // server regardless of whether the field is empty or not. This may be
  20719. // used to include empty fields in Patch requests.
  20720. ForceSendFields []string `json:"-"`
  20721. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  20722. // include in API requests with the JSON null value. By default, fields
  20723. // with empty values are omitted from API requests. However, any field
  20724. // with an empty value appearing in NullFields will be sent to the
  20725. // server as null. It is an error if a field in this list has a
  20726. // non-empty value. This may be used to include null fields in Patch
  20727. // requests.
  20728. NullFields []string `json:"-"`
  20729. }
  20730. func (s *SslPolicy) MarshalJSON() ([]byte, error) {
  20731. type NoMethod SslPolicy
  20732. raw := NoMethod(*s)
  20733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20734. }
  20735. type SslPolicyWarnings struct {
  20736. // Code: [Output Only] A warning code, if applicable. For example,
  20737. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20738. // the response.
  20739. //
  20740. // Possible values:
  20741. // "CLEANUP_FAILED"
  20742. // "DEPRECATED_RESOURCE_USED"
  20743. // "DEPRECATED_TYPE_USED"
  20744. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20745. // "EXPERIMENTAL_TYPE_USED"
  20746. // "EXTERNAL_API_WARNING"
  20747. // "FIELD_VALUE_OVERRIDEN"
  20748. // "INJECTED_KERNELS_DEPRECATED"
  20749. // "MISSING_TYPE_DEPENDENCY"
  20750. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20751. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20752. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20753. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20754. // "NEXT_HOP_NOT_RUNNING"
  20755. // "NOT_CRITICAL_ERROR"
  20756. // "NO_RESULTS_ON_PAGE"
  20757. // "REQUIRED_TOS_AGREEMENT"
  20758. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20759. // "RESOURCE_NOT_DELETED"
  20760. // "SCHEMA_VALIDATION_IGNORED"
  20761. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20762. // "UNDECLARED_PROPERTIES"
  20763. // "UNREACHABLE"
  20764. Code string `json:"code,omitempty"`
  20765. // Data: [Output Only] Metadata about this warning in key: value format.
  20766. // For example:
  20767. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20768. Data []*SslPolicyWarningsData `json:"data,omitempty"`
  20769. // Message: [Output Only] A human-readable description of the warning
  20770. // code.
  20771. Message string `json:"message,omitempty"`
  20772. // ForceSendFields is a list of field names (e.g. "Code") to
  20773. // unconditionally include in API requests. By default, fields with
  20774. // empty values are omitted from API requests. However, any non-pointer,
  20775. // non-interface field appearing in ForceSendFields will be sent to the
  20776. // server regardless of whether the field is empty or not. This may be
  20777. // used to include empty fields in Patch requests.
  20778. ForceSendFields []string `json:"-"`
  20779. // NullFields is a list of field names (e.g. "Code") to include in API
  20780. // requests with the JSON null value. By default, fields with empty
  20781. // values are omitted from API requests. However, any field with an
  20782. // empty value appearing in NullFields will be sent to the server as
  20783. // null. It is an error if a field in this list has a non-empty value.
  20784. // This may be used to include null fields in Patch requests.
  20785. NullFields []string `json:"-"`
  20786. }
  20787. func (s *SslPolicyWarnings) MarshalJSON() ([]byte, error) {
  20788. type NoMethod SslPolicyWarnings
  20789. raw := NoMethod(*s)
  20790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20791. }
  20792. type SslPolicyWarningsData struct {
  20793. // Key: [Output Only] A key that provides more detail on the warning
  20794. // being returned. For example, for warnings where there are no results
  20795. // in a list request for a particular zone, this key might be scope and
  20796. // the key value might be the zone name. Other examples might be a key
  20797. // indicating a deprecated resource and a suggested replacement, or a
  20798. // warning about invalid network settings (for example, if an instance
  20799. // attempts to perform IP forwarding but is not enabled for IP
  20800. // forwarding).
  20801. Key string `json:"key,omitempty"`
  20802. // Value: [Output Only] A warning data value corresponding to the key.
  20803. Value string `json:"value,omitempty"`
  20804. // ForceSendFields is a list of field names (e.g. "Key") to
  20805. // unconditionally include in API requests. By default, fields with
  20806. // empty values are omitted from API requests. However, any non-pointer,
  20807. // non-interface field appearing in ForceSendFields will be sent to the
  20808. // server regardless of whether the field is empty or not. This may be
  20809. // used to include empty fields in Patch requests.
  20810. ForceSendFields []string `json:"-"`
  20811. // NullFields is a list of field names (e.g. "Key") to include in API
  20812. // requests with the JSON null value. By default, fields with empty
  20813. // values are omitted from API requests. However, any field with an
  20814. // empty value appearing in NullFields will be sent to the server as
  20815. // null. It is an error if a field in this list has a non-empty value.
  20816. // This may be used to include null fields in Patch requests.
  20817. NullFields []string `json:"-"`
  20818. }
  20819. func (s *SslPolicyWarningsData) MarshalJSON() ([]byte, error) {
  20820. type NoMethod SslPolicyWarningsData
  20821. raw := NoMethod(*s)
  20822. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20823. }
  20824. type SslPolicyReference struct {
  20825. // SslPolicy: URL of the SSL policy resource. Set this to empty string
  20826. // to clear any existing SSL policy associated with the target proxy
  20827. // resource.
  20828. SslPolicy string `json:"sslPolicy,omitempty"`
  20829. // ForceSendFields is a list of field names (e.g. "SslPolicy") to
  20830. // unconditionally include in API requests. By default, fields with
  20831. // empty values are omitted from API requests. However, any non-pointer,
  20832. // non-interface field appearing in ForceSendFields will be sent to the
  20833. // server regardless of whether the field is empty or not. This may be
  20834. // used to include empty fields in Patch requests.
  20835. ForceSendFields []string `json:"-"`
  20836. // NullFields is a list of field names (e.g. "SslPolicy") to include in
  20837. // API requests with the JSON null value. By default, fields with empty
  20838. // values are omitted from API requests. However, any field with an
  20839. // empty value appearing in NullFields will be sent to the server as
  20840. // null. It is an error if a field in this list has a non-empty value.
  20841. // This may be used to include null fields in Patch requests.
  20842. NullFields []string `json:"-"`
  20843. }
  20844. func (s *SslPolicyReference) MarshalJSON() ([]byte, error) {
  20845. type NoMethod SslPolicyReference
  20846. raw := NoMethod(*s)
  20847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20848. }
  20849. // Subnetwork: A Subnetwork resource. (== resource_for beta.subnetworks
  20850. // ==) (== resource_for v1.subnetworks ==)
  20851. type Subnetwork struct {
  20852. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20853. // format.
  20854. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20855. // Description: An optional description of this resource. Provide this
  20856. // property when you create the resource. This field can be set only at
  20857. // resource creation time.
  20858. Description string `json:"description,omitempty"`
  20859. // EnableFlowLogs: Whether to enable flow logging for this subnetwork.
  20860. // If this field is not explicitly set, it will not appear in get
  20861. // listings. If not set the default behavior is to disable flow logging.
  20862. EnableFlowLogs bool `json:"enableFlowLogs,omitempty"`
  20863. // Fingerprint: Fingerprint of this resource. A hash of the contents
  20864. // stored in this object. This field is used in optimistic locking. This
  20865. // field will be ignored when inserting a Subnetwork. An up-to-date
  20866. // fingerprint must be provided in order to update the Subnetwork,
  20867. // otherwise the request will fail with error 412 conditionNotMet.
  20868. //
  20869. // To see the latest fingerprint, make a get() request to retrieve a
  20870. // Subnetwork.
  20871. Fingerprint string `json:"fingerprint,omitempty"`
  20872. // GatewayAddress: [Output Only] The gateway address for default routes
  20873. // to reach destination addresses outside this subnetwork.
  20874. GatewayAddress string `json:"gatewayAddress,omitempty"`
  20875. // Id: [Output Only] The unique identifier for the resource. This
  20876. // identifier is defined by the server.
  20877. Id uint64 `json:"id,omitempty,string"`
  20878. // IpCidrRange: The range of internal addresses that are owned by this
  20879. // subnetwork. Provide this property when you create the subnetwork. For
  20880. // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and
  20881. // non-overlapping within a network. Only IPv4 is supported. This field
  20882. // can be set only at resource creation time.
  20883. IpCidrRange string `json:"ipCidrRange,omitempty"`
  20884. // Kind: [Output Only] Type of the resource. Always compute#subnetwork
  20885. // for Subnetwork resources.
  20886. Kind string `json:"kind,omitempty"`
  20887. // Name: The name of the resource, provided by the client when initially
  20888. // creating the resource. The name must be 1-63 characters long, and
  20889. // comply with RFC1035. Specifically, the name must be 1-63 characters
  20890. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  20891. // which means the first character must be a lowercase letter, and all
  20892. // following characters must be a dash, lowercase letter, or digit,
  20893. // except the last character, which cannot be a dash.
  20894. Name string `json:"name,omitempty"`
  20895. // Network: The URL of the network to which this subnetwork belongs,
  20896. // provided by the client when initially creating the subnetwork. Only
  20897. // networks that are in the distributed mode can have subnetworks. This
  20898. // field can be set only at resource creation time.
  20899. Network string `json:"network,omitempty"`
  20900. // PrivateIpGoogleAccess: Whether the VMs in this subnet can access
  20901. // Google services without assigned external IP addresses. This field
  20902. // can be both set at resource creation time and updated using
  20903. // setPrivateIpGoogleAccess.
  20904. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  20905. // Region: URL of the region where the Subnetwork resides. This field
  20906. // can be set only at resource creation time.
  20907. Region string `json:"region,omitempty"`
  20908. // SecondaryIpRanges: An array of configurations for secondary IP ranges
  20909. // for VM instances contained in this subnetwork. The primary IP of such
  20910. // VM must belong to the primary ipCidrRange of the subnetwork. The
  20911. // alias IPs may belong to either primary or secondary ranges. This
  20912. // field can be updated with a patch request.
  20913. SecondaryIpRanges []*SubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  20914. // SelfLink: [Output Only] Server-defined URL for the resource.
  20915. SelfLink string `json:"selfLink,omitempty"`
  20916. // ServerResponse contains the HTTP response code and headers from the
  20917. // server.
  20918. googleapi.ServerResponse `json:"-"`
  20919. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  20920. // to unconditionally include in API requests. By default, fields with
  20921. // empty values are omitted from API requests. However, any non-pointer,
  20922. // non-interface field appearing in ForceSendFields will be sent to the
  20923. // server regardless of whether the field is empty or not. This may be
  20924. // used to include empty fields in Patch requests.
  20925. ForceSendFields []string `json:"-"`
  20926. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  20927. // include in API requests with the JSON null value. By default, fields
  20928. // with empty values are omitted from API requests. However, any field
  20929. // with an empty value appearing in NullFields will be sent to the
  20930. // server as null. It is an error if a field in this list has a
  20931. // non-empty value. This may be used to include null fields in Patch
  20932. // requests.
  20933. NullFields []string `json:"-"`
  20934. }
  20935. func (s *Subnetwork) MarshalJSON() ([]byte, error) {
  20936. type NoMethod Subnetwork
  20937. raw := NoMethod(*s)
  20938. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20939. }
  20940. type SubnetworkAggregatedList struct {
  20941. // Id: [Output Only] Unique identifier for the resource; defined by the
  20942. // server.
  20943. Id string `json:"id,omitempty"`
  20944. // Items: A list of SubnetworksScopedList resources.
  20945. Items map[string]SubnetworksScopedList `json:"items,omitempty"`
  20946. // Kind: [Output Only] Type of resource. Always
  20947. // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
  20948. Kind string `json:"kind,omitempty"`
  20949. // NextPageToken: [Output Only] This token allows you to get the next
  20950. // page of results for list requests. If the number of results is larger
  20951. // than maxResults, use the nextPageToken as a value for the query
  20952. // parameter pageToken in the next list request. Subsequent list
  20953. // requests will have their own nextPageToken to continue paging through
  20954. // the results.
  20955. NextPageToken string `json:"nextPageToken,omitempty"`
  20956. // SelfLink: [Output Only] Server-defined URL for this resource.
  20957. SelfLink string `json:"selfLink,omitempty"`
  20958. // Warning: [Output Only] Informational warning message.
  20959. Warning *SubnetworkAggregatedListWarning `json:"warning,omitempty"`
  20960. // ServerResponse contains the HTTP response code and headers from the
  20961. // server.
  20962. googleapi.ServerResponse `json:"-"`
  20963. // ForceSendFields is a list of field names (e.g. "Id") to
  20964. // unconditionally include in API requests. By default, fields with
  20965. // empty values are omitted from API requests. However, any non-pointer,
  20966. // non-interface field appearing in ForceSendFields will be sent to the
  20967. // server regardless of whether the field is empty or not. This may be
  20968. // used to include empty fields in Patch requests.
  20969. ForceSendFields []string `json:"-"`
  20970. // NullFields is a list of field names (e.g. "Id") to include in API
  20971. // requests with the JSON null value. By default, fields with empty
  20972. // values are omitted from API requests. However, any field with an
  20973. // empty value appearing in NullFields will be sent to the server as
  20974. // null. It is an error if a field in this list has a non-empty value.
  20975. // This may be used to include null fields in Patch requests.
  20976. NullFields []string `json:"-"`
  20977. }
  20978. func (s *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
  20979. type NoMethod SubnetworkAggregatedList
  20980. raw := NoMethod(*s)
  20981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20982. }
  20983. // SubnetworkAggregatedListWarning: [Output Only] Informational warning
  20984. // message.
  20985. type SubnetworkAggregatedListWarning struct {
  20986. // Code: [Output Only] A warning code, if applicable. For example,
  20987. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20988. // the response.
  20989. //
  20990. // Possible values:
  20991. // "CLEANUP_FAILED"
  20992. // "DEPRECATED_RESOURCE_USED"
  20993. // "DEPRECATED_TYPE_USED"
  20994. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20995. // "EXPERIMENTAL_TYPE_USED"
  20996. // "EXTERNAL_API_WARNING"
  20997. // "FIELD_VALUE_OVERRIDEN"
  20998. // "INJECTED_KERNELS_DEPRECATED"
  20999. // "MISSING_TYPE_DEPENDENCY"
  21000. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21001. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21002. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21003. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21004. // "NEXT_HOP_NOT_RUNNING"
  21005. // "NOT_CRITICAL_ERROR"
  21006. // "NO_RESULTS_ON_PAGE"
  21007. // "REQUIRED_TOS_AGREEMENT"
  21008. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21009. // "RESOURCE_NOT_DELETED"
  21010. // "SCHEMA_VALIDATION_IGNORED"
  21011. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21012. // "UNDECLARED_PROPERTIES"
  21013. // "UNREACHABLE"
  21014. Code string `json:"code,omitempty"`
  21015. // Data: [Output Only] Metadata about this warning in key: value format.
  21016. // For example:
  21017. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21018. Data []*SubnetworkAggregatedListWarningData `json:"data,omitempty"`
  21019. // Message: [Output Only] A human-readable description of the warning
  21020. // code.
  21021. Message string `json:"message,omitempty"`
  21022. // ForceSendFields is a list of field names (e.g. "Code") to
  21023. // unconditionally include in API requests. By default, fields with
  21024. // empty values are omitted from API requests. However, any non-pointer,
  21025. // non-interface field appearing in ForceSendFields will be sent to the
  21026. // server regardless of whether the field is empty or not. This may be
  21027. // used to include empty fields in Patch requests.
  21028. ForceSendFields []string `json:"-"`
  21029. // NullFields is a list of field names (e.g. "Code") to include in API
  21030. // requests with the JSON null value. By default, fields with empty
  21031. // values are omitted from API requests. However, any field with an
  21032. // empty value appearing in NullFields will be sent to the server as
  21033. // null. It is an error if a field in this list has a non-empty value.
  21034. // This may be used to include null fields in Patch requests.
  21035. NullFields []string `json:"-"`
  21036. }
  21037. func (s *SubnetworkAggregatedListWarning) MarshalJSON() ([]byte, error) {
  21038. type NoMethod SubnetworkAggregatedListWarning
  21039. raw := NoMethod(*s)
  21040. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21041. }
  21042. type SubnetworkAggregatedListWarningData struct {
  21043. // Key: [Output Only] A key that provides more detail on the warning
  21044. // being returned. For example, for warnings where there are no results
  21045. // in a list request for a particular zone, this key might be scope and
  21046. // the key value might be the zone name. Other examples might be a key
  21047. // indicating a deprecated resource and a suggested replacement, or a
  21048. // warning about invalid network settings (for example, if an instance
  21049. // attempts to perform IP forwarding but is not enabled for IP
  21050. // forwarding).
  21051. Key string `json:"key,omitempty"`
  21052. // Value: [Output Only] A warning data value corresponding to the key.
  21053. Value string `json:"value,omitempty"`
  21054. // ForceSendFields is a list of field names (e.g. "Key") to
  21055. // unconditionally include in API requests. By default, fields with
  21056. // empty values are omitted from API requests. However, any non-pointer,
  21057. // non-interface field appearing in ForceSendFields will be sent to the
  21058. // server regardless of whether the field is empty or not. This may be
  21059. // used to include empty fields in Patch requests.
  21060. ForceSendFields []string `json:"-"`
  21061. // NullFields is a list of field names (e.g. "Key") to include in API
  21062. // requests with the JSON null value. By default, fields with empty
  21063. // values are omitted from API requests. However, any field with an
  21064. // empty value appearing in NullFields will be sent to the server as
  21065. // null. It is an error if a field in this list has a non-empty value.
  21066. // This may be used to include null fields in Patch requests.
  21067. NullFields []string `json:"-"`
  21068. }
  21069. func (s *SubnetworkAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  21070. type NoMethod SubnetworkAggregatedListWarningData
  21071. raw := NoMethod(*s)
  21072. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21073. }
  21074. // SubnetworkList: Contains a list of Subnetwork resources.
  21075. type SubnetworkList struct {
  21076. // Id: [Output Only] Unique identifier for the resource; defined by the
  21077. // server.
  21078. Id string `json:"id,omitempty"`
  21079. // Items: A list of Subnetwork resources.
  21080. Items []*Subnetwork `json:"items,omitempty"`
  21081. // Kind: [Output Only] Type of resource. Always compute#subnetworkList
  21082. // for lists of subnetworks.
  21083. Kind string `json:"kind,omitempty"`
  21084. // NextPageToken: [Output Only] This token allows you to get the next
  21085. // page of results for list requests. If the number of results is larger
  21086. // than maxResults, use the nextPageToken as a value for the query
  21087. // parameter pageToken in the next list request. Subsequent list
  21088. // requests will have their own nextPageToken to continue paging through
  21089. // the results.
  21090. NextPageToken string `json:"nextPageToken,omitempty"`
  21091. // SelfLink: [Output Only] Server-defined URL for this resource.
  21092. SelfLink string `json:"selfLink,omitempty"`
  21093. // Warning: [Output Only] Informational warning message.
  21094. Warning *SubnetworkListWarning `json:"warning,omitempty"`
  21095. // ServerResponse contains the HTTP response code and headers from the
  21096. // server.
  21097. googleapi.ServerResponse `json:"-"`
  21098. // ForceSendFields is a list of field names (e.g. "Id") to
  21099. // unconditionally include in API requests. By default, fields with
  21100. // empty values are omitted from API requests. However, any non-pointer,
  21101. // non-interface field appearing in ForceSendFields will be sent to the
  21102. // server regardless of whether the field is empty or not. This may be
  21103. // used to include empty fields in Patch requests.
  21104. ForceSendFields []string `json:"-"`
  21105. // NullFields is a list of field names (e.g. "Id") to include in API
  21106. // requests with the JSON null value. By default, fields with empty
  21107. // values are omitted from API requests. However, any field with an
  21108. // empty value appearing in NullFields will be sent to the server as
  21109. // null. It is an error if a field in this list has a non-empty value.
  21110. // This may be used to include null fields in Patch requests.
  21111. NullFields []string `json:"-"`
  21112. }
  21113. func (s *SubnetworkList) MarshalJSON() ([]byte, error) {
  21114. type NoMethod SubnetworkList
  21115. raw := NoMethod(*s)
  21116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21117. }
  21118. // SubnetworkListWarning: [Output Only] Informational warning message.
  21119. type SubnetworkListWarning struct {
  21120. // Code: [Output Only] A warning code, if applicable. For example,
  21121. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21122. // the response.
  21123. //
  21124. // Possible values:
  21125. // "CLEANUP_FAILED"
  21126. // "DEPRECATED_RESOURCE_USED"
  21127. // "DEPRECATED_TYPE_USED"
  21128. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21129. // "EXPERIMENTAL_TYPE_USED"
  21130. // "EXTERNAL_API_WARNING"
  21131. // "FIELD_VALUE_OVERRIDEN"
  21132. // "INJECTED_KERNELS_DEPRECATED"
  21133. // "MISSING_TYPE_DEPENDENCY"
  21134. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21135. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21136. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21137. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21138. // "NEXT_HOP_NOT_RUNNING"
  21139. // "NOT_CRITICAL_ERROR"
  21140. // "NO_RESULTS_ON_PAGE"
  21141. // "REQUIRED_TOS_AGREEMENT"
  21142. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21143. // "RESOURCE_NOT_DELETED"
  21144. // "SCHEMA_VALIDATION_IGNORED"
  21145. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21146. // "UNDECLARED_PROPERTIES"
  21147. // "UNREACHABLE"
  21148. Code string `json:"code,omitempty"`
  21149. // Data: [Output Only] Metadata about this warning in key: value format.
  21150. // For example:
  21151. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21152. Data []*SubnetworkListWarningData `json:"data,omitempty"`
  21153. // Message: [Output Only] A human-readable description of the warning
  21154. // code.
  21155. Message string `json:"message,omitempty"`
  21156. // ForceSendFields is a list of field names (e.g. "Code") to
  21157. // unconditionally include in API requests. By default, fields with
  21158. // empty values are omitted from API requests. However, any non-pointer,
  21159. // non-interface field appearing in ForceSendFields will be sent to the
  21160. // server regardless of whether the field is empty or not. This may be
  21161. // used to include empty fields in Patch requests.
  21162. ForceSendFields []string `json:"-"`
  21163. // NullFields is a list of field names (e.g. "Code") to include in API
  21164. // requests with the JSON null value. By default, fields with empty
  21165. // values are omitted from API requests. However, any field with an
  21166. // empty value appearing in NullFields will be sent to the server as
  21167. // null. It is an error if a field in this list has a non-empty value.
  21168. // This may be used to include null fields in Patch requests.
  21169. NullFields []string `json:"-"`
  21170. }
  21171. func (s *SubnetworkListWarning) MarshalJSON() ([]byte, error) {
  21172. type NoMethod SubnetworkListWarning
  21173. raw := NoMethod(*s)
  21174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21175. }
  21176. type SubnetworkListWarningData struct {
  21177. // Key: [Output Only] A key that provides more detail on the warning
  21178. // being returned. For example, for warnings where there are no results
  21179. // in a list request for a particular zone, this key might be scope and
  21180. // the key value might be the zone name. Other examples might be a key
  21181. // indicating a deprecated resource and a suggested replacement, or a
  21182. // warning about invalid network settings (for example, if an instance
  21183. // attempts to perform IP forwarding but is not enabled for IP
  21184. // forwarding).
  21185. Key string `json:"key,omitempty"`
  21186. // Value: [Output Only] A warning data value corresponding to the key.
  21187. Value string `json:"value,omitempty"`
  21188. // ForceSendFields is a list of field names (e.g. "Key") to
  21189. // unconditionally include in API requests. By default, fields with
  21190. // empty values are omitted from API requests. However, any non-pointer,
  21191. // non-interface field appearing in ForceSendFields will be sent to the
  21192. // server regardless of whether the field is empty or not. This may be
  21193. // used to include empty fields in Patch requests.
  21194. ForceSendFields []string `json:"-"`
  21195. // NullFields is a list of field names (e.g. "Key") to include in API
  21196. // requests with the JSON null value. By default, fields with empty
  21197. // values are omitted from API requests. However, any field with an
  21198. // empty value appearing in NullFields will be sent to the server as
  21199. // null. It is an error if a field in this list has a non-empty value.
  21200. // This may be used to include null fields in Patch requests.
  21201. NullFields []string `json:"-"`
  21202. }
  21203. func (s *SubnetworkListWarningData) MarshalJSON() ([]byte, error) {
  21204. type NoMethod SubnetworkListWarningData
  21205. raw := NoMethod(*s)
  21206. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21207. }
  21208. // SubnetworkSecondaryRange: Represents a secondary IP range of a
  21209. // subnetwork.
  21210. type SubnetworkSecondaryRange struct {
  21211. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  21212. // secondary range. Provide this property when you create the
  21213. // subnetwork. Ranges must be unique and non-overlapping with all
  21214. // primary and secondary IP ranges within a network. Only IPv4 is
  21215. // supported.
  21216. IpCidrRange string `json:"ipCidrRange,omitempty"`
  21217. // RangeName: The name associated with this subnetwork secondary range,
  21218. // used when adding an alias IP range to a VM instance. The name must be
  21219. // 1-63 characters long, and comply with RFC1035. The name must be
  21220. // unique within the subnetwork.
  21221. RangeName string `json:"rangeName,omitempty"`
  21222. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  21223. // unconditionally include in API requests. By default, fields with
  21224. // empty values are omitted from API requests. However, any non-pointer,
  21225. // non-interface field appearing in ForceSendFields will be sent to the
  21226. // server regardless of whether the field is empty or not. This may be
  21227. // used to include empty fields in Patch requests.
  21228. ForceSendFields []string `json:"-"`
  21229. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  21230. // in API requests with the JSON null value. By default, fields with
  21231. // empty values are omitted from API requests. However, any field with
  21232. // an empty value appearing in NullFields will be sent to the server as
  21233. // null. It is an error if a field in this list has a non-empty value.
  21234. // This may be used to include null fields in Patch requests.
  21235. NullFields []string `json:"-"`
  21236. }
  21237. func (s *SubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  21238. type NoMethod SubnetworkSecondaryRange
  21239. raw := NoMethod(*s)
  21240. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21241. }
  21242. type SubnetworksExpandIpCidrRangeRequest struct {
  21243. // IpCidrRange: The IP (in CIDR format or netmask) of internal addresses
  21244. // that are legal on this Subnetwork. This range should be disjoint from
  21245. // other subnetworks within this network. This range can only be larger
  21246. // than (i.e. a superset of) the range previously defined before the
  21247. // update.
  21248. IpCidrRange string `json:"ipCidrRange,omitempty"`
  21249. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  21250. // unconditionally include in API requests. By default, fields with
  21251. // empty values are omitted from API requests. However, any non-pointer,
  21252. // non-interface field appearing in ForceSendFields will be sent to the
  21253. // server regardless of whether the field is empty or not. This may be
  21254. // used to include empty fields in Patch requests.
  21255. ForceSendFields []string `json:"-"`
  21256. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  21257. // in API requests with the JSON null value. By default, fields with
  21258. // empty values are omitted from API requests. However, any field with
  21259. // an empty value appearing in NullFields will be sent to the server as
  21260. // null. It is an error if a field in this list has a non-empty value.
  21261. // This may be used to include null fields in Patch requests.
  21262. NullFields []string `json:"-"`
  21263. }
  21264. func (s *SubnetworksExpandIpCidrRangeRequest) MarshalJSON() ([]byte, error) {
  21265. type NoMethod SubnetworksExpandIpCidrRangeRequest
  21266. raw := NoMethod(*s)
  21267. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21268. }
  21269. type SubnetworksScopedList struct {
  21270. // Subnetworks: A list of subnetworks contained in this scope.
  21271. Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
  21272. // Warning: An informational warning that appears when the list of
  21273. // addresses is empty.
  21274. Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
  21275. // ForceSendFields is a list of field names (e.g. "Subnetworks") to
  21276. // unconditionally include in API requests. By default, fields with
  21277. // empty values are omitted from API requests. However, any non-pointer,
  21278. // non-interface field appearing in ForceSendFields will be sent to the
  21279. // server regardless of whether the field is empty or not. This may be
  21280. // used to include empty fields in Patch requests.
  21281. ForceSendFields []string `json:"-"`
  21282. // NullFields is a list of field names (e.g. "Subnetworks") to include
  21283. // in API requests with the JSON null value. By default, fields with
  21284. // empty values are omitted from API requests. However, any field with
  21285. // an empty value appearing in NullFields will be sent to the server as
  21286. // null. It is an error if a field in this list has a non-empty value.
  21287. // This may be used to include null fields in Patch requests.
  21288. NullFields []string `json:"-"`
  21289. }
  21290. func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) {
  21291. type NoMethod SubnetworksScopedList
  21292. raw := NoMethod(*s)
  21293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21294. }
  21295. // SubnetworksScopedListWarning: An informational warning that appears
  21296. // when the list of addresses is empty.
  21297. type SubnetworksScopedListWarning struct {
  21298. // Code: [Output Only] A warning code, if applicable. For example,
  21299. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21300. // the response.
  21301. //
  21302. // Possible values:
  21303. // "CLEANUP_FAILED"
  21304. // "DEPRECATED_RESOURCE_USED"
  21305. // "DEPRECATED_TYPE_USED"
  21306. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21307. // "EXPERIMENTAL_TYPE_USED"
  21308. // "EXTERNAL_API_WARNING"
  21309. // "FIELD_VALUE_OVERRIDEN"
  21310. // "INJECTED_KERNELS_DEPRECATED"
  21311. // "MISSING_TYPE_DEPENDENCY"
  21312. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21313. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21314. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21315. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21316. // "NEXT_HOP_NOT_RUNNING"
  21317. // "NOT_CRITICAL_ERROR"
  21318. // "NO_RESULTS_ON_PAGE"
  21319. // "REQUIRED_TOS_AGREEMENT"
  21320. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21321. // "RESOURCE_NOT_DELETED"
  21322. // "SCHEMA_VALIDATION_IGNORED"
  21323. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21324. // "UNDECLARED_PROPERTIES"
  21325. // "UNREACHABLE"
  21326. Code string `json:"code,omitempty"`
  21327. // Data: [Output Only] Metadata about this warning in key: value format.
  21328. // For example:
  21329. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21330. Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
  21331. // Message: [Output Only] A human-readable description of the warning
  21332. // code.
  21333. Message string `json:"message,omitempty"`
  21334. // ForceSendFields is a list of field names (e.g. "Code") to
  21335. // unconditionally include in API requests. By default, fields with
  21336. // empty values are omitted from API requests. However, any non-pointer,
  21337. // non-interface field appearing in ForceSendFields will be sent to the
  21338. // server regardless of whether the field is empty or not. This may be
  21339. // used to include empty fields in Patch requests.
  21340. ForceSendFields []string `json:"-"`
  21341. // NullFields is a list of field names (e.g. "Code") to include in API
  21342. // requests with the JSON null value. By default, fields with empty
  21343. // values are omitted from API requests. However, any field with an
  21344. // empty value appearing in NullFields will be sent to the server as
  21345. // null. It is an error if a field in this list has a non-empty value.
  21346. // This may be used to include null fields in Patch requests.
  21347. NullFields []string `json:"-"`
  21348. }
  21349. func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
  21350. type NoMethod SubnetworksScopedListWarning
  21351. raw := NoMethod(*s)
  21352. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21353. }
  21354. type SubnetworksScopedListWarningData struct {
  21355. // Key: [Output Only] A key that provides more detail on the warning
  21356. // being returned. For example, for warnings where there are no results
  21357. // in a list request for a particular zone, this key might be scope and
  21358. // the key value might be the zone name. Other examples might be a key
  21359. // indicating a deprecated resource and a suggested replacement, or a
  21360. // warning about invalid network settings (for example, if an instance
  21361. // attempts to perform IP forwarding but is not enabled for IP
  21362. // forwarding).
  21363. Key string `json:"key,omitempty"`
  21364. // Value: [Output Only] A warning data value corresponding to the key.
  21365. Value string `json:"value,omitempty"`
  21366. // ForceSendFields is a list of field names (e.g. "Key") to
  21367. // unconditionally include in API requests. By default, fields with
  21368. // empty values are omitted from API requests. However, any non-pointer,
  21369. // non-interface field appearing in ForceSendFields will be sent to the
  21370. // server regardless of whether the field is empty or not. This may be
  21371. // used to include empty fields in Patch requests.
  21372. ForceSendFields []string `json:"-"`
  21373. // NullFields is a list of field names (e.g. "Key") to include in API
  21374. // requests with the JSON null value. By default, fields with empty
  21375. // values are omitted from API requests. However, any field with an
  21376. // empty value appearing in NullFields will be sent to the server as
  21377. // null. It is an error if a field in this list has a non-empty value.
  21378. // This may be used to include null fields in Patch requests.
  21379. NullFields []string `json:"-"`
  21380. }
  21381. func (s *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
  21382. type NoMethod SubnetworksScopedListWarningData
  21383. raw := NoMethod(*s)
  21384. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21385. }
  21386. type SubnetworksSetPrivateIpGoogleAccessRequest struct {
  21387. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  21388. // ForceSendFields is a list of field names (e.g.
  21389. // "PrivateIpGoogleAccess") to unconditionally include in API requests.
  21390. // By default, fields with empty values are omitted from API requests.
  21391. // However, any non-pointer, non-interface field appearing in
  21392. // ForceSendFields will be sent to the server regardless of whether the
  21393. // field is empty or not. This may be used to include empty fields in
  21394. // Patch requests.
  21395. ForceSendFields []string `json:"-"`
  21396. // NullFields is a list of field names (e.g. "PrivateIpGoogleAccess") to
  21397. // include in API requests with the JSON null value. By default, fields
  21398. // with empty values are omitted from API requests. However, any field
  21399. // with an empty value appearing in NullFields will be sent to the
  21400. // server as null. It is an error if a field in this list has a
  21401. // non-empty value. This may be used to include null fields in Patch
  21402. // requests.
  21403. NullFields []string `json:"-"`
  21404. }
  21405. func (s *SubnetworksSetPrivateIpGoogleAccessRequest) MarshalJSON() ([]byte, error) {
  21406. type NoMethod SubnetworksSetPrivateIpGoogleAccessRequest
  21407. raw := NoMethod(*s)
  21408. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21409. }
  21410. type TCPHealthCheck struct {
  21411. // Port: The TCP port number for the health check request. The default
  21412. // value is 80. Valid values are 1 through 65535.
  21413. Port int64 `json:"port,omitempty"`
  21414. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  21415. // both port and port_name are defined, port takes precedence.
  21416. PortName string `json:"portName,omitempty"`
  21417. // ProxyHeader: Specifies the type of proxy header to append before
  21418. // sending data to the backend, either NONE or PROXY_V1. The default is
  21419. // NONE.
  21420. //
  21421. // Possible values:
  21422. // "NONE"
  21423. // "PROXY_V1"
  21424. ProxyHeader string `json:"proxyHeader,omitempty"`
  21425. // Request: The application data to send once the TCP connection has
  21426. // been established (default value is empty). If both request and
  21427. // response are empty, the connection establishment alone will indicate
  21428. // health. The request data can only be ASCII.
  21429. Request string `json:"request,omitempty"`
  21430. // Response: The bytes to match against the beginning of the response
  21431. // data. If left empty (the default value), any response will indicate
  21432. // health. The response data can only be ASCII.
  21433. Response string `json:"response,omitempty"`
  21434. // ForceSendFields is a list of field names (e.g. "Port") to
  21435. // unconditionally include in API requests. By default, fields with
  21436. // empty values are omitted from API requests. However, any non-pointer,
  21437. // non-interface field appearing in ForceSendFields will be sent to the
  21438. // server regardless of whether the field is empty or not. This may be
  21439. // used to include empty fields in Patch requests.
  21440. ForceSendFields []string `json:"-"`
  21441. // NullFields is a list of field names (e.g. "Port") to include in API
  21442. // requests with the JSON null value. By default, fields with empty
  21443. // values are omitted from API requests. However, any field with an
  21444. // empty value appearing in NullFields will be sent to the server as
  21445. // null. It is an error if a field in this list has a non-empty value.
  21446. // This may be used to include null fields in Patch requests.
  21447. NullFields []string `json:"-"`
  21448. }
  21449. func (s *TCPHealthCheck) MarshalJSON() ([]byte, error) {
  21450. type NoMethod TCPHealthCheck
  21451. raw := NoMethod(*s)
  21452. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21453. }
  21454. // Tags: A set of instance tags.
  21455. type Tags struct {
  21456. // Fingerprint: Specifies a fingerprint for this request, which is
  21457. // essentially a hash of the tags' contents and used for optimistic
  21458. // locking. The fingerprint is initially generated by Compute Engine and
  21459. // changes after every request to modify or update tags. You must always
  21460. // provide an up-to-date fingerprint hash in order to update or change
  21461. // tags.
  21462. //
  21463. // To see the latest fingerprint, make get() request to the instance.
  21464. Fingerprint string `json:"fingerprint,omitempty"`
  21465. // Items: An array of tags. Each tag must be 1-63 characters long, and
  21466. // comply with RFC1035.
  21467. Items []string `json:"items,omitempty"`
  21468. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  21469. // unconditionally include in API requests. By default, fields with
  21470. // empty values are omitted from API requests. However, any non-pointer,
  21471. // non-interface field appearing in ForceSendFields will be sent to the
  21472. // server regardless of whether the field is empty or not. This may be
  21473. // used to include empty fields in Patch requests.
  21474. ForceSendFields []string `json:"-"`
  21475. // NullFields is a list of field names (e.g. "Fingerprint") to include
  21476. // in API requests with the JSON null value. By default, fields with
  21477. // empty values are omitted from API requests. However, any field with
  21478. // an empty value appearing in NullFields will be sent to the server as
  21479. // null. It is an error if a field in this list has a non-empty value.
  21480. // This may be used to include null fields in Patch requests.
  21481. NullFields []string `json:"-"`
  21482. }
  21483. func (s *Tags) MarshalJSON() ([]byte, error) {
  21484. type NoMethod Tags
  21485. raw := NoMethod(*s)
  21486. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21487. }
  21488. // TargetHttpProxy: A TargetHttpProxy resource. This resource defines an
  21489. // HTTP proxy. (== resource_for beta.targetHttpProxies ==) (==
  21490. // resource_for v1.targetHttpProxies ==)
  21491. type TargetHttpProxy struct {
  21492. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21493. // format.
  21494. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21495. // Description: An optional description of this resource. Provide this
  21496. // property when you create the resource.
  21497. Description string `json:"description,omitempty"`
  21498. // Id: [Output Only] The unique identifier for the resource. This
  21499. // identifier is defined by the server.
  21500. Id uint64 `json:"id,omitempty,string"`
  21501. // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy
  21502. // for target HTTP proxies.
  21503. Kind string `json:"kind,omitempty"`
  21504. // Name: Name of the resource. Provided by the client when the resource
  21505. // is created. The name must be 1-63 characters long, and comply with
  21506. // RFC1035. Specifically, the name must be 1-63 characters long and
  21507. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  21508. // the first character must be a lowercase letter, and all following
  21509. // characters must be a dash, lowercase letter, or digit, except the
  21510. // last character, which cannot be a dash.
  21511. Name string `json:"name,omitempty"`
  21512. // SelfLink: [Output Only] Server-defined URL for the resource.
  21513. SelfLink string `json:"selfLink,omitempty"`
  21514. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  21515. // to the BackendService.
  21516. UrlMap string `json:"urlMap,omitempty"`
  21517. // ServerResponse contains the HTTP response code and headers from the
  21518. // server.
  21519. googleapi.ServerResponse `json:"-"`
  21520. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21521. // to unconditionally include in API requests. By default, fields with
  21522. // empty values are omitted from API requests. However, any non-pointer,
  21523. // non-interface field appearing in ForceSendFields will be sent to the
  21524. // server regardless of whether the field is empty or not. This may be
  21525. // used to include empty fields in Patch requests.
  21526. ForceSendFields []string `json:"-"`
  21527. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  21528. // include in API requests with the JSON null value. By default, fields
  21529. // with empty values are omitted from API requests. However, any field
  21530. // with an empty value appearing in NullFields will be sent to the
  21531. // server as null. It is an error if a field in this list has a
  21532. // non-empty value. This may be used to include null fields in Patch
  21533. // requests.
  21534. NullFields []string `json:"-"`
  21535. }
  21536. func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) {
  21537. type NoMethod TargetHttpProxy
  21538. raw := NoMethod(*s)
  21539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21540. }
  21541. // TargetHttpProxyList: A list of TargetHttpProxy resources.
  21542. type TargetHttpProxyList struct {
  21543. // Id: [Output Only] Unique identifier for the resource; defined by the
  21544. // server.
  21545. Id string `json:"id,omitempty"`
  21546. // Items: A list of TargetHttpProxy resources.
  21547. Items []*TargetHttpProxy `json:"items,omitempty"`
  21548. // Kind: Type of resource. Always compute#targetHttpProxyList for lists
  21549. // of target HTTP proxies.
  21550. Kind string `json:"kind,omitempty"`
  21551. // NextPageToken: [Output Only] This token allows you to get the next
  21552. // page of results for list requests. If the number of results is larger
  21553. // than maxResults, use the nextPageToken as a value for the query
  21554. // parameter pageToken in the next list request. Subsequent list
  21555. // requests will have their own nextPageToken to continue paging through
  21556. // the results.
  21557. NextPageToken string `json:"nextPageToken,omitempty"`
  21558. // SelfLink: [Output Only] Server-defined URL for this resource.
  21559. SelfLink string `json:"selfLink,omitempty"`
  21560. // Warning: [Output Only] Informational warning message.
  21561. Warning *TargetHttpProxyListWarning `json:"warning,omitempty"`
  21562. // ServerResponse contains the HTTP response code and headers from the
  21563. // server.
  21564. googleapi.ServerResponse `json:"-"`
  21565. // ForceSendFields is a list of field names (e.g. "Id") to
  21566. // unconditionally include in API requests. By default, fields with
  21567. // empty values are omitted from API requests. However, any non-pointer,
  21568. // non-interface field appearing in ForceSendFields will be sent to the
  21569. // server regardless of whether the field is empty or not. This may be
  21570. // used to include empty fields in Patch requests.
  21571. ForceSendFields []string `json:"-"`
  21572. // NullFields is a list of field names (e.g. "Id") to include in API
  21573. // requests with the JSON null value. By default, fields with empty
  21574. // values are omitted from API requests. However, any field with an
  21575. // empty value appearing in NullFields will be sent to the server as
  21576. // null. It is an error if a field in this list has a non-empty value.
  21577. // This may be used to include null fields in Patch requests.
  21578. NullFields []string `json:"-"`
  21579. }
  21580. func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) {
  21581. type NoMethod TargetHttpProxyList
  21582. raw := NoMethod(*s)
  21583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21584. }
  21585. // TargetHttpProxyListWarning: [Output Only] Informational warning
  21586. // message.
  21587. type TargetHttpProxyListWarning struct {
  21588. // Code: [Output Only] A warning code, if applicable. For example,
  21589. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21590. // the response.
  21591. //
  21592. // Possible values:
  21593. // "CLEANUP_FAILED"
  21594. // "DEPRECATED_RESOURCE_USED"
  21595. // "DEPRECATED_TYPE_USED"
  21596. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21597. // "EXPERIMENTAL_TYPE_USED"
  21598. // "EXTERNAL_API_WARNING"
  21599. // "FIELD_VALUE_OVERRIDEN"
  21600. // "INJECTED_KERNELS_DEPRECATED"
  21601. // "MISSING_TYPE_DEPENDENCY"
  21602. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21603. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21604. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21605. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21606. // "NEXT_HOP_NOT_RUNNING"
  21607. // "NOT_CRITICAL_ERROR"
  21608. // "NO_RESULTS_ON_PAGE"
  21609. // "REQUIRED_TOS_AGREEMENT"
  21610. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21611. // "RESOURCE_NOT_DELETED"
  21612. // "SCHEMA_VALIDATION_IGNORED"
  21613. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21614. // "UNDECLARED_PROPERTIES"
  21615. // "UNREACHABLE"
  21616. Code string `json:"code,omitempty"`
  21617. // Data: [Output Only] Metadata about this warning in key: value format.
  21618. // For example:
  21619. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21620. Data []*TargetHttpProxyListWarningData `json:"data,omitempty"`
  21621. // Message: [Output Only] A human-readable description of the warning
  21622. // code.
  21623. Message string `json:"message,omitempty"`
  21624. // ForceSendFields is a list of field names (e.g. "Code") to
  21625. // unconditionally include in API requests. By default, fields with
  21626. // empty values are omitted from API requests. However, any non-pointer,
  21627. // non-interface field appearing in ForceSendFields will be sent to the
  21628. // server regardless of whether the field is empty or not. This may be
  21629. // used to include empty fields in Patch requests.
  21630. ForceSendFields []string `json:"-"`
  21631. // NullFields is a list of field names (e.g. "Code") to include in API
  21632. // requests with the JSON null value. By default, fields with empty
  21633. // values are omitted from API requests. However, any field with an
  21634. // empty value appearing in NullFields will be sent to the server as
  21635. // null. It is an error if a field in this list has a non-empty value.
  21636. // This may be used to include null fields in Patch requests.
  21637. NullFields []string `json:"-"`
  21638. }
  21639. func (s *TargetHttpProxyListWarning) MarshalJSON() ([]byte, error) {
  21640. type NoMethod TargetHttpProxyListWarning
  21641. raw := NoMethod(*s)
  21642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21643. }
  21644. type TargetHttpProxyListWarningData struct {
  21645. // Key: [Output Only] A key that provides more detail on the warning
  21646. // being returned. For example, for warnings where there are no results
  21647. // in a list request for a particular zone, this key might be scope and
  21648. // the key value might be the zone name. Other examples might be a key
  21649. // indicating a deprecated resource and a suggested replacement, or a
  21650. // warning about invalid network settings (for example, if an instance
  21651. // attempts to perform IP forwarding but is not enabled for IP
  21652. // forwarding).
  21653. Key string `json:"key,omitempty"`
  21654. // Value: [Output Only] A warning data value corresponding to the key.
  21655. Value string `json:"value,omitempty"`
  21656. // ForceSendFields is a list of field names (e.g. "Key") to
  21657. // unconditionally include in API requests. By default, fields with
  21658. // empty values are omitted from API requests. However, any non-pointer,
  21659. // non-interface field appearing in ForceSendFields will be sent to the
  21660. // server regardless of whether the field is empty or not. This may be
  21661. // used to include empty fields in Patch requests.
  21662. ForceSendFields []string `json:"-"`
  21663. // NullFields is a list of field names (e.g. "Key") to include in API
  21664. // requests with the JSON null value. By default, fields with empty
  21665. // values are omitted from API requests. However, any field with an
  21666. // empty value appearing in NullFields will be sent to the server as
  21667. // null. It is an error if a field in this list has a non-empty value.
  21668. // This may be used to include null fields in Patch requests.
  21669. NullFields []string `json:"-"`
  21670. }
  21671. func (s *TargetHttpProxyListWarningData) MarshalJSON() ([]byte, error) {
  21672. type NoMethod TargetHttpProxyListWarningData
  21673. raw := NoMethod(*s)
  21674. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21675. }
  21676. type TargetHttpsProxiesSetQuicOverrideRequest struct {
  21677. // QuicOverride: QUIC policy for the TargetHttpsProxy resource.
  21678. //
  21679. // Possible values:
  21680. // "DISABLE"
  21681. // "ENABLE"
  21682. // "NONE"
  21683. QuicOverride string `json:"quicOverride,omitempty"`
  21684. // ForceSendFields is a list of field names (e.g. "QuicOverride") to
  21685. // unconditionally include in API requests. By default, fields with
  21686. // empty values are omitted from API requests. However, any non-pointer,
  21687. // non-interface field appearing in ForceSendFields will be sent to the
  21688. // server regardless of whether the field is empty or not. This may be
  21689. // used to include empty fields in Patch requests.
  21690. ForceSendFields []string `json:"-"`
  21691. // NullFields is a list of field names (e.g. "QuicOverride") to include
  21692. // in API requests with the JSON null value. By default, fields with
  21693. // empty values are omitted from API requests. However, any field with
  21694. // an empty value appearing in NullFields will be sent to the server as
  21695. // null. It is an error if a field in this list has a non-empty value.
  21696. // This may be used to include null fields in Patch requests.
  21697. NullFields []string `json:"-"`
  21698. }
  21699. func (s *TargetHttpsProxiesSetQuicOverrideRequest) MarshalJSON() ([]byte, error) {
  21700. type NoMethod TargetHttpsProxiesSetQuicOverrideRequest
  21701. raw := NoMethod(*s)
  21702. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21703. }
  21704. type TargetHttpsProxiesSetSslCertificatesRequest struct {
  21705. // SslCertificates: New set of SslCertificate resources to associate
  21706. // with this TargetHttpsProxy resource. Currently exactly one
  21707. // SslCertificate resource must be specified.
  21708. SslCertificates []string `json:"sslCertificates,omitempty"`
  21709. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  21710. // unconditionally include in API requests. By default, fields with
  21711. // empty values are omitted from API requests. However, any non-pointer,
  21712. // non-interface field appearing in ForceSendFields will be sent to the
  21713. // server regardless of whether the field is empty or not. This may be
  21714. // used to include empty fields in Patch requests.
  21715. ForceSendFields []string `json:"-"`
  21716. // NullFields is a list of field names (e.g. "SslCertificates") to
  21717. // include in API requests with the JSON null value. By default, fields
  21718. // with empty values are omitted from API requests. However, any field
  21719. // with an empty value appearing in NullFields will be sent to the
  21720. // server as null. It is an error if a field in this list has a
  21721. // non-empty value. This may be used to include null fields in Patch
  21722. // requests.
  21723. NullFields []string `json:"-"`
  21724. }
  21725. func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  21726. type NoMethod TargetHttpsProxiesSetSslCertificatesRequest
  21727. raw := NoMethod(*s)
  21728. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21729. }
  21730. // TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines
  21731. // an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (==
  21732. // resource_for v1.targetHttpsProxies ==)
  21733. type TargetHttpsProxy struct {
  21734. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21735. // format.
  21736. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21737. // Description: An optional description of this resource. Provide this
  21738. // property when you create the resource.
  21739. Description string `json:"description,omitempty"`
  21740. // Id: [Output Only] The unique identifier for the resource. This
  21741. // identifier is defined by the server.
  21742. Id uint64 `json:"id,omitempty,string"`
  21743. // Kind: [Output Only] Type of resource. Always compute#targetHttpsProxy
  21744. // for target HTTPS proxies.
  21745. Kind string `json:"kind,omitempty"`
  21746. // Name: Name of the resource. Provided by the client when the resource
  21747. // is created. The name must be 1-63 characters long, and comply with
  21748. // RFC1035. Specifically, the name must be 1-63 characters long and
  21749. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  21750. // the first character must be a lowercase letter, and all following
  21751. // characters must be a dash, lowercase letter, or digit, except the
  21752. // last character, which cannot be a dash.
  21753. Name string `json:"name,omitempty"`
  21754. // QuicOverride: Specifies the QUIC override policy for this
  21755. // TargetHttpsProxy resource. This determines whether the load balancer
  21756. // will attempt to negotiate QUIC with clients or not. Can specify one
  21757. // of NONE, ENABLE, or DISABLE. Specify ENABLE to always enable QUIC,
  21758. // Enables QUIC when set to ENABLE, and disables QUIC when set to
  21759. // DISABLE. If NONE is specified, uses the QUIC policy with no user
  21760. // overrides, which is equivalent to DISABLE. Not specifying this field
  21761. // is equivalent to specifying NONE.
  21762. //
  21763. // Possible values:
  21764. // "DISABLE"
  21765. // "ENABLE"
  21766. // "NONE"
  21767. QuicOverride string `json:"quicOverride,omitempty"`
  21768. // SelfLink: [Output Only] Server-defined URL for the resource.
  21769. SelfLink string `json:"selfLink,omitempty"`
  21770. // SslCertificates: URLs to SslCertificate resources that are used to
  21771. // authenticate connections between users and the load balancer. At
  21772. // least one SSL certificate must be specified. Currently, you may
  21773. // specify up to 15 SSL certificates.
  21774. SslCertificates []string `json:"sslCertificates,omitempty"`
  21775. // SslPolicy: URL of SslPolicy resource that will be associated with the
  21776. // TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource
  21777. // will not have any SSL policy configured.
  21778. SslPolicy string `json:"sslPolicy,omitempty"`
  21779. // UrlMap: A fully-qualified or valid partial URL to the UrlMap resource
  21780. // that defines the mapping from URL to the BackendService. For example,
  21781. // the following are all valid URLs for specifying a URL map:
  21782. // -
  21783. // https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map
  21784. // - projects/project/global/urlMaps/url-map
  21785. // - global/urlMaps/url-map
  21786. UrlMap string `json:"urlMap,omitempty"`
  21787. // ServerResponse contains the HTTP response code and headers from the
  21788. // server.
  21789. googleapi.ServerResponse `json:"-"`
  21790. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21791. // to unconditionally include in API requests. By default, fields with
  21792. // empty values are omitted from API requests. However, any non-pointer,
  21793. // non-interface field appearing in ForceSendFields will be sent to the
  21794. // server regardless of whether the field is empty or not. This may be
  21795. // used to include empty fields in Patch requests.
  21796. ForceSendFields []string `json:"-"`
  21797. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  21798. // include in API requests with the JSON null value. By default, fields
  21799. // with empty values are omitted from API requests. However, any field
  21800. // with an empty value appearing in NullFields will be sent to the
  21801. // server as null. It is an error if a field in this list has a
  21802. // non-empty value. This may be used to include null fields in Patch
  21803. // requests.
  21804. NullFields []string `json:"-"`
  21805. }
  21806. func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) {
  21807. type NoMethod TargetHttpsProxy
  21808. raw := NoMethod(*s)
  21809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21810. }
  21811. // TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
  21812. type TargetHttpsProxyList struct {
  21813. // Id: [Output Only] Unique identifier for the resource; defined by the
  21814. // server.
  21815. Id string `json:"id,omitempty"`
  21816. // Items: A list of TargetHttpsProxy resources.
  21817. Items []*TargetHttpsProxy `json:"items,omitempty"`
  21818. // Kind: Type of resource. Always compute#targetHttpsProxyList for lists
  21819. // of target HTTPS proxies.
  21820. Kind string `json:"kind,omitempty"`
  21821. // NextPageToken: [Output Only] This token allows you to get the next
  21822. // page of results for list requests. If the number of results is larger
  21823. // than maxResults, use the nextPageToken as a value for the query
  21824. // parameter pageToken in the next list request. Subsequent list
  21825. // requests will have their own nextPageToken to continue paging through
  21826. // the results.
  21827. NextPageToken string `json:"nextPageToken,omitempty"`
  21828. // SelfLink: [Output Only] Server-defined URL for this resource.
  21829. SelfLink string `json:"selfLink,omitempty"`
  21830. // Warning: [Output Only] Informational warning message.
  21831. Warning *TargetHttpsProxyListWarning `json:"warning,omitempty"`
  21832. // ServerResponse contains the HTTP response code and headers from the
  21833. // server.
  21834. googleapi.ServerResponse `json:"-"`
  21835. // ForceSendFields is a list of field names (e.g. "Id") to
  21836. // unconditionally include in API requests. By default, fields with
  21837. // empty values are omitted from API requests. However, any non-pointer,
  21838. // non-interface field appearing in ForceSendFields will be sent to the
  21839. // server regardless of whether the field is empty or not. This may be
  21840. // used to include empty fields in Patch requests.
  21841. ForceSendFields []string `json:"-"`
  21842. // NullFields is a list of field names (e.g. "Id") to include in API
  21843. // requests with the JSON null value. By default, fields with empty
  21844. // values are omitted from API requests. However, any field with an
  21845. // empty value appearing in NullFields will be sent to the server as
  21846. // null. It is an error if a field in this list has a non-empty value.
  21847. // This may be used to include null fields in Patch requests.
  21848. NullFields []string `json:"-"`
  21849. }
  21850. func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
  21851. type NoMethod TargetHttpsProxyList
  21852. raw := NoMethod(*s)
  21853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21854. }
  21855. // TargetHttpsProxyListWarning: [Output Only] Informational warning
  21856. // message.
  21857. type TargetHttpsProxyListWarning struct {
  21858. // Code: [Output Only] A warning code, if applicable. For example,
  21859. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21860. // the response.
  21861. //
  21862. // Possible values:
  21863. // "CLEANUP_FAILED"
  21864. // "DEPRECATED_RESOURCE_USED"
  21865. // "DEPRECATED_TYPE_USED"
  21866. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21867. // "EXPERIMENTAL_TYPE_USED"
  21868. // "EXTERNAL_API_WARNING"
  21869. // "FIELD_VALUE_OVERRIDEN"
  21870. // "INJECTED_KERNELS_DEPRECATED"
  21871. // "MISSING_TYPE_DEPENDENCY"
  21872. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21873. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21874. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21875. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21876. // "NEXT_HOP_NOT_RUNNING"
  21877. // "NOT_CRITICAL_ERROR"
  21878. // "NO_RESULTS_ON_PAGE"
  21879. // "REQUIRED_TOS_AGREEMENT"
  21880. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21881. // "RESOURCE_NOT_DELETED"
  21882. // "SCHEMA_VALIDATION_IGNORED"
  21883. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21884. // "UNDECLARED_PROPERTIES"
  21885. // "UNREACHABLE"
  21886. Code string `json:"code,omitempty"`
  21887. // Data: [Output Only] Metadata about this warning in key: value format.
  21888. // For example:
  21889. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21890. Data []*TargetHttpsProxyListWarningData `json:"data,omitempty"`
  21891. // Message: [Output Only] A human-readable description of the warning
  21892. // code.
  21893. Message string `json:"message,omitempty"`
  21894. // ForceSendFields is a list of field names (e.g. "Code") to
  21895. // unconditionally include in API requests. By default, fields with
  21896. // empty values are omitted from API requests. However, any non-pointer,
  21897. // non-interface field appearing in ForceSendFields will be sent to the
  21898. // server regardless of whether the field is empty or not. This may be
  21899. // used to include empty fields in Patch requests.
  21900. ForceSendFields []string `json:"-"`
  21901. // NullFields is a list of field names (e.g. "Code") to include in API
  21902. // requests with the JSON null value. By default, fields with empty
  21903. // values are omitted from API requests. However, any field with an
  21904. // empty value appearing in NullFields will be sent to the server as
  21905. // null. It is an error if a field in this list has a non-empty value.
  21906. // This may be used to include null fields in Patch requests.
  21907. NullFields []string `json:"-"`
  21908. }
  21909. func (s *TargetHttpsProxyListWarning) MarshalJSON() ([]byte, error) {
  21910. type NoMethod TargetHttpsProxyListWarning
  21911. raw := NoMethod(*s)
  21912. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21913. }
  21914. type TargetHttpsProxyListWarningData struct {
  21915. // Key: [Output Only] A key that provides more detail on the warning
  21916. // being returned. For example, for warnings where there are no results
  21917. // in a list request for a particular zone, this key might be scope and
  21918. // the key value might be the zone name. Other examples might be a key
  21919. // indicating a deprecated resource and a suggested replacement, or a
  21920. // warning about invalid network settings (for example, if an instance
  21921. // attempts to perform IP forwarding but is not enabled for IP
  21922. // forwarding).
  21923. Key string `json:"key,omitempty"`
  21924. // Value: [Output Only] A warning data value corresponding to the key.
  21925. Value string `json:"value,omitempty"`
  21926. // ForceSendFields is a list of field names (e.g. "Key") to
  21927. // unconditionally include in API requests. By default, fields with
  21928. // empty values are omitted from API requests. However, any non-pointer,
  21929. // non-interface field appearing in ForceSendFields will be sent to the
  21930. // server regardless of whether the field is empty or not. This may be
  21931. // used to include empty fields in Patch requests.
  21932. ForceSendFields []string `json:"-"`
  21933. // NullFields is a list of field names (e.g. "Key") to include in API
  21934. // requests with the JSON null value. By default, fields with empty
  21935. // values are omitted from API requests. However, any field with an
  21936. // empty value appearing in NullFields will be sent to the server as
  21937. // null. It is an error if a field in this list has a non-empty value.
  21938. // This may be used to include null fields in Patch requests.
  21939. NullFields []string `json:"-"`
  21940. }
  21941. func (s *TargetHttpsProxyListWarningData) MarshalJSON() ([]byte, error) {
  21942. type NoMethod TargetHttpsProxyListWarningData
  21943. raw := NoMethod(*s)
  21944. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21945. }
  21946. // TargetInstance: A TargetInstance resource. This resource defines an
  21947. // endpoint instance that terminates traffic of certain protocols. (==
  21948. // resource_for beta.targetInstances ==) (== resource_for
  21949. // v1.targetInstances ==)
  21950. type TargetInstance struct {
  21951. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21952. // format.
  21953. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21954. // Description: An optional description of this resource. Provide this
  21955. // property when you create the resource.
  21956. Description string `json:"description,omitempty"`
  21957. // Id: [Output Only] The unique identifier for the resource. This
  21958. // identifier is defined by the server.
  21959. Id uint64 `json:"id,omitempty,string"`
  21960. // Instance: A URL to the virtual machine instance that handles traffic
  21961. // for this target instance. When creating a target instance, you can
  21962. // provide the fully-qualified URL or a valid partial URL to the desired
  21963. // virtual machine. For example, the following are all valid URLs:
  21964. // -
  21965. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  21966. // - projects/project/zones/zone/instances/instance
  21967. // - zones/zone/instances/instance
  21968. Instance string `json:"instance,omitempty"`
  21969. // Kind: [Output Only] The type of the resource. Always
  21970. // compute#targetInstance for target instances.
  21971. Kind string `json:"kind,omitempty"`
  21972. // Name: Name of the resource. Provided by the client when the resource
  21973. // is created. The name must be 1-63 characters long, and comply with
  21974. // RFC1035. Specifically, the name must be 1-63 characters long and
  21975. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  21976. // the first character must be a lowercase letter, and all following
  21977. // characters must be a dash, lowercase letter, or digit, except the
  21978. // last character, which cannot be a dash.
  21979. Name string `json:"name,omitempty"`
  21980. // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance.
  21981. // Currently only NO_NAT (default value) is supported.
  21982. //
  21983. // Possible values:
  21984. // "NO_NAT"
  21985. NatPolicy string `json:"natPolicy,omitempty"`
  21986. // SelfLink: [Output Only] Server-defined URL for the resource.
  21987. SelfLink string `json:"selfLink,omitempty"`
  21988. // Zone: [Output Only] URL of the zone where the target instance
  21989. // resides. You must specify this field as part of the HTTP request URL.
  21990. // It is not settable as a field in the request body.
  21991. Zone string `json:"zone,omitempty"`
  21992. // ServerResponse contains the HTTP response code and headers from the
  21993. // server.
  21994. googleapi.ServerResponse `json:"-"`
  21995. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21996. // to unconditionally include in API requests. By default, fields with
  21997. // empty values are omitted from API requests. However, any non-pointer,
  21998. // non-interface field appearing in ForceSendFields will be sent to the
  21999. // server regardless of whether the field is empty or not. This may be
  22000. // used to include empty fields in Patch requests.
  22001. ForceSendFields []string `json:"-"`
  22002. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  22003. // include in API requests with the JSON null value. By default, fields
  22004. // with empty values are omitted from API requests. However, any field
  22005. // with an empty value appearing in NullFields will be sent to the
  22006. // server as null. It is an error if a field in this list has a
  22007. // non-empty value. This may be used to include null fields in Patch
  22008. // requests.
  22009. NullFields []string `json:"-"`
  22010. }
  22011. func (s *TargetInstance) MarshalJSON() ([]byte, error) {
  22012. type NoMethod TargetInstance
  22013. raw := NoMethod(*s)
  22014. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22015. }
  22016. type TargetInstanceAggregatedList struct {
  22017. // Id: [Output Only] Unique identifier for the resource; defined by the
  22018. // server.
  22019. Id string `json:"id,omitempty"`
  22020. // Items: A list of TargetInstance resources.
  22021. Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
  22022. // Kind: Type of resource.
  22023. Kind string `json:"kind,omitempty"`
  22024. // NextPageToken: [Output Only] This token allows you to get the next
  22025. // page of results for list requests. If the number of results is larger
  22026. // than maxResults, use the nextPageToken as a value for the query
  22027. // parameter pageToken in the next list request. Subsequent list
  22028. // requests will have their own nextPageToken to continue paging through
  22029. // the results.
  22030. NextPageToken string `json:"nextPageToken,omitempty"`
  22031. // SelfLink: [Output Only] Server-defined URL for this resource.
  22032. SelfLink string `json:"selfLink,omitempty"`
  22033. // Warning: [Output Only] Informational warning message.
  22034. Warning *TargetInstanceAggregatedListWarning `json:"warning,omitempty"`
  22035. // ServerResponse contains the HTTP response code and headers from the
  22036. // server.
  22037. googleapi.ServerResponse `json:"-"`
  22038. // ForceSendFields is a list of field names (e.g. "Id") to
  22039. // unconditionally include in API requests. By default, fields with
  22040. // empty values are omitted from API requests. However, any non-pointer,
  22041. // non-interface field appearing in ForceSendFields will be sent to the
  22042. // server regardless of whether the field is empty or not. This may be
  22043. // used to include empty fields in Patch requests.
  22044. ForceSendFields []string `json:"-"`
  22045. // NullFields is a list of field names (e.g. "Id") to include in API
  22046. // requests with the JSON null value. By default, fields with empty
  22047. // values are omitted from API requests. However, any field with an
  22048. // empty value appearing in NullFields will be sent to the server as
  22049. // null. It is an error if a field in this list has a non-empty value.
  22050. // This may be used to include null fields in Patch requests.
  22051. NullFields []string `json:"-"`
  22052. }
  22053. func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
  22054. type NoMethod TargetInstanceAggregatedList
  22055. raw := NoMethod(*s)
  22056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22057. }
  22058. // TargetInstanceAggregatedListWarning: [Output Only] Informational
  22059. // warning message.
  22060. type TargetInstanceAggregatedListWarning struct {
  22061. // Code: [Output Only] A warning code, if applicable. For example,
  22062. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22063. // the response.
  22064. //
  22065. // Possible values:
  22066. // "CLEANUP_FAILED"
  22067. // "DEPRECATED_RESOURCE_USED"
  22068. // "DEPRECATED_TYPE_USED"
  22069. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22070. // "EXPERIMENTAL_TYPE_USED"
  22071. // "EXTERNAL_API_WARNING"
  22072. // "FIELD_VALUE_OVERRIDEN"
  22073. // "INJECTED_KERNELS_DEPRECATED"
  22074. // "MISSING_TYPE_DEPENDENCY"
  22075. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22076. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22077. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22078. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22079. // "NEXT_HOP_NOT_RUNNING"
  22080. // "NOT_CRITICAL_ERROR"
  22081. // "NO_RESULTS_ON_PAGE"
  22082. // "REQUIRED_TOS_AGREEMENT"
  22083. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22084. // "RESOURCE_NOT_DELETED"
  22085. // "SCHEMA_VALIDATION_IGNORED"
  22086. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22087. // "UNDECLARED_PROPERTIES"
  22088. // "UNREACHABLE"
  22089. Code string `json:"code,omitempty"`
  22090. // Data: [Output Only] Metadata about this warning in key: value format.
  22091. // For example:
  22092. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22093. Data []*TargetInstanceAggregatedListWarningData `json:"data,omitempty"`
  22094. // Message: [Output Only] A human-readable description of the warning
  22095. // code.
  22096. Message string `json:"message,omitempty"`
  22097. // ForceSendFields is a list of field names (e.g. "Code") to
  22098. // unconditionally include in API requests. By default, fields with
  22099. // empty values are omitted from API requests. However, any non-pointer,
  22100. // non-interface field appearing in ForceSendFields will be sent to the
  22101. // server regardless of whether the field is empty or not. This may be
  22102. // used to include empty fields in Patch requests.
  22103. ForceSendFields []string `json:"-"`
  22104. // NullFields is a list of field names (e.g. "Code") to include in API
  22105. // requests with the JSON null value. By default, fields with empty
  22106. // values are omitted from API requests. However, any field with an
  22107. // empty value appearing in NullFields will be sent to the server as
  22108. // null. It is an error if a field in this list has a non-empty value.
  22109. // This may be used to include null fields in Patch requests.
  22110. NullFields []string `json:"-"`
  22111. }
  22112. func (s *TargetInstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  22113. type NoMethod TargetInstanceAggregatedListWarning
  22114. raw := NoMethod(*s)
  22115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22116. }
  22117. type TargetInstanceAggregatedListWarningData struct {
  22118. // Key: [Output Only] A key that provides more detail on the warning
  22119. // being returned. For example, for warnings where there are no results
  22120. // in a list request for a particular zone, this key might be scope and
  22121. // the key value might be the zone name. Other examples might be a key
  22122. // indicating a deprecated resource and a suggested replacement, or a
  22123. // warning about invalid network settings (for example, if an instance
  22124. // attempts to perform IP forwarding but is not enabled for IP
  22125. // forwarding).
  22126. Key string `json:"key,omitempty"`
  22127. // Value: [Output Only] A warning data value corresponding to the key.
  22128. Value string `json:"value,omitempty"`
  22129. // ForceSendFields is a list of field names (e.g. "Key") to
  22130. // unconditionally include in API requests. By default, fields with
  22131. // empty values are omitted from API requests. However, any non-pointer,
  22132. // non-interface field appearing in ForceSendFields will be sent to the
  22133. // server regardless of whether the field is empty or not. This may be
  22134. // used to include empty fields in Patch requests.
  22135. ForceSendFields []string `json:"-"`
  22136. // NullFields is a list of field names (e.g. "Key") to include in API
  22137. // requests with the JSON null value. By default, fields with empty
  22138. // values are omitted from API requests. However, any field with an
  22139. // empty value appearing in NullFields will be sent to the server as
  22140. // null. It is an error if a field in this list has a non-empty value.
  22141. // This may be used to include null fields in Patch requests.
  22142. NullFields []string `json:"-"`
  22143. }
  22144. func (s *TargetInstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  22145. type NoMethod TargetInstanceAggregatedListWarningData
  22146. raw := NoMethod(*s)
  22147. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22148. }
  22149. // TargetInstanceList: Contains a list of TargetInstance resources.
  22150. type TargetInstanceList struct {
  22151. // Id: [Output Only] Unique identifier for the resource; defined by the
  22152. // server.
  22153. Id string `json:"id,omitempty"`
  22154. // Items: A list of TargetInstance resources.
  22155. Items []*TargetInstance `json:"items,omitempty"`
  22156. // Kind: Type of resource.
  22157. Kind string `json:"kind,omitempty"`
  22158. // NextPageToken: [Output Only] This token allows you to get the next
  22159. // page of results for list requests. If the number of results is larger
  22160. // than maxResults, use the nextPageToken as a value for the query
  22161. // parameter pageToken in the next list request. Subsequent list
  22162. // requests will have their own nextPageToken to continue paging through
  22163. // the results.
  22164. NextPageToken string `json:"nextPageToken,omitempty"`
  22165. // SelfLink: [Output Only] Server-defined URL for this resource.
  22166. SelfLink string `json:"selfLink,omitempty"`
  22167. // Warning: [Output Only] Informational warning message.
  22168. Warning *TargetInstanceListWarning `json:"warning,omitempty"`
  22169. // ServerResponse contains the HTTP response code and headers from the
  22170. // server.
  22171. googleapi.ServerResponse `json:"-"`
  22172. // ForceSendFields is a list of field names (e.g. "Id") to
  22173. // unconditionally include in API requests. By default, fields with
  22174. // empty values are omitted from API requests. However, any non-pointer,
  22175. // non-interface field appearing in ForceSendFields will be sent to the
  22176. // server regardless of whether the field is empty or not. This may be
  22177. // used to include empty fields in Patch requests.
  22178. ForceSendFields []string `json:"-"`
  22179. // NullFields is a list of field names (e.g. "Id") to include in API
  22180. // requests with the JSON null value. By default, fields with empty
  22181. // values are omitted from API requests. However, any field with an
  22182. // empty value appearing in NullFields will be sent to the server as
  22183. // null. It is an error if a field in this list has a non-empty value.
  22184. // This may be used to include null fields in Patch requests.
  22185. NullFields []string `json:"-"`
  22186. }
  22187. func (s *TargetInstanceList) MarshalJSON() ([]byte, error) {
  22188. type NoMethod TargetInstanceList
  22189. raw := NoMethod(*s)
  22190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22191. }
  22192. // TargetInstanceListWarning: [Output Only] Informational warning
  22193. // message.
  22194. type TargetInstanceListWarning struct {
  22195. // Code: [Output Only] A warning code, if applicable. For example,
  22196. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22197. // the response.
  22198. //
  22199. // Possible values:
  22200. // "CLEANUP_FAILED"
  22201. // "DEPRECATED_RESOURCE_USED"
  22202. // "DEPRECATED_TYPE_USED"
  22203. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22204. // "EXPERIMENTAL_TYPE_USED"
  22205. // "EXTERNAL_API_WARNING"
  22206. // "FIELD_VALUE_OVERRIDEN"
  22207. // "INJECTED_KERNELS_DEPRECATED"
  22208. // "MISSING_TYPE_DEPENDENCY"
  22209. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22210. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22211. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22212. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22213. // "NEXT_HOP_NOT_RUNNING"
  22214. // "NOT_CRITICAL_ERROR"
  22215. // "NO_RESULTS_ON_PAGE"
  22216. // "REQUIRED_TOS_AGREEMENT"
  22217. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22218. // "RESOURCE_NOT_DELETED"
  22219. // "SCHEMA_VALIDATION_IGNORED"
  22220. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22221. // "UNDECLARED_PROPERTIES"
  22222. // "UNREACHABLE"
  22223. Code string `json:"code,omitempty"`
  22224. // Data: [Output Only] Metadata about this warning in key: value format.
  22225. // For example:
  22226. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22227. Data []*TargetInstanceListWarningData `json:"data,omitempty"`
  22228. // Message: [Output Only] A human-readable description of the warning
  22229. // code.
  22230. Message string `json:"message,omitempty"`
  22231. // ForceSendFields is a list of field names (e.g. "Code") to
  22232. // unconditionally include in API requests. By default, fields with
  22233. // empty values are omitted from API requests. However, any non-pointer,
  22234. // non-interface field appearing in ForceSendFields will be sent to the
  22235. // server regardless of whether the field is empty or not. This may be
  22236. // used to include empty fields in Patch requests.
  22237. ForceSendFields []string `json:"-"`
  22238. // NullFields is a list of field names (e.g. "Code") to include in API
  22239. // requests with the JSON null value. By default, fields with empty
  22240. // values are omitted from API requests. However, any field with an
  22241. // empty value appearing in NullFields will be sent to the server as
  22242. // null. It is an error if a field in this list has a non-empty value.
  22243. // This may be used to include null fields in Patch requests.
  22244. NullFields []string `json:"-"`
  22245. }
  22246. func (s *TargetInstanceListWarning) MarshalJSON() ([]byte, error) {
  22247. type NoMethod TargetInstanceListWarning
  22248. raw := NoMethod(*s)
  22249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22250. }
  22251. type TargetInstanceListWarningData struct {
  22252. // Key: [Output Only] A key that provides more detail on the warning
  22253. // being returned. For example, for warnings where there are no results
  22254. // in a list request for a particular zone, this key might be scope and
  22255. // the key value might be the zone name. Other examples might be a key
  22256. // indicating a deprecated resource and a suggested replacement, or a
  22257. // warning about invalid network settings (for example, if an instance
  22258. // attempts to perform IP forwarding but is not enabled for IP
  22259. // forwarding).
  22260. Key string `json:"key,omitempty"`
  22261. // Value: [Output Only] A warning data value corresponding to the key.
  22262. Value string `json:"value,omitempty"`
  22263. // ForceSendFields is a list of field names (e.g. "Key") to
  22264. // unconditionally include in API requests. By default, fields with
  22265. // empty values are omitted from API requests. However, any non-pointer,
  22266. // non-interface field appearing in ForceSendFields will be sent to the
  22267. // server regardless of whether the field is empty or not. This may be
  22268. // used to include empty fields in Patch requests.
  22269. ForceSendFields []string `json:"-"`
  22270. // NullFields is a list of field names (e.g. "Key") to include in API
  22271. // requests with the JSON null value. By default, fields with empty
  22272. // values are omitted from API requests. However, any field with an
  22273. // empty value appearing in NullFields will be sent to the server as
  22274. // null. It is an error if a field in this list has a non-empty value.
  22275. // This may be used to include null fields in Patch requests.
  22276. NullFields []string `json:"-"`
  22277. }
  22278. func (s *TargetInstanceListWarningData) MarshalJSON() ([]byte, error) {
  22279. type NoMethod TargetInstanceListWarningData
  22280. raw := NoMethod(*s)
  22281. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22282. }
  22283. type TargetInstancesScopedList struct {
  22284. // TargetInstances: A list of target instances contained in this scope.
  22285. TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
  22286. // Warning: Informational warning which replaces the list of addresses
  22287. // when the list is empty.
  22288. Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
  22289. // ForceSendFields is a list of field names (e.g. "TargetInstances") to
  22290. // unconditionally include in API requests. By default, fields with
  22291. // empty values are omitted from API requests. However, any non-pointer,
  22292. // non-interface field appearing in ForceSendFields will be sent to the
  22293. // server regardless of whether the field is empty or not. This may be
  22294. // used to include empty fields in Patch requests.
  22295. ForceSendFields []string `json:"-"`
  22296. // NullFields is a list of field names (e.g. "TargetInstances") to
  22297. // include in API requests with the JSON null value. By default, fields
  22298. // with empty values are omitted from API requests. However, any field
  22299. // with an empty value appearing in NullFields will be sent to the
  22300. // server as null. It is an error if a field in this list has a
  22301. // non-empty value. This may be used to include null fields in Patch
  22302. // requests.
  22303. NullFields []string `json:"-"`
  22304. }
  22305. func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
  22306. type NoMethod TargetInstancesScopedList
  22307. raw := NoMethod(*s)
  22308. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22309. }
  22310. // TargetInstancesScopedListWarning: Informational warning which
  22311. // replaces the list of addresses when the list is empty.
  22312. type TargetInstancesScopedListWarning struct {
  22313. // Code: [Output Only] A warning code, if applicable. For example,
  22314. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22315. // the response.
  22316. //
  22317. // Possible values:
  22318. // "CLEANUP_FAILED"
  22319. // "DEPRECATED_RESOURCE_USED"
  22320. // "DEPRECATED_TYPE_USED"
  22321. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22322. // "EXPERIMENTAL_TYPE_USED"
  22323. // "EXTERNAL_API_WARNING"
  22324. // "FIELD_VALUE_OVERRIDEN"
  22325. // "INJECTED_KERNELS_DEPRECATED"
  22326. // "MISSING_TYPE_DEPENDENCY"
  22327. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22328. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22329. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22330. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22331. // "NEXT_HOP_NOT_RUNNING"
  22332. // "NOT_CRITICAL_ERROR"
  22333. // "NO_RESULTS_ON_PAGE"
  22334. // "REQUIRED_TOS_AGREEMENT"
  22335. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22336. // "RESOURCE_NOT_DELETED"
  22337. // "SCHEMA_VALIDATION_IGNORED"
  22338. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22339. // "UNDECLARED_PROPERTIES"
  22340. // "UNREACHABLE"
  22341. Code string `json:"code,omitempty"`
  22342. // Data: [Output Only] Metadata about this warning in key: value format.
  22343. // For example:
  22344. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22345. Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
  22346. // Message: [Output Only] A human-readable description of the warning
  22347. // code.
  22348. Message string `json:"message,omitempty"`
  22349. // ForceSendFields is a list of field names (e.g. "Code") to
  22350. // unconditionally include in API requests. By default, fields with
  22351. // empty values are omitted from API requests. However, any non-pointer,
  22352. // non-interface field appearing in ForceSendFields will be sent to the
  22353. // server regardless of whether the field is empty or not. This may be
  22354. // used to include empty fields in Patch requests.
  22355. ForceSendFields []string `json:"-"`
  22356. // NullFields is a list of field names (e.g. "Code") to include in API
  22357. // requests with the JSON null value. By default, fields with empty
  22358. // values are omitted from API requests. However, any field with an
  22359. // empty value appearing in NullFields will be sent to the server as
  22360. // null. It is an error if a field in this list has a non-empty value.
  22361. // This may be used to include null fields in Patch requests.
  22362. NullFields []string `json:"-"`
  22363. }
  22364. func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  22365. type NoMethod TargetInstancesScopedListWarning
  22366. raw := NoMethod(*s)
  22367. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22368. }
  22369. type TargetInstancesScopedListWarningData struct {
  22370. // Key: [Output Only] A key that provides more detail on the warning
  22371. // being returned. For example, for warnings where there are no results
  22372. // in a list request for a particular zone, this key might be scope and
  22373. // the key value might be the zone name. Other examples might be a key
  22374. // indicating a deprecated resource and a suggested replacement, or a
  22375. // warning about invalid network settings (for example, if an instance
  22376. // attempts to perform IP forwarding but is not enabled for IP
  22377. // forwarding).
  22378. Key string `json:"key,omitempty"`
  22379. // Value: [Output Only] A warning data value corresponding to the key.
  22380. Value string `json:"value,omitempty"`
  22381. // ForceSendFields is a list of field names (e.g. "Key") to
  22382. // unconditionally include in API requests. By default, fields with
  22383. // empty values are omitted from API requests. However, any non-pointer,
  22384. // non-interface field appearing in ForceSendFields will be sent to the
  22385. // server regardless of whether the field is empty or not. This may be
  22386. // used to include empty fields in Patch requests.
  22387. ForceSendFields []string `json:"-"`
  22388. // NullFields is a list of field names (e.g. "Key") to include in API
  22389. // requests with the JSON null value. By default, fields with empty
  22390. // values are omitted from API requests. However, any field with an
  22391. // empty value appearing in NullFields will be sent to the server as
  22392. // null. It is an error if a field in this list has a non-empty value.
  22393. // This may be used to include null fields in Patch requests.
  22394. NullFields []string `json:"-"`
  22395. }
  22396. func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  22397. type NoMethod TargetInstancesScopedListWarningData
  22398. raw := NoMethod(*s)
  22399. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22400. }
  22401. // TargetPool: A TargetPool resource. This resource defines a pool of
  22402. // instances, an associated HttpHealthCheck resource, and the fallback
  22403. // target pool. (== resource_for beta.targetPools ==) (== resource_for
  22404. // v1.targetPools ==)
  22405. type TargetPool struct {
  22406. // BackupPool: This field is applicable only when the containing target
  22407. // pool is serving a forwarding rule as the primary pool, and its
  22408. // failoverRatio field is properly set to a value between [0,
  22409. // 1].
  22410. //
  22411. // backupPool and failoverRatio together define the fallback behavior of
  22412. // the primary target pool: if the ratio of the healthy instances in the
  22413. // primary pool is at or below failoverRatio, traffic arriving at the
  22414. // load-balanced IP will be directed to the backup pool.
  22415. //
  22416. // In case where failoverRatio and backupPool are not set, or all the
  22417. // instances in the backup pool are unhealthy, the traffic will be
  22418. // directed back to the primary pool in the "force" mode, where traffic
  22419. // will be spread to the healthy instances with the best effort, or to
  22420. // all instances when no instance is healthy.
  22421. BackupPool string `json:"backupPool,omitempty"`
  22422. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  22423. // format.
  22424. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  22425. // Description: An optional description of this resource. Provide this
  22426. // property when you create the resource.
  22427. Description string `json:"description,omitempty"`
  22428. // FailoverRatio: This field is applicable only when the containing
  22429. // target pool is serving a forwarding rule as the primary pool (i.e.,
  22430. // not as a backup pool to some other target pool). The value of the
  22431. // field must be in [0, 1].
  22432. //
  22433. // If set, backupPool must also be set. They together define the
  22434. // fallback behavior of the primary target pool: if the ratio of the
  22435. // healthy instances in the primary pool is at or below this number,
  22436. // traffic arriving at the load-balanced IP will be directed to the
  22437. // backup pool.
  22438. //
  22439. // In case where failoverRatio is not set or all the instances in the
  22440. // backup pool are unhealthy, the traffic will be directed back to the
  22441. // primary pool in the "force" mode, where traffic will be spread to the
  22442. // healthy instances with the best effort, or to all instances when no
  22443. // instance is healthy.
  22444. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  22445. // HealthChecks: The URL of the HttpHealthCheck resource. A member
  22446. // instance in this pool is considered healthy if and only if the health
  22447. // checks pass. An empty list means all member instances will be
  22448. // considered healthy at all times. Only HttpHealthChecks are supported.
  22449. // Only one health check may be specified.
  22450. HealthChecks []string `json:"healthChecks,omitempty"`
  22451. // Id: [Output Only] The unique identifier for the resource. This
  22452. // identifier is defined by the server.
  22453. Id uint64 `json:"id,omitempty,string"`
  22454. // Instances: A list of resource URLs to the virtual machine instances
  22455. // serving this pool. They must live in zones contained in the same
  22456. // region as this pool.
  22457. Instances []string `json:"instances,omitempty"`
  22458. // Kind: [Output Only] Type of the resource. Always compute#targetPool
  22459. // for target pools.
  22460. Kind string `json:"kind,omitempty"`
  22461. // Name: Name of the resource. Provided by the client when the resource
  22462. // is created. The name must be 1-63 characters long, and comply with
  22463. // RFC1035. Specifically, the name must be 1-63 characters long and
  22464. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  22465. // the first character must be a lowercase letter, and all following
  22466. // characters must be a dash, lowercase letter, or digit, except the
  22467. // last character, which cannot be a dash.
  22468. Name string `json:"name,omitempty"`
  22469. // Region: [Output Only] URL of the region where the target pool
  22470. // resides.
  22471. Region string `json:"region,omitempty"`
  22472. // SelfLink: [Output Only] Server-defined URL for the resource.
  22473. SelfLink string `json:"selfLink,omitempty"`
  22474. // SessionAffinity: Session affinity option, must be one of the
  22475. // following values:
  22476. // NONE: Connections from the same client IP may go to any instance in
  22477. // the pool.
  22478. // CLIENT_IP: Connections from the same client IP will go to the same
  22479. // instance in the pool while that instance remains
  22480. // healthy.
  22481. // CLIENT_IP_PROTO: Connections from the same client IP with the same IP
  22482. // protocol will go to the same instance in the pool while that instance
  22483. // remains healthy.
  22484. //
  22485. // Possible values:
  22486. // "CLIENT_IP"
  22487. // "CLIENT_IP_PORT_PROTO"
  22488. // "CLIENT_IP_PROTO"
  22489. // "GENERATED_COOKIE"
  22490. // "NONE"
  22491. SessionAffinity string `json:"sessionAffinity,omitempty"`
  22492. // ServerResponse contains the HTTP response code and headers from the
  22493. // server.
  22494. googleapi.ServerResponse `json:"-"`
  22495. // ForceSendFields is a list of field names (e.g. "BackupPool") to
  22496. // unconditionally include in API requests. By default, fields with
  22497. // empty values are omitted from API requests. However, any non-pointer,
  22498. // non-interface field appearing in ForceSendFields will be sent to the
  22499. // server regardless of whether the field is empty or not. This may be
  22500. // used to include empty fields in Patch requests.
  22501. ForceSendFields []string `json:"-"`
  22502. // NullFields is a list of field names (e.g. "BackupPool") to include in
  22503. // API requests with the JSON null value. By default, fields with empty
  22504. // values are omitted from API requests. However, any field with an
  22505. // empty value appearing in NullFields will be sent to the server as
  22506. // null. It is an error if a field in this list has a non-empty value.
  22507. // This may be used to include null fields in Patch requests.
  22508. NullFields []string `json:"-"`
  22509. }
  22510. func (s *TargetPool) MarshalJSON() ([]byte, error) {
  22511. type NoMethod TargetPool
  22512. raw := NoMethod(*s)
  22513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22514. }
  22515. func (s *TargetPool) UnmarshalJSON(data []byte) error {
  22516. type NoMethod TargetPool
  22517. var s1 struct {
  22518. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  22519. *NoMethod
  22520. }
  22521. s1.NoMethod = (*NoMethod)(s)
  22522. if err := json.Unmarshal(data, &s1); err != nil {
  22523. return err
  22524. }
  22525. s.FailoverRatio = float64(s1.FailoverRatio)
  22526. return nil
  22527. }
  22528. type TargetPoolAggregatedList struct {
  22529. // Id: [Output Only] Unique identifier for the resource; defined by the
  22530. // server.
  22531. Id string `json:"id,omitempty"`
  22532. // Items: A list of TargetPool resources.
  22533. Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
  22534. // Kind: [Output Only] Type of resource. Always
  22535. // compute#targetPoolAggregatedList for aggregated lists of target
  22536. // pools.
  22537. Kind string `json:"kind,omitempty"`
  22538. // NextPageToken: [Output Only] This token allows you to get the next
  22539. // page of results for list requests. If the number of results is larger
  22540. // than maxResults, use the nextPageToken as a value for the query
  22541. // parameter pageToken in the next list request. Subsequent list
  22542. // requests will have their own nextPageToken to continue paging through
  22543. // the results.
  22544. NextPageToken string `json:"nextPageToken,omitempty"`
  22545. // SelfLink: [Output Only] Server-defined URL for this resource.
  22546. SelfLink string `json:"selfLink,omitempty"`
  22547. // Warning: [Output Only] Informational warning message.
  22548. Warning *TargetPoolAggregatedListWarning `json:"warning,omitempty"`
  22549. // ServerResponse contains the HTTP response code and headers from the
  22550. // server.
  22551. googleapi.ServerResponse `json:"-"`
  22552. // ForceSendFields is a list of field names (e.g. "Id") to
  22553. // unconditionally include in API requests. By default, fields with
  22554. // empty values are omitted from API requests. However, any non-pointer,
  22555. // non-interface field appearing in ForceSendFields will be sent to the
  22556. // server regardless of whether the field is empty or not. This may be
  22557. // used to include empty fields in Patch requests.
  22558. ForceSendFields []string `json:"-"`
  22559. // NullFields is a list of field names (e.g. "Id") to include in API
  22560. // requests with the JSON null value. By default, fields with empty
  22561. // values are omitted from API requests. However, any field with an
  22562. // empty value appearing in NullFields will be sent to the server as
  22563. // null. It is an error if a field in this list has a non-empty value.
  22564. // This may be used to include null fields in Patch requests.
  22565. NullFields []string `json:"-"`
  22566. }
  22567. func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
  22568. type NoMethod TargetPoolAggregatedList
  22569. raw := NoMethod(*s)
  22570. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22571. }
  22572. // TargetPoolAggregatedListWarning: [Output Only] Informational warning
  22573. // message.
  22574. type TargetPoolAggregatedListWarning struct {
  22575. // Code: [Output Only] A warning code, if applicable. For example,
  22576. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22577. // the response.
  22578. //
  22579. // Possible values:
  22580. // "CLEANUP_FAILED"
  22581. // "DEPRECATED_RESOURCE_USED"
  22582. // "DEPRECATED_TYPE_USED"
  22583. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22584. // "EXPERIMENTAL_TYPE_USED"
  22585. // "EXTERNAL_API_WARNING"
  22586. // "FIELD_VALUE_OVERRIDEN"
  22587. // "INJECTED_KERNELS_DEPRECATED"
  22588. // "MISSING_TYPE_DEPENDENCY"
  22589. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22590. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22591. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22592. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22593. // "NEXT_HOP_NOT_RUNNING"
  22594. // "NOT_CRITICAL_ERROR"
  22595. // "NO_RESULTS_ON_PAGE"
  22596. // "REQUIRED_TOS_AGREEMENT"
  22597. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22598. // "RESOURCE_NOT_DELETED"
  22599. // "SCHEMA_VALIDATION_IGNORED"
  22600. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22601. // "UNDECLARED_PROPERTIES"
  22602. // "UNREACHABLE"
  22603. Code string `json:"code,omitempty"`
  22604. // Data: [Output Only] Metadata about this warning in key: value format.
  22605. // For example:
  22606. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22607. Data []*TargetPoolAggregatedListWarningData `json:"data,omitempty"`
  22608. // Message: [Output Only] A human-readable description of the warning
  22609. // code.
  22610. Message string `json:"message,omitempty"`
  22611. // ForceSendFields is a list of field names (e.g. "Code") to
  22612. // unconditionally include in API requests. By default, fields with
  22613. // empty values are omitted from API requests. However, any non-pointer,
  22614. // non-interface field appearing in ForceSendFields will be sent to the
  22615. // server regardless of whether the field is empty or not. This may be
  22616. // used to include empty fields in Patch requests.
  22617. ForceSendFields []string `json:"-"`
  22618. // NullFields is a list of field names (e.g. "Code") to include in API
  22619. // requests with the JSON null value. By default, fields with empty
  22620. // values are omitted from API requests. However, any field with an
  22621. // empty value appearing in NullFields will be sent to the server as
  22622. // null. It is an error if a field in this list has a non-empty value.
  22623. // This may be used to include null fields in Patch requests.
  22624. NullFields []string `json:"-"`
  22625. }
  22626. func (s *TargetPoolAggregatedListWarning) MarshalJSON() ([]byte, error) {
  22627. type NoMethod TargetPoolAggregatedListWarning
  22628. raw := NoMethod(*s)
  22629. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22630. }
  22631. type TargetPoolAggregatedListWarningData struct {
  22632. // Key: [Output Only] A key that provides more detail on the warning
  22633. // being returned. For example, for warnings where there are no results
  22634. // in a list request for a particular zone, this key might be scope and
  22635. // the key value might be the zone name. Other examples might be a key
  22636. // indicating a deprecated resource and a suggested replacement, or a
  22637. // warning about invalid network settings (for example, if an instance
  22638. // attempts to perform IP forwarding but is not enabled for IP
  22639. // forwarding).
  22640. Key string `json:"key,omitempty"`
  22641. // Value: [Output Only] A warning data value corresponding to the key.
  22642. Value string `json:"value,omitempty"`
  22643. // ForceSendFields is a list of field names (e.g. "Key") to
  22644. // unconditionally include in API requests. By default, fields with
  22645. // empty values are omitted from API requests. However, any non-pointer,
  22646. // non-interface field appearing in ForceSendFields will be sent to the
  22647. // server regardless of whether the field is empty or not. This may be
  22648. // used to include empty fields in Patch requests.
  22649. ForceSendFields []string `json:"-"`
  22650. // NullFields is a list of field names (e.g. "Key") to include in API
  22651. // requests with the JSON null value. By default, fields with empty
  22652. // values are omitted from API requests. However, any field with an
  22653. // empty value appearing in NullFields will be sent to the server as
  22654. // null. It is an error if a field in this list has a non-empty value.
  22655. // This may be used to include null fields in Patch requests.
  22656. NullFields []string `json:"-"`
  22657. }
  22658. func (s *TargetPoolAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  22659. type NoMethod TargetPoolAggregatedListWarningData
  22660. raw := NoMethod(*s)
  22661. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22662. }
  22663. type TargetPoolInstanceHealth struct {
  22664. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  22665. // Kind: [Output Only] Type of resource. Always
  22666. // compute#targetPoolInstanceHealth when checking the health of an
  22667. // instance.
  22668. Kind string `json:"kind,omitempty"`
  22669. // ServerResponse contains the HTTP response code and headers from the
  22670. // server.
  22671. googleapi.ServerResponse `json:"-"`
  22672. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  22673. // unconditionally include in API requests. By default, fields with
  22674. // empty values are omitted from API requests. However, any non-pointer,
  22675. // non-interface field appearing in ForceSendFields will be sent to the
  22676. // server regardless of whether the field is empty or not. This may be
  22677. // used to include empty fields in Patch requests.
  22678. ForceSendFields []string `json:"-"`
  22679. // NullFields is a list of field names (e.g. "HealthStatus") to include
  22680. // in API requests with the JSON null value. By default, fields with
  22681. // empty values are omitted from API requests. However, any field with
  22682. // an empty value appearing in NullFields will be sent to the server as
  22683. // null. It is an error if a field in this list has a non-empty value.
  22684. // This may be used to include null fields in Patch requests.
  22685. NullFields []string `json:"-"`
  22686. }
  22687. func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
  22688. type NoMethod TargetPoolInstanceHealth
  22689. raw := NoMethod(*s)
  22690. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22691. }
  22692. // TargetPoolList: Contains a list of TargetPool resources.
  22693. type TargetPoolList struct {
  22694. // Id: [Output Only] Unique identifier for the resource; defined by the
  22695. // server.
  22696. Id string `json:"id,omitempty"`
  22697. // Items: A list of TargetPool resources.
  22698. Items []*TargetPool `json:"items,omitempty"`
  22699. // Kind: [Output Only] Type of resource. Always compute#targetPoolList
  22700. // for lists of target pools.
  22701. Kind string `json:"kind,omitempty"`
  22702. // NextPageToken: [Output Only] This token allows you to get the next
  22703. // page of results for list requests. If the number of results is larger
  22704. // than maxResults, use the nextPageToken as a value for the query
  22705. // parameter pageToken in the next list request. Subsequent list
  22706. // requests will have their own nextPageToken to continue paging through
  22707. // the results.
  22708. NextPageToken string `json:"nextPageToken,omitempty"`
  22709. // SelfLink: [Output Only] Server-defined URL for this resource.
  22710. SelfLink string `json:"selfLink,omitempty"`
  22711. // Warning: [Output Only] Informational warning message.
  22712. Warning *TargetPoolListWarning `json:"warning,omitempty"`
  22713. // ServerResponse contains the HTTP response code and headers from the
  22714. // server.
  22715. googleapi.ServerResponse `json:"-"`
  22716. // ForceSendFields is a list of field names (e.g. "Id") to
  22717. // unconditionally include in API requests. By default, fields with
  22718. // empty values are omitted from API requests. However, any non-pointer,
  22719. // non-interface field appearing in ForceSendFields will be sent to the
  22720. // server regardless of whether the field is empty or not. This may be
  22721. // used to include empty fields in Patch requests.
  22722. ForceSendFields []string `json:"-"`
  22723. // NullFields is a list of field names (e.g. "Id") to include in API
  22724. // requests with the JSON null value. By default, fields with empty
  22725. // values are omitted from API requests. However, any field with an
  22726. // empty value appearing in NullFields will be sent to the server as
  22727. // null. It is an error if a field in this list has a non-empty value.
  22728. // This may be used to include null fields in Patch requests.
  22729. NullFields []string `json:"-"`
  22730. }
  22731. func (s *TargetPoolList) MarshalJSON() ([]byte, error) {
  22732. type NoMethod TargetPoolList
  22733. raw := NoMethod(*s)
  22734. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22735. }
  22736. // TargetPoolListWarning: [Output Only] Informational warning message.
  22737. type TargetPoolListWarning struct {
  22738. // Code: [Output Only] A warning code, if applicable. For example,
  22739. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22740. // the response.
  22741. //
  22742. // Possible values:
  22743. // "CLEANUP_FAILED"
  22744. // "DEPRECATED_RESOURCE_USED"
  22745. // "DEPRECATED_TYPE_USED"
  22746. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22747. // "EXPERIMENTAL_TYPE_USED"
  22748. // "EXTERNAL_API_WARNING"
  22749. // "FIELD_VALUE_OVERRIDEN"
  22750. // "INJECTED_KERNELS_DEPRECATED"
  22751. // "MISSING_TYPE_DEPENDENCY"
  22752. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22753. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22754. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22755. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22756. // "NEXT_HOP_NOT_RUNNING"
  22757. // "NOT_CRITICAL_ERROR"
  22758. // "NO_RESULTS_ON_PAGE"
  22759. // "REQUIRED_TOS_AGREEMENT"
  22760. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22761. // "RESOURCE_NOT_DELETED"
  22762. // "SCHEMA_VALIDATION_IGNORED"
  22763. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22764. // "UNDECLARED_PROPERTIES"
  22765. // "UNREACHABLE"
  22766. Code string `json:"code,omitempty"`
  22767. // Data: [Output Only] Metadata about this warning in key: value format.
  22768. // For example:
  22769. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22770. Data []*TargetPoolListWarningData `json:"data,omitempty"`
  22771. // Message: [Output Only] A human-readable description of the warning
  22772. // code.
  22773. Message string `json:"message,omitempty"`
  22774. // ForceSendFields is a list of field names (e.g. "Code") to
  22775. // unconditionally include in API requests. By default, fields with
  22776. // empty values are omitted from API requests. However, any non-pointer,
  22777. // non-interface field appearing in ForceSendFields will be sent to the
  22778. // server regardless of whether the field is empty or not. This may be
  22779. // used to include empty fields in Patch requests.
  22780. ForceSendFields []string `json:"-"`
  22781. // NullFields is a list of field names (e.g. "Code") to include in API
  22782. // requests with the JSON null value. By default, fields with empty
  22783. // values are omitted from API requests. However, any field with an
  22784. // empty value appearing in NullFields will be sent to the server as
  22785. // null. It is an error if a field in this list has a non-empty value.
  22786. // This may be used to include null fields in Patch requests.
  22787. NullFields []string `json:"-"`
  22788. }
  22789. func (s *TargetPoolListWarning) MarshalJSON() ([]byte, error) {
  22790. type NoMethod TargetPoolListWarning
  22791. raw := NoMethod(*s)
  22792. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22793. }
  22794. type TargetPoolListWarningData struct {
  22795. // Key: [Output Only] A key that provides more detail on the warning
  22796. // being returned. For example, for warnings where there are no results
  22797. // in a list request for a particular zone, this key might be scope and
  22798. // the key value might be the zone name. Other examples might be a key
  22799. // indicating a deprecated resource and a suggested replacement, or a
  22800. // warning about invalid network settings (for example, if an instance
  22801. // attempts to perform IP forwarding but is not enabled for IP
  22802. // forwarding).
  22803. Key string `json:"key,omitempty"`
  22804. // Value: [Output Only] A warning data value corresponding to the key.
  22805. Value string `json:"value,omitempty"`
  22806. // ForceSendFields is a list of field names (e.g. "Key") to
  22807. // unconditionally include in API requests. By default, fields with
  22808. // empty values are omitted from API requests. However, any non-pointer,
  22809. // non-interface field appearing in ForceSendFields will be sent to the
  22810. // server regardless of whether the field is empty or not. This may be
  22811. // used to include empty fields in Patch requests.
  22812. ForceSendFields []string `json:"-"`
  22813. // NullFields is a list of field names (e.g. "Key") to include in API
  22814. // requests with the JSON null value. By default, fields with empty
  22815. // values are omitted from API requests. However, any field with an
  22816. // empty value appearing in NullFields will be sent to the server as
  22817. // null. It is an error if a field in this list has a non-empty value.
  22818. // This may be used to include null fields in Patch requests.
  22819. NullFields []string `json:"-"`
  22820. }
  22821. func (s *TargetPoolListWarningData) MarshalJSON() ([]byte, error) {
  22822. type NoMethod TargetPoolListWarningData
  22823. raw := NoMethod(*s)
  22824. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22825. }
  22826. type TargetPoolsAddHealthCheckRequest struct {
  22827. // HealthChecks: The HttpHealthCheck to add to the target pool.
  22828. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  22829. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  22830. // unconditionally include in API requests. By default, fields with
  22831. // empty values are omitted from API requests. However, any non-pointer,
  22832. // non-interface field appearing in ForceSendFields will be sent to the
  22833. // server regardless of whether the field is empty or not. This may be
  22834. // used to include empty fields in Patch requests.
  22835. ForceSendFields []string `json:"-"`
  22836. // NullFields is a list of field names (e.g. "HealthChecks") to include
  22837. // in API requests with the JSON null value. By default, fields with
  22838. // empty values are omitted from API requests. However, any field with
  22839. // an empty value appearing in NullFields will be sent to the server as
  22840. // null. It is an error if a field in this list has a non-empty value.
  22841. // This may be used to include null fields in Patch requests.
  22842. NullFields []string `json:"-"`
  22843. }
  22844. func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
  22845. type NoMethod TargetPoolsAddHealthCheckRequest
  22846. raw := NoMethod(*s)
  22847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22848. }
  22849. type TargetPoolsAddInstanceRequest struct {
  22850. // Instances: A full or partial URL to an instance to add to this target
  22851. // pool. This can be a full or partial URL. For example, the following
  22852. // are valid URLs:
  22853. // -
  22854. // https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name
  22855. // - projects/project-id/zones/zone/instances/instance-name
  22856. // - zones/zone/instances/instance-name
  22857. Instances []*InstanceReference `json:"instances,omitempty"`
  22858. // ForceSendFields is a list of field names (e.g. "Instances") to
  22859. // unconditionally include in API requests. By default, fields with
  22860. // empty values are omitted from API requests. However, any non-pointer,
  22861. // non-interface field appearing in ForceSendFields will be sent to the
  22862. // server regardless of whether the field is empty or not. This may be
  22863. // used to include empty fields in Patch requests.
  22864. ForceSendFields []string `json:"-"`
  22865. // NullFields is a list of field names (e.g. "Instances") to include in
  22866. // API requests with the JSON null value. By default, fields with empty
  22867. // values are omitted from API requests. However, any field with an
  22868. // empty value appearing in NullFields will be sent to the server as
  22869. // null. It is an error if a field in this list has a non-empty value.
  22870. // This may be used to include null fields in Patch requests.
  22871. NullFields []string `json:"-"`
  22872. }
  22873. func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
  22874. type NoMethod TargetPoolsAddInstanceRequest
  22875. raw := NoMethod(*s)
  22876. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22877. }
  22878. type TargetPoolsRemoveHealthCheckRequest struct {
  22879. // HealthChecks: Health check URL to be removed. This can be a full or
  22880. // valid partial URL. For example, the following are valid URLs:
  22881. // -
  22882. // https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check
  22883. // - projects/project/global/httpHealthChecks/health-check
  22884. // - global/httpHealthChecks/health-check
  22885. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  22886. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  22887. // unconditionally include in API requests. By default, fields with
  22888. // empty values are omitted from API requests. However, any non-pointer,
  22889. // non-interface field appearing in ForceSendFields will be sent to the
  22890. // server regardless of whether the field is empty or not. This may be
  22891. // used to include empty fields in Patch requests.
  22892. ForceSendFields []string `json:"-"`
  22893. // NullFields is a list of field names (e.g. "HealthChecks") to include
  22894. // in API requests with the JSON null value. By default, fields with
  22895. // empty values are omitted from API requests. However, any field with
  22896. // an empty value appearing in NullFields will be sent to the server as
  22897. // null. It is an error if a field in this list has a non-empty value.
  22898. // This may be used to include null fields in Patch requests.
  22899. NullFields []string `json:"-"`
  22900. }
  22901. func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
  22902. type NoMethod TargetPoolsRemoveHealthCheckRequest
  22903. raw := NoMethod(*s)
  22904. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22905. }
  22906. type TargetPoolsRemoveInstanceRequest struct {
  22907. // Instances: URLs of the instances to be removed from target pool.
  22908. Instances []*InstanceReference `json:"instances,omitempty"`
  22909. // ForceSendFields is a list of field names (e.g. "Instances") to
  22910. // unconditionally include in API requests. By default, fields with
  22911. // empty values are omitted from API requests. However, any non-pointer,
  22912. // non-interface field appearing in ForceSendFields will be sent to the
  22913. // server regardless of whether the field is empty or not. This may be
  22914. // used to include empty fields in Patch requests.
  22915. ForceSendFields []string `json:"-"`
  22916. // NullFields is a list of field names (e.g. "Instances") to include in
  22917. // API requests with the JSON null value. By default, fields with empty
  22918. // values are omitted from API requests. However, any field with an
  22919. // empty value appearing in NullFields will be sent to the server as
  22920. // null. It is an error if a field in this list has a non-empty value.
  22921. // This may be used to include null fields in Patch requests.
  22922. NullFields []string `json:"-"`
  22923. }
  22924. func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
  22925. type NoMethod TargetPoolsRemoveInstanceRequest
  22926. raw := NoMethod(*s)
  22927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22928. }
  22929. type TargetPoolsScopedList struct {
  22930. // TargetPools: A list of target pools contained in this scope.
  22931. TargetPools []*TargetPool `json:"targetPools,omitempty"`
  22932. // Warning: Informational warning which replaces the list of addresses
  22933. // when the list is empty.
  22934. Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
  22935. // ForceSendFields is a list of field names (e.g. "TargetPools") to
  22936. // unconditionally include in API requests. By default, fields with
  22937. // empty values are omitted from API requests. However, any non-pointer,
  22938. // non-interface field appearing in ForceSendFields will be sent to the
  22939. // server regardless of whether the field is empty or not. This may be
  22940. // used to include empty fields in Patch requests.
  22941. ForceSendFields []string `json:"-"`
  22942. // NullFields is a list of field names (e.g. "TargetPools") to include
  22943. // in API requests with the JSON null value. By default, fields with
  22944. // empty values are omitted from API requests. However, any field with
  22945. // an empty value appearing in NullFields will be sent to the server as
  22946. // null. It is an error if a field in this list has a non-empty value.
  22947. // This may be used to include null fields in Patch requests.
  22948. NullFields []string `json:"-"`
  22949. }
  22950. func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
  22951. type NoMethod TargetPoolsScopedList
  22952. raw := NoMethod(*s)
  22953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22954. }
  22955. // TargetPoolsScopedListWarning: Informational warning which replaces
  22956. // the list of addresses when the list is empty.
  22957. type TargetPoolsScopedListWarning struct {
  22958. // Code: [Output Only] A warning code, if applicable. For example,
  22959. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22960. // the response.
  22961. //
  22962. // Possible values:
  22963. // "CLEANUP_FAILED"
  22964. // "DEPRECATED_RESOURCE_USED"
  22965. // "DEPRECATED_TYPE_USED"
  22966. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22967. // "EXPERIMENTAL_TYPE_USED"
  22968. // "EXTERNAL_API_WARNING"
  22969. // "FIELD_VALUE_OVERRIDEN"
  22970. // "INJECTED_KERNELS_DEPRECATED"
  22971. // "MISSING_TYPE_DEPENDENCY"
  22972. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22973. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22974. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22975. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22976. // "NEXT_HOP_NOT_RUNNING"
  22977. // "NOT_CRITICAL_ERROR"
  22978. // "NO_RESULTS_ON_PAGE"
  22979. // "REQUIRED_TOS_AGREEMENT"
  22980. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22981. // "RESOURCE_NOT_DELETED"
  22982. // "SCHEMA_VALIDATION_IGNORED"
  22983. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22984. // "UNDECLARED_PROPERTIES"
  22985. // "UNREACHABLE"
  22986. Code string `json:"code,omitempty"`
  22987. // Data: [Output Only] Metadata about this warning in key: value format.
  22988. // For example:
  22989. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22990. Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
  22991. // Message: [Output Only] A human-readable description of the warning
  22992. // code.
  22993. Message string `json:"message,omitempty"`
  22994. // ForceSendFields is a list of field names (e.g. "Code") to
  22995. // unconditionally include in API requests. By default, fields with
  22996. // empty values are omitted from API requests. However, any non-pointer,
  22997. // non-interface field appearing in ForceSendFields will be sent to the
  22998. // server regardless of whether the field is empty or not. This may be
  22999. // used to include empty fields in Patch requests.
  23000. ForceSendFields []string `json:"-"`
  23001. // NullFields is a list of field names (e.g. "Code") to include in API
  23002. // requests with the JSON null value. By default, fields with empty
  23003. // values are omitted from API requests. However, any field with an
  23004. // empty value appearing in NullFields will be sent to the server as
  23005. // null. It is an error if a field in this list has a non-empty value.
  23006. // This may be used to include null fields in Patch requests.
  23007. NullFields []string `json:"-"`
  23008. }
  23009. func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
  23010. type NoMethod TargetPoolsScopedListWarning
  23011. raw := NoMethod(*s)
  23012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23013. }
  23014. type TargetPoolsScopedListWarningData struct {
  23015. // Key: [Output Only] A key that provides more detail on the warning
  23016. // being returned. For example, for warnings where there are no results
  23017. // in a list request for a particular zone, this key might be scope and
  23018. // the key value might be the zone name. Other examples might be a key
  23019. // indicating a deprecated resource and a suggested replacement, or a
  23020. // warning about invalid network settings (for example, if an instance
  23021. // attempts to perform IP forwarding but is not enabled for IP
  23022. // forwarding).
  23023. Key string `json:"key,omitempty"`
  23024. // Value: [Output Only] A warning data value corresponding to the key.
  23025. Value string `json:"value,omitempty"`
  23026. // ForceSendFields is a list of field names (e.g. "Key") to
  23027. // unconditionally include in API requests. By default, fields with
  23028. // empty values are omitted from API requests. However, any non-pointer,
  23029. // non-interface field appearing in ForceSendFields will be sent to the
  23030. // server regardless of whether the field is empty or not. This may be
  23031. // used to include empty fields in Patch requests.
  23032. ForceSendFields []string `json:"-"`
  23033. // NullFields is a list of field names (e.g. "Key") to include in API
  23034. // requests with the JSON null value. By default, fields with empty
  23035. // values are omitted from API requests. However, any field with an
  23036. // empty value appearing in NullFields will be sent to the server as
  23037. // null. It is an error if a field in this list has a non-empty value.
  23038. // This may be used to include null fields in Patch requests.
  23039. NullFields []string `json:"-"`
  23040. }
  23041. func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
  23042. type NoMethod TargetPoolsScopedListWarningData
  23043. raw := NoMethod(*s)
  23044. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23045. }
  23046. type TargetReference struct {
  23047. Target string `json:"target,omitempty"`
  23048. // ForceSendFields is a list of field names (e.g. "Target") to
  23049. // unconditionally include in API requests. By default, fields with
  23050. // empty values are omitted from API requests. However, any non-pointer,
  23051. // non-interface field appearing in ForceSendFields will be sent to the
  23052. // server regardless of whether the field is empty or not. This may be
  23053. // used to include empty fields in Patch requests.
  23054. ForceSendFields []string `json:"-"`
  23055. // NullFields is a list of field names (e.g. "Target") to include in API
  23056. // requests with the JSON null value. By default, fields with empty
  23057. // values are omitted from API requests. However, any field with an
  23058. // empty value appearing in NullFields will be sent to the server as
  23059. // null. It is an error if a field in this list has a non-empty value.
  23060. // This may be used to include null fields in Patch requests.
  23061. NullFields []string `json:"-"`
  23062. }
  23063. func (s *TargetReference) MarshalJSON() ([]byte, error) {
  23064. type NoMethod TargetReference
  23065. raw := NoMethod(*s)
  23066. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23067. }
  23068. type TargetSslProxiesSetBackendServiceRequest struct {
  23069. // Service: The URL of the new BackendService resource for the
  23070. // targetSslProxy.
  23071. Service string `json:"service,omitempty"`
  23072. // ForceSendFields is a list of field names (e.g. "Service") to
  23073. // unconditionally include in API requests. By default, fields with
  23074. // empty values are omitted from API requests. However, any non-pointer,
  23075. // non-interface field appearing in ForceSendFields will be sent to the
  23076. // server regardless of whether the field is empty or not. This may be
  23077. // used to include empty fields in Patch requests.
  23078. ForceSendFields []string `json:"-"`
  23079. // NullFields is a list of field names (e.g. "Service") to include in
  23080. // API requests with the JSON null value. By default, fields with empty
  23081. // values are omitted from API requests. However, any field with an
  23082. // empty value appearing in NullFields will be sent to the server as
  23083. // null. It is an error if a field in this list has a non-empty value.
  23084. // This may be used to include null fields in Patch requests.
  23085. NullFields []string `json:"-"`
  23086. }
  23087. func (s *TargetSslProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  23088. type NoMethod TargetSslProxiesSetBackendServiceRequest
  23089. raw := NoMethod(*s)
  23090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23091. }
  23092. type TargetSslProxiesSetProxyHeaderRequest struct {
  23093. // ProxyHeader: The new type of proxy header to append before sending
  23094. // data to the backend. NONE or PROXY_V1 are allowed.
  23095. //
  23096. // Possible values:
  23097. // "NONE"
  23098. // "PROXY_V1"
  23099. ProxyHeader string `json:"proxyHeader,omitempty"`
  23100. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  23101. // unconditionally include in API requests. By default, fields with
  23102. // empty values are omitted from API requests. However, any non-pointer,
  23103. // non-interface field appearing in ForceSendFields will be sent to the
  23104. // server regardless of whether the field is empty or not. This may be
  23105. // used to include empty fields in Patch requests.
  23106. ForceSendFields []string `json:"-"`
  23107. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  23108. // in API requests with the JSON null value. By default, fields with
  23109. // empty values are omitted from API requests. However, any field with
  23110. // an empty value appearing in NullFields will be sent to the server as
  23111. // null. It is an error if a field in this list has a non-empty value.
  23112. // This may be used to include null fields in Patch requests.
  23113. NullFields []string `json:"-"`
  23114. }
  23115. func (s *TargetSslProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  23116. type NoMethod TargetSslProxiesSetProxyHeaderRequest
  23117. raw := NoMethod(*s)
  23118. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23119. }
  23120. type TargetSslProxiesSetSslCertificatesRequest struct {
  23121. // SslCertificates: New set of URLs to SslCertificate resources to
  23122. // associate with this TargetSslProxy. Currently exactly one ssl
  23123. // certificate must be specified.
  23124. SslCertificates []string `json:"sslCertificates,omitempty"`
  23125. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  23126. // unconditionally include in API requests. By default, fields with
  23127. // empty values are omitted from API requests. However, any non-pointer,
  23128. // non-interface field appearing in ForceSendFields will be sent to the
  23129. // server regardless of whether the field is empty or not. This may be
  23130. // used to include empty fields in Patch requests.
  23131. ForceSendFields []string `json:"-"`
  23132. // NullFields is a list of field names (e.g. "SslCertificates") to
  23133. // include in API requests with the JSON null value. By default, fields
  23134. // with empty values are omitted from API requests. However, any field
  23135. // with an empty value appearing in NullFields will be sent to the
  23136. // server as null. It is an error if a field in this list has a
  23137. // non-empty value. This may be used to include null fields in Patch
  23138. // requests.
  23139. NullFields []string `json:"-"`
  23140. }
  23141. func (s *TargetSslProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  23142. type NoMethod TargetSslProxiesSetSslCertificatesRequest
  23143. raw := NoMethod(*s)
  23144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23145. }
  23146. // TargetSslProxy: A TargetSslProxy resource. This resource defines an
  23147. // SSL proxy. (== resource_for beta.targetSslProxies ==) (==
  23148. // resource_for v1.targetSslProxies ==)
  23149. type TargetSslProxy struct {
  23150. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23151. // format.
  23152. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23153. // Description: An optional description of this resource. Provide this
  23154. // property when you create the resource.
  23155. Description string `json:"description,omitempty"`
  23156. // Id: [Output Only] The unique identifier for the resource. This
  23157. // identifier is defined by the server.
  23158. Id uint64 `json:"id,omitempty,string"`
  23159. // Kind: [Output Only] Type of the resource. Always
  23160. // compute#targetSslProxy for target SSL proxies.
  23161. Kind string `json:"kind,omitempty"`
  23162. // Name: Name of the resource. Provided by the client when the resource
  23163. // is created. The name must be 1-63 characters long, and comply with
  23164. // RFC1035. Specifically, the name must be 1-63 characters long and
  23165. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23166. // the first character must be a lowercase letter, and all following
  23167. // characters must be a dash, lowercase letter, or digit, except the
  23168. // last character, which cannot be a dash.
  23169. Name string `json:"name,omitempty"`
  23170. // ProxyHeader: Specifies the type of proxy header to append before
  23171. // sending data to the backend, either NONE or PROXY_V1. The default is
  23172. // NONE.
  23173. //
  23174. // Possible values:
  23175. // "NONE"
  23176. // "PROXY_V1"
  23177. ProxyHeader string `json:"proxyHeader,omitempty"`
  23178. // SelfLink: [Output Only] Server-defined URL for the resource.
  23179. SelfLink string `json:"selfLink,omitempty"`
  23180. // Service: URL to the BackendService resource.
  23181. Service string `json:"service,omitempty"`
  23182. // SslCertificates: URLs to SslCertificate resources that are used to
  23183. // authenticate connections to Backends. At least one SSL certificate
  23184. // must be specified. Currently, you may specify up to 15 SSL
  23185. // certificates.
  23186. SslCertificates []string `json:"sslCertificates,omitempty"`
  23187. // SslPolicy: URL of SslPolicy resource that will be associated with the
  23188. // TargetSslProxy resource. If not set, the TargetSslProxy resource will
  23189. // not have any SSL policy configured.
  23190. SslPolicy string `json:"sslPolicy,omitempty"`
  23191. // ServerResponse contains the HTTP response code and headers from the
  23192. // server.
  23193. googleapi.ServerResponse `json:"-"`
  23194. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  23195. // to unconditionally include in API requests. By default, fields with
  23196. // empty values are omitted from API requests. However, any non-pointer,
  23197. // non-interface field appearing in ForceSendFields will be sent to the
  23198. // server regardless of whether the field is empty or not. This may be
  23199. // used to include empty fields in Patch requests.
  23200. ForceSendFields []string `json:"-"`
  23201. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  23202. // include in API requests with the JSON null value. By default, fields
  23203. // with empty values are omitted from API requests. However, any field
  23204. // with an empty value appearing in NullFields will be sent to the
  23205. // server as null. It is an error if a field in this list has a
  23206. // non-empty value. This may be used to include null fields in Patch
  23207. // requests.
  23208. NullFields []string `json:"-"`
  23209. }
  23210. func (s *TargetSslProxy) MarshalJSON() ([]byte, error) {
  23211. type NoMethod TargetSslProxy
  23212. raw := NoMethod(*s)
  23213. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23214. }
  23215. // TargetSslProxyList: Contains a list of TargetSslProxy resources.
  23216. type TargetSslProxyList struct {
  23217. // Id: [Output Only] Unique identifier for the resource; defined by the
  23218. // server.
  23219. Id string `json:"id,omitempty"`
  23220. // Items: A list of TargetSslProxy resources.
  23221. Items []*TargetSslProxy `json:"items,omitempty"`
  23222. // Kind: Type of resource.
  23223. Kind string `json:"kind,omitempty"`
  23224. // NextPageToken: [Output Only] This token allows you to get the next
  23225. // page of results for list requests. If the number of results is larger
  23226. // than maxResults, use the nextPageToken as a value for the query
  23227. // parameter pageToken in the next list request. Subsequent list
  23228. // requests will have their own nextPageToken to continue paging through
  23229. // the results.
  23230. NextPageToken string `json:"nextPageToken,omitempty"`
  23231. // SelfLink: [Output Only] Server-defined URL for this resource.
  23232. SelfLink string `json:"selfLink,omitempty"`
  23233. // Warning: [Output Only] Informational warning message.
  23234. Warning *TargetSslProxyListWarning `json:"warning,omitempty"`
  23235. // ServerResponse contains the HTTP response code and headers from the
  23236. // server.
  23237. googleapi.ServerResponse `json:"-"`
  23238. // ForceSendFields is a list of field names (e.g. "Id") to
  23239. // unconditionally include in API requests. By default, fields with
  23240. // empty values are omitted from API requests. However, any non-pointer,
  23241. // non-interface field appearing in ForceSendFields will be sent to the
  23242. // server regardless of whether the field is empty or not. This may be
  23243. // used to include empty fields in Patch requests.
  23244. ForceSendFields []string `json:"-"`
  23245. // NullFields is a list of field names (e.g. "Id") to include in API
  23246. // requests with the JSON null value. By default, fields with empty
  23247. // values are omitted from API requests. However, any field with an
  23248. // empty value appearing in NullFields will be sent to the server as
  23249. // null. It is an error if a field in this list has a non-empty value.
  23250. // This may be used to include null fields in Patch requests.
  23251. NullFields []string `json:"-"`
  23252. }
  23253. func (s *TargetSslProxyList) MarshalJSON() ([]byte, error) {
  23254. type NoMethod TargetSslProxyList
  23255. raw := NoMethod(*s)
  23256. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23257. }
  23258. // TargetSslProxyListWarning: [Output Only] Informational warning
  23259. // message.
  23260. type TargetSslProxyListWarning struct {
  23261. // Code: [Output Only] A warning code, if applicable. For example,
  23262. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23263. // the response.
  23264. //
  23265. // Possible values:
  23266. // "CLEANUP_FAILED"
  23267. // "DEPRECATED_RESOURCE_USED"
  23268. // "DEPRECATED_TYPE_USED"
  23269. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23270. // "EXPERIMENTAL_TYPE_USED"
  23271. // "EXTERNAL_API_WARNING"
  23272. // "FIELD_VALUE_OVERRIDEN"
  23273. // "INJECTED_KERNELS_DEPRECATED"
  23274. // "MISSING_TYPE_DEPENDENCY"
  23275. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23276. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23277. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23278. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23279. // "NEXT_HOP_NOT_RUNNING"
  23280. // "NOT_CRITICAL_ERROR"
  23281. // "NO_RESULTS_ON_PAGE"
  23282. // "REQUIRED_TOS_AGREEMENT"
  23283. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23284. // "RESOURCE_NOT_DELETED"
  23285. // "SCHEMA_VALIDATION_IGNORED"
  23286. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23287. // "UNDECLARED_PROPERTIES"
  23288. // "UNREACHABLE"
  23289. Code string `json:"code,omitempty"`
  23290. // Data: [Output Only] Metadata about this warning in key: value format.
  23291. // For example:
  23292. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23293. Data []*TargetSslProxyListWarningData `json:"data,omitempty"`
  23294. // Message: [Output Only] A human-readable description of the warning
  23295. // code.
  23296. Message string `json:"message,omitempty"`
  23297. // ForceSendFields is a list of field names (e.g. "Code") to
  23298. // unconditionally include in API requests. By default, fields with
  23299. // empty values are omitted from API requests. However, any non-pointer,
  23300. // non-interface field appearing in ForceSendFields will be sent to the
  23301. // server regardless of whether the field is empty or not. This may be
  23302. // used to include empty fields in Patch requests.
  23303. ForceSendFields []string `json:"-"`
  23304. // NullFields is a list of field names (e.g. "Code") to include in API
  23305. // requests with the JSON null value. By default, fields with empty
  23306. // values are omitted from API requests. However, any field with an
  23307. // empty value appearing in NullFields will be sent to the server as
  23308. // null. It is an error if a field in this list has a non-empty value.
  23309. // This may be used to include null fields in Patch requests.
  23310. NullFields []string `json:"-"`
  23311. }
  23312. func (s *TargetSslProxyListWarning) MarshalJSON() ([]byte, error) {
  23313. type NoMethod TargetSslProxyListWarning
  23314. raw := NoMethod(*s)
  23315. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23316. }
  23317. type TargetSslProxyListWarningData struct {
  23318. // Key: [Output Only] A key that provides more detail on the warning
  23319. // being returned. For example, for warnings where there are no results
  23320. // in a list request for a particular zone, this key might be scope and
  23321. // the key value might be the zone name. Other examples might be a key
  23322. // indicating a deprecated resource and a suggested replacement, or a
  23323. // warning about invalid network settings (for example, if an instance
  23324. // attempts to perform IP forwarding but is not enabled for IP
  23325. // forwarding).
  23326. Key string `json:"key,omitempty"`
  23327. // Value: [Output Only] A warning data value corresponding to the key.
  23328. Value string `json:"value,omitempty"`
  23329. // ForceSendFields is a list of field names (e.g. "Key") to
  23330. // unconditionally include in API requests. By default, fields with
  23331. // empty values are omitted from API requests. However, any non-pointer,
  23332. // non-interface field appearing in ForceSendFields will be sent to the
  23333. // server regardless of whether the field is empty or not. This may be
  23334. // used to include empty fields in Patch requests.
  23335. ForceSendFields []string `json:"-"`
  23336. // NullFields is a list of field names (e.g. "Key") to include in API
  23337. // requests with the JSON null value. By default, fields with empty
  23338. // values are omitted from API requests. However, any field with an
  23339. // empty value appearing in NullFields will be sent to the server as
  23340. // null. It is an error if a field in this list has a non-empty value.
  23341. // This may be used to include null fields in Patch requests.
  23342. NullFields []string `json:"-"`
  23343. }
  23344. func (s *TargetSslProxyListWarningData) MarshalJSON() ([]byte, error) {
  23345. type NoMethod TargetSslProxyListWarningData
  23346. raw := NoMethod(*s)
  23347. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23348. }
  23349. type TargetTcpProxiesSetBackendServiceRequest struct {
  23350. // Service: The URL of the new BackendService resource for the
  23351. // targetTcpProxy.
  23352. Service string `json:"service,omitempty"`
  23353. // ForceSendFields is a list of field names (e.g. "Service") to
  23354. // unconditionally include in API requests. By default, fields with
  23355. // empty values are omitted from API requests. However, any non-pointer,
  23356. // non-interface field appearing in ForceSendFields will be sent to the
  23357. // server regardless of whether the field is empty or not. This may be
  23358. // used to include empty fields in Patch requests.
  23359. ForceSendFields []string `json:"-"`
  23360. // NullFields is a list of field names (e.g. "Service") to include in
  23361. // API requests with the JSON null value. By default, fields with empty
  23362. // values are omitted from API requests. However, any field with an
  23363. // empty value appearing in NullFields will be sent to the server as
  23364. // null. It is an error if a field in this list has a non-empty value.
  23365. // This may be used to include null fields in Patch requests.
  23366. NullFields []string `json:"-"`
  23367. }
  23368. func (s *TargetTcpProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  23369. type NoMethod TargetTcpProxiesSetBackendServiceRequest
  23370. raw := NoMethod(*s)
  23371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23372. }
  23373. type TargetTcpProxiesSetProxyHeaderRequest struct {
  23374. // ProxyHeader: The new type of proxy header to append before sending
  23375. // data to the backend. NONE or PROXY_V1 are allowed.
  23376. //
  23377. // Possible values:
  23378. // "NONE"
  23379. // "PROXY_V1"
  23380. ProxyHeader string `json:"proxyHeader,omitempty"`
  23381. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  23382. // unconditionally include in API requests. By default, fields with
  23383. // empty values are omitted from API requests. However, any non-pointer,
  23384. // non-interface field appearing in ForceSendFields will be sent to the
  23385. // server regardless of whether the field is empty or not. This may be
  23386. // used to include empty fields in Patch requests.
  23387. ForceSendFields []string `json:"-"`
  23388. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  23389. // in API requests with the JSON null value. By default, fields with
  23390. // empty values are omitted from API requests. However, any field with
  23391. // an empty value appearing in NullFields will be sent to the server as
  23392. // null. It is an error if a field in this list has a non-empty value.
  23393. // This may be used to include null fields in Patch requests.
  23394. NullFields []string `json:"-"`
  23395. }
  23396. func (s *TargetTcpProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  23397. type NoMethod TargetTcpProxiesSetProxyHeaderRequest
  23398. raw := NoMethod(*s)
  23399. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23400. }
  23401. // TargetTcpProxy: A TargetTcpProxy resource. This resource defines a
  23402. // TCP proxy. (== resource_for beta.targetTcpProxies ==) (==
  23403. // resource_for v1.targetTcpProxies ==)
  23404. type TargetTcpProxy struct {
  23405. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23406. // format.
  23407. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23408. // Description: An optional description of this resource. Provide this
  23409. // property when you create the resource.
  23410. Description string `json:"description,omitempty"`
  23411. // Id: [Output Only] The unique identifier for the resource. This
  23412. // identifier is defined by the server.
  23413. Id uint64 `json:"id,omitempty,string"`
  23414. // Kind: [Output Only] Type of the resource. Always
  23415. // compute#targetTcpProxy for target TCP proxies.
  23416. Kind string `json:"kind,omitempty"`
  23417. // Name: Name of the resource. Provided by the client when the resource
  23418. // is created. The name must be 1-63 characters long, and comply with
  23419. // RFC1035. Specifically, the name must be 1-63 characters long and
  23420. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23421. // the first character must be a lowercase letter, and all following
  23422. // characters must be a dash, lowercase letter, or digit, except the
  23423. // last character, which cannot be a dash.
  23424. Name string `json:"name,omitempty"`
  23425. // ProxyHeader: Specifies the type of proxy header to append before
  23426. // sending data to the backend, either NONE or PROXY_V1. The default is
  23427. // NONE.
  23428. //
  23429. // Possible values:
  23430. // "NONE"
  23431. // "PROXY_V1"
  23432. ProxyHeader string `json:"proxyHeader,omitempty"`
  23433. // SelfLink: [Output Only] Server-defined URL for the resource.
  23434. SelfLink string `json:"selfLink,omitempty"`
  23435. // Service: URL to the BackendService resource.
  23436. Service string `json:"service,omitempty"`
  23437. // ServerResponse contains the HTTP response code and headers from the
  23438. // server.
  23439. googleapi.ServerResponse `json:"-"`
  23440. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  23441. // to unconditionally include in API requests. By default, fields with
  23442. // empty values are omitted from API requests. However, any non-pointer,
  23443. // non-interface field appearing in ForceSendFields will be sent to the
  23444. // server regardless of whether the field is empty or not. This may be
  23445. // used to include empty fields in Patch requests.
  23446. ForceSendFields []string `json:"-"`
  23447. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  23448. // include in API requests with the JSON null value. By default, fields
  23449. // with empty values are omitted from API requests. However, any field
  23450. // with an empty value appearing in NullFields will be sent to the
  23451. // server as null. It is an error if a field in this list has a
  23452. // non-empty value. This may be used to include null fields in Patch
  23453. // requests.
  23454. NullFields []string `json:"-"`
  23455. }
  23456. func (s *TargetTcpProxy) MarshalJSON() ([]byte, error) {
  23457. type NoMethod TargetTcpProxy
  23458. raw := NoMethod(*s)
  23459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23460. }
  23461. // TargetTcpProxyList: Contains a list of TargetTcpProxy resources.
  23462. type TargetTcpProxyList struct {
  23463. // Id: [Output Only] Unique identifier for the resource; defined by the
  23464. // server.
  23465. Id string `json:"id,omitempty"`
  23466. // Items: A list of TargetTcpProxy resources.
  23467. Items []*TargetTcpProxy `json:"items,omitempty"`
  23468. // Kind: Type of resource.
  23469. Kind string `json:"kind,omitempty"`
  23470. // NextPageToken: [Output Only] This token allows you to get the next
  23471. // page of results for list requests. If the number of results is larger
  23472. // than maxResults, use the nextPageToken as a value for the query
  23473. // parameter pageToken in the next list request. Subsequent list
  23474. // requests will have their own nextPageToken to continue paging through
  23475. // the results.
  23476. NextPageToken string `json:"nextPageToken,omitempty"`
  23477. // SelfLink: [Output Only] Server-defined URL for this resource.
  23478. SelfLink string `json:"selfLink,omitempty"`
  23479. // Warning: [Output Only] Informational warning message.
  23480. Warning *TargetTcpProxyListWarning `json:"warning,omitempty"`
  23481. // ServerResponse contains the HTTP response code and headers from the
  23482. // server.
  23483. googleapi.ServerResponse `json:"-"`
  23484. // ForceSendFields is a list of field names (e.g. "Id") to
  23485. // unconditionally include in API requests. By default, fields with
  23486. // empty values are omitted from API requests. However, any non-pointer,
  23487. // non-interface field appearing in ForceSendFields will be sent to the
  23488. // server regardless of whether the field is empty or not. This may be
  23489. // used to include empty fields in Patch requests.
  23490. ForceSendFields []string `json:"-"`
  23491. // NullFields is a list of field names (e.g. "Id") to include in API
  23492. // requests with the JSON null value. By default, fields with empty
  23493. // values are omitted from API requests. However, any field with an
  23494. // empty value appearing in NullFields will be sent to the server as
  23495. // null. It is an error if a field in this list has a non-empty value.
  23496. // This may be used to include null fields in Patch requests.
  23497. NullFields []string `json:"-"`
  23498. }
  23499. func (s *TargetTcpProxyList) MarshalJSON() ([]byte, error) {
  23500. type NoMethod TargetTcpProxyList
  23501. raw := NoMethod(*s)
  23502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23503. }
  23504. // TargetTcpProxyListWarning: [Output Only] Informational warning
  23505. // message.
  23506. type TargetTcpProxyListWarning struct {
  23507. // Code: [Output Only] A warning code, if applicable. For example,
  23508. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23509. // the response.
  23510. //
  23511. // Possible values:
  23512. // "CLEANUP_FAILED"
  23513. // "DEPRECATED_RESOURCE_USED"
  23514. // "DEPRECATED_TYPE_USED"
  23515. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23516. // "EXPERIMENTAL_TYPE_USED"
  23517. // "EXTERNAL_API_WARNING"
  23518. // "FIELD_VALUE_OVERRIDEN"
  23519. // "INJECTED_KERNELS_DEPRECATED"
  23520. // "MISSING_TYPE_DEPENDENCY"
  23521. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23522. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23523. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23524. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23525. // "NEXT_HOP_NOT_RUNNING"
  23526. // "NOT_CRITICAL_ERROR"
  23527. // "NO_RESULTS_ON_PAGE"
  23528. // "REQUIRED_TOS_AGREEMENT"
  23529. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23530. // "RESOURCE_NOT_DELETED"
  23531. // "SCHEMA_VALIDATION_IGNORED"
  23532. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23533. // "UNDECLARED_PROPERTIES"
  23534. // "UNREACHABLE"
  23535. Code string `json:"code,omitempty"`
  23536. // Data: [Output Only] Metadata about this warning in key: value format.
  23537. // For example:
  23538. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23539. Data []*TargetTcpProxyListWarningData `json:"data,omitempty"`
  23540. // Message: [Output Only] A human-readable description of the warning
  23541. // code.
  23542. Message string `json:"message,omitempty"`
  23543. // ForceSendFields is a list of field names (e.g. "Code") to
  23544. // unconditionally include in API requests. By default, fields with
  23545. // empty values are omitted from API requests. However, any non-pointer,
  23546. // non-interface field appearing in ForceSendFields will be sent to the
  23547. // server regardless of whether the field is empty or not. This may be
  23548. // used to include empty fields in Patch requests.
  23549. ForceSendFields []string `json:"-"`
  23550. // NullFields is a list of field names (e.g. "Code") to include in API
  23551. // requests with the JSON null value. By default, fields with empty
  23552. // values are omitted from API requests. However, any field with an
  23553. // empty value appearing in NullFields will be sent to the server as
  23554. // null. It is an error if a field in this list has a non-empty value.
  23555. // This may be used to include null fields in Patch requests.
  23556. NullFields []string `json:"-"`
  23557. }
  23558. func (s *TargetTcpProxyListWarning) MarshalJSON() ([]byte, error) {
  23559. type NoMethod TargetTcpProxyListWarning
  23560. raw := NoMethod(*s)
  23561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23562. }
  23563. type TargetTcpProxyListWarningData struct {
  23564. // Key: [Output Only] A key that provides more detail on the warning
  23565. // being returned. For example, for warnings where there are no results
  23566. // in a list request for a particular zone, this key might be scope and
  23567. // the key value might be the zone name. Other examples might be a key
  23568. // indicating a deprecated resource and a suggested replacement, or a
  23569. // warning about invalid network settings (for example, if an instance
  23570. // attempts to perform IP forwarding but is not enabled for IP
  23571. // forwarding).
  23572. Key string `json:"key,omitempty"`
  23573. // Value: [Output Only] A warning data value corresponding to the key.
  23574. Value string `json:"value,omitempty"`
  23575. // ForceSendFields is a list of field names (e.g. "Key") to
  23576. // unconditionally include in API requests. By default, fields with
  23577. // empty values are omitted from API requests. However, any non-pointer,
  23578. // non-interface field appearing in ForceSendFields will be sent to the
  23579. // server regardless of whether the field is empty or not. This may be
  23580. // used to include empty fields in Patch requests.
  23581. ForceSendFields []string `json:"-"`
  23582. // NullFields is a list of field names (e.g. "Key") to include in API
  23583. // requests with the JSON null value. By default, fields with empty
  23584. // values are omitted from API requests. However, any field with an
  23585. // empty value appearing in NullFields will be sent to the server as
  23586. // null. It is an error if a field in this list has a non-empty value.
  23587. // This may be used to include null fields in Patch requests.
  23588. NullFields []string `json:"-"`
  23589. }
  23590. func (s *TargetTcpProxyListWarningData) MarshalJSON() ([]byte, error) {
  23591. type NoMethod TargetTcpProxyListWarningData
  23592. raw := NoMethod(*s)
  23593. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23594. }
  23595. // TargetVpnGateway: Represents a Target VPN gateway resource. (==
  23596. // resource_for beta.targetVpnGateways ==) (== resource_for
  23597. // v1.targetVpnGateways ==)
  23598. type TargetVpnGateway struct {
  23599. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23600. // format.
  23601. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23602. // Description: An optional description of this resource. Provide this
  23603. // property when you create the resource.
  23604. Description string `json:"description,omitempty"`
  23605. // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
  23606. // resources. ForwardingRules are created using
  23607. // compute.forwardingRules.insert and associated with a VPN gateway.
  23608. ForwardingRules []string `json:"forwardingRules,omitempty"`
  23609. // Id: [Output Only] The unique identifier for the resource. This
  23610. // identifier is defined by the server.
  23611. Id uint64 `json:"id,omitempty,string"`
  23612. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  23613. // for target VPN gateways.
  23614. Kind string `json:"kind,omitempty"`
  23615. // Name: Name of the resource. Provided by the client when the resource
  23616. // is created. The name must be 1-63 characters long, and comply with
  23617. // RFC1035. Specifically, the name must be 1-63 characters long and
  23618. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23619. // the first character must be a lowercase letter, and all following
  23620. // characters must be a dash, lowercase letter, or digit, except the
  23621. // last character, which cannot be a dash.
  23622. Name string `json:"name,omitempty"`
  23623. // Network: URL of the network to which this VPN gateway is attached.
  23624. // Provided by the client when the VPN gateway is created.
  23625. Network string `json:"network,omitempty"`
  23626. // Region: [Output Only] URL of the region where the target VPN gateway
  23627. // resides. You must specify this field as part of the HTTP request URL.
  23628. // It is not settable as a field in the request body.
  23629. Region string `json:"region,omitempty"`
  23630. // SelfLink: [Output Only] Server-defined URL for the resource.
  23631. SelfLink string `json:"selfLink,omitempty"`
  23632. // Status: [Output Only] The status of the VPN gateway, which can be one
  23633. // of the following: CREATING, READY, FAILED, or DELETING.
  23634. //
  23635. // Possible values:
  23636. // "CREATING"
  23637. // "DELETING"
  23638. // "FAILED"
  23639. // "READY"
  23640. Status string `json:"status,omitempty"`
  23641. // Tunnels: [Output Only] A list of URLs to VpnTunnel resources.
  23642. // VpnTunnels are created using the compute.vpntunnels.insert method and
  23643. // associated with a VPN gateway.
  23644. Tunnels []string `json:"tunnels,omitempty"`
  23645. // ServerResponse contains the HTTP response code and headers from the
  23646. // server.
  23647. googleapi.ServerResponse `json:"-"`
  23648. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  23649. // to unconditionally include in API requests. By default, fields with
  23650. // empty values are omitted from API requests. However, any non-pointer,
  23651. // non-interface field appearing in ForceSendFields will be sent to the
  23652. // server regardless of whether the field is empty or not. This may be
  23653. // used to include empty fields in Patch requests.
  23654. ForceSendFields []string `json:"-"`
  23655. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  23656. // include in API requests with the JSON null value. By default, fields
  23657. // with empty values are omitted from API requests. However, any field
  23658. // with an empty value appearing in NullFields will be sent to the
  23659. // server as null. It is an error if a field in this list has a
  23660. // non-empty value. This may be used to include null fields in Patch
  23661. // requests.
  23662. NullFields []string `json:"-"`
  23663. }
  23664. func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) {
  23665. type NoMethod TargetVpnGateway
  23666. raw := NoMethod(*s)
  23667. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23668. }
  23669. type TargetVpnGatewayAggregatedList struct {
  23670. // Id: [Output Only] Unique identifier for the resource; defined by the
  23671. // server.
  23672. Id string `json:"id,omitempty"`
  23673. // Items: A list of TargetVpnGateway resources.
  23674. Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"`
  23675. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  23676. // for target VPN gateways.
  23677. Kind string `json:"kind,omitempty"`
  23678. // NextPageToken: [Output Only] This token allows you to get the next
  23679. // page of results for list requests. If the number of results is larger
  23680. // than maxResults, use the nextPageToken as a value for the query
  23681. // parameter pageToken in the next list request. Subsequent list
  23682. // requests will have their own nextPageToken to continue paging through
  23683. // the results.
  23684. NextPageToken string `json:"nextPageToken,omitempty"`
  23685. // SelfLink: [Output Only] Server-defined URL for this resource.
  23686. SelfLink string `json:"selfLink,omitempty"`
  23687. // Warning: [Output Only] Informational warning message.
  23688. Warning *TargetVpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  23689. // ServerResponse contains the HTTP response code and headers from the
  23690. // server.
  23691. googleapi.ServerResponse `json:"-"`
  23692. // ForceSendFields is a list of field names (e.g. "Id") to
  23693. // unconditionally include in API requests. By default, fields with
  23694. // empty values are omitted from API requests. However, any non-pointer,
  23695. // non-interface field appearing in ForceSendFields will be sent to the
  23696. // server regardless of whether the field is empty or not. This may be
  23697. // used to include empty fields in Patch requests.
  23698. ForceSendFields []string `json:"-"`
  23699. // NullFields is a list of field names (e.g. "Id") to include in API
  23700. // requests with the JSON null value. By default, fields with empty
  23701. // values are omitted from API requests. However, any field with an
  23702. // empty value appearing in NullFields will be sent to the server as
  23703. // null. It is an error if a field in this list has a non-empty value.
  23704. // This may be used to include null fields in Patch requests.
  23705. NullFields []string `json:"-"`
  23706. }
  23707. func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  23708. type NoMethod TargetVpnGatewayAggregatedList
  23709. raw := NoMethod(*s)
  23710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23711. }
  23712. // TargetVpnGatewayAggregatedListWarning: [Output Only] Informational
  23713. // warning message.
  23714. type TargetVpnGatewayAggregatedListWarning struct {
  23715. // Code: [Output Only] A warning code, if applicable. For example,
  23716. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23717. // the response.
  23718. //
  23719. // Possible values:
  23720. // "CLEANUP_FAILED"
  23721. // "DEPRECATED_RESOURCE_USED"
  23722. // "DEPRECATED_TYPE_USED"
  23723. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23724. // "EXPERIMENTAL_TYPE_USED"
  23725. // "EXTERNAL_API_WARNING"
  23726. // "FIELD_VALUE_OVERRIDEN"
  23727. // "INJECTED_KERNELS_DEPRECATED"
  23728. // "MISSING_TYPE_DEPENDENCY"
  23729. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23730. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23731. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23732. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23733. // "NEXT_HOP_NOT_RUNNING"
  23734. // "NOT_CRITICAL_ERROR"
  23735. // "NO_RESULTS_ON_PAGE"
  23736. // "REQUIRED_TOS_AGREEMENT"
  23737. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23738. // "RESOURCE_NOT_DELETED"
  23739. // "SCHEMA_VALIDATION_IGNORED"
  23740. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23741. // "UNDECLARED_PROPERTIES"
  23742. // "UNREACHABLE"
  23743. Code string `json:"code,omitempty"`
  23744. // Data: [Output Only] Metadata about this warning in key: value format.
  23745. // For example:
  23746. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23747. Data []*TargetVpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  23748. // Message: [Output Only] A human-readable description of the warning
  23749. // code.
  23750. Message string `json:"message,omitempty"`
  23751. // ForceSendFields is a list of field names (e.g. "Code") to
  23752. // unconditionally include in API requests. By default, fields with
  23753. // empty values are omitted from API requests. However, any non-pointer,
  23754. // non-interface field appearing in ForceSendFields will be sent to the
  23755. // server regardless of whether the field is empty or not. This may be
  23756. // used to include empty fields in Patch requests.
  23757. ForceSendFields []string `json:"-"`
  23758. // NullFields is a list of field names (e.g. "Code") to include in API
  23759. // requests with the JSON null value. By default, fields with empty
  23760. // values are omitted from API requests. However, any field with an
  23761. // empty value appearing in NullFields will be sent to the server as
  23762. // null. It is an error if a field in this list has a non-empty value.
  23763. // This may be used to include null fields in Patch requests.
  23764. NullFields []string `json:"-"`
  23765. }
  23766. func (s *TargetVpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  23767. type NoMethod TargetVpnGatewayAggregatedListWarning
  23768. raw := NoMethod(*s)
  23769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23770. }
  23771. type TargetVpnGatewayAggregatedListWarningData struct {
  23772. // Key: [Output Only] A key that provides more detail on the warning
  23773. // being returned. For example, for warnings where there are no results
  23774. // in a list request for a particular zone, this key might be scope and
  23775. // the key value might be the zone name. Other examples might be a key
  23776. // indicating a deprecated resource and a suggested replacement, or a
  23777. // warning about invalid network settings (for example, if an instance
  23778. // attempts to perform IP forwarding but is not enabled for IP
  23779. // forwarding).
  23780. Key string `json:"key,omitempty"`
  23781. // Value: [Output Only] A warning data value corresponding to the key.
  23782. Value string `json:"value,omitempty"`
  23783. // ForceSendFields is a list of field names (e.g. "Key") to
  23784. // unconditionally include in API requests. By default, fields with
  23785. // empty values are omitted from API requests. However, any non-pointer,
  23786. // non-interface field appearing in ForceSendFields will be sent to the
  23787. // server regardless of whether the field is empty or not. This may be
  23788. // used to include empty fields in Patch requests.
  23789. ForceSendFields []string `json:"-"`
  23790. // NullFields is a list of field names (e.g. "Key") to include in API
  23791. // requests with the JSON null value. By default, fields with empty
  23792. // values are omitted from API requests. However, any field with an
  23793. // empty value appearing in NullFields will be sent to the server as
  23794. // null. It is an error if a field in this list has a non-empty value.
  23795. // This may be used to include null fields in Patch requests.
  23796. NullFields []string `json:"-"`
  23797. }
  23798. func (s *TargetVpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  23799. type NoMethod TargetVpnGatewayAggregatedListWarningData
  23800. raw := NoMethod(*s)
  23801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23802. }
  23803. // TargetVpnGatewayList: Contains a list of TargetVpnGateway resources.
  23804. type TargetVpnGatewayList struct {
  23805. // Id: [Output Only] Unique identifier for the resource; defined by the
  23806. // server.
  23807. Id string `json:"id,omitempty"`
  23808. // Items: A list of TargetVpnGateway resources.
  23809. Items []*TargetVpnGateway `json:"items,omitempty"`
  23810. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  23811. // for target VPN gateways.
  23812. Kind string `json:"kind,omitempty"`
  23813. // NextPageToken: [Output Only] This token allows you to get the next
  23814. // page of results for list requests. If the number of results is larger
  23815. // than maxResults, use the nextPageToken as a value for the query
  23816. // parameter pageToken in the next list request. Subsequent list
  23817. // requests will have their own nextPageToken to continue paging through
  23818. // the results.
  23819. NextPageToken string `json:"nextPageToken,omitempty"`
  23820. // SelfLink: [Output Only] Server-defined URL for this resource.
  23821. SelfLink string `json:"selfLink,omitempty"`
  23822. // Warning: [Output Only] Informational warning message.
  23823. Warning *TargetVpnGatewayListWarning `json:"warning,omitempty"`
  23824. // ServerResponse contains the HTTP response code and headers from the
  23825. // server.
  23826. googleapi.ServerResponse `json:"-"`
  23827. // ForceSendFields is a list of field names (e.g. "Id") to
  23828. // unconditionally include in API requests. By default, fields with
  23829. // empty values are omitted from API requests. However, any non-pointer,
  23830. // non-interface field appearing in ForceSendFields will be sent to the
  23831. // server regardless of whether the field is empty or not. This may be
  23832. // used to include empty fields in Patch requests.
  23833. ForceSendFields []string `json:"-"`
  23834. // NullFields is a list of field names (e.g. "Id") to include in API
  23835. // requests with the JSON null value. By default, fields with empty
  23836. // values are omitted from API requests. However, any field with an
  23837. // empty value appearing in NullFields will be sent to the server as
  23838. // null. It is an error if a field in this list has a non-empty value.
  23839. // This may be used to include null fields in Patch requests.
  23840. NullFields []string `json:"-"`
  23841. }
  23842. func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
  23843. type NoMethod TargetVpnGatewayList
  23844. raw := NoMethod(*s)
  23845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23846. }
  23847. // TargetVpnGatewayListWarning: [Output Only] Informational warning
  23848. // message.
  23849. type TargetVpnGatewayListWarning struct {
  23850. // Code: [Output Only] A warning code, if applicable. For example,
  23851. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23852. // the response.
  23853. //
  23854. // Possible values:
  23855. // "CLEANUP_FAILED"
  23856. // "DEPRECATED_RESOURCE_USED"
  23857. // "DEPRECATED_TYPE_USED"
  23858. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23859. // "EXPERIMENTAL_TYPE_USED"
  23860. // "EXTERNAL_API_WARNING"
  23861. // "FIELD_VALUE_OVERRIDEN"
  23862. // "INJECTED_KERNELS_DEPRECATED"
  23863. // "MISSING_TYPE_DEPENDENCY"
  23864. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23865. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23866. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23867. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23868. // "NEXT_HOP_NOT_RUNNING"
  23869. // "NOT_CRITICAL_ERROR"
  23870. // "NO_RESULTS_ON_PAGE"
  23871. // "REQUIRED_TOS_AGREEMENT"
  23872. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23873. // "RESOURCE_NOT_DELETED"
  23874. // "SCHEMA_VALIDATION_IGNORED"
  23875. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23876. // "UNDECLARED_PROPERTIES"
  23877. // "UNREACHABLE"
  23878. Code string `json:"code,omitempty"`
  23879. // Data: [Output Only] Metadata about this warning in key: value format.
  23880. // For example:
  23881. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23882. Data []*TargetVpnGatewayListWarningData `json:"data,omitempty"`
  23883. // Message: [Output Only] A human-readable description of the warning
  23884. // code.
  23885. Message string `json:"message,omitempty"`
  23886. // ForceSendFields is a list of field names (e.g. "Code") to
  23887. // unconditionally include in API requests. By default, fields with
  23888. // empty values are omitted from API requests. However, any non-pointer,
  23889. // non-interface field appearing in ForceSendFields will be sent to the
  23890. // server regardless of whether the field is empty or not. This may be
  23891. // used to include empty fields in Patch requests.
  23892. ForceSendFields []string `json:"-"`
  23893. // NullFields is a list of field names (e.g. "Code") to include in API
  23894. // requests with the JSON null value. By default, fields with empty
  23895. // values are omitted from API requests. However, any field with an
  23896. // empty value appearing in NullFields will be sent to the server as
  23897. // null. It is an error if a field in this list has a non-empty value.
  23898. // This may be used to include null fields in Patch requests.
  23899. NullFields []string `json:"-"`
  23900. }
  23901. func (s *TargetVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  23902. type NoMethod TargetVpnGatewayListWarning
  23903. raw := NoMethod(*s)
  23904. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23905. }
  23906. type TargetVpnGatewayListWarningData struct {
  23907. // Key: [Output Only] A key that provides more detail on the warning
  23908. // being returned. For example, for warnings where there are no results
  23909. // in a list request for a particular zone, this key might be scope and
  23910. // the key value might be the zone name. Other examples might be a key
  23911. // indicating a deprecated resource and a suggested replacement, or a
  23912. // warning about invalid network settings (for example, if an instance
  23913. // attempts to perform IP forwarding but is not enabled for IP
  23914. // forwarding).
  23915. Key string `json:"key,omitempty"`
  23916. // Value: [Output Only] A warning data value corresponding to the key.
  23917. Value string `json:"value,omitempty"`
  23918. // ForceSendFields is a list of field names (e.g. "Key") to
  23919. // unconditionally include in API requests. By default, fields with
  23920. // empty values are omitted from API requests. However, any non-pointer,
  23921. // non-interface field appearing in ForceSendFields will be sent to the
  23922. // server regardless of whether the field is empty or not. This may be
  23923. // used to include empty fields in Patch requests.
  23924. ForceSendFields []string `json:"-"`
  23925. // NullFields is a list of field names (e.g. "Key") to include in API
  23926. // requests with the JSON null value. By default, fields with empty
  23927. // values are omitted from API requests. However, any field with an
  23928. // empty value appearing in NullFields will be sent to the server as
  23929. // null. It is an error if a field in this list has a non-empty value.
  23930. // This may be used to include null fields in Patch requests.
  23931. NullFields []string `json:"-"`
  23932. }
  23933. func (s *TargetVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  23934. type NoMethod TargetVpnGatewayListWarningData
  23935. raw := NoMethod(*s)
  23936. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23937. }
  23938. type TargetVpnGatewaysScopedList struct {
  23939. // TargetVpnGateways: [Output Only] A list of target VPN gateways
  23940. // contained in this scope.
  23941. TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"`
  23942. // Warning: [Output Only] Informational warning which replaces the list
  23943. // of addresses when the list is empty.
  23944. Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"`
  23945. // ForceSendFields is a list of field names (e.g. "TargetVpnGateways")
  23946. // to unconditionally include in API requests. By default, fields with
  23947. // empty values are omitted from API requests. However, any non-pointer,
  23948. // non-interface field appearing in ForceSendFields will be sent to the
  23949. // server regardless of whether the field is empty or not. This may be
  23950. // used to include empty fields in Patch requests.
  23951. ForceSendFields []string `json:"-"`
  23952. // NullFields is a list of field names (e.g. "TargetVpnGateways") to
  23953. // include in API requests with the JSON null value. By default, fields
  23954. // with empty values are omitted from API requests. However, any field
  23955. // with an empty value appearing in NullFields will be sent to the
  23956. // server as null. It is an error if a field in this list has a
  23957. // non-empty value. This may be used to include null fields in Patch
  23958. // requests.
  23959. NullFields []string `json:"-"`
  23960. }
  23961. func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  23962. type NoMethod TargetVpnGatewaysScopedList
  23963. raw := NoMethod(*s)
  23964. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23965. }
  23966. // TargetVpnGatewaysScopedListWarning: [Output Only] Informational
  23967. // warning which replaces the list of addresses when the list is empty.
  23968. type TargetVpnGatewaysScopedListWarning struct {
  23969. // Code: [Output Only] A warning code, if applicable. For example,
  23970. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23971. // the response.
  23972. //
  23973. // Possible values:
  23974. // "CLEANUP_FAILED"
  23975. // "DEPRECATED_RESOURCE_USED"
  23976. // "DEPRECATED_TYPE_USED"
  23977. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23978. // "EXPERIMENTAL_TYPE_USED"
  23979. // "EXTERNAL_API_WARNING"
  23980. // "FIELD_VALUE_OVERRIDEN"
  23981. // "INJECTED_KERNELS_DEPRECATED"
  23982. // "MISSING_TYPE_DEPENDENCY"
  23983. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23984. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23985. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23986. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23987. // "NEXT_HOP_NOT_RUNNING"
  23988. // "NOT_CRITICAL_ERROR"
  23989. // "NO_RESULTS_ON_PAGE"
  23990. // "REQUIRED_TOS_AGREEMENT"
  23991. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23992. // "RESOURCE_NOT_DELETED"
  23993. // "SCHEMA_VALIDATION_IGNORED"
  23994. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23995. // "UNDECLARED_PROPERTIES"
  23996. // "UNREACHABLE"
  23997. Code string `json:"code,omitempty"`
  23998. // Data: [Output Only] Metadata about this warning in key: value format.
  23999. // For example:
  24000. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24001. Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"`
  24002. // Message: [Output Only] A human-readable description of the warning
  24003. // code.
  24004. Message string `json:"message,omitempty"`
  24005. // ForceSendFields is a list of field names (e.g. "Code") to
  24006. // unconditionally include in API requests. By default, fields with
  24007. // empty values are omitted from API requests. However, any non-pointer,
  24008. // non-interface field appearing in ForceSendFields will be sent to the
  24009. // server regardless of whether the field is empty or not. This may be
  24010. // used to include empty fields in Patch requests.
  24011. ForceSendFields []string `json:"-"`
  24012. // NullFields is a list of field names (e.g. "Code") to include in API
  24013. // requests with the JSON null value. By default, fields with empty
  24014. // values are omitted from API requests. However, any field with an
  24015. // empty value appearing in NullFields will be sent to the server as
  24016. // null. It is an error if a field in this list has a non-empty value.
  24017. // This may be used to include null fields in Patch requests.
  24018. NullFields []string `json:"-"`
  24019. }
  24020. func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  24021. type NoMethod TargetVpnGatewaysScopedListWarning
  24022. raw := NoMethod(*s)
  24023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24024. }
  24025. type TargetVpnGatewaysScopedListWarningData struct {
  24026. // Key: [Output Only] A key that provides more detail on the warning
  24027. // being returned. For example, for warnings where there are no results
  24028. // in a list request for a particular zone, this key might be scope and
  24029. // the key value might be the zone name. Other examples might be a key
  24030. // indicating a deprecated resource and a suggested replacement, or a
  24031. // warning about invalid network settings (for example, if an instance
  24032. // attempts to perform IP forwarding but is not enabled for IP
  24033. // forwarding).
  24034. Key string `json:"key,omitempty"`
  24035. // Value: [Output Only] A warning data value corresponding to the key.
  24036. Value string `json:"value,omitempty"`
  24037. // ForceSendFields is a list of field names (e.g. "Key") to
  24038. // unconditionally include in API requests. By default, fields with
  24039. // empty values are omitted from API requests. However, any non-pointer,
  24040. // non-interface field appearing in ForceSendFields will be sent to the
  24041. // server regardless of whether the field is empty or not. This may be
  24042. // used to include empty fields in Patch requests.
  24043. ForceSendFields []string `json:"-"`
  24044. // NullFields is a list of field names (e.g. "Key") to include in API
  24045. // requests with the JSON null value. By default, fields with empty
  24046. // values are omitted from API requests. However, any field with an
  24047. // empty value appearing in NullFields will be sent to the server as
  24048. // null. It is an error if a field in this list has a non-empty value.
  24049. // This may be used to include null fields in Patch requests.
  24050. NullFields []string `json:"-"`
  24051. }
  24052. func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  24053. type NoMethod TargetVpnGatewaysScopedListWarningData
  24054. raw := NoMethod(*s)
  24055. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24056. }
  24057. type TestFailure struct {
  24058. ActualService string `json:"actualService,omitempty"`
  24059. ExpectedService string `json:"expectedService,omitempty"`
  24060. Host string `json:"host,omitempty"`
  24061. Path string `json:"path,omitempty"`
  24062. // ForceSendFields is a list of field names (e.g. "ActualService") to
  24063. // unconditionally include in API requests. By default, fields with
  24064. // empty values are omitted from API requests. However, any non-pointer,
  24065. // non-interface field appearing in ForceSendFields will be sent to the
  24066. // server regardless of whether the field is empty or not. This may be
  24067. // used to include empty fields in Patch requests.
  24068. ForceSendFields []string `json:"-"`
  24069. // NullFields is a list of field names (e.g. "ActualService") to include
  24070. // in API requests with the JSON null value. By default, fields with
  24071. // empty values are omitted from API requests. However, any field with
  24072. // an empty value appearing in NullFields will be sent to the server as
  24073. // null. It is an error if a field in this list has a non-empty value.
  24074. // This may be used to include null fields in Patch requests.
  24075. NullFields []string `json:"-"`
  24076. }
  24077. func (s *TestFailure) MarshalJSON() ([]byte, error) {
  24078. type NoMethod TestFailure
  24079. raw := NoMethod(*s)
  24080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24081. }
  24082. type TestPermissionsRequest struct {
  24083. // Permissions: The set of permissions to check for the 'resource'.
  24084. // Permissions with wildcards (such as '*' or 'storage.*') are not
  24085. // allowed.
  24086. Permissions []string `json:"permissions,omitempty"`
  24087. // ForceSendFields is a list of field names (e.g. "Permissions") to
  24088. // unconditionally include in API requests. By default, fields with
  24089. // empty values are omitted from API requests. However, any non-pointer,
  24090. // non-interface field appearing in ForceSendFields will be sent to the
  24091. // server regardless of whether the field is empty or not. This may be
  24092. // used to include empty fields in Patch requests.
  24093. ForceSendFields []string `json:"-"`
  24094. // NullFields is a list of field names (e.g. "Permissions") to include
  24095. // in API requests with the JSON null value. By default, fields with
  24096. // empty values are omitted from API requests. However, any field with
  24097. // an empty value appearing in NullFields will be sent to the server as
  24098. // null. It is an error if a field in this list has a non-empty value.
  24099. // This may be used to include null fields in Patch requests.
  24100. NullFields []string `json:"-"`
  24101. }
  24102. func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) {
  24103. type NoMethod TestPermissionsRequest
  24104. raw := NoMethod(*s)
  24105. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24106. }
  24107. type TestPermissionsResponse struct {
  24108. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  24109. // the caller is allowed.
  24110. Permissions []string `json:"permissions,omitempty"`
  24111. // ServerResponse contains the HTTP response code and headers from the
  24112. // server.
  24113. googleapi.ServerResponse `json:"-"`
  24114. // ForceSendFields is a list of field names (e.g. "Permissions") to
  24115. // unconditionally include in API requests. By default, fields with
  24116. // empty values are omitted from API requests. However, any non-pointer,
  24117. // non-interface field appearing in ForceSendFields will be sent to the
  24118. // server regardless of whether the field is empty or not. This may be
  24119. // used to include empty fields in Patch requests.
  24120. ForceSendFields []string `json:"-"`
  24121. // NullFields is a list of field names (e.g. "Permissions") to include
  24122. // in API requests with the JSON null value. By default, fields with
  24123. // empty values are omitted from API requests. However, any field with
  24124. // an empty value appearing in NullFields will be sent to the server as
  24125. // null. It is an error if a field in this list has a non-empty value.
  24126. // This may be used to include null fields in Patch requests.
  24127. NullFields []string `json:"-"`
  24128. }
  24129. func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) {
  24130. type NoMethod TestPermissionsResponse
  24131. raw := NoMethod(*s)
  24132. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24133. }
  24134. // UrlMap: A UrlMap resource. This resource defines the mapping from URL
  24135. // to the BackendService resource, based on the "longest-match" of the
  24136. // URL's host and path.
  24137. type UrlMap struct {
  24138. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  24139. // format.
  24140. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  24141. // DefaultService: The full or partial URL of the defaultService
  24142. // resource to which traffic is directed if none of the hostRules match.
  24143. // If defaultRouteAction is additionally specified, advanced routing
  24144. // actions like URL Rewrites, etc. take effect prior to sending the
  24145. // request to the backend. However, if defaultService is specified,
  24146. // defaultRouteAction cannot contain any weightedBackendServices.
  24147. // Conversely, if routeAction specifies any weightedBackendServices,
  24148. // service must not be specified.
  24149. // Only one of defaultService, defaultUrlRedirect or
  24150. // defaultRouteAction.weightedBackendService must be set.
  24151. DefaultService string `json:"defaultService,omitempty"`
  24152. // Description: An optional description of this resource. Provide this
  24153. // property when you create the resource.
  24154. Description string `json:"description,omitempty"`
  24155. // Fingerprint: Fingerprint of this resource. A hash of the contents
  24156. // stored in this object. This field is used in optimistic locking. This
  24157. // field will be ignored when inserting a UrlMap. An up-to-date
  24158. // fingerprint must be provided in order to update the UrlMap, otherwise
  24159. // the request will fail with error 412 conditionNotMet.
  24160. //
  24161. // To see the latest fingerprint, make a get() request to retrieve a
  24162. // UrlMap.
  24163. Fingerprint string `json:"fingerprint,omitempty"`
  24164. // HostRules: The list of HostRules to use against the URL.
  24165. HostRules []*HostRule `json:"hostRules,omitempty"`
  24166. // Id: [Output Only] The unique identifier for the resource. This
  24167. // identifier is defined by the server.
  24168. Id uint64 `json:"id,omitempty,string"`
  24169. // Kind: [Output Only] Type of the resource. Always compute#urlMaps for
  24170. // url maps.
  24171. Kind string `json:"kind,omitempty"`
  24172. // Name: Name of the resource. Provided by the client when the resource
  24173. // is created. The name must be 1-63 characters long, and comply with
  24174. // RFC1035. Specifically, the name must be 1-63 characters long and
  24175. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  24176. // the first character must be a lowercase letter, and all following
  24177. // characters must be a dash, lowercase letter, or digit, except the
  24178. // last character, which cannot be a dash.
  24179. Name string `json:"name,omitempty"`
  24180. // PathMatchers: The list of named PathMatchers to use against the URL.
  24181. PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"`
  24182. // SelfLink: [Output Only] Server-defined URL for the resource.
  24183. SelfLink string `json:"selfLink,omitempty"`
  24184. // Tests: The list of expected URL mapping tests. Request to update this
  24185. // UrlMap will succeed only if all of the test cases pass. You can
  24186. // specify a maximum of 100 tests per UrlMap.
  24187. Tests []*UrlMapTest `json:"tests,omitempty"`
  24188. // ServerResponse contains the HTTP response code and headers from the
  24189. // server.
  24190. googleapi.ServerResponse `json:"-"`
  24191. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  24192. // to unconditionally include in API requests. By default, fields with
  24193. // empty values are omitted from API requests. However, any non-pointer,
  24194. // non-interface field appearing in ForceSendFields will be sent to the
  24195. // server regardless of whether the field is empty or not. This may be
  24196. // used to include empty fields in Patch requests.
  24197. ForceSendFields []string `json:"-"`
  24198. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  24199. // include in API requests with the JSON null value. By default, fields
  24200. // with empty values are omitted from API requests. However, any field
  24201. // with an empty value appearing in NullFields will be sent to the
  24202. // server as null. It is an error if a field in this list has a
  24203. // non-empty value. This may be used to include null fields in Patch
  24204. // requests.
  24205. NullFields []string `json:"-"`
  24206. }
  24207. func (s *UrlMap) MarshalJSON() ([]byte, error) {
  24208. type NoMethod UrlMap
  24209. raw := NoMethod(*s)
  24210. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24211. }
  24212. // UrlMapList: Contains a list of UrlMap resources.
  24213. type UrlMapList struct {
  24214. // Id: [Output Only] Unique identifier for the resource; defined by the
  24215. // server.
  24216. Id string `json:"id,omitempty"`
  24217. // Items: A list of UrlMap resources.
  24218. Items []*UrlMap `json:"items,omitempty"`
  24219. // Kind: Type of resource.
  24220. Kind string `json:"kind,omitempty"`
  24221. // NextPageToken: [Output Only] This token allows you to get the next
  24222. // page of results for list requests. If the number of results is larger
  24223. // than maxResults, use the nextPageToken as a value for the query
  24224. // parameter pageToken in the next list request. Subsequent list
  24225. // requests will have their own nextPageToken to continue paging through
  24226. // the results.
  24227. NextPageToken string `json:"nextPageToken,omitempty"`
  24228. // SelfLink: [Output Only] Server-defined URL for this resource.
  24229. SelfLink string `json:"selfLink,omitempty"`
  24230. // Warning: [Output Only] Informational warning message.
  24231. Warning *UrlMapListWarning `json:"warning,omitempty"`
  24232. // ServerResponse contains the HTTP response code and headers from the
  24233. // server.
  24234. googleapi.ServerResponse `json:"-"`
  24235. // ForceSendFields is a list of field names (e.g. "Id") to
  24236. // unconditionally include in API requests. By default, fields with
  24237. // empty values are omitted from API requests. However, any non-pointer,
  24238. // non-interface field appearing in ForceSendFields will be sent to the
  24239. // server regardless of whether the field is empty or not. This may be
  24240. // used to include empty fields in Patch requests.
  24241. ForceSendFields []string `json:"-"`
  24242. // NullFields is a list of field names (e.g. "Id") to include in API
  24243. // requests with the JSON null value. By default, fields with empty
  24244. // values are omitted from API requests. However, any field with an
  24245. // empty value appearing in NullFields will be sent to the server as
  24246. // null. It is an error if a field in this list has a non-empty value.
  24247. // This may be used to include null fields in Patch requests.
  24248. NullFields []string `json:"-"`
  24249. }
  24250. func (s *UrlMapList) MarshalJSON() ([]byte, error) {
  24251. type NoMethod UrlMapList
  24252. raw := NoMethod(*s)
  24253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24254. }
  24255. // UrlMapListWarning: [Output Only] Informational warning message.
  24256. type UrlMapListWarning struct {
  24257. // Code: [Output Only] A warning code, if applicable. For example,
  24258. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24259. // the response.
  24260. //
  24261. // Possible values:
  24262. // "CLEANUP_FAILED"
  24263. // "DEPRECATED_RESOURCE_USED"
  24264. // "DEPRECATED_TYPE_USED"
  24265. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24266. // "EXPERIMENTAL_TYPE_USED"
  24267. // "EXTERNAL_API_WARNING"
  24268. // "FIELD_VALUE_OVERRIDEN"
  24269. // "INJECTED_KERNELS_DEPRECATED"
  24270. // "MISSING_TYPE_DEPENDENCY"
  24271. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24272. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24273. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24274. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24275. // "NEXT_HOP_NOT_RUNNING"
  24276. // "NOT_CRITICAL_ERROR"
  24277. // "NO_RESULTS_ON_PAGE"
  24278. // "REQUIRED_TOS_AGREEMENT"
  24279. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24280. // "RESOURCE_NOT_DELETED"
  24281. // "SCHEMA_VALIDATION_IGNORED"
  24282. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24283. // "UNDECLARED_PROPERTIES"
  24284. // "UNREACHABLE"
  24285. Code string `json:"code,omitempty"`
  24286. // Data: [Output Only] Metadata about this warning in key: value format.
  24287. // For example:
  24288. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24289. Data []*UrlMapListWarningData `json:"data,omitempty"`
  24290. // Message: [Output Only] A human-readable description of the warning
  24291. // code.
  24292. Message string `json:"message,omitempty"`
  24293. // ForceSendFields is a list of field names (e.g. "Code") to
  24294. // unconditionally include in API requests. By default, fields with
  24295. // empty values are omitted from API requests. However, any non-pointer,
  24296. // non-interface field appearing in ForceSendFields will be sent to the
  24297. // server regardless of whether the field is empty or not. This may be
  24298. // used to include empty fields in Patch requests.
  24299. ForceSendFields []string `json:"-"`
  24300. // NullFields is a list of field names (e.g. "Code") to include in API
  24301. // requests with the JSON null value. By default, fields with empty
  24302. // values are omitted from API requests. However, any field with an
  24303. // empty value appearing in NullFields will be sent to the server as
  24304. // null. It is an error if a field in this list has a non-empty value.
  24305. // This may be used to include null fields in Patch requests.
  24306. NullFields []string `json:"-"`
  24307. }
  24308. func (s *UrlMapListWarning) MarshalJSON() ([]byte, error) {
  24309. type NoMethod UrlMapListWarning
  24310. raw := NoMethod(*s)
  24311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24312. }
  24313. type UrlMapListWarningData struct {
  24314. // Key: [Output Only] A key that provides more detail on the warning
  24315. // being returned. For example, for warnings where there are no results
  24316. // in a list request for a particular zone, this key might be scope and
  24317. // the key value might be the zone name. Other examples might be a key
  24318. // indicating a deprecated resource and a suggested replacement, or a
  24319. // warning about invalid network settings (for example, if an instance
  24320. // attempts to perform IP forwarding but is not enabled for IP
  24321. // forwarding).
  24322. Key string `json:"key,omitempty"`
  24323. // Value: [Output Only] A warning data value corresponding to the key.
  24324. Value string `json:"value,omitempty"`
  24325. // ForceSendFields is a list of field names (e.g. "Key") to
  24326. // unconditionally include in API requests. By default, fields with
  24327. // empty values are omitted from API requests. However, any non-pointer,
  24328. // non-interface field appearing in ForceSendFields will be sent to the
  24329. // server regardless of whether the field is empty or not. This may be
  24330. // used to include empty fields in Patch requests.
  24331. ForceSendFields []string `json:"-"`
  24332. // NullFields is a list of field names (e.g. "Key") to include in API
  24333. // requests with the JSON null value. By default, fields with empty
  24334. // values are omitted from API requests. However, any field with an
  24335. // empty value appearing in NullFields will be sent to the server as
  24336. // null. It is an error if a field in this list has a non-empty value.
  24337. // This may be used to include null fields in Patch requests.
  24338. NullFields []string `json:"-"`
  24339. }
  24340. func (s *UrlMapListWarningData) MarshalJSON() ([]byte, error) {
  24341. type NoMethod UrlMapListWarningData
  24342. raw := NoMethod(*s)
  24343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24344. }
  24345. type UrlMapReference struct {
  24346. UrlMap string `json:"urlMap,omitempty"`
  24347. // ForceSendFields is a list of field names (e.g. "UrlMap") to
  24348. // unconditionally include in API requests. By default, fields with
  24349. // empty values are omitted from API requests. However, any non-pointer,
  24350. // non-interface field appearing in ForceSendFields will be sent to the
  24351. // server regardless of whether the field is empty or not. This may be
  24352. // used to include empty fields in Patch requests.
  24353. ForceSendFields []string `json:"-"`
  24354. // NullFields is a list of field names (e.g. "UrlMap") to include in API
  24355. // requests with the JSON null value. By default, fields with empty
  24356. // values are omitted from API requests. However, any field with an
  24357. // empty value appearing in NullFields will be sent to the server as
  24358. // null. It is an error if a field in this list has a non-empty value.
  24359. // This may be used to include null fields in Patch requests.
  24360. NullFields []string `json:"-"`
  24361. }
  24362. func (s *UrlMapReference) MarshalJSON() ([]byte, error) {
  24363. type NoMethod UrlMapReference
  24364. raw := NoMethod(*s)
  24365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24366. }
  24367. // UrlMapTest: Message for the expected URL mappings.
  24368. type UrlMapTest struct {
  24369. // Description: Description of this test case.
  24370. Description string `json:"description,omitempty"`
  24371. // Host: Host portion of the URL.
  24372. Host string `json:"host,omitempty"`
  24373. // Path: Path portion of the URL.
  24374. Path string `json:"path,omitempty"`
  24375. // Service: Expected BackendService resource the given URL should be
  24376. // mapped to.
  24377. Service string `json:"service,omitempty"`
  24378. // ForceSendFields is a list of field names (e.g. "Description") to
  24379. // unconditionally include in API requests. By default, fields with
  24380. // empty values are omitted from API requests. However, any non-pointer,
  24381. // non-interface field appearing in ForceSendFields will be sent to the
  24382. // server regardless of whether the field is empty or not. This may be
  24383. // used to include empty fields in Patch requests.
  24384. ForceSendFields []string `json:"-"`
  24385. // NullFields is a list of field names (e.g. "Description") to include
  24386. // in API requests with the JSON null value. By default, fields with
  24387. // empty values are omitted from API requests. However, any field with
  24388. // an empty value appearing in NullFields will be sent to the server as
  24389. // null. It is an error if a field in this list has a non-empty value.
  24390. // This may be used to include null fields in Patch requests.
  24391. NullFields []string `json:"-"`
  24392. }
  24393. func (s *UrlMapTest) MarshalJSON() ([]byte, error) {
  24394. type NoMethod UrlMapTest
  24395. raw := NoMethod(*s)
  24396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24397. }
  24398. // UrlMapValidationResult: Message representing the validation result
  24399. // for a UrlMap.
  24400. type UrlMapValidationResult struct {
  24401. LoadErrors []string `json:"loadErrors,omitempty"`
  24402. // LoadSucceeded: Whether the given UrlMap can be successfully loaded.
  24403. // If false, 'loadErrors' indicates the reasons.
  24404. LoadSucceeded bool `json:"loadSucceeded,omitempty"`
  24405. TestFailures []*TestFailure `json:"testFailures,omitempty"`
  24406. // TestPassed: If successfully loaded, this field indicates whether the
  24407. // test passed. If false, 'testFailures's indicate the reason of
  24408. // failure.
  24409. TestPassed bool `json:"testPassed,omitempty"`
  24410. // ForceSendFields is a list of field names (e.g. "LoadErrors") to
  24411. // unconditionally include in API requests. By default, fields with
  24412. // empty values are omitted from API requests. However, any non-pointer,
  24413. // non-interface field appearing in ForceSendFields will be sent to the
  24414. // server regardless of whether the field is empty or not. This may be
  24415. // used to include empty fields in Patch requests.
  24416. ForceSendFields []string `json:"-"`
  24417. // NullFields is a list of field names (e.g. "LoadErrors") to include in
  24418. // API requests with the JSON null value. By default, fields with empty
  24419. // values are omitted from API requests. However, any field with an
  24420. // empty value appearing in NullFields will be sent to the server as
  24421. // null. It is an error if a field in this list has a non-empty value.
  24422. // This may be used to include null fields in Patch requests.
  24423. NullFields []string `json:"-"`
  24424. }
  24425. func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) {
  24426. type NoMethod UrlMapValidationResult
  24427. raw := NoMethod(*s)
  24428. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24429. }
  24430. type UrlMapsValidateRequest struct {
  24431. // Resource: Content of the UrlMap to be validated.
  24432. Resource *UrlMap `json:"resource,omitempty"`
  24433. // ForceSendFields is a list of field names (e.g. "Resource") to
  24434. // unconditionally include in API requests. By default, fields with
  24435. // empty values are omitted from API requests. However, any non-pointer,
  24436. // non-interface field appearing in ForceSendFields will be sent to the
  24437. // server regardless of whether the field is empty or not. This may be
  24438. // used to include empty fields in Patch requests.
  24439. ForceSendFields []string `json:"-"`
  24440. // NullFields is a list of field names (e.g. "Resource") to include in
  24441. // API requests with the JSON null value. By default, fields with empty
  24442. // values are omitted from API requests. However, any field with an
  24443. // empty value appearing in NullFields will be sent to the server as
  24444. // null. It is an error if a field in this list has a non-empty value.
  24445. // This may be used to include null fields in Patch requests.
  24446. NullFields []string `json:"-"`
  24447. }
  24448. func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  24449. type NoMethod UrlMapsValidateRequest
  24450. raw := NoMethod(*s)
  24451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24452. }
  24453. type UrlMapsValidateResponse struct {
  24454. Result *UrlMapValidationResult `json:"result,omitempty"`
  24455. // ServerResponse contains the HTTP response code and headers from the
  24456. // server.
  24457. googleapi.ServerResponse `json:"-"`
  24458. // ForceSendFields is a list of field names (e.g. "Result") to
  24459. // unconditionally include in API requests. By default, fields with
  24460. // empty values are omitted from API requests. However, any non-pointer,
  24461. // non-interface field appearing in ForceSendFields will be sent to the
  24462. // server regardless of whether the field is empty or not. This may be
  24463. // used to include empty fields in Patch requests.
  24464. ForceSendFields []string `json:"-"`
  24465. // NullFields is a list of field names (e.g. "Result") to include in API
  24466. // requests with the JSON null value. By default, fields with empty
  24467. // values are omitted from API requests. However, any field with an
  24468. // empty value appearing in NullFields will be sent to the server as
  24469. // null. It is an error if a field in this list has a non-empty value.
  24470. // This may be used to include null fields in Patch requests.
  24471. NullFields []string `json:"-"`
  24472. }
  24473. func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
  24474. type NoMethod UrlMapsValidateResponse
  24475. raw := NoMethod(*s)
  24476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24477. }
  24478. // UsableSubnetwork: Subnetwork which the current user has
  24479. // compute.subnetworks.use permission on.
  24480. type UsableSubnetwork struct {
  24481. // IpCidrRange: The range of internal addresses that are owned by this
  24482. // subnetwork.
  24483. IpCidrRange string `json:"ipCidrRange,omitempty"`
  24484. // Network: Network URL.
  24485. Network string `json:"network,omitempty"`
  24486. // SecondaryIpRanges: Secondary IP ranges.
  24487. SecondaryIpRanges []*UsableSubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  24488. // Subnetwork: Subnetwork URL.
  24489. Subnetwork string `json:"subnetwork,omitempty"`
  24490. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  24491. // unconditionally include in API requests. By default, fields with
  24492. // empty values are omitted from API requests. However, any non-pointer,
  24493. // non-interface field appearing in ForceSendFields will be sent to the
  24494. // server regardless of whether the field is empty or not. This may be
  24495. // used to include empty fields in Patch requests.
  24496. ForceSendFields []string `json:"-"`
  24497. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  24498. // in API requests with the JSON null value. By default, fields with
  24499. // empty values are omitted from API requests. However, any field with
  24500. // an empty value appearing in NullFields will be sent to the server as
  24501. // null. It is an error if a field in this list has a non-empty value.
  24502. // This may be used to include null fields in Patch requests.
  24503. NullFields []string `json:"-"`
  24504. }
  24505. func (s *UsableSubnetwork) MarshalJSON() ([]byte, error) {
  24506. type NoMethod UsableSubnetwork
  24507. raw := NoMethod(*s)
  24508. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24509. }
  24510. // UsableSubnetworkSecondaryRange: Secondary IP range of a usable
  24511. // subnetwork.
  24512. type UsableSubnetworkSecondaryRange struct {
  24513. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  24514. // secondary range.
  24515. IpCidrRange string `json:"ipCidrRange,omitempty"`
  24516. // RangeName: The name associated with this subnetwork secondary range,
  24517. // used when adding an alias IP range to a VM instance. The name must be
  24518. // 1-63 characters long, and comply with RFC1035. The name must be
  24519. // unique within the subnetwork.
  24520. RangeName string `json:"rangeName,omitempty"`
  24521. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  24522. // unconditionally include in API requests. By default, fields with
  24523. // empty values are omitted from API requests. However, any non-pointer,
  24524. // non-interface field appearing in ForceSendFields will be sent to the
  24525. // server regardless of whether the field is empty or not. This may be
  24526. // used to include empty fields in Patch requests.
  24527. ForceSendFields []string `json:"-"`
  24528. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  24529. // in API requests with the JSON null value. By default, fields with
  24530. // empty values are omitted from API requests. However, any field with
  24531. // an empty value appearing in NullFields will be sent to the server as
  24532. // null. It is an error if a field in this list has a non-empty value.
  24533. // This may be used to include null fields in Patch requests.
  24534. NullFields []string `json:"-"`
  24535. }
  24536. func (s *UsableSubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  24537. type NoMethod UsableSubnetworkSecondaryRange
  24538. raw := NoMethod(*s)
  24539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24540. }
  24541. type UsableSubnetworksAggregatedList struct {
  24542. // Id: [Output Only] The unique identifier for the resource. This
  24543. // identifier is defined by the server.
  24544. Id string `json:"id,omitempty"`
  24545. // Items: [Output] A list of usable subnetwork URLs.
  24546. Items []*UsableSubnetwork `json:"items,omitempty"`
  24547. // Kind: [Output Only] Type of resource. Always
  24548. // compute#usableSubnetworksAggregatedList for aggregated lists of
  24549. // usable subnetworks.
  24550. Kind string `json:"kind,omitempty"`
  24551. // NextPageToken: [Output Only] This token allows you to get the next
  24552. // page of results for list requests. If the number of results is larger
  24553. // than maxResults, use the nextPageToken as a value for the query
  24554. // parameter pageToken in the next list request. Subsequent list
  24555. // requests will have their own nextPageToken to continue paging through
  24556. // the results.
  24557. NextPageToken string `json:"nextPageToken,omitempty"`
  24558. // SelfLink: [Output Only] Server-defined URL for this resource.
  24559. SelfLink string `json:"selfLink,omitempty"`
  24560. // Warning: [Output Only] Informational warning message.
  24561. Warning *UsableSubnetworksAggregatedListWarning `json:"warning,omitempty"`
  24562. // ServerResponse contains the HTTP response code and headers from the
  24563. // server.
  24564. googleapi.ServerResponse `json:"-"`
  24565. // ForceSendFields is a list of field names (e.g. "Id") to
  24566. // unconditionally include in API requests. By default, fields with
  24567. // empty values are omitted from API requests. However, any non-pointer,
  24568. // non-interface field appearing in ForceSendFields will be sent to the
  24569. // server regardless of whether the field is empty or not. This may be
  24570. // used to include empty fields in Patch requests.
  24571. ForceSendFields []string `json:"-"`
  24572. // NullFields is a list of field names (e.g. "Id") to include in API
  24573. // requests with the JSON null value. By default, fields with empty
  24574. // values are omitted from API requests. However, any field with an
  24575. // empty value appearing in NullFields will be sent to the server as
  24576. // null. It is an error if a field in this list has a non-empty value.
  24577. // This may be used to include null fields in Patch requests.
  24578. NullFields []string `json:"-"`
  24579. }
  24580. func (s *UsableSubnetworksAggregatedList) MarshalJSON() ([]byte, error) {
  24581. type NoMethod UsableSubnetworksAggregatedList
  24582. raw := NoMethod(*s)
  24583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24584. }
  24585. // UsableSubnetworksAggregatedListWarning: [Output Only] Informational
  24586. // warning message.
  24587. type UsableSubnetworksAggregatedListWarning struct {
  24588. // Code: [Output Only] A warning code, if applicable. For example,
  24589. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24590. // the response.
  24591. //
  24592. // Possible values:
  24593. // "CLEANUP_FAILED"
  24594. // "DEPRECATED_RESOURCE_USED"
  24595. // "DEPRECATED_TYPE_USED"
  24596. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24597. // "EXPERIMENTAL_TYPE_USED"
  24598. // "EXTERNAL_API_WARNING"
  24599. // "FIELD_VALUE_OVERRIDEN"
  24600. // "INJECTED_KERNELS_DEPRECATED"
  24601. // "MISSING_TYPE_DEPENDENCY"
  24602. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24603. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24604. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24605. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24606. // "NEXT_HOP_NOT_RUNNING"
  24607. // "NOT_CRITICAL_ERROR"
  24608. // "NO_RESULTS_ON_PAGE"
  24609. // "REQUIRED_TOS_AGREEMENT"
  24610. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24611. // "RESOURCE_NOT_DELETED"
  24612. // "SCHEMA_VALIDATION_IGNORED"
  24613. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24614. // "UNDECLARED_PROPERTIES"
  24615. // "UNREACHABLE"
  24616. Code string `json:"code,omitempty"`
  24617. // Data: [Output Only] Metadata about this warning in key: value format.
  24618. // For example:
  24619. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24620. Data []*UsableSubnetworksAggregatedListWarningData `json:"data,omitempty"`
  24621. // Message: [Output Only] A human-readable description of the warning
  24622. // code.
  24623. Message string `json:"message,omitempty"`
  24624. // ForceSendFields is a list of field names (e.g. "Code") to
  24625. // unconditionally include in API requests. By default, fields with
  24626. // empty values are omitted from API requests. However, any non-pointer,
  24627. // non-interface field appearing in ForceSendFields will be sent to the
  24628. // server regardless of whether the field is empty or not. This may be
  24629. // used to include empty fields in Patch requests.
  24630. ForceSendFields []string `json:"-"`
  24631. // NullFields is a list of field names (e.g. "Code") to include in API
  24632. // requests with the JSON null value. By default, fields with empty
  24633. // values are omitted from API requests. However, any field with an
  24634. // empty value appearing in NullFields will be sent to the server as
  24635. // null. It is an error if a field in this list has a non-empty value.
  24636. // This may be used to include null fields in Patch requests.
  24637. NullFields []string `json:"-"`
  24638. }
  24639. func (s *UsableSubnetworksAggregatedListWarning) MarshalJSON() ([]byte, error) {
  24640. type NoMethod UsableSubnetworksAggregatedListWarning
  24641. raw := NoMethod(*s)
  24642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24643. }
  24644. type UsableSubnetworksAggregatedListWarningData struct {
  24645. // Key: [Output Only] A key that provides more detail on the warning
  24646. // being returned. For example, for warnings where there are no results
  24647. // in a list request for a particular zone, this key might be scope and
  24648. // the key value might be the zone name. Other examples might be a key
  24649. // indicating a deprecated resource and a suggested replacement, or a
  24650. // warning about invalid network settings (for example, if an instance
  24651. // attempts to perform IP forwarding but is not enabled for IP
  24652. // forwarding).
  24653. Key string `json:"key,omitempty"`
  24654. // Value: [Output Only] A warning data value corresponding to the key.
  24655. Value string `json:"value,omitempty"`
  24656. // ForceSendFields is a list of field names (e.g. "Key") to
  24657. // unconditionally include in API requests. By default, fields with
  24658. // empty values are omitted from API requests. However, any non-pointer,
  24659. // non-interface field appearing in ForceSendFields will be sent to the
  24660. // server regardless of whether the field is empty or not. This may be
  24661. // used to include empty fields in Patch requests.
  24662. ForceSendFields []string `json:"-"`
  24663. // NullFields is a list of field names (e.g. "Key") to include in API
  24664. // requests with the JSON null value. By default, fields with empty
  24665. // values are omitted from API requests. However, any field with an
  24666. // empty value appearing in NullFields will be sent to the server as
  24667. // null. It is an error if a field in this list has a non-empty value.
  24668. // This may be used to include null fields in Patch requests.
  24669. NullFields []string `json:"-"`
  24670. }
  24671. func (s *UsableSubnetworksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  24672. type NoMethod UsableSubnetworksAggregatedListWarningData
  24673. raw := NoMethod(*s)
  24674. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24675. }
  24676. // UsageExportLocation: The location in Cloud Storage and naming method
  24677. // of the daily usage report. Contains bucket_name and report_name
  24678. // prefix.
  24679. type UsageExportLocation struct {
  24680. // BucketName: The name of an existing bucket in Cloud Storage where the
  24681. // usage report object is stored. The Google Service Account is granted
  24682. // write access to this bucket. This can either be the bucket name by
  24683. // itself, such as example-bucket, or the bucket name with gs:// or
  24684. // https://storage.googleapis.com/ in front of it, such as
  24685. // gs://example-bucket.
  24686. BucketName string `json:"bucketName,omitempty"`
  24687. // ReportNamePrefix: An optional prefix for the name of the usage report
  24688. // object stored in bucketName. If not supplied, defaults to usage. The
  24689. // report is stored as a CSV file named
  24690. // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the
  24691. // usage according to Pacific Time. If you supply a prefix, it should
  24692. // conform to Cloud Storage object naming conventions.
  24693. ReportNamePrefix string `json:"reportNamePrefix,omitempty"`
  24694. // ForceSendFields is a list of field names (e.g. "BucketName") to
  24695. // unconditionally include in API requests. By default, fields with
  24696. // empty values are omitted from API requests. However, any non-pointer,
  24697. // non-interface field appearing in ForceSendFields will be sent to the
  24698. // server regardless of whether the field is empty or not. This may be
  24699. // used to include empty fields in Patch requests.
  24700. ForceSendFields []string `json:"-"`
  24701. // NullFields is a list of field names (e.g. "BucketName") to include in
  24702. // API requests with the JSON null value. By default, fields with empty
  24703. // values are omitted from API requests. However, any field with an
  24704. // empty value appearing in NullFields will be sent to the server as
  24705. // null. It is an error if a field in this list has a non-empty value.
  24706. // This may be used to include null fields in Patch requests.
  24707. NullFields []string `json:"-"`
  24708. }
  24709. func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
  24710. type NoMethod UsageExportLocation
  24711. raw := NoMethod(*s)
  24712. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24713. }
  24714. // VmEndpointNatMappings: Contain information of Nat mapping for a VM
  24715. // endpoint (i.e., NIC).
  24716. type VmEndpointNatMappings struct {
  24717. // InstanceName: Name of the VM instance which the endpoint belongs to
  24718. InstanceName string `json:"instanceName,omitempty"`
  24719. InterfaceNatMappings []*VmEndpointNatMappingsInterfaceNatMappings `json:"interfaceNatMappings,omitempty"`
  24720. // ForceSendFields is a list of field names (e.g. "InstanceName") to
  24721. // unconditionally include in API requests. By default, fields with
  24722. // empty values are omitted from API requests. However, any non-pointer,
  24723. // non-interface field appearing in ForceSendFields will be sent to the
  24724. // server regardless of whether the field is empty or not. This may be
  24725. // used to include empty fields in Patch requests.
  24726. ForceSendFields []string `json:"-"`
  24727. // NullFields is a list of field names (e.g. "InstanceName") to include
  24728. // in API requests with the JSON null value. By default, fields with
  24729. // empty values are omitted from API requests. However, any field with
  24730. // an empty value appearing in NullFields will be sent to the server as
  24731. // null. It is an error if a field in this list has a non-empty value.
  24732. // This may be used to include null fields in Patch requests.
  24733. NullFields []string `json:"-"`
  24734. }
  24735. func (s *VmEndpointNatMappings) MarshalJSON() ([]byte, error) {
  24736. type NoMethod VmEndpointNatMappings
  24737. raw := NoMethod(*s)
  24738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24739. }
  24740. // VmEndpointNatMappingsInterfaceNatMappings: Contain information of Nat
  24741. // mapping for an interface of this endpoint.
  24742. type VmEndpointNatMappingsInterfaceNatMappings struct {
  24743. // NatIpPortRanges: A list of all IP:port-range mappings assigned to
  24744. // this interface. These ranges are inclusive, that is, both the first
  24745. // and the last ports can be used for NAT. Example:
  24746. // ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
  24747. NatIpPortRanges []string `json:"natIpPortRanges,omitempty"`
  24748. // NumTotalNatPorts: Total number of ports across all NAT IPs allocated
  24749. // to this interface. It equals to the aggregated port number in the
  24750. // field nat_ip_port_ranges.
  24751. NumTotalNatPorts int64 `json:"numTotalNatPorts,omitempty"`
  24752. // SourceAliasIpRange: Alias IP range for this interface endpoint. It
  24753. // will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or
  24754. // "192.168.5.0/24".
  24755. SourceAliasIpRange string `json:"sourceAliasIpRange,omitempty"`
  24756. // SourceVirtualIp: Primary IP of the VM for this NIC.
  24757. SourceVirtualIp string `json:"sourceVirtualIp,omitempty"`
  24758. // ForceSendFields is a list of field names (e.g. "NatIpPortRanges") to
  24759. // unconditionally include in API requests. By default, fields with
  24760. // empty values are omitted from API requests. However, any non-pointer,
  24761. // non-interface field appearing in ForceSendFields will be sent to the
  24762. // server regardless of whether the field is empty or not. This may be
  24763. // used to include empty fields in Patch requests.
  24764. ForceSendFields []string `json:"-"`
  24765. // NullFields is a list of field names (e.g. "NatIpPortRanges") to
  24766. // include in API requests with the JSON null value. By default, fields
  24767. // with empty values are omitted from API requests. However, any field
  24768. // with an empty value appearing in NullFields will be sent to the
  24769. // server as null. It is an error if a field in this list has a
  24770. // non-empty value. This may be used to include null fields in Patch
  24771. // requests.
  24772. NullFields []string `json:"-"`
  24773. }
  24774. func (s *VmEndpointNatMappingsInterfaceNatMappings) MarshalJSON() ([]byte, error) {
  24775. type NoMethod VmEndpointNatMappingsInterfaceNatMappings
  24776. raw := NoMethod(*s)
  24777. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24778. }
  24779. // VmEndpointNatMappingsList: Contains a list of VmEndpointNatMappings.
  24780. type VmEndpointNatMappingsList struct {
  24781. // Id: [Output Only] The unique identifier for the resource. This
  24782. // identifier is defined by the server.
  24783. Id string `json:"id,omitempty"`
  24784. // Kind: [Output Only] Type of resource. Always
  24785. // compute#vmEndpointNatMappingsList for lists of Nat mappings of VM
  24786. // endpoints.
  24787. Kind string `json:"kind,omitempty"`
  24788. // NextPageToken: [Output Only] This token allows you to get the next
  24789. // page of results for list requests. If the number of results is larger
  24790. // than maxResults, use the nextPageToken as a value for the query
  24791. // parameter pageToken in the next list request. Subsequent list
  24792. // requests will have their own nextPageToken to continue paging through
  24793. // the results.
  24794. NextPageToken string `json:"nextPageToken,omitempty"`
  24795. // Result: [Output Only] A list of Nat mapping information of VM
  24796. // endpoints.
  24797. Result []*VmEndpointNatMappings `json:"result,omitempty"`
  24798. // SelfLink: [Output Only] Server-defined URL for this resource.
  24799. SelfLink string `json:"selfLink,omitempty"`
  24800. // Warning: [Output Only] Informational warning message.
  24801. Warning *VmEndpointNatMappingsListWarning `json:"warning,omitempty"`
  24802. // ServerResponse contains the HTTP response code and headers from the
  24803. // server.
  24804. googleapi.ServerResponse `json:"-"`
  24805. // ForceSendFields is a list of field names (e.g. "Id") to
  24806. // unconditionally include in API requests. By default, fields with
  24807. // empty values are omitted from API requests. However, any non-pointer,
  24808. // non-interface field appearing in ForceSendFields will be sent to the
  24809. // server regardless of whether the field is empty or not. This may be
  24810. // used to include empty fields in Patch requests.
  24811. ForceSendFields []string `json:"-"`
  24812. // NullFields is a list of field names (e.g. "Id") to include in API
  24813. // requests with the JSON null value. By default, fields with empty
  24814. // values are omitted from API requests. However, any field with an
  24815. // empty value appearing in NullFields will be sent to the server as
  24816. // null. It is an error if a field in this list has a non-empty value.
  24817. // This may be used to include null fields in Patch requests.
  24818. NullFields []string `json:"-"`
  24819. }
  24820. func (s *VmEndpointNatMappingsList) MarshalJSON() ([]byte, error) {
  24821. type NoMethod VmEndpointNatMappingsList
  24822. raw := NoMethod(*s)
  24823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24824. }
  24825. // VmEndpointNatMappingsListWarning: [Output Only] Informational warning
  24826. // message.
  24827. type VmEndpointNatMappingsListWarning struct {
  24828. // Code: [Output Only] A warning code, if applicable. For example,
  24829. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24830. // the response.
  24831. //
  24832. // Possible values:
  24833. // "CLEANUP_FAILED"
  24834. // "DEPRECATED_RESOURCE_USED"
  24835. // "DEPRECATED_TYPE_USED"
  24836. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24837. // "EXPERIMENTAL_TYPE_USED"
  24838. // "EXTERNAL_API_WARNING"
  24839. // "FIELD_VALUE_OVERRIDEN"
  24840. // "INJECTED_KERNELS_DEPRECATED"
  24841. // "MISSING_TYPE_DEPENDENCY"
  24842. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24843. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24844. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24845. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24846. // "NEXT_HOP_NOT_RUNNING"
  24847. // "NOT_CRITICAL_ERROR"
  24848. // "NO_RESULTS_ON_PAGE"
  24849. // "REQUIRED_TOS_AGREEMENT"
  24850. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24851. // "RESOURCE_NOT_DELETED"
  24852. // "SCHEMA_VALIDATION_IGNORED"
  24853. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24854. // "UNDECLARED_PROPERTIES"
  24855. // "UNREACHABLE"
  24856. Code string `json:"code,omitempty"`
  24857. // Data: [Output Only] Metadata about this warning in key: value format.
  24858. // For example:
  24859. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24860. Data []*VmEndpointNatMappingsListWarningData `json:"data,omitempty"`
  24861. // Message: [Output Only] A human-readable description of the warning
  24862. // code.
  24863. Message string `json:"message,omitempty"`
  24864. // ForceSendFields is a list of field names (e.g. "Code") to
  24865. // unconditionally include in API requests. By default, fields with
  24866. // empty values are omitted from API requests. However, any non-pointer,
  24867. // non-interface field appearing in ForceSendFields will be sent to the
  24868. // server regardless of whether the field is empty or not. This may be
  24869. // used to include empty fields in Patch requests.
  24870. ForceSendFields []string `json:"-"`
  24871. // NullFields is a list of field names (e.g. "Code") to include in API
  24872. // requests with the JSON null value. By default, fields with empty
  24873. // values are omitted from API requests. However, any field with an
  24874. // empty value appearing in NullFields will be sent to the server as
  24875. // null. It is an error if a field in this list has a non-empty value.
  24876. // This may be used to include null fields in Patch requests.
  24877. NullFields []string `json:"-"`
  24878. }
  24879. func (s *VmEndpointNatMappingsListWarning) MarshalJSON() ([]byte, error) {
  24880. type NoMethod VmEndpointNatMappingsListWarning
  24881. raw := NoMethod(*s)
  24882. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24883. }
  24884. type VmEndpointNatMappingsListWarningData struct {
  24885. // Key: [Output Only] A key that provides more detail on the warning
  24886. // being returned. For example, for warnings where there are no results
  24887. // in a list request for a particular zone, this key might be scope and
  24888. // the key value might be the zone name. Other examples might be a key
  24889. // indicating a deprecated resource and a suggested replacement, or a
  24890. // warning about invalid network settings (for example, if an instance
  24891. // attempts to perform IP forwarding but is not enabled for IP
  24892. // forwarding).
  24893. Key string `json:"key,omitempty"`
  24894. // Value: [Output Only] A warning data value corresponding to the key.
  24895. Value string `json:"value,omitempty"`
  24896. // ForceSendFields is a list of field names (e.g. "Key") to
  24897. // unconditionally include in API requests. By default, fields with
  24898. // empty values are omitted from API requests. However, any non-pointer,
  24899. // non-interface field appearing in ForceSendFields will be sent to the
  24900. // server regardless of whether the field is empty or not. This may be
  24901. // used to include empty fields in Patch requests.
  24902. ForceSendFields []string `json:"-"`
  24903. // NullFields is a list of field names (e.g. "Key") to include in API
  24904. // requests with the JSON null value. By default, fields with empty
  24905. // values are omitted from API requests. However, any field with an
  24906. // empty value appearing in NullFields will be sent to the server as
  24907. // null. It is an error if a field in this list has a non-empty value.
  24908. // This may be used to include null fields in Patch requests.
  24909. NullFields []string `json:"-"`
  24910. }
  24911. func (s *VmEndpointNatMappingsListWarningData) MarshalJSON() ([]byte, error) {
  24912. type NoMethod VmEndpointNatMappingsListWarningData
  24913. raw := NoMethod(*s)
  24914. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24915. }
  24916. // VpnTunnel: VPN tunnel resource. (== resource_for beta.vpnTunnels ==)
  24917. // (== resource_for v1.vpnTunnels ==)
  24918. type VpnTunnel struct {
  24919. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  24920. // format.
  24921. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  24922. // Description: An optional description of this resource. Provide this
  24923. // property when you create the resource.
  24924. Description string `json:"description,omitempty"`
  24925. // DetailedStatus: [Output Only] Detailed status message for the VPN
  24926. // tunnel.
  24927. DetailedStatus string `json:"detailedStatus,omitempty"`
  24928. // Id: [Output Only] The unique identifier for the resource. This
  24929. // identifier is defined by the server.
  24930. Id uint64 `json:"id,omitempty,string"`
  24931. // IkeVersion: IKE protocol version to use when establishing the VPN
  24932. // tunnel with the peer VPN gateway. Acceptable IKE versions are 1 or 2.
  24933. // The default version is 2.
  24934. IkeVersion int64 `json:"ikeVersion,omitempty"`
  24935. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  24936. // VPN tunnels.
  24937. Kind string `json:"kind,omitempty"`
  24938. // LocalTrafficSelector: Local traffic selector to use when establishing
  24939. // the VPN tunnel with the peer VPN gateway. The value should be a CIDR
  24940. // formatted string, for example: 192.168.0.0/16. The ranges must be
  24941. // disjoint. Only IPv4 is supported.
  24942. LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"`
  24943. // Name: Name of the resource. Provided by the client when the resource
  24944. // is created. The name must be 1-63 characters long, and comply with
  24945. // RFC1035. Specifically, the name must be 1-63 characters long and
  24946. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  24947. // the first character must be a lowercase letter, and all following
  24948. // characters must be a dash, lowercase letter, or digit, except the
  24949. // last character, which cannot be a dash.
  24950. Name string `json:"name,omitempty"`
  24951. // PeerIp: IP address of the peer VPN gateway. Only IPv4 is supported.
  24952. PeerIp string `json:"peerIp,omitempty"`
  24953. // Region: [Output Only] URL of the region where the VPN tunnel resides.
  24954. // You must specify this field as part of the HTTP request URL. It is
  24955. // not settable as a field in the request body.
  24956. Region string `json:"region,omitempty"`
  24957. // RemoteTrafficSelector: Remote traffic selectors to use when
  24958. // establishing the VPN tunnel with the peer VPN gateway. The value
  24959. // should be a CIDR formatted string, for example: 192.168.0.0/16. The
  24960. // ranges should be disjoint. Only IPv4 is supported.
  24961. RemoteTrafficSelector []string `json:"remoteTrafficSelector,omitempty"`
  24962. // Router: URL of the router resource to be used for dynamic routing.
  24963. Router string `json:"router,omitempty"`
  24964. // SelfLink: [Output Only] Server-defined URL for the resource.
  24965. SelfLink string `json:"selfLink,omitempty"`
  24966. // SharedSecret: Shared secret used to set the secure session between
  24967. // the Cloud VPN gateway and the peer VPN gateway.
  24968. SharedSecret string `json:"sharedSecret,omitempty"`
  24969. // SharedSecretHash: Hash of the shared secret.
  24970. SharedSecretHash string `json:"sharedSecretHash,omitempty"`
  24971. // Status: [Output Only] The status of the VPN tunnel, which can be one
  24972. // of the following:
  24973. // - PROVISIONING: Resource is being allocated for the VPN tunnel.
  24974. // - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related configs
  24975. // from the user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule,
  24976. // and Route resources are needed to setup the VPN tunnel.
  24977. // - FIRST_HANDSHAKE: Successful first handshake with the peer VPN.
  24978. // - ESTABLISHED: Secure session is successfully established with the
  24979. // peer VPN.
  24980. // - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS
  24981. // - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret).
  24982. //
  24983. // - NEGOTIATION_FAILURE: Handshake failed.
  24984. // - DEPROVISIONING: Resources are being deallocated for the VPN tunnel.
  24985. //
  24986. // - FAILED: Tunnel creation has failed and the tunnel is not ready to
  24987. // be used.
  24988. //
  24989. // Possible values:
  24990. // "ALLOCATING_RESOURCES"
  24991. // "AUTHORIZATION_ERROR"
  24992. // "DEPROVISIONING"
  24993. // "ESTABLISHED"
  24994. // "FAILED"
  24995. // "FIRST_HANDSHAKE"
  24996. // "NEGOTIATION_FAILURE"
  24997. // "NETWORK_ERROR"
  24998. // "NO_INCOMING_PACKETS"
  24999. // "PROVISIONING"
  25000. // "REJECTED"
  25001. // "WAITING_FOR_FULL_CONFIG"
  25002. Status string `json:"status,omitempty"`
  25003. // TargetVpnGateway: URL of the Target VPN gateway with which this VPN
  25004. // tunnel is associated. Provided by the client when the VPN tunnel is
  25005. // created.
  25006. TargetVpnGateway string `json:"targetVpnGateway,omitempty"`
  25007. // ServerResponse contains the HTTP response code and headers from the
  25008. // server.
  25009. googleapi.ServerResponse `json:"-"`
  25010. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  25011. // to unconditionally include in API requests. By default, fields with
  25012. // empty values are omitted from API requests. However, any non-pointer,
  25013. // non-interface field appearing in ForceSendFields will be sent to the
  25014. // server regardless of whether the field is empty or not. This may be
  25015. // used to include empty fields in Patch requests.
  25016. ForceSendFields []string `json:"-"`
  25017. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  25018. // include in API requests with the JSON null value. By default, fields
  25019. // with empty values are omitted from API requests. However, any field
  25020. // with an empty value appearing in NullFields will be sent to the
  25021. // server as null. It is an error if a field in this list has a
  25022. // non-empty value. This may be used to include null fields in Patch
  25023. // requests.
  25024. NullFields []string `json:"-"`
  25025. }
  25026. func (s *VpnTunnel) MarshalJSON() ([]byte, error) {
  25027. type NoMethod VpnTunnel
  25028. raw := NoMethod(*s)
  25029. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25030. }
  25031. type VpnTunnelAggregatedList struct {
  25032. // Id: [Output Only] Unique identifier for the resource; defined by the
  25033. // server.
  25034. Id string `json:"id,omitempty"`
  25035. // Items: A list of VpnTunnelsScopedList resources.
  25036. Items map[string]VpnTunnelsScopedList `json:"items,omitempty"`
  25037. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  25038. // VPN tunnels.
  25039. Kind string `json:"kind,omitempty"`
  25040. // NextPageToken: [Output Only] This token allows you to get the next
  25041. // page of results for list requests. If the number of results is larger
  25042. // than maxResults, use the nextPageToken as a value for the query
  25043. // parameter pageToken in the next list request. Subsequent list
  25044. // requests will have their own nextPageToken to continue paging through
  25045. // the results.
  25046. NextPageToken string `json:"nextPageToken,omitempty"`
  25047. // SelfLink: [Output Only] Server-defined URL for this resource.
  25048. SelfLink string `json:"selfLink,omitempty"`
  25049. // Warning: [Output Only] Informational warning message.
  25050. Warning *VpnTunnelAggregatedListWarning `json:"warning,omitempty"`
  25051. // ServerResponse contains the HTTP response code and headers from the
  25052. // server.
  25053. googleapi.ServerResponse `json:"-"`
  25054. // ForceSendFields is a list of field names (e.g. "Id") to
  25055. // unconditionally include in API requests. By default, fields with
  25056. // empty values are omitted from API requests. However, any non-pointer,
  25057. // non-interface field appearing in ForceSendFields will be sent to the
  25058. // server regardless of whether the field is empty or not. This may be
  25059. // used to include empty fields in Patch requests.
  25060. ForceSendFields []string `json:"-"`
  25061. // NullFields is a list of field names (e.g. "Id") to include in API
  25062. // requests with the JSON null value. By default, fields with empty
  25063. // values are omitted from API requests. However, any field with an
  25064. // empty value appearing in NullFields will be sent to the server as
  25065. // null. It is an error if a field in this list has a non-empty value.
  25066. // This may be used to include null fields in Patch requests.
  25067. NullFields []string `json:"-"`
  25068. }
  25069. func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
  25070. type NoMethod VpnTunnelAggregatedList
  25071. raw := NoMethod(*s)
  25072. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25073. }
  25074. // VpnTunnelAggregatedListWarning: [Output Only] Informational warning
  25075. // message.
  25076. type VpnTunnelAggregatedListWarning struct {
  25077. // Code: [Output Only] A warning code, if applicable. For example,
  25078. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25079. // the response.
  25080. //
  25081. // Possible values:
  25082. // "CLEANUP_FAILED"
  25083. // "DEPRECATED_RESOURCE_USED"
  25084. // "DEPRECATED_TYPE_USED"
  25085. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25086. // "EXPERIMENTAL_TYPE_USED"
  25087. // "EXTERNAL_API_WARNING"
  25088. // "FIELD_VALUE_OVERRIDEN"
  25089. // "INJECTED_KERNELS_DEPRECATED"
  25090. // "MISSING_TYPE_DEPENDENCY"
  25091. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25092. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25093. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25094. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25095. // "NEXT_HOP_NOT_RUNNING"
  25096. // "NOT_CRITICAL_ERROR"
  25097. // "NO_RESULTS_ON_PAGE"
  25098. // "REQUIRED_TOS_AGREEMENT"
  25099. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25100. // "RESOURCE_NOT_DELETED"
  25101. // "SCHEMA_VALIDATION_IGNORED"
  25102. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25103. // "UNDECLARED_PROPERTIES"
  25104. // "UNREACHABLE"
  25105. Code string `json:"code,omitempty"`
  25106. // Data: [Output Only] Metadata about this warning in key: value format.
  25107. // For example:
  25108. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25109. Data []*VpnTunnelAggregatedListWarningData `json:"data,omitempty"`
  25110. // Message: [Output Only] A human-readable description of the warning
  25111. // code.
  25112. Message string `json:"message,omitempty"`
  25113. // ForceSendFields is a list of field names (e.g. "Code") to
  25114. // unconditionally include in API requests. By default, fields with
  25115. // empty values are omitted from API requests. However, any non-pointer,
  25116. // non-interface field appearing in ForceSendFields will be sent to the
  25117. // server regardless of whether the field is empty or not. This may be
  25118. // used to include empty fields in Patch requests.
  25119. ForceSendFields []string `json:"-"`
  25120. // NullFields is a list of field names (e.g. "Code") to include in API
  25121. // requests with the JSON null value. By default, fields with empty
  25122. // values are omitted from API requests. However, any field with an
  25123. // empty value appearing in NullFields will be sent to the server as
  25124. // null. It is an error if a field in this list has a non-empty value.
  25125. // This may be used to include null fields in Patch requests.
  25126. NullFields []string `json:"-"`
  25127. }
  25128. func (s *VpnTunnelAggregatedListWarning) MarshalJSON() ([]byte, error) {
  25129. type NoMethod VpnTunnelAggregatedListWarning
  25130. raw := NoMethod(*s)
  25131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25132. }
  25133. type VpnTunnelAggregatedListWarningData struct {
  25134. // Key: [Output Only] A key that provides more detail on the warning
  25135. // being returned. For example, for warnings where there are no results
  25136. // in a list request for a particular zone, this key might be scope and
  25137. // the key value might be the zone name. Other examples might be a key
  25138. // indicating a deprecated resource and a suggested replacement, or a
  25139. // warning about invalid network settings (for example, if an instance
  25140. // attempts to perform IP forwarding but is not enabled for IP
  25141. // forwarding).
  25142. Key string `json:"key,omitempty"`
  25143. // Value: [Output Only] A warning data value corresponding to the key.
  25144. Value string `json:"value,omitempty"`
  25145. // ForceSendFields is a list of field names (e.g. "Key") to
  25146. // unconditionally include in API requests. By default, fields with
  25147. // empty values are omitted from API requests. However, any non-pointer,
  25148. // non-interface field appearing in ForceSendFields will be sent to the
  25149. // server regardless of whether the field is empty or not. This may be
  25150. // used to include empty fields in Patch requests.
  25151. ForceSendFields []string `json:"-"`
  25152. // NullFields is a list of field names (e.g. "Key") to include in API
  25153. // requests with the JSON null value. By default, fields with empty
  25154. // values are omitted from API requests. However, any field with an
  25155. // empty value appearing in NullFields will be sent to the server as
  25156. // null. It is an error if a field in this list has a non-empty value.
  25157. // This may be used to include null fields in Patch requests.
  25158. NullFields []string `json:"-"`
  25159. }
  25160. func (s *VpnTunnelAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  25161. type NoMethod VpnTunnelAggregatedListWarningData
  25162. raw := NoMethod(*s)
  25163. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25164. }
  25165. // VpnTunnelList: Contains a list of VpnTunnel resources.
  25166. type VpnTunnelList struct {
  25167. // Id: [Output Only] Unique identifier for the resource; defined by the
  25168. // server.
  25169. Id string `json:"id,omitempty"`
  25170. // Items: A list of VpnTunnel resources.
  25171. Items []*VpnTunnel `json:"items,omitempty"`
  25172. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  25173. // VPN tunnels.
  25174. Kind string `json:"kind,omitempty"`
  25175. // NextPageToken: [Output Only] This token allows you to get the next
  25176. // page of results for list requests. If the number of results is larger
  25177. // than maxResults, use the nextPageToken as a value for the query
  25178. // parameter pageToken in the next list request. Subsequent list
  25179. // requests will have their own nextPageToken to continue paging through
  25180. // the results.
  25181. NextPageToken string `json:"nextPageToken,omitempty"`
  25182. // SelfLink: [Output Only] Server-defined URL for this resource.
  25183. SelfLink string `json:"selfLink,omitempty"`
  25184. // Warning: [Output Only] Informational warning message.
  25185. Warning *VpnTunnelListWarning `json:"warning,omitempty"`
  25186. // ServerResponse contains the HTTP response code and headers from the
  25187. // server.
  25188. googleapi.ServerResponse `json:"-"`
  25189. // ForceSendFields is a list of field names (e.g. "Id") to
  25190. // unconditionally include in API requests. By default, fields with
  25191. // empty values are omitted from API requests. However, any non-pointer,
  25192. // non-interface field appearing in ForceSendFields will be sent to the
  25193. // server regardless of whether the field is empty or not. This may be
  25194. // used to include empty fields in Patch requests.
  25195. ForceSendFields []string `json:"-"`
  25196. // NullFields is a list of field names (e.g. "Id") to include in API
  25197. // requests with the JSON null value. By default, fields with empty
  25198. // values are omitted from API requests. However, any field with an
  25199. // empty value appearing in NullFields will be sent to the server as
  25200. // null. It is an error if a field in this list has a non-empty value.
  25201. // This may be used to include null fields in Patch requests.
  25202. NullFields []string `json:"-"`
  25203. }
  25204. func (s *VpnTunnelList) MarshalJSON() ([]byte, error) {
  25205. type NoMethod VpnTunnelList
  25206. raw := NoMethod(*s)
  25207. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25208. }
  25209. // VpnTunnelListWarning: [Output Only] Informational warning message.
  25210. type VpnTunnelListWarning struct {
  25211. // Code: [Output Only] A warning code, if applicable. For example,
  25212. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25213. // the response.
  25214. //
  25215. // Possible values:
  25216. // "CLEANUP_FAILED"
  25217. // "DEPRECATED_RESOURCE_USED"
  25218. // "DEPRECATED_TYPE_USED"
  25219. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25220. // "EXPERIMENTAL_TYPE_USED"
  25221. // "EXTERNAL_API_WARNING"
  25222. // "FIELD_VALUE_OVERRIDEN"
  25223. // "INJECTED_KERNELS_DEPRECATED"
  25224. // "MISSING_TYPE_DEPENDENCY"
  25225. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25226. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25227. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25228. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25229. // "NEXT_HOP_NOT_RUNNING"
  25230. // "NOT_CRITICAL_ERROR"
  25231. // "NO_RESULTS_ON_PAGE"
  25232. // "REQUIRED_TOS_AGREEMENT"
  25233. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25234. // "RESOURCE_NOT_DELETED"
  25235. // "SCHEMA_VALIDATION_IGNORED"
  25236. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25237. // "UNDECLARED_PROPERTIES"
  25238. // "UNREACHABLE"
  25239. Code string `json:"code,omitempty"`
  25240. // Data: [Output Only] Metadata about this warning in key: value format.
  25241. // For example:
  25242. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25243. Data []*VpnTunnelListWarningData `json:"data,omitempty"`
  25244. // Message: [Output Only] A human-readable description of the warning
  25245. // code.
  25246. Message string `json:"message,omitempty"`
  25247. // ForceSendFields is a list of field names (e.g. "Code") to
  25248. // unconditionally include in API requests. By default, fields with
  25249. // empty values are omitted from API requests. However, any non-pointer,
  25250. // non-interface field appearing in ForceSendFields will be sent to the
  25251. // server regardless of whether the field is empty or not. This may be
  25252. // used to include empty fields in Patch requests.
  25253. ForceSendFields []string `json:"-"`
  25254. // NullFields is a list of field names (e.g. "Code") to include in API
  25255. // requests with the JSON null value. By default, fields with empty
  25256. // values are omitted from API requests. However, any field with an
  25257. // empty value appearing in NullFields will be sent to the server as
  25258. // null. It is an error if a field in this list has a non-empty value.
  25259. // This may be used to include null fields in Patch requests.
  25260. NullFields []string `json:"-"`
  25261. }
  25262. func (s *VpnTunnelListWarning) MarshalJSON() ([]byte, error) {
  25263. type NoMethod VpnTunnelListWarning
  25264. raw := NoMethod(*s)
  25265. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25266. }
  25267. type VpnTunnelListWarningData struct {
  25268. // Key: [Output Only] A key that provides more detail on the warning
  25269. // being returned. For example, for warnings where there are no results
  25270. // in a list request for a particular zone, this key might be scope and
  25271. // the key value might be the zone name. Other examples might be a key
  25272. // indicating a deprecated resource and a suggested replacement, or a
  25273. // warning about invalid network settings (for example, if an instance
  25274. // attempts to perform IP forwarding but is not enabled for IP
  25275. // forwarding).
  25276. Key string `json:"key,omitempty"`
  25277. // Value: [Output Only] A warning data value corresponding to the key.
  25278. Value string `json:"value,omitempty"`
  25279. // ForceSendFields is a list of field names (e.g. "Key") to
  25280. // unconditionally include in API requests. By default, fields with
  25281. // empty values are omitted from API requests. However, any non-pointer,
  25282. // non-interface field appearing in ForceSendFields will be sent to the
  25283. // server regardless of whether the field is empty or not. This may be
  25284. // used to include empty fields in Patch requests.
  25285. ForceSendFields []string `json:"-"`
  25286. // NullFields is a list of field names (e.g. "Key") to include in API
  25287. // requests with the JSON null value. By default, fields with empty
  25288. // values are omitted from API requests. However, any field with an
  25289. // empty value appearing in NullFields will be sent to the server as
  25290. // null. It is an error if a field in this list has a non-empty value.
  25291. // This may be used to include null fields in Patch requests.
  25292. NullFields []string `json:"-"`
  25293. }
  25294. func (s *VpnTunnelListWarningData) MarshalJSON() ([]byte, error) {
  25295. type NoMethod VpnTunnelListWarningData
  25296. raw := NoMethod(*s)
  25297. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25298. }
  25299. type VpnTunnelsScopedList struct {
  25300. // VpnTunnels: A list of VPN tunnels contained in this scope.
  25301. VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"`
  25302. // Warning: Informational warning which replaces the list of addresses
  25303. // when the list is empty.
  25304. Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"`
  25305. // ForceSendFields is a list of field names (e.g. "VpnTunnels") to
  25306. // unconditionally include in API requests. By default, fields with
  25307. // empty values are omitted from API requests. However, any non-pointer,
  25308. // non-interface field appearing in ForceSendFields will be sent to the
  25309. // server regardless of whether the field is empty or not. This may be
  25310. // used to include empty fields in Patch requests.
  25311. ForceSendFields []string `json:"-"`
  25312. // NullFields is a list of field names (e.g. "VpnTunnels") to include in
  25313. // API requests with the JSON null value. By default, fields with empty
  25314. // values are omitted from API requests. However, any field with an
  25315. // empty value appearing in NullFields will be sent to the server as
  25316. // null. It is an error if a field in this list has a non-empty value.
  25317. // This may be used to include null fields in Patch requests.
  25318. NullFields []string `json:"-"`
  25319. }
  25320. func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
  25321. type NoMethod VpnTunnelsScopedList
  25322. raw := NoMethod(*s)
  25323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25324. }
  25325. // VpnTunnelsScopedListWarning: Informational warning which replaces the
  25326. // list of addresses when the list is empty.
  25327. type VpnTunnelsScopedListWarning struct {
  25328. // Code: [Output Only] A warning code, if applicable. For example,
  25329. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25330. // the response.
  25331. //
  25332. // Possible values:
  25333. // "CLEANUP_FAILED"
  25334. // "DEPRECATED_RESOURCE_USED"
  25335. // "DEPRECATED_TYPE_USED"
  25336. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25337. // "EXPERIMENTAL_TYPE_USED"
  25338. // "EXTERNAL_API_WARNING"
  25339. // "FIELD_VALUE_OVERRIDEN"
  25340. // "INJECTED_KERNELS_DEPRECATED"
  25341. // "MISSING_TYPE_DEPENDENCY"
  25342. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25343. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25344. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25345. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25346. // "NEXT_HOP_NOT_RUNNING"
  25347. // "NOT_CRITICAL_ERROR"
  25348. // "NO_RESULTS_ON_PAGE"
  25349. // "REQUIRED_TOS_AGREEMENT"
  25350. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25351. // "RESOURCE_NOT_DELETED"
  25352. // "SCHEMA_VALIDATION_IGNORED"
  25353. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25354. // "UNDECLARED_PROPERTIES"
  25355. // "UNREACHABLE"
  25356. Code string `json:"code,omitempty"`
  25357. // Data: [Output Only] Metadata about this warning in key: value format.
  25358. // For example:
  25359. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25360. Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"`
  25361. // Message: [Output Only] A human-readable description of the warning
  25362. // code.
  25363. Message string `json:"message,omitempty"`
  25364. // ForceSendFields is a list of field names (e.g. "Code") to
  25365. // unconditionally include in API requests. By default, fields with
  25366. // empty values are omitted from API requests. However, any non-pointer,
  25367. // non-interface field appearing in ForceSendFields will be sent to the
  25368. // server regardless of whether the field is empty or not. This may be
  25369. // used to include empty fields in Patch requests.
  25370. ForceSendFields []string `json:"-"`
  25371. // NullFields is a list of field names (e.g. "Code") to include in API
  25372. // requests with the JSON null value. By default, fields with empty
  25373. // values are omitted from API requests. However, any field with an
  25374. // empty value appearing in NullFields will be sent to the server as
  25375. // null. It is an error if a field in this list has a non-empty value.
  25376. // This may be used to include null fields in Patch requests.
  25377. NullFields []string `json:"-"`
  25378. }
  25379. func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
  25380. type NoMethod VpnTunnelsScopedListWarning
  25381. raw := NoMethod(*s)
  25382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25383. }
  25384. type VpnTunnelsScopedListWarningData struct {
  25385. // Key: [Output Only] A key that provides more detail on the warning
  25386. // being returned. For example, for warnings where there are no results
  25387. // in a list request for a particular zone, this key might be scope and
  25388. // the key value might be the zone name. Other examples might be a key
  25389. // indicating a deprecated resource and a suggested replacement, or a
  25390. // warning about invalid network settings (for example, if an instance
  25391. // attempts to perform IP forwarding but is not enabled for IP
  25392. // forwarding).
  25393. Key string `json:"key,omitempty"`
  25394. // Value: [Output Only] A warning data value corresponding to the key.
  25395. Value string `json:"value,omitempty"`
  25396. // ForceSendFields is a list of field names (e.g. "Key") to
  25397. // unconditionally include in API requests. By default, fields with
  25398. // empty values are omitted from API requests. However, any non-pointer,
  25399. // non-interface field appearing in ForceSendFields will be sent to the
  25400. // server regardless of whether the field is empty or not. This may be
  25401. // used to include empty fields in Patch requests.
  25402. ForceSendFields []string `json:"-"`
  25403. // NullFields is a list of field names (e.g. "Key") to include in API
  25404. // requests with the JSON null value. By default, fields with empty
  25405. // values are omitted from API requests. However, any field with an
  25406. // empty value appearing in NullFields will be sent to the server as
  25407. // null. It is an error if a field in this list has a non-empty value.
  25408. // This may be used to include null fields in Patch requests.
  25409. NullFields []string `json:"-"`
  25410. }
  25411. func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
  25412. type NoMethod VpnTunnelsScopedListWarningData
  25413. raw := NoMethod(*s)
  25414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25415. }
  25416. type XpnHostList struct {
  25417. // Id: [Output Only] Unique identifier for the resource; defined by the
  25418. // server.
  25419. Id string `json:"id,omitempty"`
  25420. // Items: [Output Only] A list of shared VPC host project URLs.
  25421. Items []*Project `json:"items,omitempty"`
  25422. // Kind: [Output Only] Type of resource. Always compute#xpnHostList for
  25423. // lists of shared VPC hosts.
  25424. Kind string `json:"kind,omitempty"`
  25425. // NextPageToken: [Output Only] This token allows you to get the next
  25426. // page of results for list requests. If the number of results is larger
  25427. // than maxResults, use the nextPageToken as a value for the query
  25428. // parameter pageToken in the next list request. Subsequent list
  25429. // requests will have their own nextPageToken to continue paging through
  25430. // the results.
  25431. NextPageToken string `json:"nextPageToken,omitempty"`
  25432. // SelfLink: [Output Only] Server-defined URL for this resource.
  25433. SelfLink string `json:"selfLink,omitempty"`
  25434. // Warning: [Output Only] Informational warning message.
  25435. Warning *XpnHostListWarning `json:"warning,omitempty"`
  25436. // ServerResponse contains the HTTP response code and headers from the
  25437. // server.
  25438. googleapi.ServerResponse `json:"-"`
  25439. // ForceSendFields is a list of field names (e.g. "Id") to
  25440. // unconditionally include in API requests. By default, fields with
  25441. // empty values are omitted from API requests. However, any non-pointer,
  25442. // non-interface field appearing in ForceSendFields will be sent to the
  25443. // server regardless of whether the field is empty or not. This may be
  25444. // used to include empty fields in Patch requests.
  25445. ForceSendFields []string `json:"-"`
  25446. // NullFields is a list of field names (e.g. "Id") to include in API
  25447. // requests with the JSON null value. By default, fields with empty
  25448. // values are omitted from API requests. However, any field with an
  25449. // empty value appearing in NullFields will be sent to the server as
  25450. // null. It is an error if a field in this list has a non-empty value.
  25451. // This may be used to include null fields in Patch requests.
  25452. NullFields []string `json:"-"`
  25453. }
  25454. func (s *XpnHostList) MarshalJSON() ([]byte, error) {
  25455. type NoMethod XpnHostList
  25456. raw := NoMethod(*s)
  25457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25458. }
  25459. // XpnHostListWarning: [Output Only] Informational warning message.
  25460. type XpnHostListWarning struct {
  25461. // Code: [Output Only] A warning code, if applicable. For example,
  25462. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25463. // the response.
  25464. //
  25465. // Possible values:
  25466. // "CLEANUP_FAILED"
  25467. // "DEPRECATED_RESOURCE_USED"
  25468. // "DEPRECATED_TYPE_USED"
  25469. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25470. // "EXPERIMENTAL_TYPE_USED"
  25471. // "EXTERNAL_API_WARNING"
  25472. // "FIELD_VALUE_OVERRIDEN"
  25473. // "INJECTED_KERNELS_DEPRECATED"
  25474. // "MISSING_TYPE_DEPENDENCY"
  25475. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25476. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25477. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25478. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25479. // "NEXT_HOP_NOT_RUNNING"
  25480. // "NOT_CRITICAL_ERROR"
  25481. // "NO_RESULTS_ON_PAGE"
  25482. // "REQUIRED_TOS_AGREEMENT"
  25483. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25484. // "RESOURCE_NOT_DELETED"
  25485. // "SCHEMA_VALIDATION_IGNORED"
  25486. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25487. // "UNDECLARED_PROPERTIES"
  25488. // "UNREACHABLE"
  25489. Code string `json:"code,omitempty"`
  25490. // Data: [Output Only] Metadata about this warning in key: value format.
  25491. // For example:
  25492. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25493. Data []*XpnHostListWarningData `json:"data,omitempty"`
  25494. // Message: [Output Only] A human-readable description of the warning
  25495. // code.
  25496. Message string `json:"message,omitempty"`
  25497. // ForceSendFields is a list of field names (e.g. "Code") to
  25498. // unconditionally include in API requests. By default, fields with
  25499. // empty values are omitted from API requests. However, any non-pointer,
  25500. // non-interface field appearing in ForceSendFields will be sent to the
  25501. // server regardless of whether the field is empty or not. This may be
  25502. // used to include empty fields in Patch requests.
  25503. ForceSendFields []string `json:"-"`
  25504. // NullFields is a list of field names (e.g. "Code") to include in API
  25505. // requests with the JSON null value. By default, fields with empty
  25506. // values are omitted from API requests. However, any field with an
  25507. // empty value appearing in NullFields will be sent to the server as
  25508. // null. It is an error if a field in this list has a non-empty value.
  25509. // This may be used to include null fields in Patch requests.
  25510. NullFields []string `json:"-"`
  25511. }
  25512. func (s *XpnHostListWarning) MarshalJSON() ([]byte, error) {
  25513. type NoMethod XpnHostListWarning
  25514. raw := NoMethod(*s)
  25515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25516. }
  25517. type XpnHostListWarningData struct {
  25518. // Key: [Output Only] A key that provides more detail on the warning
  25519. // being returned. For example, for warnings where there are no results
  25520. // in a list request for a particular zone, this key might be scope and
  25521. // the key value might be the zone name. Other examples might be a key
  25522. // indicating a deprecated resource and a suggested replacement, or a
  25523. // warning about invalid network settings (for example, if an instance
  25524. // attempts to perform IP forwarding but is not enabled for IP
  25525. // forwarding).
  25526. Key string `json:"key,omitempty"`
  25527. // Value: [Output Only] A warning data value corresponding to the key.
  25528. Value string `json:"value,omitempty"`
  25529. // ForceSendFields is a list of field names (e.g. "Key") to
  25530. // unconditionally include in API requests. By default, fields with
  25531. // empty values are omitted from API requests. However, any non-pointer,
  25532. // non-interface field appearing in ForceSendFields will be sent to the
  25533. // server regardless of whether the field is empty or not. This may be
  25534. // used to include empty fields in Patch requests.
  25535. ForceSendFields []string `json:"-"`
  25536. // NullFields is a list of field names (e.g. "Key") to include in API
  25537. // requests with the JSON null value. By default, fields with empty
  25538. // values are omitted from API requests. However, any field with an
  25539. // empty value appearing in NullFields will be sent to the server as
  25540. // null. It is an error if a field in this list has a non-empty value.
  25541. // This may be used to include null fields in Patch requests.
  25542. NullFields []string `json:"-"`
  25543. }
  25544. func (s *XpnHostListWarningData) MarshalJSON() ([]byte, error) {
  25545. type NoMethod XpnHostListWarningData
  25546. raw := NoMethod(*s)
  25547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25548. }
  25549. // XpnResourceId: Service resource (a.k.a service project) ID.
  25550. type XpnResourceId struct {
  25551. // Id: The ID of the service resource. In the case of projects, this
  25552. // field supports project id (e.g., my-project-123) and project number
  25553. // (e.g. 12345678).
  25554. Id string `json:"id,omitempty"`
  25555. // Type: The type of the service resource.
  25556. //
  25557. // Possible values:
  25558. // "PROJECT"
  25559. // "XPN_RESOURCE_TYPE_UNSPECIFIED"
  25560. Type string `json:"type,omitempty"`
  25561. // ForceSendFields is a list of field names (e.g. "Id") to
  25562. // unconditionally include in API requests. By default, fields with
  25563. // empty values are omitted from API requests. However, any non-pointer,
  25564. // non-interface field appearing in ForceSendFields will be sent to the
  25565. // server regardless of whether the field is empty or not. This may be
  25566. // used to include empty fields in Patch requests.
  25567. ForceSendFields []string `json:"-"`
  25568. // NullFields is a list of field names (e.g. "Id") to include in API
  25569. // requests with the JSON null value. By default, fields with empty
  25570. // values are omitted from API requests. However, any field with an
  25571. // empty value appearing in NullFields will be sent to the server as
  25572. // null. It is an error if a field in this list has a non-empty value.
  25573. // This may be used to include null fields in Patch requests.
  25574. NullFields []string `json:"-"`
  25575. }
  25576. func (s *XpnResourceId) MarshalJSON() ([]byte, error) {
  25577. type NoMethod XpnResourceId
  25578. raw := NoMethod(*s)
  25579. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25580. }
  25581. // Zone: A Zone resource. (== resource_for beta.zones ==) (==
  25582. // resource_for v1.zones ==)
  25583. type Zone struct {
  25584. // AvailableCpuPlatforms: [Output Only] Available cpu/platform
  25585. // selections for the zone.
  25586. AvailableCpuPlatforms []string `json:"availableCpuPlatforms,omitempty"`
  25587. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  25588. // format.
  25589. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  25590. // Deprecated: [Output Only] The deprecation status associated with this
  25591. // zone.
  25592. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  25593. // Description: [Output Only] Textual description of the resource.
  25594. Description string `json:"description,omitempty"`
  25595. // Id: [Output Only] The unique identifier for the resource. This
  25596. // identifier is defined by the server.
  25597. Id uint64 `json:"id,omitempty,string"`
  25598. // Kind: [Output Only] Type of the resource. Always compute#zone for
  25599. // zones.
  25600. Kind string `json:"kind,omitempty"`
  25601. // Name: [Output Only] Name of the resource.
  25602. Name string `json:"name,omitempty"`
  25603. // Region: [Output Only] Full URL reference to the region which hosts
  25604. // the zone.
  25605. Region string `json:"region,omitempty"`
  25606. // SelfLink: [Output Only] Server-defined URL for the resource.
  25607. SelfLink string `json:"selfLink,omitempty"`
  25608. // Status: [Output Only] Status of the zone, either UP or DOWN.
  25609. //
  25610. // Possible values:
  25611. // "DOWN"
  25612. // "UP"
  25613. Status string `json:"status,omitempty"`
  25614. // ServerResponse contains the HTTP response code and headers from the
  25615. // server.
  25616. googleapi.ServerResponse `json:"-"`
  25617. // ForceSendFields is a list of field names (e.g.
  25618. // "AvailableCpuPlatforms") to unconditionally include in API requests.
  25619. // By default, fields with empty values are omitted from API requests.
  25620. // However, any non-pointer, non-interface field appearing in
  25621. // ForceSendFields will be sent to the server regardless of whether the
  25622. // field is empty or not. This may be used to include empty fields in
  25623. // Patch requests.
  25624. ForceSendFields []string `json:"-"`
  25625. // NullFields is a list of field names (e.g. "AvailableCpuPlatforms") to
  25626. // include in API requests with the JSON null value. By default, fields
  25627. // with empty values are omitted from API requests. However, any field
  25628. // with an empty value appearing in NullFields will be sent to the
  25629. // server as null. It is an error if a field in this list has a
  25630. // non-empty value. This may be used to include null fields in Patch
  25631. // requests.
  25632. NullFields []string `json:"-"`
  25633. }
  25634. func (s *Zone) MarshalJSON() ([]byte, error) {
  25635. type NoMethod Zone
  25636. raw := NoMethod(*s)
  25637. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25638. }
  25639. // ZoneList: Contains a list of zone resources.
  25640. type ZoneList struct {
  25641. // Id: [Output Only] Unique identifier for the resource; defined by the
  25642. // server.
  25643. Id string `json:"id,omitempty"`
  25644. // Items: A list of Zone resources.
  25645. Items []*Zone `json:"items,omitempty"`
  25646. // Kind: Type of resource.
  25647. Kind string `json:"kind,omitempty"`
  25648. // NextPageToken: [Output Only] This token allows you to get the next
  25649. // page of results for list requests. If the number of results is larger
  25650. // than maxResults, use the nextPageToken as a value for the query
  25651. // parameter pageToken in the next list request. Subsequent list
  25652. // requests will have their own nextPageToken to continue paging through
  25653. // the results.
  25654. NextPageToken string `json:"nextPageToken,omitempty"`
  25655. // SelfLink: [Output Only] Server-defined URL for this resource.
  25656. SelfLink string `json:"selfLink,omitempty"`
  25657. // Warning: [Output Only] Informational warning message.
  25658. Warning *ZoneListWarning `json:"warning,omitempty"`
  25659. // ServerResponse contains the HTTP response code and headers from the
  25660. // server.
  25661. googleapi.ServerResponse `json:"-"`
  25662. // ForceSendFields is a list of field names (e.g. "Id") to
  25663. // unconditionally include in API requests. By default, fields with
  25664. // empty values are omitted from API requests. However, any non-pointer,
  25665. // non-interface field appearing in ForceSendFields will be sent to the
  25666. // server regardless of whether the field is empty or not. This may be
  25667. // used to include empty fields in Patch requests.
  25668. ForceSendFields []string `json:"-"`
  25669. // NullFields is a list of field names (e.g. "Id") to include in API
  25670. // requests with the JSON null value. By default, fields with empty
  25671. // values are omitted from API requests. However, any field with an
  25672. // empty value appearing in NullFields will be sent to the server as
  25673. // null. It is an error if a field in this list has a non-empty value.
  25674. // This may be used to include null fields in Patch requests.
  25675. NullFields []string `json:"-"`
  25676. }
  25677. func (s *ZoneList) MarshalJSON() ([]byte, error) {
  25678. type NoMethod ZoneList
  25679. raw := NoMethod(*s)
  25680. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25681. }
  25682. // ZoneListWarning: [Output Only] Informational warning message.
  25683. type ZoneListWarning struct {
  25684. // Code: [Output Only] A warning code, if applicable. For example,
  25685. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25686. // the response.
  25687. //
  25688. // Possible values:
  25689. // "CLEANUP_FAILED"
  25690. // "DEPRECATED_RESOURCE_USED"
  25691. // "DEPRECATED_TYPE_USED"
  25692. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25693. // "EXPERIMENTAL_TYPE_USED"
  25694. // "EXTERNAL_API_WARNING"
  25695. // "FIELD_VALUE_OVERRIDEN"
  25696. // "INJECTED_KERNELS_DEPRECATED"
  25697. // "MISSING_TYPE_DEPENDENCY"
  25698. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25699. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25700. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25701. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25702. // "NEXT_HOP_NOT_RUNNING"
  25703. // "NOT_CRITICAL_ERROR"
  25704. // "NO_RESULTS_ON_PAGE"
  25705. // "REQUIRED_TOS_AGREEMENT"
  25706. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25707. // "RESOURCE_NOT_DELETED"
  25708. // "SCHEMA_VALIDATION_IGNORED"
  25709. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25710. // "UNDECLARED_PROPERTIES"
  25711. // "UNREACHABLE"
  25712. Code string `json:"code,omitempty"`
  25713. // Data: [Output Only] Metadata about this warning in key: value format.
  25714. // For example:
  25715. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25716. Data []*ZoneListWarningData `json:"data,omitempty"`
  25717. // Message: [Output Only] A human-readable description of the warning
  25718. // code.
  25719. Message string `json:"message,omitempty"`
  25720. // ForceSendFields is a list of field names (e.g. "Code") to
  25721. // unconditionally include in API requests. By default, fields with
  25722. // empty values are omitted from API requests. However, any non-pointer,
  25723. // non-interface field appearing in ForceSendFields will be sent to the
  25724. // server regardless of whether the field is empty or not. This may be
  25725. // used to include empty fields in Patch requests.
  25726. ForceSendFields []string `json:"-"`
  25727. // NullFields is a list of field names (e.g. "Code") to include in API
  25728. // requests with the JSON null value. By default, fields with empty
  25729. // values are omitted from API requests. However, any field with an
  25730. // empty value appearing in NullFields will be sent to the server as
  25731. // null. It is an error if a field in this list has a non-empty value.
  25732. // This may be used to include null fields in Patch requests.
  25733. NullFields []string `json:"-"`
  25734. }
  25735. func (s *ZoneListWarning) MarshalJSON() ([]byte, error) {
  25736. type NoMethod ZoneListWarning
  25737. raw := NoMethod(*s)
  25738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25739. }
  25740. type ZoneListWarningData struct {
  25741. // Key: [Output Only] A key that provides more detail on the warning
  25742. // being returned. For example, for warnings where there are no results
  25743. // in a list request for a particular zone, this key might be scope and
  25744. // the key value might be the zone name. Other examples might be a key
  25745. // indicating a deprecated resource and a suggested replacement, or a
  25746. // warning about invalid network settings (for example, if an instance
  25747. // attempts to perform IP forwarding but is not enabled for IP
  25748. // forwarding).
  25749. Key string `json:"key,omitempty"`
  25750. // Value: [Output Only] A warning data value corresponding to the key.
  25751. Value string `json:"value,omitempty"`
  25752. // ForceSendFields is a list of field names (e.g. "Key") to
  25753. // unconditionally include in API requests. By default, fields with
  25754. // empty values are omitted from API requests. However, any non-pointer,
  25755. // non-interface field appearing in ForceSendFields will be sent to the
  25756. // server regardless of whether the field is empty or not. This may be
  25757. // used to include empty fields in Patch requests.
  25758. ForceSendFields []string `json:"-"`
  25759. // NullFields is a list of field names (e.g. "Key") to include in API
  25760. // requests with the JSON null value. By default, fields with empty
  25761. // values are omitted from API requests. However, any field with an
  25762. // empty value appearing in NullFields will be sent to the server as
  25763. // null. It is an error if a field in this list has a non-empty value.
  25764. // This may be used to include null fields in Patch requests.
  25765. NullFields []string `json:"-"`
  25766. }
  25767. func (s *ZoneListWarningData) MarshalJSON() ([]byte, error) {
  25768. type NoMethod ZoneListWarningData
  25769. raw := NoMethod(*s)
  25770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25771. }
  25772. type ZoneSetLabelsRequest struct {
  25773. // LabelFingerprint: The fingerprint of the previous set of labels for
  25774. // this resource, used to detect conflicts. The fingerprint is initially
  25775. // generated by Compute Engine and changes after every request to modify
  25776. // or update labels. You must always provide an up-to-date fingerprint
  25777. // hash in order to update or change labels. Make a get() request to the
  25778. // resource to get the latest fingerprint.
  25779. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  25780. // Labels: The labels to set for this resource.
  25781. Labels map[string]string `json:"labels,omitempty"`
  25782. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  25783. // unconditionally include in API requests. By default, fields with
  25784. // empty values are omitted from API requests. However, any non-pointer,
  25785. // non-interface field appearing in ForceSendFields will be sent to the
  25786. // server regardless of whether the field is empty or not. This may be
  25787. // used to include empty fields in Patch requests.
  25788. ForceSendFields []string `json:"-"`
  25789. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  25790. // include in API requests with the JSON null value. By default, fields
  25791. // with empty values are omitted from API requests. However, any field
  25792. // with an empty value appearing in NullFields will be sent to the
  25793. // server as null. It is an error if a field in this list has a
  25794. // non-empty value. This may be used to include null fields in Patch
  25795. // requests.
  25796. NullFields []string `json:"-"`
  25797. }
  25798. func (s *ZoneSetLabelsRequest) MarshalJSON() ([]byte, error) {
  25799. type NoMethod ZoneSetLabelsRequest
  25800. raw := NoMethod(*s)
  25801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25802. }
  25803. type ZoneSetPolicyRequest struct {
  25804. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  25805. // Deprecated. Use 'policy' to specify bindings.
  25806. Bindings []*Binding `json:"bindings,omitempty"`
  25807. // Etag: Flatten Policy to create a backward compatible wire-format.
  25808. // Deprecated. Use 'policy' to specify the etag.
  25809. Etag string `json:"etag,omitempty"`
  25810. // Policy: REQUIRED: The complete policy to be applied to the
  25811. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  25812. // empty policy is in general a valid policy but certain services (like
  25813. // Projects) might reject them.
  25814. Policy *Policy `json:"policy,omitempty"`
  25815. // ForceSendFields is a list of field names (e.g. "Bindings") to
  25816. // unconditionally include in API requests. By default, fields with
  25817. // empty values are omitted from API requests. However, any non-pointer,
  25818. // non-interface field appearing in ForceSendFields will be sent to the
  25819. // server regardless of whether the field is empty or not. This may be
  25820. // used to include empty fields in Patch requests.
  25821. ForceSendFields []string `json:"-"`
  25822. // NullFields is a list of field names (e.g. "Bindings") to include in
  25823. // API requests with the JSON null value. By default, fields with empty
  25824. // values are omitted from API requests. However, any field with an
  25825. // empty value appearing in NullFields will be sent to the server as
  25826. // null. It is an error if a field in this list has a non-empty value.
  25827. // This may be used to include null fields in Patch requests.
  25828. NullFields []string `json:"-"`
  25829. }
  25830. func (s *ZoneSetPolicyRequest) MarshalJSON() ([]byte, error) {
  25831. type NoMethod ZoneSetPolicyRequest
  25832. raw := NoMethod(*s)
  25833. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25834. }
  25835. // method id "compute.acceleratorTypes.aggregatedList":
  25836. type AcceleratorTypesAggregatedListCall struct {
  25837. s *Service
  25838. project string
  25839. urlParams_ gensupport.URLParams
  25840. ifNoneMatch_ string
  25841. ctx_ context.Context
  25842. header_ http.Header
  25843. }
  25844. // AggregatedList: Retrieves an aggregated list of accelerator types.
  25845. func (r *AcceleratorTypesService) AggregatedList(project string) *AcceleratorTypesAggregatedListCall {
  25846. c := &AcceleratorTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25847. c.project = project
  25848. return c
  25849. }
  25850. // Filter sets the optional parameter "filter": A filter expression that
  25851. // filters resources listed in the response. The expression must specify
  25852. // the field name, a comparison operator, and the value that you want to
  25853. // use for filtering. The value must be a string, a number, or a
  25854. // boolean. The comparison operator must be either =, !=, >, or <.
  25855. //
  25856. // For example, if you are filtering Compute Engine instances, you can
  25857. // exclude instances named example-instance by specifying name !=
  25858. // example-instance.
  25859. //
  25860. // You can also filter nested fields. For example, you could specify
  25861. // scheduling.automaticRestart = false to include instances only if they
  25862. // are not scheduled for automatic restarts. You can use filtering on
  25863. // nested fields to filter based on resource labels.
  25864. //
  25865. // To filter on multiple expressions, provide each separate expression
  25866. // within parentheses. For example, (scheduling.automaticRestart = true)
  25867. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  25868. // AND expression. However, you can include AND and OR expressions
  25869. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  25870. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  25871. // true).
  25872. func (c *AcceleratorTypesAggregatedListCall) Filter(filter string) *AcceleratorTypesAggregatedListCall {
  25873. c.urlParams_.Set("filter", filter)
  25874. return c
  25875. }
  25876. // MaxResults sets the optional parameter "maxResults": The maximum
  25877. // number of results per page that should be returned. If the number of
  25878. // available results is larger than maxResults, Compute Engine returns a
  25879. // nextPageToken that can be used to get the next page of results in
  25880. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  25881. // (Default: 500)
  25882. func (c *AcceleratorTypesAggregatedListCall) MaxResults(maxResults int64) *AcceleratorTypesAggregatedListCall {
  25883. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25884. return c
  25885. }
  25886. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  25887. // a certain order. By default, results are returned in alphanumerical
  25888. // order based on the resource name.
  25889. //
  25890. // You can also sort results in descending order based on the creation
  25891. // timestamp using orderBy="creationTimestamp desc". This sorts results
  25892. // based on the creationTimestamp field in reverse chronological order
  25893. // (newest result first). Use this to sort resources like operations so
  25894. // that the newest operation is returned first.
  25895. //
  25896. // Currently, only sorting by name or creationTimestamp desc is
  25897. // supported.
  25898. func (c *AcceleratorTypesAggregatedListCall) OrderBy(orderBy string) *AcceleratorTypesAggregatedListCall {
  25899. c.urlParams_.Set("orderBy", orderBy)
  25900. return c
  25901. }
  25902. // PageToken sets the optional parameter "pageToken": Specifies a page
  25903. // token to use. Set pageToken to the nextPageToken returned by a
  25904. // previous list request to get the next page of results.
  25905. func (c *AcceleratorTypesAggregatedListCall) PageToken(pageToken string) *AcceleratorTypesAggregatedListCall {
  25906. c.urlParams_.Set("pageToken", pageToken)
  25907. return c
  25908. }
  25909. // Fields allows partial responses to be retrieved. See
  25910. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25911. // for more information.
  25912. func (c *AcceleratorTypesAggregatedListCall) Fields(s ...googleapi.Field) *AcceleratorTypesAggregatedListCall {
  25913. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25914. return c
  25915. }
  25916. // IfNoneMatch sets the optional parameter which makes the operation
  25917. // fail if the object's ETag matches the given value. This is useful for
  25918. // getting updates only after the object has changed since the last
  25919. // request. Use googleapi.IsNotModified to check whether the response
  25920. // error from Do is the result of In-None-Match.
  25921. func (c *AcceleratorTypesAggregatedListCall) IfNoneMatch(entityTag string) *AcceleratorTypesAggregatedListCall {
  25922. c.ifNoneMatch_ = entityTag
  25923. return c
  25924. }
  25925. // Context sets the context to be used in this call's Do method. Any
  25926. // pending HTTP request will be aborted if the provided context is
  25927. // canceled.
  25928. func (c *AcceleratorTypesAggregatedListCall) Context(ctx context.Context) *AcceleratorTypesAggregatedListCall {
  25929. c.ctx_ = ctx
  25930. return c
  25931. }
  25932. // Header returns an http.Header that can be modified by the caller to
  25933. // add HTTP headers to the request.
  25934. func (c *AcceleratorTypesAggregatedListCall) Header() http.Header {
  25935. if c.header_ == nil {
  25936. c.header_ = make(http.Header)
  25937. }
  25938. return c.header_
  25939. }
  25940. func (c *AcceleratorTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  25941. reqHeaders := make(http.Header)
  25942. for k, v := range c.header_ {
  25943. reqHeaders[k] = v
  25944. }
  25945. reqHeaders.Set("User-Agent", c.s.userAgent())
  25946. if c.ifNoneMatch_ != "" {
  25947. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25948. }
  25949. var body io.Reader = nil
  25950. c.urlParams_.Set("alt", alt)
  25951. c.urlParams_.Set("prettyPrint", "false")
  25952. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/acceleratorTypes")
  25953. urls += "?" + c.urlParams_.Encode()
  25954. req, err := http.NewRequest("GET", urls, body)
  25955. if err != nil {
  25956. return nil, err
  25957. }
  25958. req.Header = reqHeaders
  25959. googleapi.Expand(req.URL, map[string]string{
  25960. "project": c.project,
  25961. })
  25962. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25963. }
  25964. // Do executes the "compute.acceleratorTypes.aggregatedList" call.
  25965. // Exactly one of *AcceleratorTypeAggregatedList or error will be
  25966. // non-nil. Any non-2xx status code is an error. Response headers are in
  25967. // either *AcceleratorTypeAggregatedList.ServerResponse.Header or (if a
  25968. // response was returned at all) in error.(*googleapi.Error).Header. Use
  25969. // googleapi.IsNotModified to check whether the returned error was
  25970. // because http.StatusNotModified was returned.
  25971. func (c *AcceleratorTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeAggregatedList, error) {
  25972. gensupport.SetOptions(c.urlParams_, opts...)
  25973. res, err := c.doRequest("json")
  25974. if res != nil && res.StatusCode == http.StatusNotModified {
  25975. if res.Body != nil {
  25976. res.Body.Close()
  25977. }
  25978. return nil, &googleapi.Error{
  25979. Code: res.StatusCode,
  25980. Header: res.Header,
  25981. }
  25982. }
  25983. if err != nil {
  25984. return nil, err
  25985. }
  25986. defer googleapi.CloseBody(res)
  25987. if err := googleapi.CheckResponse(res); err != nil {
  25988. return nil, err
  25989. }
  25990. ret := &AcceleratorTypeAggregatedList{
  25991. ServerResponse: googleapi.ServerResponse{
  25992. Header: res.Header,
  25993. HTTPStatusCode: res.StatusCode,
  25994. },
  25995. }
  25996. target := &ret
  25997. if err := gensupport.DecodeResponse(target, res); err != nil {
  25998. return nil, err
  25999. }
  26000. return ret, nil
  26001. // {
  26002. // "description": "Retrieves an aggregated list of accelerator types.",
  26003. // "httpMethod": "GET",
  26004. // "id": "compute.acceleratorTypes.aggregatedList",
  26005. // "parameterOrder": [
  26006. // "project"
  26007. // ],
  26008. // "parameters": {
  26009. // "filter": {
  26010. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  26011. // "location": "query",
  26012. // "type": "string"
  26013. // },
  26014. // "maxResults": {
  26015. // "default": "500",
  26016. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  26017. // "format": "uint32",
  26018. // "location": "query",
  26019. // "minimum": "0",
  26020. // "type": "integer"
  26021. // },
  26022. // "orderBy": {
  26023. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  26024. // "location": "query",
  26025. // "type": "string"
  26026. // },
  26027. // "pageToken": {
  26028. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  26029. // "location": "query",
  26030. // "type": "string"
  26031. // },
  26032. // "project": {
  26033. // "description": "Project ID for this request.",
  26034. // "location": "path",
  26035. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26036. // "required": true,
  26037. // "type": "string"
  26038. // }
  26039. // },
  26040. // "path": "{project}/aggregated/acceleratorTypes",
  26041. // "response": {
  26042. // "$ref": "AcceleratorTypeAggregatedList"
  26043. // },
  26044. // "scopes": [
  26045. // "https://www.googleapis.com/auth/cloud-platform",
  26046. // "https://www.googleapis.com/auth/compute",
  26047. // "https://www.googleapis.com/auth/compute.readonly"
  26048. // ]
  26049. // }
  26050. }
  26051. // Pages invokes f for each page of results.
  26052. // A non-nil error returned from f will halt the iteration.
  26053. // The provided context supersedes any context provided to the Context method.
  26054. func (c *AcceleratorTypesAggregatedListCall) Pages(ctx context.Context, f func(*AcceleratorTypeAggregatedList) error) error {
  26055. c.ctx_ = ctx
  26056. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26057. for {
  26058. x, err := c.Do()
  26059. if err != nil {
  26060. return err
  26061. }
  26062. if err := f(x); err != nil {
  26063. return err
  26064. }
  26065. if x.NextPageToken == "" {
  26066. return nil
  26067. }
  26068. c.PageToken(x.NextPageToken)
  26069. }
  26070. }
  26071. // method id "compute.acceleratorTypes.get":
  26072. type AcceleratorTypesGetCall struct {
  26073. s *Service
  26074. project string
  26075. zone string
  26076. acceleratorType string
  26077. urlParams_ gensupport.URLParams
  26078. ifNoneMatch_ string
  26079. ctx_ context.Context
  26080. header_ http.Header
  26081. }
  26082. // Get: Returns the specified accelerator type.
  26083. func (r *AcceleratorTypesService) Get(project string, zone string, acceleratorType string) *AcceleratorTypesGetCall {
  26084. c := &AcceleratorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26085. c.project = project
  26086. c.zone = zone
  26087. c.acceleratorType = acceleratorType
  26088. return c
  26089. }
  26090. // Fields allows partial responses to be retrieved. See
  26091. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26092. // for more information.
  26093. func (c *AcceleratorTypesGetCall) Fields(s ...googleapi.Field) *AcceleratorTypesGetCall {
  26094. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26095. return c
  26096. }
  26097. // IfNoneMatch sets the optional parameter which makes the operation
  26098. // fail if the object's ETag matches the given value. This is useful for
  26099. // getting updates only after the object has changed since the last
  26100. // request. Use googleapi.IsNotModified to check whether the response
  26101. // error from Do is the result of In-None-Match.
  26102. func (c *AcceleratorTypesGetCall) IfNoneMatch(entityTag string) *AcceleratorTypesGetCall {
  26103. c.ifNoneMatch_ = entityTag
  26104. return c
  26105. }
  26106. // Context sets the context to be used in this call's Do method. Any
  26107. // pending HTTP request will be aborted if the provided context is
  26108. // canceled.
  26109. func (c *AcceleratorTypesGetCall) Context(ctx context.Context) *AcceleratorTypesGetCall {
  26110. c.ctx_ = ctx
  26111. return c
  26112. }
  26113. // Header returns an http.Header that can be modified by the caller to
  26114. // add HTTP headers to the request.
  26115. func (c *AcceleratorTypesGetCall) Header() http.Header {
  26116. if c.header_ == nil {
  26117. c.header_ = make(http.Header)
  26118. }
  26119. return c.header_
  26120. }
  26121. func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) {
  26122. reqHeaders := make(http.Header)
  26123. for k, v := range c.header_ {
  26124. reqHeaders[k] = v
  26125. }
  26126. reqHeaders.Set("User-Agent", c.s.userAgent())
  26127. if c.ifNoneMatch_ != "" {
  26128. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26129. }
  26130. var body io.Reader = nil
  26131. c.urlParams_.Set("alt", alt)
  26132. c.urlParams_.Set("prettyPrint", "false")
  26133. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")
  26134. urls += "?" + c.urlParams_.Encode()
  26135. req, err := http.NewRequest("GET", urls, body)
  26136. if err != nil {
  26137. return nil, err
  26138. }
  26139. req.Header = reqHeaders
  26140. googleapi.Expand(req.URL, map[string]string{
  26141. "project": c.project,
  26142. "zone": c.zone,
  26143. "acceleratorType": c.acceleratorType,
  26144. })
  26145. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26146. }
  26147. // Do executes the "compute.acceleratorTypes.get" call.
  26148. // Exactly one of *AcceleratorType or error will be non-nil. Any non-2xx
  26149. // status code is an error. Response headers are in either
  26150. // *AcceleratorType.ServerResponse.Header or (if a response was returned
  26151. // at all) in error.(*googleapi.Error).Header. Use
  26152. // googleapi.IsNotModified to check whether the returned error was
  26153. // because http.StatusNotModified was returned.
  26154. func (c *AcceleratorTypesGetCall) Do(opts ...googleapi.CallOption) (*AcceleratorType, error) {
  26155. gensupport.SetOptions(c.urlParams_, opts...)
  26156. res, err := c.doRequest("json")
  26157. if res != nil && res.StatusCode == http.StatusNotModified {
  26158. if res.Body != nil {
  26159. res.Body.Close()
  26160. }
  26161. return nil, &googleapi.Error{
  26162. Code: res.StatusCode,
  26163. Header: res.Header,
  26164. }
  26165. }
  26166. if err != nil {
  26167. return nil, err
  26168. }
  26169. defer googleapi.CloseBody(res)
  26170. if err := googleapi.CheckResponse(res); err != nil {
  26171. return nil, err
  26172. }
  26173. ret := &AcceleratorType{
  26174. ServerResponse: googleapi.ServerResponse{
  26175. Header: res.Header,
  26176. HTTPStatusCode: res.StatusCode,
  26177. },
  26178. }
  26179. target := &ret
  26180. if err := gensupport.DecodeResponse(target, res); err != nil {
  26181. return nil, err
  26182. }
  26183. return ret, nil
  26184. // {
  26185. // "description": "Returns the specified accelerator type.",
  26186. // "httpMethod": "GET",
  26187. // "id": "compute.acceleratorTypes.get",
  26188. // "parameterOrder": [
  26189. // "project",
  26190. // "zone",
  26191. // "acceleratorType"
  26192. // ],
  26193. // "parameters": {
  26194. // "acceleratorType": {
  26195. // "description": "Name of the accelerator type to return.",
  26196. // "location": "path",
  26197. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  26198. // "required": true,
  26199. // "type": "string"
  26200. // },
  26201. // "project": {
  26202. // "description": "Project ID for this request.",
  26203. // "location": "path",
  26204. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26205. // "required": true,
  26206. // "type": "string"
  26207. // },
  26208. // "zone": {
  26209. // "description": "The name of the zone for this request.",
  26210. // "location": "path",
  26211. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26212. // "required": true,
  26213. // "type": "string"
  26214. // }
  26215. // },
  26216. // "path": "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}",
  26217. // "response": {
  26218. // "$ref": "AcceleratorType"
  26219. // },
  26220. // "scopes": [
  26221. // "https://www.googleapis.com/auth/cloud-platform",
  26222. // "https://www.googleapis.com/auth/compute",
  26223. // "https://www.googleapis.com/auth/compute.readonly"
  26224. // ]
  26225. // }
  26226. }
  26227. // method id "compute.acceleratorTypes.list":
  26228. type AcceleratorTypesListCall struct {
  26229. s *Service
  26230. project string
  26231. zone string
  26232. urlParams_ gensupport.URLParams
  26233. ifNoneMatch_ string
  26234. ctx_ context.Context
  26235. header_ http.Header
  26236. }
  26237. // List: Retrieves a list of accelerator types available to the
  26238. // specified project.
  26239. func (r *AcceleratorTypesService) List(project string, zone string) *AcceleratorTypesListCall {
  26240. c := &AcceleratorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26241. c.project = project
  26242. c.zone = zone
  26243. return c
  26244. }
  26245. // Filter sets the optional parameter "filter": A filter expression that
  26246. // filters resources listed in the response. The expression must specify
  26247. // the field name, a comparison operator, and the value that you want to
  26248. // use for filtering. The value must be a string, a number, or a
  26249. // boolean. The comparison operator must be either =, !=, >, or <.
  26250. //
  26251. // For example, if you are filtering Compute Engine instances, you can
  26252. // exclude instances named example-instance by specifying name !=
  26253. // example-instance.
  26254. //
  26255. // You can also filter nested fields. For example, you could specify
  26256. // scheduling.automaticRestart = false to include instances only if they
  26257. // are not scheduled for automatic restarts. You can use filtering on
  26258. // nested fields to filter based on resource labels.
  26259. //
  26260. // To filter on multiple expressions, provide each separate expression
  26261. // within parentheses. For example, (scheduling.automaticRestart = true)
  26262. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  26263. // AND expression. However, you can include AND and OR expressions
  26264. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  26265. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  26266. // true).
  26267. func (c *AcceleratorTypesListCall) Filter(filter string) *AcceleratorTypesListCall {
  26268. c.urlParams_.Set("filter", filter)
  26269. return c
  26270. }
  26271. // MaxResults sets the optional parameter "maxResults": The maximum
  26272. // number of results per page that should be returned. If the number of
  26273. // available results is larger than maxResults, Compute Engine returns a
  26274. // nextPageToken that can be used to get the next page of results in
  26275. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  26276. // (Default: 500)
  26277. func (c *AcceleratorTypesListCall) MaxResults(maxResults int64) *AcceleratorTypesListCall {
  26278. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26279. return c
  26280. }
  26281. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  26282. // a certain order. By default, results are returned in alphanumerical
  26283. // order based on the resource name.
  26284. //
  26285. // You can also sort results in descending order based on the creation
  26286. // timestamp using orderBy="creationTimestamp desc". This sorts results
  26287. // based on the creationTimestamp field in reverse chronological order
  26288. // (newest result first). Use this to sort resources like operations so
  26289. // that the newest operation is returned first.
  26290. //
  26291. // Currently, only sorting by name or creationTimestamp desc is
  26292. // supported.
  26293. func (c *AcceleratorTypesListCall) OrderBy(orderBy string) *AcceleratorTypesListCall {
  26294. c.urlParams_.Set("orderBy", orderBy)
  26295. return c
  26296. }
  26297. // PageToken sets the optional parameter "pageToken": Specifies a page
  26298. // token to use. Set pageToken to the nextPageToken returned by a
  26299. // previous list request to get the next page of results.
  26300. func (c *AcceleratorTypesListCall) PageToken(pageToken string) *AcceleratorTypesListCall {
  26301. c.urlParams_.Set("pageToken", pageToken)
  26302. return c
  26303. }
  26304. // Fields allows partial responses to be retrieved. See
  26305. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26306. // for more information.
  26307. func (c *AcceleratorTypesListCall) Fields(s ...googleapi.Field) *AcceleratorTypesListCall {
  26308. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26309. return c
  26310. }
  26311. // IfNoneMatch sets the optional parameter which makes the operation
  26312. // fail if the object's ETag matches the given value. This is useful for
  26313. // getting updates only after the object has changed since the last
  26314. // request. Use googleapi.IsNotModified to check whether the response
  26315. // error from Do is the result of In-None-Match.
  26316. func (c *AcceleratorTypesListCall) IfNoneMatch(entityTag string) *AcceleratorTypesListCall {
  26317. c.ifNoneMatch_ = entityTag
  26318. return c
  26319. }
  26320. // Context sets the context to be used in this call's Do method. Any
  26321. // pending HTTP request will be aborted if the provided context is
  26322. // canceled.
  26323. func (c *AcceleratorTypesListCall) Context(ctx context.Context) *AcceleratorTypesListCall {
  26324. c.ctx_ = ctx
  26325. return c
  26326. }
  26327. // Header returns an http.Header that can be modified by the caller to
  26328. // add HTTP headers to the request.
  26329. func (c *AcceleratorTypesListCall) Header() http.Header {
  26330. if c.header_ == nil {
  26331. c.header_ = make(http.Header)
  26332. }
  26333. return c.header_
  26334. }
  26335. func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) {
  26336. reqHeaders := make(http.Header)
  26337. for k, v := range c.header_ {
  26338. reqHeaders[k] = v
  26339. }
  26340. reqHeaders.Set("User-Agent", c.s.userAgent())
  26341. if c.ifNoneMatch_ != "" {
  26342. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26343. }
  26344. var body io.Reader = nil
  26345. c.urlParams_.Set("alt", alt)
  26346. c.urlParams_.Set("prettyPrint", "false")
  26347. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes")
  26348. urls += "?" + c.urlParams_.Encode()
  26349. req, err := http.NewRequest("GET", urls, body)
  26350. if err != nil {
  26351. return nil, err
  26352. }
  26353. req.Header = reqHeaders
  26354. googleapi.Expand(req.URL, map[string]string{
  26355. "project": c.project,
  26356. "zone": c.zone,
  26357. })
  26358. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26359. }
  26360. // Do executes the "compute.acceleratorTypes.list" call.
  26361. // Exactly one of *AcceleratorTypeList or error will be non-nil. Any
  26362. // non-2xx status code is an error. Response headers are in either
  26363. // *AcceleratorTypeList.ServerResponse.Header or (if a response was
  26364. // returned at all) in error.(*googleapi.Error).Header. Use
  26365. // googleapi.IsNotModified to check whether the returned error was
  26366. // because http.StatusNotModified was returned.
  26367. func (c *AcceleratorTypesListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeList, error) {
  26368. gensupport.SetOptions(c.urlParams_, opts...)
  26369. res, err := c.doRequest("json")
  26370. if res != nil && res.StatusCode == http.StatusNotModified {
  26371. if res.Body != nil {
  26372. res.Body.Close()
  26373. }
  26374. return nil, &googleapi.Error{
  26375. Code: res.StatusCode,
  26376. Header: res.Header,
  26377. }
  26378. }
  26379. if err != nil {
  26380. return nil, err
  26381. }
  26382. defer googleapi.CloseBody(res)
  26383. if err := googleapi.CheckResponse(res); err != nil {
  26384. return nil, err
  26385. }
  26386. ret := &AcceleratorTypeList{
  26387. ServerResponse: googleapi.ServerResponse{
  26388. Header: res.Header,
  26389. HTTPStatusCode: res.StatusCode,
  26390. },
  26391. }
  26392. target := &ret
  26393. if err := gensupport.DecodeResponse(target, res); err != nil {
  26394. return nil, err
  26395. }
  26396. return ret, nil
  26397. // {
  26398. // "description": "Retrieves a list of accelerator types available to the specified project.",
  26399. // "httpMethod": "GET",
  26400. // "id": "compute.acceleratorTypes.list",
  26401. // "parameterOrder": [
  26402. // "project",
  26403. // "zone"
  26404. // ],
  26405. // "parameters": {
  26406. // "filter": {
  26407. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  26408. // "location": "query",
  26409. // "type": "string"
  26410. // },
  26411. // "maxResults": {
  26412. // "default": "500",
  26413. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  26414. // "format": "uint32",
  26415. // "location": "query",
  26416. // "minimum": "0",
  26417. // "type": "integer"
  26418. // },
  26419. // "orderBy": {
  26420. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  26421. // "location": "query",
  26422. // "type": "string"
  26423. // },
  26424. // "pageToken": {
  26425. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  26426. // "location": "query",
  26427. // "type": "string"
  26428. // },
  26429. // "project": {
  26430. // "description": "Project ID for this request.",
  26431. // "location": "path",
  26432. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26433. // "required": true,
  26434. // "type": "string"
  26435. // },
  26436. // "zone": {
  26437. // "description": "The name of the zone for this request.",
  26438. // "location": "path",
  26439. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26440. // "required": true,
  26441. // "type": "string"
  26442. // }
  26443. // },
  26444. // "path": "{project}/zones/{zone}/acceleratorTypes",
  26445. // "response": {
  26446. // "$ref": "AcceleratorTypeList"
  26447. // },
  26448. // "scopes": [
  26449. // "https://www.googleapis.com/auth/cloud-platform",
  26450. // "https://www.googleapis.com/auth/compute",
  26451. // "https://www.googleapis.com/auth/compute.readonly"
  26452. // ]
  26453. // }
  26454. }
  26455. // Pages invokes f for each page of results.
  26456. // A non-nil error returned from f will halt the iteration.
  26457. // The provided context supersedes any context provided to the Context method.
  26458. func (c *AcceleratorTypesListCall) Pages(ctx context.Context, f func(*AcceleratorTypeList) error) error {
  26459. c.ctx_ = ctx
  26460. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26461. for {
  26462. x, err := c.Do()
  26463. if err != nil {
  26464. return err
  26465. }
  26466. if err := f(x); err != nil {
  26467. return err
  26468. }
  26469. if x.NextPageToken == "" {
  26470. return nil
  26471. }
  26472. c.PageToken(x.NextPageToken)
  26473. }
  26474. }
  26475. // method id "compute.addresses.aggregatedList":
  26476. type AddressesAggregatedListCall struct {
  26477. s *Service
  26478. project string
  26479. urlParams_ gensupport.URLParams
  26480. ifNoneMatch_ string
  26481. ctx_ context.Context
  26482. header_ http.Header
  26483. }
  26484. // AggregatedList: Retrieves an aggregated list of addresses.
  26485. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList
  26486. func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
  26487. c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26488. c.project = project
  26489. return c
  26490. }
  26491. // Filter sets the optional parameter "filter": A filter expression that
  26492. // filters resources listed in the response. The expression must specify
  26493. // the field name, a comparison operator, and the value that you want to
  26494. // use for filtering. The value must be a string, a number, or a
  26495. // boolean. The comparison operator must be either =, !=, >, or <.
  26496. //
  26497. // For example, if you are filtering Compute Engine instances, you can
  26498. // exclude instances named example-instance by specifying name !=
  26499. // example-instance.
  26500. //
  26501. // You can also filter nested fields. For example, you could specify
  26502. // scheduling.automaticRestart = false to include instances only if they
  26503. // are not scheduled for automatic restarts. You can use filtering on
  26504. // nested fields to filter based on resource labels.
  26505. //
  26506. // To filter on multiple expressions, provide each separate expression
  26507. // within parentheses. For example, (scheduling.automaticRestart = true)
  26508. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  26509. // AND expression. However, you can include AND and OR expressions
  26510. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  26511. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  26512. // true).
  26513. func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
  26514. c.urlParams_.Set("filter", filter)
  26515. return c
  26516. }
  26517. // MaxResults sets the optional parameter "maxResults": The maximum
  26518. // number of results per page that should be returned. If the number of
  26519. // available results is larger than maxResults, Compute Engine returns a
  26520. // nextPageToken that can be used to get the next page of results in
  26521. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  26522. // (Default: 500)
  26523. func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
  26524. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26525. return c
  26526. }
  26527. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  26528. // a certain order. By default, results are returned in alphanumerical
  26529. // order based on the resource name.
  26530. //
  26531. // You can also sort results in descending order based on the creation
  26532. // timestamp using orderBy="creationTimestamp desc". This sorts results
  26533. // based on the creationTimestamp field in reverse chronological order
  26534. // (newest result first). Use this to sort resources like operations so
  26535. // that the newest operation is returned first.
  26536. //
  26537. // Currently, only sorting by name or creationTimestamp desc is
  26538. // supported.
  26539. func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall {
  26540. c.urlParams_.Set("orderBy", orderBy)
  26541. return c
  26542. }
  26543. // PageToken sets the optional parameter "pageToken": Specifies a page
  26544. // token to use. Set pageToken to the nextPageToken returned by a
  26545. // previous list request to get the next page of results.
  26546. func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
  26547. c.urlParams_.Set("pageToken", pageToken)
  26548. return c
  26549. }
  26550. // Fields allows partial responses to be retrieved. See
  26551. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26552. // for more information.
  26553. func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
  26554. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26555. return c
  26556. }
  26557. // IfNoneMatch sets the optional parameter which makes the operation
  26558. // fail if the object's ETag matches the given value. This is useful for
  26559. // getting updates only after the object has changed since the last
  26560. // request. Use googleapi.IsNotModified to check whether the response
  26561. // error from Do is the result of In-None-Match.
  26562. func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
  26563. c.ifNoneMatch_ = entityTag
  26564. return c
  26565. }
  26566. // Context sets the context to be used in this call's Do method. Any
  26567. // pending HTTP request will be aborted if the provided context is
  26568. // canceled.
  26569. func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
  26570. c.ctx_ = ctx
  26571. return c
  26572. }
  26573. // Header returns an http.Header that can be modified by the caller to
  26574. // add HTTP headers to the request.
  26575. func (c *AddressesAggregatedListCall) Header() http.Header {
  26576. if c.header_ == nil {
  26577. c.header_ = make(http.Header)
  26578. }
  26579. return c.header_
  26580. }
  26581. func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  26582. reqHeaders := make(http.Header)
  26583. for k, v := range c.header_ {
  26584. reqHeaders[k] = v
  26585. }
  26586. reqHeaders.Set("User-Agent", c.s.userAgent())
  26587. if c.ifNoneMatch_ != "" {
  26588. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26589. }
  26590. var body io.Reader = nil
  26591. c.urlParams_.Set("alt", alt)
  26592. c.urlParams_.Set("prettyPrint", "false")
  26593. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses")
  26594. urls += "?" + c.urlParams_.Encode()
  26595. req, err := http.NewRequest("GET", urls, body)
  26596. if err != nil {
  26597. return nil, err
  26598. }
  26599. req.Header = reqHeaders
  26600. googleapi.Expand(req.URL, map[string]string{
  26601. "project": c.project,
  26602. })
  26603. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26604. }
  26605. // Do executes the "compute.addresses.aggregatedList" call.
  26606. // Exactly one of *AddressAggregatedList or error will be non-nil. Any
  26607. // non-2xx status code is an error. Response headers are in either
  26608. // *AddressAggregatedList.ServerResponse.Header or (if a response was
  26609. // returned at all) in error.(*googleapi.Error).Header. Use
  26610. // googleapi.IsNotModified to check whether the returned error was
  26611. // because http.StatusNotModified was returned.
  26612. func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, error) {
  26613. gensupport.SetOptions(c.urlParams_, opts...)
  26614. res, err := c.doRequest("json")
  26615. if res != nil && res.StatusCode == http.StatusNotModified {
  26616. if res.Body != nil {
  26617. res.Body.Close()
  26618. }
  26619. return nil, &googleapi.Error{
  26620. Code: res.StatusCode,
  26621. Header: res.Header,
  26622. }
  26623. }
  26624. if err != nil {
  26625. return nil, err
  26626. }
  26627. defer googleapi.CloseBody(res)
  26628. if err := googleapi.CheckResponse(res); err != nil {
  26629. return nil, err
  26630. }
  26631. ret := &AddressAggregatedList{
  26632. ServerResponse: googleapi.ServerResponse{
  26633. Header: res.Header,
  26634. HTTPStatusCode: res.StatusCode,
  26635. },
  26636. }
  26637. target := &ret
  26638. if err := gensupport.DecodeResponse(target, res); err != nil {
  26639. return nil, err
  26640. }
  26641. return ret, nil
  26642. // {
  26643. // "description": "Retrieves an aggregated list of addresses.",
  26644. // "httpMethod": "GET",
  26645. // "id": "compute.addresses.aggregatedList",
  26646. // "parameterOrder": [
  26647. // "project"
  26648. // ],
  26649. // "parameters": {
  26650. // "filter": {
  26651. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  26652. // "location": "query",
  26653. // "type": "string"
  26654. // },
  26655. // "maxResults": {
  26656. // "default": "500",
  26657. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  26658. // "format": "uint32",
  26659. // "location": "query",
  26660. // "minimum": "0",
  26661. // "type": "integer"
  26662. // },
  26663. // "orderBy": {
  26664. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  26665. // "location": "query",
  26666. // "type": "string"
  26667. // },
  26668. // "pageToken": {
  26669. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  26670. // "location": "query",
  26671. // "type": "string"
  26672. // },
  26673. // "project": {
  26674. // "description": "Project ID for this request.",
  26675. // "location": "path",
  26676. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26677. // "required": true,
  26678. // "type": "string"
  26679. // }
  26680. // },
  26681. // "path": "{project}/aggregated/addresses",
  26682. // "response": {
  26683. // "$ref": "AddressAggregatedList"
  26684. // },
  26685. // "scopes": [
  26686. // "https://www.googleapis.com/auth/cloud-platform",
  26687. // "https://www.googleapis.com/auth/compute",
  26688. // "https://www.googleapis.com/auth/compute.readonly"
  26689. // ]
  26690. // }
  26691. }
  26692. // Pages invokes f for each page of results.
  26693. // A non-nil error returned from f will halt the iteration.
  26694. // The provided context supersedes any context provided to the Context method.
  26695. func (c *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error {
  26696. c.ctx_ = ctx
  26697. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26698. for {
  26699. x, err := c.Do()
  26700. if err != nil {
  26701. return err
  26702. }
  26703. if err := f(x); err != nil {
  26704. return err
  26705. }
  26706. if x.NextPageToken == "" {
  26707. return nil
  26708. }
  26709. c.PageToken(x.NextPageToken)
  26710. }
  26711. }
  26712. // method id "compute.addresses.delete":
  26713. type AddressesDeleteCall struct {
  26714. s *Service
  26715. project string
  26716. region string
  26717. address string
  26718. urlParams_ gensupport.URLParams
  26719. ctx_ context.Context
  26720. header_ http.Header
  26721. }
  26722. // Delete: Deletes the specified address resource.
  26723. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete
  26724. func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
  26725. c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26726. c.project = project
  26727. c.region = region
  26728. c.address = address
  26729. return c
  26730. }
  26731. // RequestId sets the optional parameter "requestId": An optional
  26732. // request ID to identify requests. Specify a unique request ID so that
  26733. // if you must retry your request, the server will know to ignore the
  26734. // request if it has already been completed.
  26735. //
  26736. // For example, consider a situation where you make an initial request
  26737. // and the request times out. If you make the request again with the
  26738. // same request ID, the server can check if original operation with the
  26739. // same request ID was received, and if so, will ignore the second
  26740. // request. This prevents clients from accidentally creating duplicate
  26741. // commitments.
  26742. //
  26743. // The request ID must be a valid UUID with the exception that zero UUID
  26744. // is not supported (00000000-0000-0000-0000-000000000000).
  26745. func (c *AddressesDeleteCall) RequestId(requestId string) *AddressesDeleteCall {
  26746. c.urlParams_.Set("requestId", requestId)
  26747. return c
  26748. }
  26749. // Fields allows partial responses to be retrieved. See
  26750. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26751. // for more information.
  26752. func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
  26753. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26754. return c
  26755. }
  26756. // Context sets the context to be used in this call's Do method. Any
  26757. // pending HTTP request will be aborted if the provided context is
  26758. // canceled.
  26759. func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
  26760. c.ctx_ = ctx
  26761. return c
  26762. }
  26763. // Header returns an http.Header that can be modified by the caller to
  26764. // add HTTP headers to the request.
  26765. func (c *AddressesDeleteCall) Header() http.Header {
  26766. if c.header_ == nil {
  26767. c.header_ = make(http.Header)
  26768. }
  26769. return c.header_
  26770. }
  26771. func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  26772. reqHeaders := make(http.Header)
  26773. for k, v := range c.header_ {
  26774. reqHeaders[k] = v
  26775. }
  26776. reqHeaders.Set("User-Agent", c.s.userAgent())
  26777. var body io.Reader = nil
  26778. c.urlParams_.Set("alt", alt)
  26779. c.urlParams_.Set("prettyPrint", "false")
  26780. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  26781. urls += "?" + c.urlParams_.Encode()
  26782. req, err := http.NewRequest("DELETE", urls, body)
  26783. if err != nil {
  26784. return nil, err
  26785. }
  26786. req.Header = reqHeaders
  26787. googleapi.Expand(req.URL, map[string]string{
  26788. "project": c.project,
  26789. "region": c.region,
  26790. "address": c.address,
  26791. })
  26792. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26793. }
  26794. // Do executes the "compute.addresses.delete" call.
  26795. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26796. // status code is an error. Response headers are in either
  26797. // *Operation.ServerResponse.Header or (if a response was returned at
  26798. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26799. // to check whether the returned error was because
  26800. // http.StatusNotModified was returned.
  26801. func (c *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26802. gensupport.SetOptions(c.urlParams_, opts...)
  26803. res, err := c.doRequest("json")
  26804. if res != nil && res.StatusCode == http.StatusNotModified {
  26805. if res.Body != nil {
  26806. res.Body.Close()
  26807. }
  26808. return nil, &googleapi.Error{
  26809. Code: res.StatusCode,
  26810. Header: res.Header,
  26811. }
  26812. }
  26813. if err != nil {
  26814. return nil, err
  26815. }
  26816. defer googleapi.CloseBody(res)
  26817. if err := googleapi.CheckResponse(res); err != nil {
  26818. return nil, err
  26819. }
  26820. ret := &Operation{
  26821. ServerResponse: googleapi.ServerResponse{
  26822. Header: res.Header,
  26823. HTTPStatusCode: res.StatusCode,
  26824. },
  26825. }
  26826. target := &ret
  26827. if err := gensupport.DecodeResponse(target, res); err != nil {
  26828. return nil, err
  26829. }
  26830. return ret, nil
  26831. // {
  26832. // "description": "Deletes the specified address resource.",
  26833. // "httpMethod": "DELETE",
  26834. // "id": "compute.addresses.delete",
  26835. // "parameterOrder": [
  26836. // "project",
  26837. // "region",
  26838. // "address"
  26839. // ],
  26840. // "parameters": {
  26841. // "address": {
  26842. // "description": "Name of the address resource to delete.",
  26843. // "location": "path",
  26844. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  26845. // "required": true,
  26846. // "type": "string"
  26847. // },
  26848. // "project": {
  26849. // "description": "Project ID for this request.",
  26850. // "location": "path",
  26851. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26852. // "required": true,
  26853. // "type": "string"
  26854. // },
  26855. // "region": {
  26856. // "description": "Name of the region for this request.",
  26857. // "location": "path",
  26858. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26859. // "required": true,
  26860. // "type": "string"
  26861. // },
  26862. // "requestId": {
  26863. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  26864. // "location": "query",
  26865. // "type": "string"
  26866. // }
  26867. // },
  26868. // "path": "{project}/regions/{region}/addresses/{address}",
  26869. // "response": {
  26870. // "$ref": "Operation"
  26871. // },
  26872. // "scopes": [
  26873. // "https://www.googleapis.com/auth/cloud-platform",
  26874. // "https://www.googleapis.com/auth/compute"
  26875. // ]
  26876. // }
  26877. }
  26878. // method id "compute.addresses.get":
  26879. type AddressesGetCall struct {
  26880. s *Service
  26881. project string
  26882. region string
  26883. address string
  26884. urlParams_ gensupport.URLParams
  26885. ifNoneMatch_ string
  26886. ctx_ context.Context
  26887. header_ http.Header
  26888. }
  26889. // Get: Returns the specified address resource.
  26890. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get
  26891. func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
  26892. c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26893. c.project = project
  26894. c.region = region
  26895. c.address = address
  26896. return c
  26897. }
  26898. // Fields allows partial responses to be retrieved. See
  26899. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26900. // for more information.
  26901. func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
  26902. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26903. return c
  26904. }
  26905. // IfNoneMatch sets the optional parameter which makes the operation
  26906. // fail if the object's ETag matches the given value. This is useful for
  26907. // getting updates only after the object has changed since the last
  26908. // request. Use googleapi.IsNotModified to check whether the response
  26909. // error from Do is the result of In-None-Match.
  26910. func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
  26911. c.ifNoneMatch_ = entityTag
  26912. return c
  26913. }
  26914. // Context sets the context to be used in this call's Do method. Any
  26915. // pending HTTP request will be aborted if the provided context is
  26916. // canceled.
  26917. func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
  26918. c.ctx_ = ctx
  26919. return c
  26920. }
  26921. // Header returns an http.Header that can be modified by the caller to
  26922. // add HTTP headers to the request.
  26923. func (c *AddressesGetCall) Header() http.Header {
  26924. if c.header_ == nil {
  26925. c.header_ = make(http.Header)
  26926. }
  26927. return c.header_
  26928. }
  26929. func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
  26930. reqHeaders := make(http.Header)
  26931. for k, v := range c.header_ {
  26932. reqHeaders[k] = v
  26933. }
  26934. reqHeaders.Set("User-Agent", c.s.userAgent())
  26935. if c.ifNoneMatch_ != "" {
  26936. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26937. }
  26938. var body io.Reader = nil
  26939. c.urlParams_.Set("alt", alt)
  26940. c.urlParams_.Set("prettyPrint", "false")
  26941. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  26942. urls += "?" + c.urlParams_.Encode()
  26943. req, err := http.NewRequest("GET", urls, body)
  26944. if err != nil {
  26945. return nil, err
  26946. }
  26947. req.Header = reqHeaders
  26948. googleapi.Expand(req.URL, map[string]string{
  26949. "project": c.project,
  26950. "region": c.region,
  26951. "address": c.address,
  26952. })
  26953. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26954. }
  26955. // Do executes the "compute.addresses.get" call.
  26956. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  26957. // code is an error. Response headers are in either
  26958. // *Address.ServerResponse.Header or (if a response was returned at all)
  26959. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  26960. // check whether the returned error was because http.StatusNotModified
  26961. // was returned.
  26962. func (c *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  26963. gensupport.SetOptions(c.urlParams_, opts...)
  26964. res, err := c.doRequest("json")
  26965. if res != nil && res.StatusCode == http.StatusNotModified {
  26966. if res.Body != nil {
  26967. res.Body.Close()
  26968. }
  26969. return nil, &googleapi.Error{
  26970. Code: res.StatusCode,
  26971. Header: res.Header,
  26972. }
  26973. }
  26974. if err != nil {
  26975. return nil, err
  26976. }
  26977. defer googleapi.CloseBody(res)
  26978. if err := googleapi.CheckResponse(res); err != nil {
  26979. return nil, err
  26980. }
  26981. ret := &Address{
  26982. ServerResponse: googleapi.ServerResponse{
  26983. Header: res.Header,
  26984. HTTPStatusCode: res.StatusCode,
  26985. },
  26986. }
  26987. target := &ret
  26988. if err := gensupport.DecodeResponse(target, res); err != nil {
  26989. return nil, err
  26990. }
  26991. return ret, nil
  26992. // {
  26993. // "description": "Returns the specified address resource.",
  26994. // "httpMethod": "GET",
  26995. // "id": "compute.addresses.get",
  26996. // "parameterOrder": [
  26997. // "project",
  26998. // "region",
  26999. // "address"
  27000. // ],
  27001. // "parameters": {
  27002. // "address": {
  27003. // "description": "Name of the address resource to return.",
  27004. // "location": "path",
  27005. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  27006. // "required": true,
  27007. // "type": "string"
  27008. // },
  27009. // "project": {
  27010. // "description": "Project ID for this request.",
  27011. // "location": "path",
  27012. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27013. // "required": true,
  27014. // "type": "string"
  27015. // },
  27016. // "region": {
  27017. // "description": "Name of the region for this request.",
  27018. // "location": "path",
  27019. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27020. // "required": true,
  27021. // "type": "string"
  27022. // }
  27023. // },
  27024. // "path": "{project}/regions/{region}/addresses/{address}",
  27025. // "response": {
  27026. // "$ref": "Address"
  27027. // },
  27028. // "scopes": [
  27029. // "https://www.googleapis.com/auth/cloud-platform",
  27030. // "https://www.googleapis.com/auth/compute",
  27031. // "https://www.googleapis.com/auth/compute.readonly"
  27032. // ]
  27033. // }
  27034. }
  27035. // method id "compute.addresses.insert":
  27036. type AddressesInsertCall struct {
  27037. s *Service
  27038. project string
  27039. region string
  27040. address *Address
  27041. urlParams_ gensupport.URLParams
  27042. ctx_ context.Context
  27043. header_ http.Header
  27044. }
  27045. // Insert: Creates an address resource in the specified project using
  27046. // the data included in the request.
  27047. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert
  27048. func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
  27049. c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27050. c.project = project
  27051. c.region = region
  27052. c.address = address
  27053. return c
  27054. }
  27055. // RequestId sets the optional parameter "requestId": An optional
  27056. // request ID to identify requests. Specify a unique request ID so that
  27057. // if you must retry your request, the server will know to ignore the
  27058. // request if it has already been completed.
  27059. //
  27060. // For example, consider a situation where you make an initial request
  27061. // and the request times out. If you make the request again with the
  27062. // same request ID, the server can check if original operation with the
  27063. // same request ID was received, and if so, will ignore the second
  27064. // request. This prevents clients from accidentally creating duplicate
  27065. // commitments.
  27066. //
  27067. // The request ID must be a valid UUID with the exception that zero UUID
  27068. // is not supported (00000000-0000-0000-0000-000000000000).
  27069. func (c *AddressesInsertCall) RequestId(requestId string) *AddressesInsertCall {
  27070. c.urlParams_.Set("requestId", requestId)
  27071. return c
  27072. }
  27073. // Fields allows partial responses to be retrieved. See
  27074. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27075. // for more information.
  27076. func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
  27077. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27078. return c
  27079. }
  27080. // Context sets the context to be used in this call's Do method. Any
  27081. // pending HTTP request will be aborted if the provided context is
  27082. // canceled.
  27083. func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
  27084. c.ctx_ = ctx
  27085. return c
  27086. }
  27087. // Header returns an http.Header that can be modified by the caller to
  27088. // add HTTP headers to the request.
  27089. func (c *AddressesInsertCall) Header() http.Header {
  27090. if c.header_ == nil {
  27091. c.header_ = make(http.Header)
  27092. }
  27093. return c.header_
  27094. }
  27095. func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  27096. reqHeaders := make(http.Header)
  27097. for k, v := range c.header_ {
  27098. reqHeaders[k] = v
  27099. }
  27100. reqHeaders.Set("User-Agent", c.s.userAgent())
  27101. var body io.Reader = nil
  27102. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  27103. if err != nil {
  27104. return nil, err
  27105. }
  27106. reqHeaders.Set("Content-Type", "application/json")
  27107. c.urlParams_.Set("alt", alt)
  27108. c.urlParams_.Set("prettyPrint", "false")
  27109. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  27110. urls += "?" + c.urlParams_.Encode()
  27111. req, err := http.NewRequest("POST", urls, body)
  27112. if err != nil {
  27113. return nil, err
  27114. }
  27115. req.Header = reqHeaders
  27116. googleapi.Expand(req.URL, map[string]string{
  27117. "project": c.project,
  27118. "region": c.region,
  27119. })
  27120. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27121. }
  27122. // Do executes the "compute.addresses.insert" call.
  27123. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27124. // status code is an error. Response headers are in either
  27125. // *Operation.ServerResponse.Header or (if a response was returned at
  27126. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27127. // to check whether the returned error was because
  27128. // http.StatusNotModified was returned.
  27129. func (c *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27130. gensupport.SetOptions(c.urlParams_, opts...)
  27131. res, err := c.doRequest("json")
  27132. if res != nil && res.StatusCode == http.StatusNotModified {
  27133. if res.Body != nil {
  27134. res.Body.Close()
  27135. }
  27136. return nil, &googleapi.Error{
  27137. Code: res.StatusCode,
  27138. Header: res.Header,
  27139. }
  27140. }
  27141. if err != nil {
  27142. return nil, err
  27143. }
  27144. defer googleapi.CloseBody(res)
  27145. if err := googleapi.CheckResponse(res); err != nil {
  27146. return nil, err
  27147. }
  27148. ret := &Operation{
  27149. ServerResponse: googleapi.ServerResponse{
  27150. Header: res.Header,
  27151. HTTPStatusCode: res.StatusCode,
  27152. },
  27153. }
  27154. target := &ret
  27155. if err := gensupport.DecodeResponse(target, res); err != nil {
  27156. return nil, err
  27157. }
  27158. return ret, nil
  27159. // {
  27160. // "description": "Creates an address resource in the specified project using the data included in the request.",
  27161. // "httpMethod": "POST",
  27162. // "id": "compute.addresses.insert",
  27163. // "parameterOrder": [
  27164. // "project",
  27165. // "region"
  27166. // ],
  27167. // "parameters": {
  27168. // "project": {
  27169. // "description": "Project ID for this request.",
  27170. // "location": "path",
  27171. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27172. // "required": true,
  27173. // "type": "string"
  27174. // },
  27175. // "region": {
  27176. // "description": "Name of the region for this request.",
  27177. // "location": "path",
  27178. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27179. // "required": true,
  27180. // "type": "string"
  27181. // },
  27182. // "requestId": {
  27183. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  27184. // "location": "query",
  27185. // "type": "string"
  27186. // }
  27187. // },
  27188. // "path": "{project}/regions/{region}/addresses",
  27189. // "request": {
  27190. // "$ref": "Address"
  27191. // },
  27192. // "response": {
  27193. // "$ref": "Operation"
  27194. // },
  27195. // "scopes": [
  27196. // "https://www.googleapis.com/auth/cloud-platform",
  27197. // "https://www.googleapis.com/auth/compute"
  27198. // ]
  27199. // }
  27200. }
  27201. // method id "compute.addresses.list":
  27202. type AddressesListCall struct {
  27203. s *Service
  27204. project string
  27205. region string
  27206. urlParams_ gensupport.URLParams
  27207. ifNoneMatch_ string
  27208. ctx_ context.Context
  27209. header_ http.Header
  27210. }
  27211. // List: Retrieves a list of addresses contained within the specified
  27212. // region.
  27213. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list
  27214. func (r *AddressesService) List(project string, region string) *AddressesListCall {
  27215. c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27216. c.project = project
  27217. c.region = region
  27218. return c
  27219. }
  27220. // Filter sets the optional parameter "filter": A filter expression that
  27221. // filters resources listed in the response. The expression must specify
  27222. // the field name, a comparison operator, and the value that you want to
  27223. // use for filtering. The value must be a string, a number, or a
  27224. // boolean. The comparison operator must be either =, !=, >, or <.
  27225. //
  27226. // For example, if you are filtering Compute Engine instances, you can
  27227. // exclude instances named example-instance by specifying name !=
  27228. // example-instance.
  27229. //
  27230. // You can also filter nested fields. For example, you could specify
  27231. // scheduling.automaticRestart = false to include instances only if they
  27232. // are not scheduled for automatic restarts. You can use filtering on
  27233. // nested fields to filter based on resource labels.
  27234. //
  27235. // To filter on multiple expressions, provide each separate expression
  27236. // within parentheses. For example, (scheduling.automaticRestart = true)
  27237. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  27238. // AND expression. However, you can include AND and OR expressions
  27239. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  27240. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  27241. // true).
  27242. func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
  27243. c.urlParams_.Set("filter", filter)
  27244. return c
  27245. }
  27246. // MaxResults sets the optional parameter "maxResults": The maximum
  27247. // number of results per page that should be returned. If the number of
  27248. // available results is larger than maxResults, Compute Engine returns a
  27249. // nextPageToken that can be used to get the next page of results in
  27250. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  27251. // (Default: 500)
  27252. func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
  27253. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27254. return c
  27255. }
  27256. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  27257. // a certain order. By default, results are returned in alphanumerical
  27258. // order based on the resource name.
  27259. //
  27260. // You can also sort results in descending order based on the creation
  27261. // timestamp using orderBy="creationTimestamp desc". This sorts results
  27262. // based on the creationTimestamp field in reverse chronological order
  27263. // (newest result first). Use this to sort resources like operations so
  27264. // that the newest operation is returned first.
  27265. //
  27266. // Currently, only sorting by name or creationTimestamp desc is
  27267. // supported.
  27268. func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall {
  27269. c.urlParams_.Set("orderBy", orderBy)
  27270. return c
  27271. }
  27272. // PageToken sets the optional parameter "pageToken": Specifies a page
  27273. // token to use. Set pageToken to the nextPageToken returned by a
  27274. // previous list request to get the next page of results.
  27275. func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
  27276. c.urlParams_.Set("pageToken", pageToken)
  27277. return c
  27278. }
  27279. // Fields allows partial responses to be retrieved. See
  27280. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27281. // for more information.
  27282. func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
  27283. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27284. return c
  27285. }
  27286. // IfNoneMatch sets the optional parameter which makes the operation
  27287. // fail if the object's ETag matches the given value. This is useful for
  27288. // getting updates only after the object has changed since the last
  27289. // request. Use googleapi.IsNotModified to check whether the response
  27290. // error from Do is the result of In-None-Match.
  27291. func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
  27292. c.ifNoneMatch_ = entityTag
  27293. return c
  27294. }
  27295. // Context sets the context to be used in this call's Do method. Any
  27296. // pending HTTP request will be aborted if the provided context is
  27297. // canceled.
  27298. func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
  27299. c.ctx_ = ctx
  27300. return c
  27301. }
  27302. // Header returns an http.Header that can be modified by the caller to
  27303. // add HTTP headers to the request.
  27304. func (c *AddressesListCall) Header() http.Header {
  27305. if c.header_ == nil {
  27306. c.header_ = make(http.Header)
  27307. }
  27308. return c.header_
  27309. }
  27310. func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
  27311. reqHeaders := make(http.Header)
  27312. for k, v := range c.header_ {
  27313. reqHeaders[k] = v
  27314. }
  27315. reqHeaders.Set("User-Agent", c.s.userAgent())
  27316. if c.ifNoneMatch_ != "" {
  27317. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27318. }
  27319. var body io.Reader = nil
  27320. c.urlParams_.Set("alt", alt)
  27321. c.urlParams_.Set("prettyPrint", "false")
  27322. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  27323. urls += "?" + c.urlParams_.Encode()
  27324. req, err := http.NewRequest("GET", urls, body)
  27325. if err != nil {
  27326. return nil, err
  27327. }
  27328. req.Header = reqHeaders
  27329. googleapi.Expand(req.URL, map[string]string{
  27330. "project": c.project,
  27331. "region": c.region,
  27332. })
  27333. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27334. }
  27335. // Do executes the "compute.addresses.list" call.
  27336. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  27337. // status code is an error. Response headers are in either
  27338. // *AddressList.ServerResponse.Header or (if a response was returned at
  27339. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27340. // to check whether the returned error was because
  27341. // http.StatusNotModified was returned.
  27342. func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  27343. gensupport.SetOptions(c.urlParams_, opts...)
  27344. res, err := c.doRequest("json")
  27345. if res != nil && res.StatusCode == http.StatusNotModified {
  27346. if res.Body != nil {
  27347. res.Body.Close()
  27348. }
  27349. return nil, &googleapi.Error{
  27350. Code: res.StatusCode,
  27351. Header: res.Header,
  27352. }
  27353. }
  27354. if err != nil {
  27355. return nil, err
  27356. }
  27357. defer googleapi.CloseBody(res)
  27358. if err := googleapi.CheckResponse(res); err != nil {
  27359. return nil, err
  27360. }
  27361. ret := &AddressList{
  27362. ServerResponse: googleapi.ServerResponse{
  27363. Header: res.Header,
  27364. HTTPStatusCode: res.StatusCode,
  27365. },
  27366. }
  27367. target := &ret
  27368. if err := gensupport.DecodeResponse(target, res); err != nil {
  27369. return nil, err
  27370. }
  27371. return ret, nil
  27372. // {
  27373. // "description": "Retrieves a list of addresses contained within the specified region.",
  27374. // "httpMethod": "GET",
  27375. // "id": "compute.addresses.list",
  27376. // "parameterOrder": [
  27377. // "project",
  27378. // "region"
  27379. // ],
  27380. // "parameters": {
  27381. // "filter": {
  27382. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  27383. // "location": "query",
  27384. // "type": "string"
  27385. // },
  27386. // "maxResults": {
  27387. // "default": "500",
  27388. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  27389. // "format": "uint32",
  27390. // "location": "query",
  27391. // "minimum": "0",
  27392. // "type": "integer"
  27393. // },
  27394. // "orderBy": {
  27395. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  27396. // "location": "query",
  27397. // "type": "string"
  27398. // },
  27399. // "pageToken": {
  27400. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  27401. // "location": "query",
  27402. // "type": "string"
  27403. // },
  27404. // "project": {
  27405. // "description": "Project ID for this request.",
  27406. // "location": "path",
  27407. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27408. // "required": true,
  27409. // "type": "string"
  27410. // },
  27411. // "region": {
  27412. // "description": "Name of the region for this request.",
  27413. // "location": "path",
  27414. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27415. // "required": true,
  27416. // "type": "string"
  27417. // }
  27418. // },
  27419. // "path": "{project}/regions/{region}/addresses",
  27420. // "response": {
  27421. // "$ref": "AddressList"
  27422. // },
  27423. // "scopes": [
  27424. // "https://www.googleapis.com/auth/cloud-platform",
  27425. // "https://www.googleapis.com/auth/compute",
  27426. // "https://www.googleapis.com/auth/compute.readonly"
  27427. // ]
  27428. // }
  27429. }
  27430. // Pages invokes f for each page of results.
  27431. // A non-nil error returned from f will halt the iteration.
  27432. // The provided context supersedes any context provided to the Context method.
  27433. func (c *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  27434. c.ctx_ = ctx
  27435. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27436. for {
  27437. x, err := c.Do()
  27438. if err != nil {
  27439. return err
  27440. }
  27441. if err := f(x); err != nil {
  27442. return err
  27443. }
  27444. if x.NextPageToken == "" {
  27445. return nil
  27446. }
  27447. c.PageToken(x.NextPageToken)
  27448. }
  27449. }
  27450. // method id "compute.autoscalers.aggregatedList":
  27451. type AutoscalersAggregatedListCall struct {
  27452. s *Service
  27453. project string
  27454. urlParams_ gensupport.URLParams
  27455. ifNoneMatch_ string
  27456. ctx_ context.Context
  27457. header_ http.Header
  27458. }
  27459. // AggregatedList: Retrieves an aggregated list of autoscalers.
  27460. func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
  27461. c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27462. c.project = project
  27463. return c
  27464. }
  27465. // Filter sets the optional parameter "filter": A filter expression that
  27466. // filters resources listed in the response. The expression must specify
  27467. // the field name, a comparison operator, and the value that you want to
  27468. // use for filtering. The value must be a string, a number, or a
  27469. // boolean. The comparison operator must be either =, !=, >, or <.
  27470. //
  27471. // For example, if you are filtering Compute Engine instances, you can
  27472. // exclude instances named example-instance by specifying name !=
  27473. // example-instance.
  27474. //
  27475. // You can also filter nested fields. For example, you could specify
  27476. // scheduling.automaticRestart = false to include instances only if they
  27477. // are not scheduled for automatic restarts. You can use filtering on
  27478. // nested fields to filter based on resource labels.
  27479. //
  27480. // To filter on multiple expressions, provide each separate expression
  27481. // within parentheses. For example, (scheduling.automaticRestart = true)
  27482. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  27483. // AND expression. However, you can include AND and OR expressions
  27484. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  27485. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  27486. // true).
  27487. func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
  27488. c.urlParams_.Set("filter", filter)
  27489. return c
  27490. }
  27491. // MaxResults sets the optional parameter "maxResults": The maximum
  27492. // number of results per page that should be returned. If the number of
  27493. // available results is larger than maxResults, Compute Engine returns a
  27494. // nextPageToken that can be used to get the next page of results in
  27495. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  27496. // (Default: 500)
  27497. func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
  27498. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27499. return c
  27500. }
  27501. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  27502. // a certain order. By default, results are returned in alphanumerical
  27503. // order based on the resource name.
  27504. //
  27505. // You can also sort results in descending order based on the creation
  27506. // timestamp using orderBy="creationTimestamp desc". This sorts results
  27507. // based on the creationTimestamp field in reverse chronological order
  27508. // (newest result first). Use this to sort resources like operations so
  27509. // that the newest operation is returned first.
  27510. //
  27511. // Currently, only sorting by name or creationTimestamp desc is
  27512. // supported.
  27513. func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall {
  27514. c.urlParams_.Set("orderBy", orderBy)
  27515. return c
  27516. }
  27517. // PageToken sets the optional parameter "pageToken": Specifies a page
  27518. // token to use. Set pageToken to the nextPageToken returned by a
  27519. // previous list request to get the next page of results.
  27520. func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
  27521. c.urlParams_.Set("pageToken", pageToken)
  27522. return c
  27523. }
  27524. // Fields allows partial responses to be retrieved. See
  27525. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27526. // for more information.
  27527. func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
  27528. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27529. return c
  27530. }
  27531. // IfNoneMatch sets the optional parameter which makes the operation
  27532. // fail if the object's ETag matches the given value. This is useful for
  27533. // getting updates only after the object has changed since the last
  27534. // request. Use googleapi.IsNotModified to check whether the response
  27535. // error from Do is the result of In-None-Match.
  27536. func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
  27537. c.ifNoneMatch_ = entityTag
  27538. return c
  27539. }
  27540. // Context sets the context to be used in this call's Do method. Any
  27541. // pending HTTP request will be aborted if the provided context is
  27542. // canceled.
  27543. func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
  27544. c.ctx_ = ctx
  27545. return c
  27546. }
  27547. // Header returns an http.Header that can be modified by the caller to
  27548. // add HTTP headers to the request.
  27549. func (c *AutoscalersAggregatedListCall) Header() http.Header {
  27550. if c.header_ == nil {
  27551. c.header_ = make(http.Header)
  27552. }
  27553. return c.header_
  27554. }
  27555. func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  27556. reqHeaders := make(http.Header)
  27557. for k, v := range c.header_ {
  27558. reqHeaders[k] = v
  27559. }
  27560. reqHeaders.Set("User-Agent", c.s.userAgent())
  27561. if c.ifNoneMatch_ != "" {
  27562. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27563. }
  27564. var body io.Reader = nil
  27565. c.urlParams_.Set("alt", alt)
  27566. c.urlParams_.Set("prettyPrint", "false")
  27567. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers")
  27568. urls += "?" + c.urlParams_.Encode()
  27569. req, err := http.NewRequest("GET", urls, body)
  27570. if err != nil {
  27571. return nil, err
  27572. }
  27573. req.Header = reqHeaders
  27574. googleapi.Expand(req.URL, map[string]string{
  27575. "project": c.project,
  27576. })
  27577. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27578. }
  27579. // Do executes the "compute.autoscalers.aggregatedList" call.
  27580. // Exactly one of *AutoscalerAggregatedList or error will be non-nil.
  27581. // Any non-2xx status code is an error. Response headers are in either
  27582. // *AutoscalerAggregatedList.ServerResponse.Header or (if a response was
  27583. // returned at all) in error.(*googleapi.Error).Header. Use
  27584. // googleapi.IsNotModified to check whether the returned error was
  27585. // because http.StatusNotModified was returned.
  27586. func (c *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, error) {
  27587. gensupport.SetOptions(c.urlParams_, opts...)
  27588. res, err := c.doRequest("json")
  27589. if res != nil && res.StatusCode == http.StatusNotModified {
  27590. if res.Body != nil {
  27591. res.Body.Close()
  27592. }
  27593. return nil, &googleapi.Error{
  27594. Code: res.StatusCode,
  27595. Header: res.Header,
  27596. }
  27597. }
  27598. if err != nil {
  27599. return nil, err
  27600. }
  27601. defer googleapi.CloseBody(res)
  27602. if err := googleapi.CheckResponse(res); err != nil {
  27603. return nil, err
  27604. }
  27605. ret := &AutoscalerAggregatedList{
  27606. ServerResponse: googleapi.ServerResponse{
  27607. Header: res.Header,
  27608. HTTPStatusCode: res.StatusCode,
  27609. },
  27610. }
  27611. target := &ret
  27612. if err := gensupport.DecodeResponse(target, res); err != nil {
  27613. return nil, err
  27614. }
  27615. return ret, nil
  27616. // {
  27617. // "description": "Retrieves an aggregated list of autoscalers.",
  27618. // "httpMethod": "GET",
  27619. // "id": "compute.autoscalers.aggregatedList",
  27620. // "parameterOrder": [
  27621. // "project"
  27622. // ],
  27623. // "parameters": {
  27624. // "filter": {
  27625. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  27626. // "location": "query",
  27627. // "type": "string"
  27628. // },
  27629. // "maxResults": {
  27630. // "default": "500",
  27631. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  27632. // "format": "uint32",
  27633. // "location": "query",
  27634. // "minimum": "0",
  27635. // "type": "integer"
  27636. // },
  27637. // "orderBy": {
  27638. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  27639. // "location": "query",
  27640. // "type": "string"
  27641. // },
  27642. // "pageToken": {
  27643. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  27644. // "location": "query",
  27645. // "type": "string"
  27646. // },
  27647. // "project": {
  27648. // "description": "Project ID for this request.",
  27649. // "location": "path",
  27650. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27651. // "required": true,
  27652. // "type": "string"
  27653. // }
  27654. // },
  27655. // "path": "{project}/aggregated/autoscalers",
  27656. // "response": {
  27657. // "$ref": "AutoscalerAggregatedList"
  27658. // },
  27659. // "scopes": [
  27660. // "https://www.googleapis.com/auth/cloud-platform",
  27661. // "https://www.googleapis.com/auth/compute",
  27662. // "https://www.googleapis.com/auth/compute.readonly"
  27663. // ]
  27664. // }
  27665. }
  27666. // Pages invokes f for each page of results.
  27667. // A non-nil error returned from f will halt the iteration.
  27668. // The provided context supersedes any context provided to the Context method.
  27669. func (c *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error {
  27670. c.ctx_ = ctx
  27671. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27672. for {
  27673. x, err := c.Do()
  27674. if err != nil {
  27675. return err
  27676. }
  27677. if err := f(x); err != nil {
  27678. return err
  27679. }
  27680. if x.NextPageToken == "" {
  27681. return nil
  27682. }
  27683. c.PageToken(x.NextPageToken)
  27684. }
  27685. }
  27686. // method id "compute.autoscalers.delete":
  27687. type AutoscalersDeleteCall struct {
  27688. s *Service
  27689. project string
  27690. zone string
  27691. autoscaler string
  27692. urlParams_ gensupport.URLParams
  27693. ctx_ context.Context
  27694. header_ http.Header
  27695. }
  27696. // Delete: Deletes the specified autoscaler.
  27697. func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
  27698. c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27699. c.project = project
  27700. c.zone = zone
  27701. c.autoscaler = autoscaler
  27702. return c
  27703. }
  27704. // RequestId sets the optional parameter "requestId": An optional
  27705. // request ID to identify requests. Specify a unique request ID so that
  27706. // if you must retry your request, the server will know to ignore the
  27707. // request if it has already been completed.
  27708. //
  27709. // For example, consider a situation where you make an initial request
  27710. // and the request times out. If you make the request again with the
  27711. // same request ID, the server can check if original operation with the
  27712. // same request ID was received, and if so, will ignore the second
  27713. // request. This prevents clients from accidentally creating duplicate
  27714. // commitments.
  27715. //
  27716. // The request ID must be a valid UUID with the exception that zero UUID
  27717. // is not supported (00000000-0000-0000-0000-000000000000).
  27718. func (c *AutoscalersDeleteCall) RequestId(requestId string) *AutoscalersDeleteCall {
  27719. c.urlParams_.Set("requestId", requestId)
  27720. return c
  27721. }
  27722. // Fields allows partial responses to be retrieved. See
  27723. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27724. // for more information.
  27725. func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
  27726. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27727. return c
  27728. }
  27729. // Context sets the context to be used in this call's Do method. Any
  27730. // pending HTTP request will be aborted if the provided context is
  27731. // canceled.
  27732. func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
  27733. c.ctx_ = ctx
  27734. return c
  27735. }
  27736. // Header returns an http.Header that can be modified by the caller to
  27737. // add HTTP headers to the request.
  27738. func (c *AutoscalersDeleteCall) Header() http.Header {
  27739. if c.header_ == nil {
  27740. c.header_ = make(http.Header)
  27741. }
  27742. return c.header_
  27743. }
  27744. func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  27745. reqHeaders := make(http.Header)
  27746. for k, v := range c.header_ {
  27747. reqHeaders[k] = v
  27748. }
  27749. reqHeaders.Set("User-Agent", c.s.userAgent())
  27750. var body io.Reader = nil
  27751. c.urlParams_.Set("alt", alt)
  27752. c.urlParams_.Set("prettyPrint", "false")
  27753. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  27754. urls += "?" + c.urlParams_.Encode()
  27755. req, err := http.NewRequest("DELETE", urls, body)
  27756. if err != nil {
  27757. return nil, err
  27758. }
  27759. req.Header = reqHeaders
  27760. googleapi.Expand(req.URL, map[string]string{
  27761. "project": c.project,
  27762. "zone": c.zone,
  27763. "autoscaler": c.autoscaler,
  27764. })
  27765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27766. }
  27767. // Do executes the "compute.autoscalers.delete" call.
  27768. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27769. // status code is an error. Response headers are in either
  27770. // *Operation.ServerResponse.Header or (if a response was returned at
  27771. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27772. // to check whether the returned error was because
  27773. // http.StatusNotModified was returned.
  27774. func (c *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27775. gensupport.SetOptions(c.urlParams_, opts...)
  27776. res, err := c.doRequest("json")
  27777. if res != nil && res.StatusCode == http.StatusNotModified {
  27778. if res.Body != nil {
  27779. res.Body.Close()
  27780. }
  27781. return nil, &googleapi.Error{
  27782. Code: res.StatusCode,
  27783. Header: res.Header,
  27784. }
  27785. }
  27786. if err != nil {
  27787. return nil, err
  27788. }
  27789. defer googleapi.CloseBody(res)
  27790. if err := googleapi.CheckResponse(res); err != nil {
  27791. return nil, err
  27792. }
  27793. ret := &Operation{
  27794. ServerResponse: googleapi.ServerResponse{
  27795. Header: res.Header,
  27796. HTTPStatusCode: res.StatusCode,
  27797. },
  27798. }
  27799. target := &ret
  27800. if err := gensupport.DecodeResponse(target, res); err != nil {
  27801. return nil, err
  27802. }
  27803. return ret, nil
  27804. // {
  27805. // "description": "Deletes the specified autoscaler.",
  27806. // "httpMethod": "DELETE",
  27807. // "id": "compute.autoscalers.delete",
  27808. // "parameterOrder": [
  27809. // "project",
  27810. // "zone",
  27811. // "autoscaler"
  27812. // ],
  27813. // "parameters": {
  27814. // "autoscaler": {
  27815. // "description": "Name of the autoscaler to delete.",
  27816. // "location": "path",
  27817. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  27818. // "required": true,
  27819. // "type": "string"
  27820. // },
  27821. // "project": {
  27822. // "description": "Project ID for this request.",
  27823. // "location": "path",
  27824. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27825. // "required": true,
  27826. // "type": "string"
  27827. // },
  27828. // "requestId": {
  27829. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  27830. // "location": "query",
  27831. // "type": "string"
  27832. // },
  27833. // "zone": {
  27834. // "description": "Name of the zone for this request.",
  27835. // "location": "path",
  27836. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27837. // "required": true,
  27838. // "type": "string"
  27839. // }
  27840. // },
  27841. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  27842. // "response": {
  27843. // "$ref": "Operation"
  27844. // },
  27845. // "scopes": [
  27846. // "https://www.googleapis.com/auth/cloud-platform",
  27847. // "https://www.googleapis.com/auth/compute"
  27848. // ]
  27849. // }
  27850. }
  27851. // method id "compute.autoscalers.get":
  27852. type AutoscalersGetCall struct {
  27853. s *Service
  27854. project string
  27855. zone string
  27856. autoscaler string
  27857. urlParams_ gensupport.URLParams
  27858. ifNoneMatch_ string
  27859. ctx_ context.Context
  27860. header_ http.Header
  27861. }
  27862. // Get: Returns the specified autoscaler resource. Gets a list of
  27863. // available autoscalers by making a list() request.
  27864. func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
  27865. c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27866. c.project = project
  27867. c.zone = zone
  27868. c.autoscaler = autoscaler
  27869. return c
  27870. }
  27871. // Fields allows partial responses to be retrieved. See
  27872. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27873. // for more information.
  27874. func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
  27875. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27876. return c
  27877. }
  27878. // IfNoneMatch sets the optional parameter which makes the operation
  27879. // fail if the object's ETag matches the given value. This is useful for
  27880. // getting updates only after the object has changed since the last
  27881. // request. Use googleapi.IsNotModified to check whether the response
  27882. // error from Do is the result of In-None-Match.
  27883. func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
  27884. c.ifNoneMatch_ = entityTag
  27885. return c
  27886. }
  27887. // Context sets the context to be used in this call's Do method. Any
  27888. // pending HTTP request will be aborted if the provided context is
  27889. // canceled.
  27890. func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
  27891. c.ctx_ = ctx
  27892. return c
  27893. }
  27894. // Header returns an http.Header that can be modified by the caller to
  27895. // add HTTP headers to the request.
  27896. func (c *AutoscalersGetCall) Header() http.Header {
  27897. if c.header_ == nil {
  27898. c.header_ = make(http.Header)
  27899. }
  27900. return c.header_
  27901. }
  27902. func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  27903. reqHeaders := make(http.Header)
  27904. for k, v := range c.header_ {
  27905. reqHeaders[k] = v
  27906. }
  27907. reqHeaders.Set("User-Agent", c.s.userAgent())
  27908. if c.ifNoneMatch_ != "" {
  27909. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27910. }
  27911. var body io.Reader = nil
  27912. c.urlParams_.Set("alt", alt)
  27913. c.urlParams_.Set("prettyPrint", "false")
  27914. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  27915. urls += "?" + c.urlParams_.Encode()
  27916. req, err := http.NewRequest("GET", urls, body)
  27917. if err != nil {
  27918. return nil, err
  27919. }
  27920. req.Header = reqHeaders
  27921. googleapi.Expand(req.URL, map[string]string{
  27922. "project": c.project,
  27923. "zone": c.zone,
  27924. "autoscaler": c.autoscaler,
  27925. })
  27926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27927. }
  27928. // Do executes the "compute.autoscalers.get" call.
  27929. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  27930. // status code is an error. Response headers are in either
  27931. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  27932. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27933. // to check whether the returned error was because
  27934. // http.StatusNotModified was returned.
  27935. func (c *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  27936. gensupport.SetOptions(c.urlParams_, opts...)
  27937. res, err := c.doRequest("json")
  27938. if res != nil && res.StatusCode == http.StatusNotModified {
  27939. if res.Body != nil {
  27940. res.Body.Close()
  27941. }
  27942. return nil, &googleapi.Error{
  27943. Code: res.StatusCode,
  27944. Header: res.Header,
  27945. }
  27946. }
  27947. if err != nil {
  27948. return nil, err
  27949. }
  27950. defer googleapi.CloseBody(res)
  27951. if err := googleapi.CheckResponse(res); err != nil {
  27952. return nil, err
  27953. }
  27954. ret := &Autoscaler{
  27955. ServerResponse: googleapi.ServerResponse{
  27956. Header: res.Header,
  27957. HTTPStatusCode: res.StatusCode,
  27958. },
  27959. }
  27960. target := &ret
  27961. if err := gensupport.DecodeResponse(target, res); err != nil {
  27962. return nil, err
  27963. }
  27964. return ret, nil
  27965. // {
  27966. // "description": "Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.",
  27967. // "httpMethod": "GET",
  27968. // "id": "compute.autoscalers.get",
  27969. // "parameterOrder": [
  27970. // "project",
  27971. // "zone",
  27972. // "autoscaler"
  27973. // ],
  27974. // "parameters": {
  27975. // "autoscaler": {
  27976. // "description": "Name of the autoscaler to return.",
  27977. // "location": "path",
  27978. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  27979. // "required": true,
  27980. // "type": "string"
  27981. // },
  27982. // "project": {
  27983. // "description": "Project ID for this request.",
  27984. // "location": "path",
  27985. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27986. // "required": true,
  27987. // "type": "string"
  27988. // },
  27989. // "zone": {
  27990. // "description": "Name of the zone for this request.",
  27991. // "location": "path",
  27992. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27993. // "required": true,
  27994. // "type": "string"
  27995. // }
  27996. // },
  27997. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  27998. // "response": {
  27999. // "$ref": "Autoscaler"
  28000. // },
  28001. // "scopes": [
  28002. // "https://www.googleapis.com/auth/cloud-platform",
  28003. // "https://www.googleapis.com/auth/compute",
  28004. // "https://www.googleapis.com/auth/compute.readonly"
  28005. // ]
  28006. // }
  28007. }
  28008. // method id "compute.autoscalers.insert":
  28009. type AutoscalersInsertCall struct {
  28010. s *Service
  28011. project string
  28012. zone string
  28013. autoscaler *Autoscaler
  28014. urlParams_ gensupport.URLParams
  28015. ctx_ context.Context
  28016. header_ http.Header
  28017. }
  28018. // Insert: Creates an autoscaler in the specified project using the data
  28019. // included in the request.
  28020. func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
  28021. c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28022. c.project = project
  28023. c.zone = zone
  28024. c.autoscaler = autoscaler
  28025. return c
  28026. }
  28027. // RequestId sets the optional parameter "requestId": An optional
  28028. // request ID to identify requests. Specify a unique request ID so that
  28029. // if you must retry your request, the server will know to ignore the
  28030. // request if it has already been completed.
  28031. //
  28032. // For example, consider a situation where you make an initial request
  28033. // and the request times out. If you make the request again with the
  28034. // same request ID, the server can check if original operation with the
  28035. // same request ID was received, and if so, will ignore the second
  28036. // request. This prevents clients from accidentally creating duplicate
  28037. // commitments.
  28038. //
  28039. // The request ID must be a valid UUID with the exception that zero UUID
  28040. // is not supported (00000000-0000-0000-0000-000000000000).
  28041. func (c *AutoscalersInsertCall) RequestId(requestId string) *AutoscalersInsertCall {
  28042. c.urlParams_.Set("requestId", requestId)
  28043. return c
  28044. }
  28045. // Fields allows partial responses to be retrieved. See
  28046. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28047. // for more information.
  28048. func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
  28049. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28050. return c
  28051. }
  28052. // Context sets the context to be used in this call's Do method. Any
  28053. // pending HTTP request will be aborted if the provided context is
  28054. // canceled.
  28055. func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
  28056. c.ctx_ = ctx
  28057. return c
  28058. }
  28059. // Header returns an http.Header that can be modified by the caller to
  28060. // add HTTP headers to the request.
  28061. func (c *AutoscalersInsertCall) Header() http.Header {
  28062. if c.header_ == nil {
  28063. c.header_ = make(http.Header)
  28064. }
  28065. return c.header_
  28066. }
  28067. func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  28068. reqHeaders := make(http.Header)
  28069. for k, v := range c.header_ {
  28070. reqHeaders[k] = v
  28071. }
  28072. reqHeaders.Set("User-Agent", c.s.userAgent())
  28073. var body io.Reader = nil
  28074. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  28075. if err != nil {
  28076. return nil, err
  28077. }
  28078. reqHeaders.Set("Content-Type", "application/json")
  28079. c.urlParams_.Set("alt", alt)
  28080. c.urlParams_.Set("prettyPrint", "false")
  28081. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  28082. urls += "?" + c.urlParams_.Encode()
  28083. req, err := http.NewRequest("POST", urls, body)
  28084. if err != nil {
  28085. return nil, err
  28086. }
  28087. req.Header = reqHeaders
  28088. googleapi.Expand(req.URL, map[string]string{
  28089. "project": c.project,
  28090. "zone": c.zone,
  28091. })
  28092. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28093. }
  28094. // Do executes the "compute.autoscalers.insert" call.
  28095. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28096. // status code is an error. Response headers are in either
  28097. // *Operation.ServerResponse.Header or (if a response was returned at
  28098. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28099. // to check whether the returned error was because
  28100. // http.StatusNotModified was returned.
  28101. func (c *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28102. gensupport.SetOptions(c.urlParams_, opts...)
  28103. res, err := c.doRequest("json")
  28104. if res != nil && res.StatusCode == http.StatusNotModified {
  28105. if res.Body != nil {
  28106. res.Body.Close()
  28107. }
  28108. return nil, &googleapi.Error{
  28109. Code: res.StatusCode,
  28110. Header: res.Header,
  28111. }
  28112. }
  28113. if err != nil {
  28114. return nil, err
  28115. }
  28116. defer googleapi.CloseBody(res)
  28117. if err := googleapi.CheckResponse(res); err != nil {
  28118. return nil, err
  28119. }
  28120. ret := &Operation{
  28121. ServerResponse: googleapi.ServerResponse{
  28122. Header: res.Header,
  28123. HTTPStatusCode: res.StatusCode,
  28124. },
  28125. }
  28126. target := &ret
  28127. if err := gensupport.DecodeResponse(target, res); err != nil {
  28128. return nil, err
  28129. }
  28130. return ret, nil
  28131. // {
  28132. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  28133. // "httpMethod": "POST",
  28134. // "id": "compute.autoscalers.insert",
  28135. // "parameterOrder": [
  28136. // "project",
  28137. // "zone"
  28138. // ],
  28139. // "parameters": {
  28140. // "project": {
  28141. // "description": "Project ID for this request.",
  28142. // "location": "path",
  28143. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28144. // "required": true,
  28145. // "type": "string"
  28146. // },
  28147. // "requestId": {
  28148. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  28149. // "location": "query",
  28150. // "type": "string"
  28151. // },
  28152. // "zone": {
  28153. // "description": "Name of the zone for this request.",
  28154. // "location": "path",
  28155. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28156. // "required": true,
  28157. // "type": "string"
  28158. // }
  28159. // },
  28160. // "path": "{project}/zones/{zone}/autoscalers",
  28161. // "request": {
  28162. // "$ref": "Autoscaler"
  28163. // },
  28164. // "response": {
  28165. // "$ref": "Operation"
  28166. // },
  28167. // "scopes": [
  28168. // "https://www.googleapis.com/auth/cloud-platform",
  28169. // "https://www.googleapis.com/auth/compute"
  28170. // ]
  28171. // }
  28172. }
  28173. // method id "compute.autoscalers.list":
  28174. type AutoscalersListCall struct {
  28175. s *Service
  28176. project string
  28177. zone string
  28178. urlParams_ gensupport.URLParams
  28179. ifNoneMatch_ string
  28180. ctx_ context.Context
  28181. header_ http.Header
  28182. }
  28183. // List: Retrieves a list of autoscalers contained within the specified
  28184. // zone.
  28185. func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
  28186. c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28187. c.project = project
  28188. c.zone = zone
  28189. return c
  28190. }
  28191. // Filter sets the optional parameter "filter": A filter expression that
  28192. // filters resources listed in the response. The expression must specify
  28193. // the field name, a comparison operator, and the value that you want to
  28194. // use for filtering. The value must be a string, a number, or a
  28195. // boolean. The comparison operator must be either =, !=, >, or <.
  28196. //
  28197. // For example, if you are filtering Compute Engine instances, you can
  28198. // exclude instances named example-instance by specifying name !=
  28199. // example-instance.
  28200. //
  28201. // You can also filter nested fields. For example, you could specify
  28202. // scheduling.automaticRestart = false to include instances only if they
  28203. // are not scheduled for automatic restarts. You can use filtering on
  28204. // nested fields to filter based on resource labels.
  28205. //
  28206. // To filter on multiple expressions, provide each separate expression
  28207. // within parentheses. For example, (scheduling.automaticRestart = true)
  28208. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  28209. // AND expression. However, you can include AND and OR expressions
  28210. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  28211. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  28212. // true).
  28213. func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
  28214. c.urlParams_.Set("filter", filter)
  28215. return c
  28216. }
  28217. // MaxResults sets the optional parameter "maxResults": The maximum
  28218. // number of results per page that should be returned. If the number of
  28219. // available results is larger than maxResults, Compute Engine returns a
  28220. // nextPageToken that can be used to get the next page of results in
  28221. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  28222. // (Default: 500)
  28223. func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
  28224. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28225. return c
  28226. }
  28227. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  28228. // a certain order. By default, results are returned in alphanumerical
  28229. // order based on the resource name.
  28230. //
  28231. // You can also sort results in descending order based on the creation
  28232. // timestamp using orderBy="creationTimestamp desc". This sorts results
  28233. // based on the creationTimestamp field in reverse chronological order
  28234. // (newest result first). Use this to sort resources like operations so
  28235. // that the newest operation is returned first.
  28236. //
  28237. // Currently, only sorting by name or creationTimestamp desc is
  28238. // supported.
  28239. func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall {
  28240. c.urlParams_.Set("orderBy", orderBy)
  28241. return c
  28242. }
  28243. // PageToken sets the optional parameter "pageToken": Specifies a page
  28244. // token to use. Set pageToken to the nextPageToken returned by a
  28245. // previous list request to get the next page of results.
  28246. func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
  28247. c.urlParams_.Set("pageToken", pageToken)
  28248. return c
  28249. }
  28250. // Fields allows partial responses to be retrieved. See
  28251. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28252. // for more information.
  28253. func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
  28254. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28255. return c
  28256. }
  28257. // IfNoneMatch sets the optional parameter which makes the operation
  28258. // fail if the object's ETag matches the given value. This is useful for
  28259. // getting updates only after the object has changed since the last
  28260. // request. Use googleapi.IsNotModified to check whether the response
  28261. // error from Do is the result of In-None-Match.
  28262. func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
  28263. c.ifNoneMatch_ = entityTag
  28264. return c
  28265. }
  28266. // Context sets the context to be used in this call's Do method. Any
  28267. // pending HTTP request will be aborted if the provided context is
  28268. // canceled.
  28269. func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
  28270. c.ctx_ = ctx
  28271. return c
  28272. }
  28273. // Header returns an http.Header that can be modified by the caller to
  28274. // add HTTP headers to the request.
  28275. func (c *AutoscalersListCall) Header() http.Header {
  28276. if c.header_ == nil {
  28277. c.header_ = make(http.Header)
  28278. }
  28279. return c.header_
  28280. }
  28281. func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  28282. reqHeaders := make(http.Header)
  28283. for k, v := range c.header_ {
  28284. reqHeaders[k] = v
  28285. }
  28286. reqHeaders.Set("User-Agent", c.s.userAgent())
  28287. if c.ifNoneMatch_ != "" {
  28288. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28289. }
  28290. var body io.Reader = nil
  28291. c.urlParams_.Set("alt", alt)
  28292. c.urlParams_.Set("prettyPrint", "false")
  28293. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  28294. urls += "?" + c.urlParams_.Encode()
  28295. req, err := http.NewRequest("GET", urls, body)
  28296. if err != nil {
  28297. return nil, err
  28298. }
  28299. req.Header = reqHeaders
  28300. googleapi.Expand(req.URL, map[string]string{
  28301. "project": c.project,
  28302. "zone": c.zone,
  28303. })
  28304. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28305. }
  28306. // Do executes the "compute.autoscalers.list" call.
  28307. // Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx
  28308. // status code is an error. Response headers are in either
  28309. // *AutoscalerList.ServerResponse.Header or (if a response was returned
  28310. // at all) in error.(*googleapi.Error).Header. Use
  28311. // googleapi.IsNotModified to check whether the returned error was
  28312. // because http.StatusNotModified was returned.
  28313. func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, error) {
  28314. gensupport.SetOptions(c.urlParams_, opts...)
  28315. res, err := c.doRequest("json")
  28316. if res != nil && res.StatusCode == http.StatusNotModified {
  28317. if res.Body != nil {
  28318. res.Body.Close()
  28319. }
  28320. return nil, &googleapi.Error{
  28321. Code: res.StatusCode,
  28322. Header: res.Header,
  28323. }
  28324. }
  28325. if err != nil {
  28326. return nil, err
  28327. }
  28328. defer googleapi.CloseBody(res)
  28329. if err := googleapi.CheckResponse(res); err != nil {
  28330. return nil, err
  28331. }
  28332. ret := &AutoscalerList{
  28333. ServerResponse: googleapi.ServerResponse{
  28334. Header: res.Header,
  28335. HTTPStatusCode: res.StatusCode,
  28336. },
  28337. }
  28338. target := &ret
  28339. if err := gensupport.DecodeResponse(target, res); err != nil {
  28340. return nil, err
  28341. }
  28342. return ret, nil
  28343. // {
  28344. // "description": "Retrieves a list of autoscalers contained within the specified zone.",
  28345. // "httpMethod": "GET",
  28346. // "id": "compute.autoscalers.list",
  28347. // "parameterOrder": [
  28348. // "project",
  28349. // "zone"
  28350. // ],
  28351. // "parameters": {
  28352. // "filter": {
  28353. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  28354. // "location": "query",
  28355. // "type": "string"
  28356. // },
  28357. // "maxResults": {
  28358. // "default": "500",
  28359. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  28360. // "format": "uint32",
  28361. // "location": "query",
  28362. // "minimum": "0",
  28363. // "type": "integer"
  28364. // },
  28365. // "orderBy": {
  28366. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  28367. // "location": "query",
  28368. // "type": "string"
  28369. // },
  28370. // "pageToken": {
  28371. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  28372. // "location": "query",
  28373. // "type": "string"
  28374. // },
  28375. // "project": {
  28376. // "description": "Project ID for this request.",
  28377. // "location": "path",
  28378. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28379. // "required": true,
  28380. // "type": "string"
  28381. // },
  28382. // "zone": {
  28383. // "description": "Name of the zone for this request.",
  28384. // "location": "path",
  28385. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28386. // "required": true,
  28387. // "type": "string"
  28388. // }
  28389. // },
  28390. // "path": "{project}/zones/{zone}/autoscalers",
  28391. // "response": {
  28392. // "$ref": "AutoscalerList"
  28393. // },
  28394. // "scopes": [
  28395. // "https://www.googleapis.com/auth/cloud-platform",
  28396. // "https://www.googleapis.com/auth/compute",
  28397. // "https://www.googleapis.com/auth/compute.readonly"
  28398. // ]
  28399. // }
  28400. }
  28401. // Pages invokes f for each page of results.
  28402. // A non-nil error returned from f will halt the iteration.
  28403. // The provided context supersedes any context provided to the Context method.
  28404. func (c *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error {
  28405. c.ctx_ = ctx
  28406. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28407. for {
  28408. x, err := c.Do()
  28409. if err != nil {
  28410. return err
  28411. }
  28412. if err := f(x); err != nil {
  28413. return err
  28414. }
  28415. if x.NextPageToken == "" {
  28416. return nil
  28417. }
  28418. c.PageToken(x.NextPageToken)
  28419. }
  28420. }
  28421. // method id "compute.autoscalers.patch":
  28422. type AutoscalersPatchCall struct {
  28423. s *Service
  28424. project string
  28425. zone string
  28426. autoscaler *Autoscaler
  28427. urlParams_ gensupport.URLParams
  28428. ctx_ context.Context
  28429. header_ http.Header
  28430. }
  28431. // Patch: Updates an autoscaler in the specified project using the data
  28432. // included in the request. This method supports PATCH semantics and
  28433. // uses the JSON merge patch format and processing rules.
  28434. func (r *AutoscalersService) Patch(project string, zone string, autoscaler *Autoscaler) *AutoscalersPatchCall {
  28435. c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28436. c.project = project
  28437. c.zone = zone
  28438. c.autoscaler = autoscaler
  28439. return c
  28440. }
  28441. // Autoscaler sets the optional parameter "autoscaler": Name of the
  28442. // autoscaler to patch.
  28443. func (c *AutoscalersPatchCall) Autoscaler(autoscaler string) *AutoscalersPatchCall {
  28444. c.urlParams_.Set("autoscaler", autoscaler)
  28445. return c
  28446. }
  28447. // RequestId sets the optional parameter "requestId": An optional
  28448. // request ID to identify requests. Specify a unique request ID so that
  28449. // if you must retry your request, the server will know to ignore the
  28450. // request if it has already been completed.
  28451. //
  28452. // For example, consider a situation where you make an initial request
  28453. // and the request times out. If you make the request again with the
  28454. // same request ID, the server can check if original operation with the
  28455. // same request ID was received, and if so, will ignore the second
  28456. // request. This prevents clients from accidentally creating duplicate
  28457. // commitments.
  28458. //
  28459. // The request ID must be a valid UUID with the exception that zero UUID
  28460. // is not supported (00000000-0000-0000-0000-000000000000).
  28461. func (c *AutoscalersPatchCall) RequestId(requestId string) *AutoscalersPatchCall {
  28462. c.urlParams_.Set("requestId", requestId)
  28463. return c
  28464. }
  28465. // Fields allows partial responses to be retrieved. See
  28466. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28467. // for more information.
  28468. func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
  28469. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28470. return c
  28471. }
  28472. // Context sets the context to be used in this call's Do method. Any
  28473. // pending HTTP request will be aborted if the provided context is
  28474. // canceled.
  28475. func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
  28476. c.ctx_ = ctx
  28477. return c
  28478. }
  28479. // Header returns an http.Header that can be modified by the caller to
  28480. // add HTTP headers to the request.
  28481. func (c *AutoscalersPatchCall) Header() http.Header {
  28482. if c.header_ == nil {
  28483. c.header_ = make(http.Header)
  28484. }
  28485. return c.header_
  28486. }
  28487. func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  28488. reqHeaders := make(http.Header)
  28489. for k, v := range c.header_ {
  28490. reqHeaders[k] = v
  28491. }
  28492. reqHeaders.Set("User-Agent", c.s.userAgent())
  28493. var body io.Reader = nil
  28494. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  28495. if err != nil {
  28496. return nil, err
  28497. }
  28498. reqHeaders.Set("Content-Type", "application/json")
  28499. c.urlParams_.Set("alt", alt)
  28500. c.urlParams_.Set("prettyPrint", "false")
  28501. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  28502. urls += "?" + c.urlParams_.Encode()
  28503. req, err := http.NewRequest("PATCH", urls, body)
  28504. if err != nil {
  28505. return nil, err
  28506. }
  28507. req.Header = reqHeaders
  28508. googleapi.Expand(req.URL, map[string]string{
  28509. "project": c.project,
  28510. "zone": c.zone,
  28511. })
  28512. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28513. }
  28514. // Do executes the "compute.autoscalers.patch" call.
  28515. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28516. // status code is an error. Response headers are in either
  28517. // *Operation.ServerResponse.Header or (if a response was returned at
  28518. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28519. // to check whether the returned error was because
  28520. // http.StatusNotModified was returned.
  28521. func (c *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28522. gensupport.SetOptions(c.urlParams_, opts...)
  28523. res, err := c.doRequest("json")
  28524. if res != nil && res.StatusCode == http.StatusNotModified {
  28525. if res.Body != nil {
  28526. res.Body.Close()
  28527. }
  28528. return nil, &googleapi.Error{
  28529. Code: res.StatusCode,
  28530. Header: res.Header,
  28531. }
  28532. }
  28533. if err != nil {
  28534. return nil, err
  28535. }
  28536. defer googleapi.CloseBody(res)
  28537. if err := googleapi.CheckResponse(res); err != nil {
  28538. return nil, err
  28539. }
  28540. ret := &Operation{
  28541. ServerResponse: googleapi.ServerResponse{
  28542. Header: res.Header,
  28543. HTTPStatusCode: res.StatusCode,
  28544. },
  28545. }
  28546. target := &ret
  28547. if err := gensupport.DecodeResponse(target, res); err != nil {
  28548. return nil, err
  28549. }
  28550. return ret, nil
  28551. // {
  28552. // "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  28553. // "httpMethod": "PATCH",
  28554. // "id": "compute.autoscalers.patch",
  28555. // "parameterOrder": [
  28556. // "project",
  28557. // "zone"
  28558. // ],
  28559. // "parameters": {
  28560. // "autoscaler": {
  28561. // "description": "Name of the autoscaler to patch.",
  28562. // "location": "query",
  28563. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  28564. // "type": "string"
  28565. // },
  28566. // "project": {
  28567. // "description": "Project ID for this request.",
  28568. // "location": "path",
  28569. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28570. // "required": true,
  28571. // "type": "string"
  28572. // },
  28573. // "requestId": {
  28574. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  28575. // "location": "query",
  28576. // "type": "string"
  28577. // },
  28578. // "zone": {
  28579. // "description": "Name of the zone for this request.",
  28580. // "location": "path",
  28581. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28582. // "required": true,
  28583. // "type": "string"
  28584. // }
  28585. // },
  28586. // "path": "{project}/zones/{zone}/autoscalers",
  28587. // "request": {
  28588. // "$ref": "Autoscaler"
  28589. // },
  28590. // "response": {
  28591. // "$ref": "Operation"
  28592. // },
  28593. // "scopes": [
  28594. // "https://www.googleapis.com/auth/cloud-platform",
  28595. // "https://www.googleapis.com/auth/compute"
  28596. // ]
  28597. // }
  28598. }
  28599. // method id "compute.autoscalers.update":
  28600. type AutoscalersUpdateCall struct {
  28601. s *Service
  28602. project string
  28603. zone string
  28604. autoscaler *Autoscaler
  28605. urlParams_ gensupport.URLParams
  28606. ctx_ context.Context
  28607. header_ http.Header
  28608. }
  28609. // Update: Updates an autoscaler in the specified project using the data
  28610. // included in the request.
  28611. func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
  28612. c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28613. c.project = project
  28614. c.zone = zone
  28615. c.autoscaler = autoscaler
  28616. return c
  28617. }
  28618. // Autoscaler sets the optional parameter "autoscaler": Name of the
  28619. // autoscaler to update.
  28620. func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
  28621. c.urlParams_.Set("autoscaler", autoscaler)
  28622. return c
  28623. }
  28624. // RequestId sets the optional parameter "requestId": An optional
  28625. // request ID to identify requests. Specify a unique request ID so that
  28626. // if you must retry your request, the server will know to ignore the
  28627. // request if it has already been completed.
  28628. //
  28629. // For example, consider a situation where you make an initial request
  28630. // and the request times out. If you make the request again with the
  28631. // same request ID, the server can check if original operation with the
  28632. // same request ID was received, and if so, will ignore the second
  28633. // request. This prevents clients from accidentally creating duplicate
  28634. // commitments.
  28635. //
  28636. // The request ID must be a valid UUID with the exception that zero UUID
  28637. // is not supported (00000000-0000-0000-0000-000000000000).
  28638. func (c *AutoscalersUpdateCall) RequestId(requestId string) *AutoscalersUpdateCall {
  28639. c.urlParams_.Set("requestId", requestId)
  28640. return c
  28641. }
  28642. // Fields allows partial responses to be retrieved. See
  28643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28644. // for more information.
  28645. func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
  28646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28647. return c
  28648. }
  28649. // Context sets the context to be used in this call's Do method. Any
  28650. // pending HTTP request will be aborted if the provided context is
  28651. // canceled.
  28652. func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
  28653. c.ctx_ = ctx
  28654. return c
  28655. }
  28656. // Header returns an http.Header that can be modified by the caller to
  28657. // add HTTP headers to the request.
  28658. func (c *AutoscalersUpdateCall) Header() http.Header {
  28659. if c.header_ == nil {
  28660. c.header_ = make(http.Header)
  28661. }
  28662. return c.header_
  28663. }
  28664. func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  28665. reqHeaders := make(http.Header)
  28666. for k, v := range c.header_ {
  28667. reqHeaders[k] = v
  28668. }
  28669. reqHeaders.Set("User-Agent", c.s.userAgent())
  28670. var body io.Reader = nil
  28671. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  28672. if err != nil {
  28673. return nil, err
  28674. }
  28675. reqHeaders.Set("Content-Type", "application/json")
  28676. c.urlParams_.Set("alt", alt)
  28677. c.urlParams_.Set("prettyPrint", "false")
  28678. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  28679. urls += "?" + c.urlParams_.Encode()
  28680. req, err := http.NewRequest("PUT", urls, body)
  28681. if err != nil {
  28682. return nil, err
  28683. }
  28684. req.Header = reqHeaders
  28685. googleapi.Expand(req.URL, map[string]string{
  28686. "project": c.project,
  28687. "zone": c.zone,
  28688. })
  28689. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28690. }
  28691. // Do executes the "compute.autoscalers.update" call.
  28692. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28693. // status code is an error. Response headers are in either
  28694. // *Operation.ServerResponse.Header or (if a response was returned at
  28695. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28696. // to check whether the returned error was because
  28697. // http.StatusNotModified was returned.
  28698. func (c *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28699. gensupport.SetOptions(c.urlParams_, opts...)
  28700. res, err := c.doRequest("json")
  28701. if res != nil && res.StatusCode == http.StatusNotModified {
  28702. if res.Body != nil {
  28703. res.Body.Close()
  28704. }
  28705. return nil, &googleapi.Error{
  28706. Code: res.StatusCode,
  28707. Header: res.Header,
  28708. }
  28709. }
  28710. if err != nil {
  28711. return nil, err
  28712. }
  28713. defer googleapi.CloseBody(res)
  28714. if err := googleapi.CheckResponse(res); err != nil {
  28715. return nil, err
  28716. }
  28717. ret := &Operation{
  28718. ServerResponse: googleapi.ServerResponse{
  28719. Header: res.Header,
  28720. HTTPStatusCode: res.StatusCode,
  28721. },
  28722. }
  28723. target := &ret
  28724. if err := gensupport.DecodeResponse(target, res); err != nil {
  28725. return nil, err
  28726. }
  28727. return ret, nil
  28728. // {
  28729. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  28730. // "httpMethod": "PUT",
  28731. // "id": "compute.autoscalers.update",
  28732. // "parameterOrder": [
  28733. // "project",
  28734. // "zone"
  28735. // ],
  28736. // "parameters": {
  28737. // "autoscaler": {
  28738. // "description": "Name of the autoscaler to update.",
  28739. // "location": "query",
  28740. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  28741. // "type": "string"
  28742. // },
  28743. // "project": {
  28744. // "description": "Project ID for this request.",
  28745. // "location": "path",
  28746. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28747. // "required": true,
  28748. // "type": "string"
  28749. // },
  28750. // "requestId": {
  28751. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  28752. // "location": "query",
  28753. // "type": "string"
  28754. // },
  28755. // "zone": {
  28756. // "description": "Name of the zone for this request.",
  28757. // "location": "path",
  28758. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28759. // "required": true,
  28760. // "type": "string"
  28761. // }
  28762. // },
  28763. // "path": "{project}/zones/{zone}/autoscalers",
  28764. // "request": {
  28765. // "$ref": "Autoscaler"
  28766. // },
  28767. // "response": {
  28768. // "$ref": "Operation"
  28769. // },
  28770. // "scopes": [
  28771. // "https://www.googleapis.com/auth/cloud-platform",
  28772. // "https://www.googleapis.com/auth/compute"
  28773. // ]
  28774. // }
  28775. }
  28776. // method id "compute.backendBuckets.addSignedUrlKey":
  28777. type BackendBucketsAddSignedUrlKeyCall struct {
  28778. s *Service
  28779. project string
  28780. backendBucket string
  28781. signedurlkey *SignedUrlKey
  28782. urlParams_ gensupport.URLParams
  28783. ctx_ context.Context
  28784. header_ http.Header
  28785. }
  28786. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  28787. // for this backend bucket.
  28788. func (r *BackendBucketsService) AddSignedUrlKey(project string, backendBucket string, signedurlkey *SignedUrlKey) *BackendBucketsAddSignedUrlKeyCall {
  28789. c := &BackendBucketsAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28790. c.project = project
  28791. c.backendBucket = backendBucket
  28792. c.signedurlkey = signedurlkey
  28793. return c
  28794. }
  28795. // RequestId sets the optional parameter "requestId": An optional
  28796. // request ID to identify requests. Specify a unique request ID so that
  28797. // if you must retry your request, the server will know to ignore the
  28798. // request if it has already been completed.
  28799. //
  28800. // For example, consider a situation where you make an initial request
  28801. // and the request times out. If you make the request again with the
  28802. // same request ID, the server can check if original operation with the
  28803. // same request ID was received, and if so, will ignore the second
  28804. // request. This prevents clients from accidentally creating duplicate
  28805. // commitments.
  28806. //
  28807. // The request ID must be a valid UUID with the exception that zero UUID
  28808. // is not supported (00000000-0000-0000-0000-000000000000).
  28809. func (c *BackendBucketsAddSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsAddSignedUrlKeyCall {
  28810. c.urlParams_.Set("requestId", requestId)
  28811. return c
  28812. }
  28813. // Fields allows partial responses to be retrieved. See
  28814. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28815. // for more information.
  28816. func (c *BackendBucketsAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsAddSignedUrlKeyCall {
  28817. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28818. return c
  28819. }
  28820. // Context sets the context to be used in this call's Do method. Any
  28821. // pending HTTP request will be aborted if the provided context is
  28822. // canceled.
  28823. func (c *BackendBucketsAddSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsAddSignedUrlKeyCall {
  28824. c.ctx_ = ctx
  28825. return c
  28826. }
  28827. // Header returns an http.Header that can be modified by the caller to
  28828. // add HTTP headers to the request.
  28829. func (c *BackendBucketsAddSignedUrlKeyCall) Header() http.Header {
  28830. if c.header_ == nil {
  28831. c.header_ = make(http.Header)
  28832. }
  28833. return c.header_
  28834. }
  28835. func (c *BackendBucketsAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  28836. reqHeaders := make(http.Header)
  28837. for k, v := range c.header_ {
  28838. reqHeaders[k] = v
  28839. }
  28840. reqHeaders.Set("User-Agent", c.s.userAgent())
  28841. var body io.Reader = nil
  28842. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  28843. if err != nil {
  28844. return nil, err
  28845. }
  28846. reqHeaders.Set("Content-Type", "application/json")
  28847. c.urlParams_.Set("alt", alt)
  28848. c.urlParams_.Set("prettyPrint", "false")
  28849. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey")
  28850. urls += "?" + c.urlParams_.Encode()
  28851. req, err := http.NewRequest("POST", urls, body)
  28852. if err != nil {
  28853. return nil, err
  28854. }
  28855. req.Header = reqHeaders
  28856. googleapi.Expand(req.URL, map[string]string{
  28857. "project": c.project,
  28858. "backendBucket": c.backendBucket,
  28859. })
  28860. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28861. }
  28862. // Do executes the "compute.backendBuckets.addSignedUrlKey" call.
  28863. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28864. // status code is an error. Response headers are in either
  28865. // *Operation.ServerResponse.Header or (if a response was returned at
  28866. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28867. // to check whether the returned error was because
  28868. // http.StatusNotModified was returned.
  28869. func (c *BackendBucketsAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28870. gensupport.SetOptions(c.urlParams_, opts...)
  28871. res, err := c.doRequest("json")
  28872. if res != nil && res.StatusCode == http.StatusNotModified {
  28873. if res.Body != nil {
  28874. res.Body.Close()
  28875. }
  28876. return nil, &googleapi.Error{
  28877. Code: res.StatusCode,
  28878. Header: res.Header,
  28879. }
  28880. }
  28881. if err != nil {
  28882. return nil, err
  28883. }
  28884. defer googleapi.CloseBody(res)
  28885. if err := googleapi.CheckResponse(res); err != nil {
  28886. return nil, err
  28887. }
  28888. ret := &Operation{
  28889. ServerResponse: googleapi.ServerResponse{
  28890. Header: res.Header,
  28891. HTTPStatusCode: res.StatusCode,
  28892. },
  28893. }
  28894. target := &ret
  28895. if err := gensupport.DecodeResponse(target, res); err != nil {
  28896. return nil, err
  28897. }
  28898. return ret, nil
  28899. // {
  28900. // "description": "Adds a key for validating requests with signed URLs for this backend bucket.",
  28901. // "httpMethod": "POST",
  28902. // "id": "compute.backendBuckets.addSignedUrlKey",
  28903. // "parameterOrder": [
  28904. // "project",
  28905. // "backendBucket"
  28906. // ],
  28907. // "parameters": {
  28908. // "backendBucket": {
  28909. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  28910. // "location": "path",
  28911. // "required": true,
  28912. // "type": "string"
  28913. // },
  28914. // "project": {
  28915. // "description": "Project ID for this request.",
  28916. // "location": "path",
  28917. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28918. // "required": true,
  28919. // "type": "string"
  28920. // },
  28921. // "requestId": {
  28922. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  28923. // "location": "query",
  28924. // "type": "string"
  28925. // }
  28926. // },
  28927. // "path": "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey",
  28928. // "request": {
  28929. // "$ref": "SignedUrlKey"
  28930. // },
  28931. // "response": {
  28932. // "$ref": "Operation"
  28933. // },
  28934. // "scopes": [
  28935. // "https://www.googleapis.com/auth/cloud-platform",
  28936. // "https://www.googleapis.com/auth/compute"
  28937. // ]
  28938. // }
  28939. }
  28940. // method id "compute.backendBuckets.delete":
  28941. type BackendBucketsDeleteCall struct {
  28942. s *Service
  28943. project string
  28944. backendBucket string
  28945. urlParams_ gensupport.URLParams
  28946. ctx_ context.Context
  28947. header_ http.Header
  28948. }
  28949. // Delete: Deletes the specified BackendBucket resource.
  28950. func (r *BackendBucketsService) Delete(project string, backendBucket string) *BackendBucketsDeleteCall {
  28951. c := &BackendBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28952. c.project = project
  28953. c.backendBucket = backendBucket
  28954. return c
  28955. }
  28956. // RequestId sets the optional parameter "requestId": An optional
  28957. // request ID to identify requests. Specify a unique request ID so that
  28958. // if you must retry your request, the server will know to ignore the
  28959. // request if it has already been completed.
  28960. //
  28961. // For example, consider a situation where you make an initial request
  28962. // and the request times out. If you make the request again with the
  28963. // same request ID, the server can check if original operation with the
  28964. // same request ID was received, and if so, will ignore the second
  28965. // request. This prevents clients from accidentally creating duplicate
  28966. // commitments.
  28967. //
  28968. // The request ID must be a valid UUID with the exception that zero UUID
  28969. // is not supported (00000000-0000-0000-0000-000000000000).
  28970. func (c *BackendBucketsDeleteCall) RequestId(requestId string) *BackendBucketsDeleteCall {
  28971. c.urlParams_.Set("requestId", requestId)
  28972. return c
  28973. }
  28974. // Fields allows partial responses to be retrieved. See
  28975. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28976. // for more information.
  28977. func (c *BackendBucketsDeleteCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteCall {
  28978. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28979. return c
  28980. }
  28981. // Context sets the context to be used in this call's Do method. Any
  28982. // pending HTTP request will be aborted if the provided context is
  28983. // canceled.
  28984. func (c *BackendBucketsDeleteCall) Context(ctx context.Context) *BackendBucketsDeleteCall {
  28985. c.ctx_ = ctx
  28986. return c
  28987. }
  28988. // Header returns an http.Header that can be modified by the caller to
  28989. // add HTTP headers to the request.
  28990. func (c *BackendBucketsDeleteCall) Header() http.Header {
  28991. if c.header_ == nil {
  28992. c.header_ = make(http.Header)
  28993. }
  28994. return c.header_
  28995. }
  28996. func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  28997. reqHeaders := make(http.Header)
  28998. for k, v := range c.header_ {
  28999. reqHeaders[k] = v
  29000. }
  29001. reqHeaders.Set("User-Agent", c.s.userAgent())
  29002. var body io.Reader = nil
  29003. c.urlParams_.Set("alt", alt)
  29004. c.urlParams_.Set("prettyPrint", "false")
  29005. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  29006. urls += "?" + c.urlParams_.Encode()
  29007. req, err := http.NewRequest("DELETE", urls, body)
  29008. if err != nil {
  29009. return nil, err
  29010. }
  29011. req.Header = reqHeaders
  29012. googleapi.Expand(req.URL, map[string]string{
  29013. "project": c.project,
  29014. "backendBucket": c.backendBucket,
  29015. })
  29016. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29017. }
  29018. // Do executes the "compute.backendBuckets.delete" call.
  29019. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29020. // status code is an error. Response headers are in either
  29021. // *Operation.ServerResponse.Header or (if a response was returned at
  29022. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29023. // to check whether the returned error was because
  29024. // http.StatusNotModified was returned.
  29025. func (c *BackendBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29026. gensupport.SetOptions(c.urlParams_, opts...)
  29027. res, err := c.doRequest("json")
  29028. if res != nil && res.StatusCode == http.StatusNotModified {
  29029. if res.Body != nil {
  29030. res.Body.Close()
  29031. }
  29032. return nil, &googleapi.Error{
  29033. Code: res.StatusCode,
  29034. Header: res.Header,
  29035. }
  29036. }
  29037. if err != nil {
  29038. return nil, err
  29039. }
  29040. defer googleapi.CloseBody(res)
  29041. if err := googleapi.CheckResponse(res); err != nil {
  29042. return nil, err
  29043. }
  29044. ret := &Operation{
  29045. ServerResponse: googleapi.ServerResponse{
  29046. Header: res.Header,
  29047. HTTPStatusCode: res.StatusCode,
  29048. },
  29049. }
  29050. target := &ret
  29051. if err := gensupport.DecodeResponse(target, res); err != nil {
  29052. return nil, err
  29053. }
  29054. return ret, nil
  29055. // {
  29056. // "description": "Deletes the specified BackendBucket resource.",
  29057. // "httpMethod": "DELETE",
  29058. // "id": "compute.backendBuckets.delete",
  29059. // "parameterOrder": [
  29060. // "project",
  29061. // "backendBucket"
  29062. // ],
  29063. // "parameters": {
  29064. // "backendBucket": {
  29065. // "description": "Name of the BackendBucket resource to delete.",
  29066. // "location": "path",
  29067. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  29068. // "required": true,
  29069. // "type": "string"
  29070. // },
  29071. // "project": {
  29072. // "description": "Project ID for this request.",
  29073. // "location": "path",
  29074. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29075. // "required": true,
  29076. // "type": "string"
  29077. // },
  29078. // "requestId": {
  29079. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  29080. // "location": "query",
  29081. // "type": "string"
  29082. // }
  29083. // },
  29084. // "path": "{project}/global/backendBuckets/{backendBucket}",
  29085. // "response": {
  29086. // "$ref": "Operation"
  29087. // },
  29088. // "scopes": [
  29089. // "https://www.googleapis.com/auth/cloud-platform",
  29090. // "https://www.googleapis.com/auth/compute"
  29091. // ]
  29092. // }
  29093. }
  29094. // method id "compute.backendBuckets.deleteSignedUrlKey":
  29095. type BackendBucketsDeleteSignedUrlKeyCall struct {
  29096. s *Service
  29097. project string
  29098. backendBucket string
  29099. urlParams_ gensupport.URLParams
  29100. ctx_ context.Context
  29101. header_ http.Header
  29102. }
  29103. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  29104. // URLs for this backend bucket.
  29105. func (r *BackendBucketsService) DeleteSignedUrlKey(project string, backendBucket string, keyName string) *BackendBucketsDeleteSignedUrlKeyCall {
  29106. c := &BackendBucketsDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29107. c.project = project
  29108. c.backendBucket = backendBucket
  29109. c.urlParams_.Set("keyName", keyName)
  29110. return c
  29111. }
  29112. // RequestId sets the optional parameter "requestId": An optional
  29113. // request ID to identify requests. Specify a unique request ID so that
  29114. // if you must retry your request, the server will know to ignore the
  29115. // request if it has already been completed.
  29116. //
  29117. // For example, consider a situation where you make an initial request
  29118. // and the request times out. If you make the request again with the
  29119. // same request ID, the server can check if original operation with the
  29120. // same request ID was received, and if so, will ignore the second
  29121. // request. This prevents clients from accidentally creating duplicate
  29122. // commitments.
  29123. //
  29124. // The request ID must be a valid UUID with the exception that zero UUID
  29125. // is not supported (00000000-0000-0000-0000-000000000000).
  29126. func (c *BackendBucketsDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsDeleteSignedUrlKeyCall {
  29127. c.urlParams_.Set("requestId", requestId)
  29128. return c
  29129. }
  29130. // Fields allows partial responses to be retrieved. See
  29131. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29132. // for more information.
  29133. func (c *BackendBucketsDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteSignedUrlKeyCall {
  29134. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29135. return c
  29136. }
  29137. // Context sets the context to be used in this call's Do method. Any
  29138. // pending HTTP request will be aborted if the provided context is
  29139. // canceled.
  29140. func (c *BackendBucketsDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsDeleteSignedUrlKeyCall {
  29141. c.ctx_ = ctx
  29142. return c
  29143. }
  29144. // Header returns an http.Header that can be modified by the caller to
  29145. // add HTTP headers to the request.
  29146. func (c *BackendBucketsDeleteSignedUrlKeyCall) Header() http.Header {
  29147. if c.header_ == nil {
  29148. c.header_ = make(http.Header)
  29149. }
  29150. return c.header_
  29151. }
  29152. func (c *BackendBucketsDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  29153. reqHeaders := make(http.Header)
  29154. for k, v := range c.header_ {
  29155. reqHeaders[k] = v
  29156. }
  29157. reqHeaders.Set("User-Agent", c.s.userAgent())
  29158. var body io.Reader = nil
  29159. c.urlParams_.Set("alt", alt)
  29160. c.urlParams_.Set("prettyPrint", "false")
  29161. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey")
  29162. urls += "?" + c.urlParams_.Encode()
  29163. req, err := http.NewRequest("POST", urls, body)
  29164. if err != nil {
  29165. return nil, err
  29166. }
  29167. req.Header = reqHeaders
  29168. googleapi.Expand(req.URL, map[string]string{
  29169. "project": c.project,
  29170. "backendBucket": c.backendBucket,
  29171. })
  29172. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29173. }
  29174. // Do executes the "compute.backendBuckets.deleteSignedUrlKey" call.
  29175. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29176. // status code is an error. Response headers are in either
  29177. // *Operation.ServerResponse.Header or (if a response was returned at
  29178. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29179. // to check whether the returned error was because
  29180. // http.StatusNotModified was returned.
  29181. func (c *BackendBucketsDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29182. gensupport.SetOptions(c.urlParams_, opts...)
  29183. res, err := c.doRequest("json")
  29184. if res != nil && res.StatusCode == http.StatusNotModified {
  29185. if res.Body != nil {
  29186. res.Body.Close()
  29187. }
  29188. return nil, &googleapi.Error{
  29189. Code: res.StatusCode,
  29190. Header: res.Header,
  29191. }
  29192. }
  29193. if err != nil {
  29194. return nil, err
  29195. }
  29196. defer googleapi.CloseBody(res)
  29197. if err := googleapi.CheckResponse(res); err != nil {
  29198. return nil, err
  29199. }
  29200. ret := &Operation{
  29201. ServerResponse: googleapi.ServerResponse{
  29202. Header: res.Header,
  29203. HTTPStatusCode: res.StatusCode,
  29204. },
  29205. }
  29206. target := &ret
  29207. if err := gensupport.DecodeResponse(target, res); err != nil {
  29208. return nil, err
  29209. }
  29210. return ret, nil
  29211. // {
  29212. // "description": "Deletes a key for validating requests with signed URLs for this backend bucket.",
  29213. // "httpMethod": "POST",
  29214. // "id": "compute.backendBuckets.deleteSignedUrlKey",
  29215. // "parameterOrder": [
  29216. // "project",
  29217. // "backendBucket",
  29218. // "keyName"
  29219. // ],
  29220. // "parameters": {
  29221. // "backendBucket": {
  29222. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  29223. // "location": "path",
  29224. // "required": true,
  29225. // "type": "string"
  29226. // },
  29227. // "keyName": {
  29228. // "description": "The name of the Signed URL Key to delete.",
  29229. // "location": "query",
  29230. // "required": true,
  29231. // "type": "string"
  29232. // },
  29233. // "project": {
  29234. // "description": "Project ID for this request.",
  29235. // "location": "path",
  29236. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29237. // "required": true,
  29238. // "type": "string"
  29239. // },
  29240. // "requestId": {
  29241. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  29242. // "location": "query",
  29243. // "type": "string"
  29244. // }
  29245. // },
  29246. // "path": "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey",
  29247. // "response": {
  29248. // "$ref": "Operation"
  29249. // },
  29250. // "scopes": [
  29251. // "https://www.googleapis.com/auth/cloud-platform",
  29252. // "https://www.googleapis.com/auth/compute"
  29253. // ]
  29254. // }
  29255. }
  29256. // method id "compute.backendBuckets.get":
  29257. type BackendBucketsGetCall struct {
  29258. s *Service
  29259. project string
  29260. backendBucket string
  29261. urlParams_ gensupport.URLParams
  29262. ifNoneMatch_ string
  29263. ctx_ context.Context
  29264. header_ http.Header
  29265. }
  29266. // Get: Returns the specified BackendBucket resource. Gets a list of
  29267. // available backend buckets by making a list() request.
  29268. func (r *BackendBucketsService) Get(project string, backendBucket string) *BackendBucketsGetCall {
  29269. c := &BackendBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29270. c.project = project
  29271. c.backendBucket = backendBucket
  29272. return c
  29273. }
  29274. // Fields allows partial responses to be retrieved. See
  29275. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29276. // for more information.
  29277. func (c *BackendBucketsGetCall) Fields(s ...googleapi.Field) *BackendBucketsGetCall {
  29278. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29279. return c
  29280. }
  29281. // IfNoneMatch sets the optional parameter which makes the operation
  29282. // fail if the object's ETag matches the given value. This is useful for
  29283. // getting updates only after the object has changed since the last
  29284. // request. Use googleapi.IsNotModified to check whether the response
  29285. // error from Do is the result of In-None-Match.
  29286. func (c *BackendBucketsGetCall) IfNoneMatch(entityTag string) *BackendBucketsGetCall {
  29287. c.ifNoneMatch_ = entityTag
  29288. return c
  29289. }
  29290. // Context sets the context to be used in this call's Do method. Any
  29291. // pending HTTP request will be aborted if the provided context is
  29292. // canceled.
  29293. func (c *BackendBucketsGetCall) Context(ctx context.Context) *BackendBucketsGetCall {
  29294. c.ctx_ = ctx
  29295. return c
  29296. }
  29297. // Header returns an http.Header that can be modified by the caller to
  29298. // add HTTP headers to the request.
  29299. func (c *BackendBucketsGetCall) Header() http.Header {
  29300. if c.header_ == nil {
  29301. c.header_ = make(http.Header)
  29302. }
  29303. return c.header_
  29304. }
  29305. func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) {
  29306. reqHeaders := make(http.Header)
  29307. for k, v := range c.header_ {
  29308. reqHeaders[k] = v
  29309. }
  29310. reqHeaders.Set("User-Agent", c.s.userAgent())
  29311. if c.ifNoneMatch_ != "" {
  29312. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29313. }
  29314. var body io.Reader = nil
  29315. c.urlParams_.Set("alt", alt)
  29316. c.urlParams_.Set("prettyPrint", "false")
  29317. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  29318. urls += "?" + c.urlParams_.Encode()
  29319. req, err := http.NewRequest("GET", urls, body)
  29320. if err != nil {
  29321. return nil, err
  29322. }
  29323. req.Header = reqHeaders
  29324. googleapi.Expand(req.URL, map[string]string{
  29325. "project": c.project,
  29326. "backendBucket": c.backendBucket,
  29327. })
  29328. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29329. }
  29330. // Do executes the "compute.backendBuckets.get" call.
  29331. // Exactly one of *BackendBucket or error will be non-nil. Any non-2xx
  29332. // status code is an error. Response headers are in either
  29333. // *BackendBucket.ServerResponse.Header or (if a response was returned
  29334. // at all) in error.(*googleapi.Error).Header. Use
  29335. // googleapi.IsNotModified to check whether the returned error was
  29336. // because http.StatusNotModified was returned.
  29337. func (c *BackendBucketsGetCall) Do(opts ...googleapi.CallOption) (*BackendBucket, error) {
  29338. gensupport.SetOptions(c.urlParams_, opts...)
  29339. res, err := c.doRequest("json")
  29340. if res != nil && res.StatusCode == http.StatusNotModified {
  29341. if res.Body != nil {
  29342. res.Body.Close()
  29343. }
  29344. return nil, &googleapi.Error{
  29345. Code: res.StatusCode,
  29346. Header: res.Header,
  29347. }
  29348. }
  29349. if err != nil {
  29350. return nil, err
  29351. }
  29352. defer googleapi.CloseBody(res)
  29353. if err := googleapi.CheckResponse(res); err != nil {
  29354. return nil, err
  29355. }
  29356. ret := &BackendBucket{
  29357. ServerResponse: googleapi.ServerResponse{
  29358. Header: res.Header,
  29359. HTTPStatusCode: res.StatusCode,
  29360. },
  29361. }
  29362. target := &ret
  29363. if err := gensupport.DecodeResponse(target, res); err != nil {
  29364. return nil, err
  29365. }
  29366. return ret, nil
  29367. // {
  29368. // "description": "Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request.",
  29369. // "httpMethod": "GET",
  29370. // "id": "compute.backendBuckets.get",
  29371. // "parameterOrder": [
  29372. // "project",
  29373. // "backendBucket"
  29374. // ],
  29375. // "parameters": {
  29376. // "backendBucket": {
  29377. // "description": "Name of the BackendBucket resource to return.",
  29378. // "location": "path",
  29379. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  29380. // "required": true,
  29381. // "type": "string"
  29382. // },
  29383. // "project": {
  29384. // "description": "Project ID for this request.",
  29385. // "location": "path",
  29386. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29387. // "required": true,
  29388. // "type": "string"
  29389. // }
  29390. // },
  29391. // "path": "{project}/global/backendBuckets/{backendBucket}",
  29392. // "response": {
  29393. // "$ref": "BackendBucket"
  29394. // },
  29395. // "scopes": [
  29396. // "https://www.googleapis.com/auth/cloud-platform",
  29397. // "https://www.googleapis.com/auth/compute",
  29398. // "https://www.googleapis.com/auth/compute.readonly"
  29399. // ]
  29400. // }
  29401. }
  29402. // method id "compute.backendBuckets.insert":
  29403. type BackendBucketsInsertCall struct {
  29404. s *Service
  29405. project string
  29406. backendbucket *BackendBucket
  29407. urlParams_ gensupport.URLParams
  29408. ctx_ context.Context
  29409. header_ http.Header
  29410. }
  29411. // Insert: Creates a BackendBucket resource in the specified project
  29412. // using the data included in the request.
  29413. func (r *BackendBucketsService) Insert(project string, backendbucket *BackendBucket) *BackendBucketsInsertCall {
  29414. c := &BackendBucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29415. c.project = project
  29416. c.backendbucket = backendbucket
  29417. return c
  29418. }
  29419. // RequestId sets the optional parameter "requestId": An optional
  29420. // request ID to identify requests. Specify a unique request ID so that
  29421. // if you must retry your request, the server will know to ignore the
  29422. // request if it has already been completed.
  29423. //
  29424. // For example, consider a situation where you make an initial request
  29425. // and the request times out. If you make the request again with the
  29426. // same request ID, the server can check if original operation with the
  29427. // same request ID was received, and if so, will ignore the second
  29428. // request. This prevents clients from accidentally creating duplicate
  29429. // commitments.
  29430. //
  29431. // The request ID must be a valid UUID with the exception that zero UUID
  29432. // is not supported (00000000-0000-0000-0000-000000000000).
  29433. func (c *BackendBucketsInsertCall) RequestId(requestId string) *BackendBucketsInsertCall {
  29434. c.urlParams_.Set("requestId", requestId)
  29435. return c
  29436. }
  29437. // Fields allows partial responses to be retrieved. See
  29438. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29439. // for more information.
  29440. func (c *BackendBucketsInsertCall) Fields(s ...googleapi.Field) *BackendBucketsInsertCall {
  29441. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29442. return c
  29443. }
  29444. // Context sets the context to be used in this call's Do method. Any
  29445. // pending HTTP request will be aborted if the provided context is
  29446. // canceled.
  29447. func (c *BackendBucketsInsertCall) Context(ctx context.Context) *BackendBucketsInsertCall {
  29448. c.ctx_ = ctx
  29449. return c
  29450. }
  29451. // Header returns an http.Header that can be modified by the caller to
  29452. // add HTTP headers to the request.
  29453. func (c *BackendBucketsInsertCall) Header() http.Header {
  29454. if c.header_ == nil {
  29455. c.header_ = make(http.Header)
  29456. }
  29457. return c.header_
  29458. }
  29459. func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  29460. reqHeaders := make(http.Header)
  29461. for k, v := range c.header_ {
  29462. reqHeaders[k] = v
  29463. }
  29464. reqHeaders.Set("User-Agent", c.s.userAgent())
  29465. var body io.Reader = nil
  29466. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  29467. if err != nil {
  29468. return nil, err
  29469. }
  29470. reqHeaders.Set("Content-Type", "application/json")
  29471. c.urlParams_.Set("alt", alt)
  29472. c.urlParams_.Set("prettyPrint", "false")
  29473. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  29474. urls += "?" + c.urlParams_.Encode()
  29475. req, err := http.NewRequest("POST", urls, body)
  29476. if err != nil {
  29477. return nil, err
  29478. }
  29479. req.Header = reqHeaders
  29480. googleapi.Expand(req.URL, map[string]string{
  29481. "project": c.project,
  29482. })
  29483. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29484. }
  29485. // Do executes the "compute.backendBuckets.insert" call.
  29486. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29487. // status code is an error. Response headers are in either
  29488. // *Operation.ServerResponse.Header or (if a response was returned at
  29489. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29490. // to check whether the returned error was because
  29491. // http.StatusNotModified was returned.
  29492. func (c *BackendBucketsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29493. gensupport.SetOptions(c.urlParams_, opts...)
  29494. res, err := c.doRequest("json")
  29495. if res != nil && res.StatusCode == http.StatusNotModified {
  29496. if res.Body != nil {
  29497. res.Body.Close()
  29498. }
  29499. return nil, &googleapi.Error{
  29500. Code: res.StatusCode,
  29501. Header: res.Header,
  29502. }
  29503. }
  29504. if err != nil {
  29505. return nil, err
  29506. }
  29507. defer googleapi.CloseBody(res)
  29508. if err := googleapi.CheckResponse(res); err != nil {
  29509. return nil, err
  29510. }
  29511. ret := &Operation{
  29512. ServerResponse: googleapi.ServerResponse{
  29513. Header: res.Header,
  29514. HTTPStatusCode: res.StatusCode,
  29515. },
  29516. }
  29517. target := &ret
  29518. if err := gensupport.DecodeResponse(target, res); err != nil {
  29519. return nil, err
  29520. }
  29521. return ret, nil
  29522. // {
  29523. // "description": "Creates a BackendBucket resource in the specified project using the data included in the request.",
  29524. // "httpMethod": "POST",
  29525. // "id": "compute.backendBuckets.insert",
  29526. // "parameterOrder": [
  29527. // "project"
  29528. // ],
  29529. // "parameters": {
  29530. // "project": {
  29531. // "description": "Project ID for this request.",
  29532. // "location": "path",
  29533. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29534. // "required": true,
  29535. // "type": "string"
  29536. // },
  29537. // "requestId": {
  29538. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  29539. // "location": "query",
  29540. // "type": "string"
  29541. // }
  29542. // },
  29543. // "path": "{project}/global/backendBuckets",
  29544. // "request": {
  29545. // "$ref": "BackendBucket"
  29546. // },
  29547. // "response": {
  29548. // "$ref": "Operation"
  29549. // },
  29550. // "scopes": [
  29551. // "https://www.googleapis.com/auth/cloud-platform",
  29552. // "https://www.googleapis.com/auth/compute"
  29553. // ]
  29554. // }
  29555. }
  29556. // method id "compute.backendBuckets.list":
  29557. type BackendBucketsListCall struct {
  29558. s *Service
  29559. project string
  29560. urlParams_ gensupport.URLParams
  29561. ifNoneMatch_ string
  29562. ctx_ context.Context
  29563. header_ http.Header
  29564. }
  29565. // List: Retrieves the list of BackendBucket resources available to the
  29566. // specified project.
  29567. func (r *BackendBucketsService) List(project string) *BackendBucketsListCall {
  29568. c := &BackendBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29569. c.project = project
  29570. return c
  29571. }
  29572. // Filter sets the optional parameter "filter": A filter expression that
  29573. // filters resources listed in the response. The expression must specify
  29574. // the field name, a comparison operator, and the value that you want to
  29575. // use for filtering. The value must be a string, a number, or a
  29576. // boolean. The comparison operator must be either =, !=, >, or <.
  29577. //
  29578. // For example, if you are filtering Compute Engine instances, you can
  29579. // exclude instances named example-instance by specifying name !=
  29580. // example-instance.
  29581. //
  29582. // You can also filter nested fields. For example, you could specify
  29583. // scheduling.automaticRestart = false to include instances only if they
  29584. // are not scheduled for automatic restarts. You can use filtering on
  29585. // nested fields to filter based on resource labels.
  29586. //
  29587. // To filter on multiple expressions, provide each separate expression
  29588. // within parentheses. For example, (scheduling.automaticRestart = true)
  29589. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  29590. // AND expression. However, you can include AND and OR expressions
  29591. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  29592. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  29593. // true).
  29594. func (c *BackendBucketsListCall) Filter(filter string) *BackendBucketsListCall {
  29595. c.urlParams_.Set("filter", filter)
  29596. return c
  29597. }
  29598. // MaxResults sets the optional parameter "maxResults": The maximum
  29599. // number of results per page that should be returned. If the number of
  29600. // available results is larger than maxResults, Compute Engine returns a
  29601. // nextPageToken that can be used to get the next page of results in
  29602. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  29603. // (Default: 500)
  29604. func (c *BackendBucketsListCall) MaxResults(maxResults int64) *BackendBucketsListCall {
  29605. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29606. return c
  29607. }
  29608. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  29609. // a certain order. By default, results are returned in alphanumerical
  29610. // order based on the resource name.
  29611. //
  29612. // You can also sort results in descending order based on the creation
  29613. // timestamp using orderBy="creationTimestamp desc". This sorts results
  29614. // based on the creationTimestamp field in reverse chronological order
  29615. // (newest result first). Use this to sort resources like operations so
  29616. // that the newest operation is returned first.
  29617. //
  29618. // Currently, only sorting by name or creationTimestamp desc is
  29619. // supported.
  29620. func (c *BackendBucketsListCall) OrderBy(orderBy string) *BackendBucketsListCall {
  29621. c.urlParams_.Set("orderBy", orderBy)
  29622. return c
  29623. }
  29624. // PageToken sets the optional parameter "pageToken": Specifies a page
  29625. // token to use. Set pageToken to the nextPageToken returned by a
  29626. // previous list request to get the next page of results.
  29627. func (c *BackendBucketsListCall) PageToken(pageToken string) *BackendBucketsListCall {
  29628. c.urlParams_.Set("pageToken", pageToken)
  29629. return c
  29630. }
  29631. // Fields allows partial responses to be retrieved. See
  29632. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29633. // for more information.
  29634. func (c *BackendBucketsListCall) Fields(s ...googleapi.Field) *BackendBucketsListCall {
  29635. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29636. return c
  29637. }
  29638. // IfNoneMatch sets the optional parameter which makes the operation
  29639. // fail if the object's ETag matches the given value. This is useful for
  29640. // getting updates only after the object has changed since the last
  29641. // request. Use googleapi.IsNotModified to check whether the response
  29642. // error from Do is the result of In-None-Match.
  29643. func (c *BackendBucketsListCall) IfNoneMatch(entityTag string) *BackendBucketsListCall {
  29644. c.ifNoneMatch_ = entityTag
  29645. return c
  29646. }
  29647. // Context sets the context to be used in this call's Do method. Any
  29648. // pending HTTP request will be aborted if the provided context is
  29649. // canceled.
  29650. func (c *BackendBucketsListCall) Context(ctx context.Context) *BackendBucketsListCall {
  29651. c.ctx_ = ctx
  29652. return c
  29653. }
  29654. // Header returns an http.Header that can be modified by the caller to
  29655. // add HTTP headers to the request.
  29656. func (c *BackendBucketsListCall) Header() http.Header {
  29657. if c.header_ == nil {
  29658. c.header_ = make(http.Header)
  29659. }
  29660. return c.header_
  29661. }
  29662. func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) {
  29663. reqHeaders := make(http.Header)
  29664. for k, v := range c.header_ {
  29665. reqHeaders[k] = v
  29666. }
  29667. reqHeaders.Set("User-Agent", c.s.userAgent())
  29668. if c.ifNoneMatch_ != "" {
  29669. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29670. }
  29671. var body io.Reader = nil
  29672. c.urlParams_.Set("alt", alt)
  29673. c.urlParams_.Set("prettyPrint", "false")
  29674. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  29675. urls += "?" + c.urlParams_.Encode()
  29676. req, err := http.NewRequest("GET", urls, body)
  29677. if err != nil {
  29678. return nil, err
  29679. }
  29680. req.Header = reqHeaders
  29681. googleapi.Expand(req.URL, map[string]string{
  29682. "project": c.project,
  29683. })
  29684. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29685. }
  29686. // Do executes the "compute.backendBuckets.list" call.
  29687. // Exactly one of *BackendBucketList or error will be non-nil. Any
  29688. // non-2xx status code is an error. Response headers are in either
  29689. // *BackendBucketList.ServerResponse.Header or (if a response was
  29690. // returned at all) in error.(*googleapi.Error).Header. Use
  29691. // googleapi.IsNotModified to check whether the returned error was
  29692. // because http.StatusNotModified was returned.
  29693. func (c *BackendBucketsListCall) Do(opts ...googleapi.CallOption) (*BackendBucketList, error) {
  29694. gensupport.SetOptions(c.urlParams_, opts...)
  29695. res, err := c.doRequest("json")
  29696. if res != nil && res.StatusCode == http.StatusNotModified {
  29697. if res.Body != nil {
  29698. res.Body.Close()
  29699. }
  29700. return nil, &googleapi.Error{
  29701. Code: res.StatusCode,
  29702. Header: res.Header,
  29703. }
  29704. }
  29705. if err != nil {
  29706. return nil, err
  29707. }
  29708. defer googleapi.CloseBody(res)
  29709. if err := googleapi.CheckResponse(res); err != nil {
  29710. return nil, err
  29711. }
  29712. ret := &BackendBucketList{
  29713. ServerResponse: googleapi.ServerResponse{
  29714. Header: res.Header,
  29715. HTTPStatusCode: res.StatusCode,
  29716. },
  29717. }
  29718. target := &ret
  29719. if err := gensupport.DecodeResponse(target, res); err != nil {
  29720. return nil, err
  29721. }
  29722. return ret, nil
  29723. // {
  29724. // "description": "Retrieves the list of BackendBucket resources available to the specified project.",
  29725. // "httpMethod": "GET",
  29726. // "id": "compute.backendBuckets.list",
  29727. // "parameterOrder": [
  29728. // "project"
  29729. // ],
  29730. // "parameters": {
  29731. // "filter": {
  29732. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  29733. // "location": "query",
  29734. // "type": "string"
  29735. // },
  29736. // "maxResults": {
  29737. // "default": "500",
  29738. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  29739. // "format": "uint32",
  29740. // "location": "query",
  29741. // "minimum": "0",
  29742. // "type": "integer"
  29743. // },
  29744. // "orderBy": {
  29745. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  29746. // "location": "query",
  29747. // "type": "string"
  29748. // },
  29749. // "pageToken": {
  29750. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  29751. // "location": "query",
  29752. // "type": "string"
  29753. // },
  29754. // "project": {
  29755. // "description": "Project ID for this request.",
  29756. // "location": "path",
  29757. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29758. // "required": true,
  29759. // "type": "string"
  29760. // }
  29761. // },
  29762. // "path": "{project}/global/backendBuckets",
  29763. // "response": {
  29764. // "$ref": "BackendBucketList"
  29765. // },
  29766. // "scopes": [
  29767. // "https://www.googleapis.com/auth/cloud-platform",
  29768. // "https://www.googleapis.com/auth/compute",
  29769. // "https://www.googleapis.com/auth/compute.readonly"
  29770. // ]
  29771. // }
  29772. }
  29773. // Pages invokes f for each page of results.
  29774. // A non-nil error returned from f will halt the iteration.
  29775. // The provided context supersedes any context provided to the Context method.
  29776. func (c *BackendBucketsListCall) Pages(ctx context.Context, f func(*BackendBucketList) error) error {
  29777. c.ctx_ = ctx
  29778. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29779. for {
  29780. x, err := c.Do()
  29781. if err != nil {
  29782. return err
  29783. }
  29784. if err := f(x); err != nil {
  29785. return err
  29786. }
  29787. if x.NextPageToken == "" {
  29788. return nil
  29789. }
  29790. c.PageToken(x.NextPageToken)
  29791. }
  29792. }
  29793. // method id "compute.backendBuckets.patch":
  29794. type BackendBucketsPatchCall struct {
  29795. s *Service
  29796. project string
  29797. backendBucket string
  29798. backendbucket *BackendBucket
  29799. urlParams_ gensupport.URLParams
  29800. ctx_ context.Context
  29801. header_ http.Header
  29802. }
  29803. // Patch: Updates the specified BackendBucket resource with the data
  29804. // included in the request. This method supports PATCH semantics and
  29805. // uses the JSON merge patch format and processing rules.
  29806. func (r *BackendBucketsService) Patch(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsPatchCall {
  29807. c := &BackendBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29808. c.project = project
  29809. c.backendBucket = backendBucket
  29810. c.backendbucket = backendbucket
  29811. return c
  29812. }
  29813. // RequestId sets the optional parameter "requestId": An optional
  29814. // request ID to identify requests. Specify a unique request ID so that
  29815. // if you must retry your request, the server will know to ignore the
  29816. // request if it has already been completed.
  29817. //
  29818. // For example, consider a situation where you make an initial request
  29819. // and the request times out. If you make the request again with the
  29820. // same request ID, the server can check if original operation with the
  29821. // same request ID was received, and if so, will ignore the second
  29822. // request. This prevents clients from accidentally creating duplicate
  29823. // commitments.
  29824. //
  29825. // The request ID must be a valid UUID with the exception that zero UUID
  29826. // is not supported (00000000-0000-0000-0000-000000000000).
  29827. func (c *BackendBucketsPatchCall) RequestId(requestId string) *BackendBucketsPatchCall {
  29828. c.urlParams_.Set("requestId", requestId)
  29829. return c
  29830. }
  29831. // Fields allows partial responses to be retrieved. See
  29832. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29833. // for more information.
  29834. func (c *BackendBucketsPatchCall) Fields(s ...googleapi.Field) *BackendBucketsPatchCall {
  29835. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29836. return c
  29837. }
  29838. // Context sets the context to be used in this call's Do method. Any
  29839. // pending HTTP request will be aborted if the provided context is
  29840. // canceled.
  29841. func (c *BackendBucketsPatchCall) Context(ctx context.Context) *BackendBucketsPatchCall {
  29842. c.ctx_ = ctx
  29843. return c
  29844. }
  29845. // Header returns an http.Header that can be modified by the caller to
  29846. // add HTTP headers to the request.
  29847. func (c *BackendBucketsPatchCall) Header() http.Header {
  29848. if c.header_ == nil {
  29849. c.header_ = make(http.Header)
  29850. }
  29851. return c.header_
  29852. }
  29853. func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  29854. reqHeaders := make(http.Header)
  29855. for k, v := range c.header_ {
  29856. reqHeaders[k] = v
  29857. }
  29858. reqHeaders.Set("User-Agent", c.s.userAgent())
  29859. var body io.Reader = nil
  29860. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  29861. if err != nil {
  29862. return nil, err
  29863. }
  29864. reqHeaders.Set("Content-Type", "application/json")
  29865. c.urlParams_.Set("alt", alt)
  29866. c.urlParams_.Set("prettyPrint", "false")
  29867. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  29868. urls += "?" + c.urlParams_.Encode()
  29869. req, err := http.NewRequest("PATCH", urls, body)
  29870. if err != nil {
  29871. return nil, err
  29872. }
  29873. req.Header = reqHeaders
  29874. googleapi.Expand(req.URL, map[string]string{
  29875. "project": c.project,
  29876. "backendBucket": c.backendBucket,
  29877. })
  29878. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29879. }
  29880. // Do executes the "compute.backendBuckets.patch" call.
  29881. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29882. // status code is an error. Response headers are in either
  29883. // *Operation.ServerResponse.Header or (if a response was returned at
  29884. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29885. // to check whether the returned error was because
  29886. // http.StatusNotModified was returned.
  29887. func (c *BackendBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29888. gensupport.SetOptions(c.urlParams_, opts...)
  29889. res, err := c.doRequest("json")
  29890. if res != nil && res.StatusCode == http.StatusNotModified {
  29891. if res.Body != nil {
  29892. res.Body.Close()
  29893. }
  29894. return nil, &googleapi.Error{
  29895. Code: res.StatusCode,
  29896. Header: res.Header,
  29897. }
  29898. }
  29899. if err != nil {
  29900. return nil, err
  29901. }
  29902. defer googleapi.CloseBody(res)
  29903. if err := googleapi.CheckResponse(res); err != nil {
  29904. return nil, err
  29905. }
  29906. ret := &Operation{
  29907. ServerResponse: googleapi.ServerResponse{
  29908. Header: res.Header,
  29909. HTTPStatusCode: res.StatusCode,
  29910. },
  29911. }
  29912. target := &ret
  29913. if err := gensupport.DecodeResponse(target, res); err != nil {
  29914. return nil, err
  29915. }
  29916. return ret, nil
  29917. // {
  29918. // "description": "Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  29919. // "httpMethod": "PATCH",
  29920. // "id": "compute.backendBuckets.patch",
  29921. // "parameterOrder": [
  29922. // "project",
  29923. // "backendBucket"
  29924. // ],
  29925. // "parameters": {
  29926. // "backendBucket": {
  29927. // "description": "Name of the BackendBucket resource to patch.",
  29928. // "location": "path",
  29929. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  29930. // "required": true,
  29931. // "type": "string"
  29932. // },
  29933. // "project": {
  29934. // "description": "Project ID for this request.",
  29935. // "location": "path",
  29936. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29937. // "required": true,
  29938. // "type": "string"
  29939. // },
  29940. // "requestId": {
  29941. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  29942. // "location": "query",
  29943. // "type": "string"
  29944. // }
  29945. // },
  29946. // "path": "{project}/global/backendBuckets/{backendBucket}",
  29947. // "request": {
  29948. // "$ref": "BackendBucket"
  29949. // },
  29950. // "response": {
  29951. // "$ref": "Operation"
  29952. // },
  29953. // "scopes": [
  29954. // "https://www.googleapis.com/auth/cloud-platform",
  29955. // "https://www.googleapis.com/auth/compute"
  29956. // ]
  29957. // }
  29958. }
  29959. // method id "compute.backendBuckets.update":
  29960. type BackendBucketsUpdateCall struct {
  29961. s *Service
  29962. project string
  29963. backendBucket string
  29964. backendbucket *BackendBucket
  29965. urlParams_ gensupport.URLParams
  29966. ctx_ context.Context
  29967. header_ http.Header
  29968. }
  29969. // Update: Updates the specified BackendBucket resource with the data
  29970. // included in the request.
  29971. func (r *BackendBucketsService) Update(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsUpdateCall {
  29972. c := &BackendBucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29973. c.project = project
  29974. c.backendBucket = backendBucket
  29975. c.backendbucket = backendbucket
  29976. return c
  29977. }
  29978. // RequestId sets the optional parameter "requestId": An optional
  29979. // request ID to identify requests. Specify a unique request ID so that
  29980. // if you must retry your request, the server will know to ignore the
  29981. // request if it has already been completed.
  29982. //
  29983. // For example, consider a situation where you make an initial request
  29984. // and the request times out. If you make the request again with the
  29985. // same request ID, the server can check if original operation with the
  29986. // same request ID was received, and if so, will ignore the second
  29987. // request. This prevents clients from accidentally creating duplicate
  29988. // commitments.
  29989. //
  29990. // The request ID must be a valid UUID with the exception that zero UUID
  29991. // is not supported (00000000-0000-0000-0000-000000000000).
  29992. func (c *BackendBucketsUpdateCall) RequestId(requestId string) *BackendBucketsUpdateCall {
  29993. c.urlParams_.Set("requestId", requestId)
  29994. return c
  29995. }
  29996. // Fields allows partial responses to be retrieved. See
  29997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29998. // for more information.
  29999. func (c *BackendBucketsUpdateCall) Fields(s ...googleapi.Field) *BackendBucketsUpdateCall {
  30000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30001. return c
  30002. }
  30003. // Context sets the context to be used in this call's Do method. Any
  30004. // pending HTTP request will be aborted if the provided context is
  30005. // canceled.
  30006. func (c *BackendBucketsUpdateCall) Context(ctx context.Context) *BackendBucketsUpdateCall {
  30007. c.ctx_ = ctx
  30008. return c
  30009. }
  30010. // Header returns an http.Header that can be modified by the caller to
  30011. // add HTTP headers to the request.
  30012. func (c *BackendBucketsUpdateCall) Header() http.Header {
  30013. if c.header_ == nil {
  30014. c.header_ = make(http.Header)
  30015. }
  30016. return c.header_
  30017. }
  30018. func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  30019. reqHeaders := make(http.Header)
  30020. for k, v := range c.header_ {
  30021. reqHeaders[k] = v
  30022. }
  30023. reqHeaders.Set("User-Agent", c.s.userAgent())
  30024. var body io.Reader = nil
  30025. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  30026. if err != nil {
  30027. return nil, err
  30028. }
  30029. reqHeaders.Set("Content-Type", "application/json")
  30030. c.urlParams_.Set("alt", alt)
  30031. c.urlParams_.Set("prettyPrint", "false")
  30032. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  30033. urls += "?" + c.urlParams_.Encode()
  30034. req, err := http.NewRequest("PUT", urls, body)
  30035. if err != nil {
  30036. return nil, err
  30037. }
  30038. req.Header = reqHeaders
  30039. googleapi.Expand(req.URL, map[string]string{
  30040. "project": c.project,
  30041. "backendBucket": c.backendBucket,
  30042. })
  30043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30044. }
  30045. // Do executes the "compute.backendBuckets.update" call.
  30046. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30047. // status code is an error. Response headers are in either
  30048. // *Operation.ServerResponse.Header or (if a response was returned at
  30049. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30050. // to check whether the returned error was because
  30051. // http.StatusNotModified was returned.
  30052. func (c *BackendBucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30053. gensupport.SetOptions(c.urlParams_, opts...)
  30054. res, err := c.doRequest("json")
  30055. if res != nil && res.StatusCode == http.StatusNotModified {
  30056. if res.Body != nil {
  30057. res.Body.Close()
  30058. }
  30059. return nil, &googleapi.Error{
  30060. Code: res.StatusCode,
  30061. Header: res.Header,
  30062. }
  30063. }
  30064. if err != nil {
  30065. return nil, err
  30066. }
  30067. defer googleapi.CloseBody(res)
  30068. if err := googleapi.CheckResponse(res); err != nil {
  30069. return nil, err
  30070. }
  30071. ret := &Operation{
  30072. ServerResponse: googleapi.ServerResponse{
  30073. Header: res.Header,
  30074. HTTPStatusCode: res.StatusCode,
  30075. },
  30076. }
  30077. target := &ret
  30078. if err := gensupport.DecodeResponse(target, res); err != nil {
  30079. return nil, err
  30080. }
  30081. return ret, nil
  30082. // {
  30083. // "description": "Updates the specified BackendBucket resource with the data included in the request.",
  30084. // "httpMethod": "PUT",
  30085. // "id": "compute.backendBuckets.update",
  30086. // "parameterOrder": [
  30087. // "project",
  30088. // "backendBucket"
  30089. // ],
  30090. // "parameters": {
  30091. // "backendBucket": {
  30092. // "description": "Name of the BackendBucket resource to update.",
  30093. // "location": "path",
  30094. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  30095. // "required": true,
  30096. // "type": "string"
  30097. // },
  30098. // "project": {
  30099. // "description": "Project ID for this request.",
  30100. // "location": "path",
  30101. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30102. // "required": true,
  30103. // "type": "string"
  30104. // },
  30105. // "requestId": {
  30106. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  30107. // "location": "query",
  30108. // "type": "string"
  30109. // }
  30110. // },
  30111. // "path": "{project}/global/backendBuckets/{backendBucket}",
  30112. // "request": {
  30113. // "$ref": "BackendBucket"
  30114. // },
  30115. // "response": {
  30116. // "$ref": "Operation"
  30117. // },
  30118. // "scopes": [
  30119. // "https://www.googleapis.com/auth/cloud-platform",
  30120. // "https://www.googleapis.com/auth/compute"
  30121. // ]
  30122. // }
  30123. }
  30124. // method id "compute.backendServices.addSignedUrlKey":
  30125. type BackendServicesAddSignedUrlKeyCall struct {
  30126. s *Service
  30127. project string
  30128. backendService string
  30129. signedurlkey *SignedUrlKey
  30130. urlParams_ gensupport.URLParams
  30131. ctx_ context.Context
  30132. header_ http.Header
  30133. }
  30134. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  30135. // for this backend service.
  30136. func (r *BackendServicesService) AddSignedUrlKey(project string, backendService string, signedurlkey *SignedUrlKey) *BackendServicesAddSignedUrlKeyCall {
  30137. c := &BackendServicesAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30138. c.project = project
  30139. c.backendService = backendService
  30140. c.signedurlkey = signedurlkey
  30141. return c
  30142. }
  30143. // RequestId sets the optional parameter "requestId": An optional
  30144. // request ID to identify requests. Specify a unique request ID so that
  30145. // if you must retry your request, the server will know to ignore the
  30146. // request if it has already been completed.
  30147. //
  30148. // For example, consider a situation where you make an initial request
  30149. // and the request times out. If you make the request again with the
  30150. // same request ID, the server can check if original operation with the
  30151. // same request ID was received, and if so, will ignore the second
  30152. // request. This prevents clients from accidentally creating duplicate
  30153. // commitments.
  30154. //
  30155. // The request ID must be a valid UUID with the exception that zero UUID
  30156. // is not supported (00000000-0000-0000-0000-000000000000).
  30157. func (c *BackendServicesAddSignedUrlKeyCall) RequestId(requestId string) *BackendServicesAddSignedUrlKeyCall {
  30158. c.urlParams_.Set("requestId", requestId)
  30159. return c
  30160. }
  30161. // Fields allows partial responses to be retrieved. See
  30162. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30163. // for more information.
  30164. func (c *BackendServicesAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesAddSignedUrlKeyCall {
  30165. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30166. return c
  30167. }
  30168. // Context sets the context to be used in this call's Do method. Any
  30169. // pending HTTP request will be aborted if the provided context is
  30170. // canceled.
  30171. func (c *BackendServicesAddSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesAddSignedUrlKeyCall {
  30172. c.ctx_ = ctx
  30173. return c
  30174. }
  30175. // Header returns an http.Header that can be modified by the caller to
  30176. // add HTTP headers to the request.
  30177. func (c *BackendServicesAddSignedUrlKeyCall) Header() http.Header {
  30178. if c.header_ == nil {
  30179. c.header_ = make(http.Header)
  30180. }
  30181. return c.header_
  30182. }
  30183. func (c *BackendServicesAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  30184. reqHeaders := make(http.Header)
  30185. for k, v := range c.header_ {
  30186. reqHeaders[k] = v
  30187. }
  30188. reqHeaders.Set("User-Agent", c.s.userAgent())
  30189. var body io.Reader = nil
  30190. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  30191. if err != nil {
  30192. return nil, err
  30193. }
  30194. reqHeaders.Set("Content-Type", "application/json")
  30195. c.urlParams_.Set("alt", alt)
  30196. c.urlParams_.Set("prettyPrint", "false")
  30197. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/addSignedUrlKey")
  30198. urls += "?" + c.urlParams_.Encode()
  30199. req, err := http.NewRequest("POST", urls, body)
  30200. if err != nil {
  30201. return nil, err
  30202. }
  30203. req.Header = reqHeaders
  30204. googleapi.Expand(req.URL, map[string]string{
  30205. "project": c.project,
  30206. "backendService": c.backendService,
  30207. })
  30208. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30209. }
  30210. // Do executes the "compute.backendServices.addSignedUrlKey" call.
  30211. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30212. // status code is an error. Response headers are in either
  30213. // *Operation.ServerResponse.Header or (if a response was returned at
  30214. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30215. // to check whether the returned error was because
  30216. // http.StatusNotModified was returned.
  30217. func (c *BackendServicesAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30218. gensupport.SetOptions(c.urlParams_, opts...)
  30219. res, err := c.doRequest("json")
  30220. if res != nil && res.StatusCode == http.StatusNotModified {
  30221. if res.Body != nil {
  30222. res.Body.Close()
  30223. }
  30224. return nil, &googleapi.Error{
  30225. Code: res.StatusCode,
  30226. Header: res.Header,
  30227. }
  30228. }
  30229. if err != nil {
  30230. return nil, err
  30231. }
  30232. defer googleapi.CloseBody(res)
  30233. if err := googleapi.CheckResponse(res); err != nil {
  30234. return nil, err
  30235. }
  30236. ret := &Operation{
  30237. ServerResponse: googleapi.ServerResponse{
  30238. Header: res.Header,
  30239. HTTPStatusCode: res.StatusCode,
  30240. },
  30241. }
  30242. target := &ret
  30243. if err := gensupport.DecodeResponse(target, res); err != nil {
  30244. return nil, err
  30245. }
  30246. return ret, nil
  30247. // {
  30248. // "description": "Adds a key for validating requests with signed URLs for this backend service.",
  30249. // "httpMethod": "POST",
  30250. // "id": "compute.backendServices.addSignedUrlKey",
  30251. // "parameterOrder": [
  30252. // "project",
  30253. // "backendService"
  30254. // ],
  30255. // "parameters": {
  30256. // "backendService": {
  30257. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  30258. // "location": "path",
  30259. // "required": true,
  30260. // "type": "string"
  30261. // },
  30262. // "project": {
  30263. // "description": "Project ID for this request.",
  30264. // "location": "path",
  30265. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30266. // "required": true,
  30267. // "type": "string"
  30268. // },
  30269. // "requestId": {
  30270. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  30271. // "location": "query",
  30272. // "type": "string"
  30273. // }
  30274. // },
  30275. // "path": "{project}/global/backendServices/{backendService}/addSignedUrlKey",
  30276. // "request": {
  30277. // "$ref": "SignedUrlKey"
  30278. // },
  30279. // "response": {
  30280. // "$ref": "Operation"
  30281. // },
  30282. // "scopes": [
  30283. // "https://www.googleapis.com/auth/cloud-platform",
  30284. // "https://www.googleapis.com/auth/compute"
  30285. // ]
  30286. // }
  30287. }
  30288. // method id "compute.backendServices.aggregatedList":
  30289. type BackendServicesAggregatedListCall struct {
  30290. s *Service
  30291. project string
  30292. urlParams_ gensupport.URLParams
  30293. ifNoneMatch_ string
  30294. ctx_ context.Context
  30295. header_ http.Header
  30296. }
  30297. // AggregatedList: Retrieves the list of all BackendService resources,
  30298. // regional and global, available to the specified project.
  30299. func (r *BackendServicesService) AggregatedList(project string) *BackendServicesAggregatedListCall {
  30300. c := &BackendServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30301. c.project = project
  30302. return c
  30303. }
  30304. // Filter sets the optional parameter "filter": A filter expression that
  30305. // filters resources listed in the response. The expression must specify
  30306. // the field name, a comparison operator, and the value that you want to
  30307. // use for filtering. The value must be a string, a number, or a
  30308. // boolean. The comparison operator must be either =, !=, >, or <.
  30309. //
  30310. // For example, if you are filtering Compute Engine instances, you can
  30311. // exclude instances named example-instance by specifying name !=
  30312. // example-instance.
  30313. //
  30314. // You can also filter nested fields. For example, you could specify
  30315. // scheduling.automaticRestart = false to include instances only if they
  30316. // are not scheduled for automatic restarts. You can use filtering on
  30317. // nested fields to filter based on resource labels.
  30318. //
  30319. // To filter on multiple expressions, provide each separate expression
  30320. // within parentheses. For example, (scheduling.automaticRestart = true)
  30321. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  30322. // AND expression. However, you can include AND and OR expressions
  30323. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  30324. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  30325. // true).
  30326. func (c *BackendServicesAggregatedListCall) Filter(filter string) *BackendServicesAggregatedListCall {
  30327. c.urlParams_.Set("filter", filter)
  30328. return c
  30329. }
  30330. // MaxResults sets the optional parameter "maxResults": The maximum
  30331. // number of results per page that should be returned. If the number of
  30332. // available results is larger than maxResults, Compute Engine returns a
  30333. // nextPageToken that can be used to get the next page of results in
  30334. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  30335. // (Default: 500)
  30336. func (c *BackendServicesAggregatedListCall) MaxResults(maxResults int64) *BackendServicesAggregatedListCall {
  30337. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30338. return c
  30339. }
  30340. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  30341. // a certain order. By default, results are returned in alphanumerical
  30342. // order based on the resource name.
  30343. //
  30344. // You can also sort results in descending order based on the creation
  30345. // timestamp using orderBy="creationTimestamp desc". This sorts results
  30346. // based on the creationTimestamp field in reverse chronological order
  30347. // (newest result first). Use this to sort resources like operations so
  30348. // that the newest operation is returned first.
  30349. //
  30350. // Currently, only sorting by name or creationTimestamp desc is
  30351. // supported.
  30352. func (c *BackendServicesAggregatedListCall) OrderBy(orderBy string) *BackendServicesAggregatedListCall {
  30353. c.urlParams_.Set("orderBy", orderBy)
  30354. return c
  30355. }
  30356. // PageToken sets the optional parameter "pageToken": Specifies a page
  30357. // token to use. Set pageToken to the nextPageToken returned by a
  30358. // previous list request to get the next page of results.
  30359. func (c *BackendServicesAggregatedListCall) PageToken(pageToken string) *BackendServicesAggregatedListCall {
  30360. c.urlParams_.Set("pageToken", pageToken)
  30361. return c
  30362. }
  30363. // Fields allows partial responses to be retrieved. See
  30364. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30365. // for more information.
  30366. func (c *BackendServicesAggregatedListCall) Fields(s ...googleapi.Field) *BackendServicesAggregatedListCall {
  30367. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30368. return c
  30369. }
  30370. // IfNoneMatch sets the optional parameter which makes the operation
  30371. // fail if the object's ETag matches the given value. This is useful for
  30372. // getting updates only after the object has changed since the last
  30373. // request. Use googleapi.IsNotModified to check whether the response
  30374. // error from Do is the result of In-None-Match.
  30375. func (c *BackendServicesAggregatedListCall) IfNoneMatch(entityTag string) *BackendServicesAggregatedListCall {
  30376. c.ifNoneMatch_ = entityTag
  30377. return c
  30378. }
  30379. // Context sets the context to be used in this call's Do method. Any
  30380. // pending HTTP request will be aborted if the provided context is
  30381. // canceled.
  30382. func (c *BackendServicesAggregatedListCall) Context(ctx context.Context) *BackendServicesAggregatedListCall {
  30383. c.ctx_ = ctx
  30384. return c
  30385. }
  30386. // Header returns an http.Header that can be modified by the caller to
  30387. // add HTTP headers to the request.
  30388. func (c *BackendServicesAggregatedListCall) Header() http.Header {
  30389. if c.header_ == nil {
  30390. c.header_ = make(http.Header)
  30391. }
  30392. return c.header_
  30393. }
  30394. func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  30395. reqHeaders := make(http.Header)
  30396. for k, v := range c.header_ {
  30397. reqHeaders[k] = v
  30398. }
  30399. reqHeaders.Set("User-Agent", c.s.userAgent())
  30400. if c.ifNoneMatch_ != "" {
  30401. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30402. }
  30403. var body io.Reader = nil
  30404. c.urlParams_.Set("alt", alt)
  30405. c.urlParams_.Set("prettyPrint", "false")
  30406. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/backendServices")
  30407. urls += "?" + c.urlParams_.Encode()
  30408. req, err := http.NewRequest("GET", urls, body)
  30409. if err != nil {
  30410. return nil, err
  30411. }
  30412. req.Header = reqHeaders
  30413. googleapi.Expand(req.URL, map[string]string{
  30414. "project": c.project,
  30415. })
  30416. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30417. }
  30418. // Do executes the "compute.backendServices.aggregatedList" call.
  30419. // Exactly one of *BackendServiceAggregatedList or error will be
  30420. // non-nil. Any non-2xx status code is an error. Response headers are in
  30421. // either *BackendServiceAggregatedList.ServerResponse.Header or (if a
  30422. // response was returned at all) in error.(*googleapi.Error).Header. Use
  30423. // googleapi.IsNotModified to check whether the returned error was
  30424. // because http.StatusNotModified was returned.
  30425. func (c *BackendServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*BackendServiceAggregatedList, error) {
  30426. gensupport.SetOptions(c.urlParams_, opts...)
  30427. res, err := c.doRequest("json")
  30428. if res != nil && res.StatusCode == http.StatusNotModified {
  30429. if res.Body != nil {
  30430. res.Body.Close()
  30431. }
  30432. return nil, &googleapi.Error{
  30433. Code: res.StatusCode,
  30434. Header: res.Header,
  30435. }
  30436. }
  30437. if err != nil {
  30438. return nil, err
  30439. }
  30440. defer googleapi.CloseBody(res)
  30441. if err := googleapi.CheckResponse(res); err != nil {
  30442. return nil, err
  30443. }
  30444. ret := &BackendServiceAggregatedList{
  30445. ServerResponse: googleapi.ServerResponse{
  30446. Header: res.Header,
  30447. HTTPStatusCode: res.StatusCode,
  30448. },
  30449. }
  30450. target := &ret
  30451. if err := gensupport.DecodeResponse(target, res); err != nil {
  30452. return nil, err
  30453. }
  30454. return ret, nil
  30455. // {
  30456. // "description": "Retrieves the list of all BackendService resources, regional and global, available to the specified project.",
  30457. // "httpMethod": "GET",
  30458. // "id": "compute.backendServices.aggregatedList",
  30459. // "parameterOrder": [
  30460. // "project"
  30461. // ],
  30462. // "parameters": {
  30463. // "filter": {
  30464. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  30465. // "location": "query",
  30466. // "type": "string"
  30467. // },
  30468. // "maxResults": {
  30469. // "default": "500",
  30470. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  30471. // "format": "uint32",
  30472. // "location": "query",
  30473. // "minimum": "0",
  30474. // "type": "integer"
  30475. // },
  30476. // "orderBy": {
  30477. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  30478. // "location": "query",
  30479. // "type": "string"
  30480. // },
  30481. // "pageToken": {
  30482. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  30483. // "location": "query",
  30484. // "type": "string"
  30485. // },
  30486. // "project": {
  30487. // "description": "Name of the project scoping this request.",
  30488. // "location": "path",
  30489. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30490. // "required": true,
  30491. // "type": "string"
  30492. // }
  30493. // },
  30494. // "path": "{project}/aggregated/backendServices",
  30495. // "response": {
  30496. // "$ref": "BackendServiceAggregatedList"
  30497. // },
  30498. // "scopes": [
  30499. // "https://www.googleapis.com/auth/cloud-platform",
  30500. // "https://www.googleapis.com/auth/compute",
  30501. // "https://www.googleapis.com/auth/compute.readonly"
  30502. // ]
  30503. // }
  30504. }
  30505. // Pages invokes f for each page of results.
  30506. // A non-nil error returned from f will halt the iteration.
  30507. // The provided context supersedes any context provided to the Context method.
  30508. func (c *BackendServicesAggregatedListCall) Pages(ctx context.Context, f func(*BackendServiceAggregatedList) error) error {
  30509. c.ctx_ = ctx
  30510. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30511. for {
  30512. x, err := c.Do()
  30513. if err != nil {
  30514. return err
  30515. }
  30516. if err := f(x); err != nil {
  30517. return err
  30518. }
  30519. if x.NextPageToken == "" {
  30520. return nil
  30521. }
  30522. c.PageToken(x.NextPageToken)
  30523. }
  30524. }
  30525. // method id "compute.backendServices.delete":
  30526. type BackendServicesDeleteCall struct {
  30527. s *Service
  30528. project string
  30529. backendService string
  30530. urlParams_ gensupport.URLParams
  30531. ctx_ context.Context
  30532. header_ http.Header
  30533. }
  30534. // Delete: Deletes the specified BackendService resource.
  30535. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete
  30536. func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
  30537. c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30538. c.project = project
  30539. c.backendService = backendService
  30540. return c
  30541. }
  30542. // RequestId sets the optional parameter "requestId": An optional
  30543. // request ID to identify requests. Specify a unique request ID so that
  30544. // if you must retry your request, the server will know to ignore the
  30545. // request if it has already been completed.
  30546. //
  30547. // For example, consider a situation where you make an initial request
  30548. // and the request times out. If you make the request again with the
  30549. // same request ID, the server can check if original operation with the
  30550. // same request ID was received, and if so, will ignore the second
  30551. // request. This prevents clients from accidentally creating duplicate
  30552. // commitments.
  30553. //
  30554. // The request ID must be a valid UUID with the exception that zero UUID
  30555. // is not supported (00000000-0000-0000-0000-000000000000).
  30556. func (c *BackendServicesDeleteCall) RequestId(requestId string) *BackendServicesDeleteCall {
  30557. c.urlParams_.Set("requestId", requestId)
  30558. return c
  30559. }
  30560. // Fields allows partial responses to be retrieved. See
  30561. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30562. // for more information.
  30563. func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
  30564. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30565. return c
  30566. }
  30567. // Context sets the context to be used in this call's Do method. Any
  30568. // pending HTTP request will be aborted if the provided context is
  30569. // canceled.
  30570. func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
  30571. c.ctx_ = ctx
  30572. return c
  30573. }
  30574. // Header returns an http.Header that can be modified by the caller to
  30575. // add HTTP headers to the request.
  30576. func (c *BackendServicesDeleteCall) Header() http.Header {
  30577. if c.header_ == nil {
  30578. c.header_ = make(http.Header)
  30579. }
  30580. return c.header_
  30581. }
  30582. func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  30583. reqHeaders := make(http.Header)
  30584. for k, v := range c.header_ {
  30585. reqHeaders[k] = v
  30586. }
  30587. reqHeaders.Set("User-Agent", c.s.userAgent())
  30588. var body io.Reader = nil
  30589. c.urlParams_.Set("alt", alt)
  30590. c.urlParams_.Set("prettyPrint", "false")
  30591. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  30592. urls += "?" + c.urlParams_.Encode()
  30593. req, err := http.NewRequest("DELETE", urls, body)
  30594. if err != nil {
  30595. return nil, err
  30596. }
  30597. req.Header = reqHeaders
  30598. googleapi.Expand(req.URL, map[string]string{
  30599. "project": c.project,
  30600. "backendService": c.backendService,
  30601. })
  30602. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30603. }
  30604. // Do executes the "compute.backendServices.delete" call.
  30605. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30606. // status code is an error. Response headers are in either
  30607. // *Operation.ServerResponse.Header or (if a response was returned at
  30608. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30609. // to check whether the returned error was because
  30610. // http.StatusNotModified was returned.
  30611. func (c *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30612. gensupport.SetOptions(c.urlParams_, opts...)
  30613. res, err := c.doRequest("json")
  30614. if res != nil && res.StatusCode == http.StatusNotModified {
  30615. if res.Body != nil {
  30616. res.Body.Close()
  30617. }
  30618. return nil, &googleapi.Error{
  30619. Code: res.StatusCode,
  30620. Header: res.Header,
  30621. }
  30622. }
  30623. if err != nil {
  30624. return nil, err
  30625. }
  30626. defer googleapi.CloseBody(res)
  30627. if err := googleapi.CheckResponse(res); err != nil {
  30628. return nil, err
  30629. }
  30630. ret := &Operation{
  30631. ServerResponse: googleapi.ServerResponse{
  30632. Header: res.Header,
  30633. HTTPStatusCode: res.StatusCode,
  30634. },
  30635. }
  30636. target := &ret
  30637. if err := gensupport.DecodeResponse(target, res); err != nil {
  30638. return nil, err
  30639. }
  30640. return ret, nil
  30641. // {
  30642. // "description": "Deletes the specified BackendService resource.",
  30643. // "httpMethod": "DELETE",
  30644. // "id": "compute.backendServices.delete",
  30645. // "parameterOrder": [
  30646. // "project",
  30647. // "backendService"
  30648. // ],
  30649. // "parameters": {
  30650. // "backendService": {
  30651. // "description": "Name of the BackendService resource to delete.",
  30652. // "location": "path",
  30653. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  30654. // "required": true,
  30655. // "type": "string"
  30656. // },
  30657. // "project": {
  30658. // "description": "Project ID for this request.",
  30659. // "location": "path",
  30660. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30661. // "required": true,
  30662. // "type": "string"
  30663. // },
  30664. // "requestId": {
  30665. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  30666. // "location": "query",
  30667. // "type": "string"
  30668. // }
  30669. // },
  30670. // "path": "{project}/global/backendServices/{backendService}",
  30671. // "response": {
  30672. // "$ref": "Operation"
  30673. // },
  30674. // "scopes": [
  30675. // "https://www.googleapis.com/auth/cloud-platform",
  30676. // "https://www.googleapis.com/auth/compute"
  30677. // ]
  30678. // }
  30679. }
  30680. // method id "compute.backendServices.deleteSignedUrlKey":
  30681. type BackendServicesDeleteSignedUrlKeyCall struct {
  30682. s *Service
  30683. project string
  30684. backendService string
  30685. urlParams_ gensupport.URLParams
  30686. ctx_ context.Context
  30687. header_ http.Header
  30688. }
  30689. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  30690. // URLs for this backend service.
  30691. func (r *BackendServicesService) DeleteSignedUrlKey(project string, backendService string, keyName string) *BackendServicesDeleteSignedUrlKeyCall {
  30692. c := &BackendServicesDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30693. c.project = project
  30694. c.backendService = backendService
  30695. c.urlParams_.Set("keyName", keyName)
  30696. return c
  30697. }
  30698. // RequestId sets the optional parameter "requestId": An optional
  30699. // request ID to identify requests. Specify a unique request ID so that
  30700. // if you must retry your request, the server will know to ignore the
  30701. // request if it has already been completed.
  30702. //
  30703. // For example, consider a situation where you make an initial request
  30704. // and the request times out. If you make the request again with the
  30705. // same request ID, the server can check if original operation with the
  30706. // same request ID was received, and if so, will ignore the second
  30707. // request. This prevents clients from accidentally creating duplicate
  30708. // commitments.
  30709. //
  30710. // The request ID must be a valid UUID with the exception that zero UUID
  30711. // is not supported (00000000-0000-0000-0000-000000000000).
  30712. func (c *BackendServicesDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendServicesDeleteSignedUrlKeyCall {
  30713. c.urlParams_.Set("requestId", requestId)
  30714. return c
  30715. }
  30716. // Fields allows partial responses to be retrieved. See
  30717. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30718. // for more information.
  30719. func (c *BackendServicesDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesDeleteSignedUrlKeyCall {
  30720. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30721. return c
  30722. }
  30723. // Context sets the context to be used in this call's Do method. Any
  30724. // pending HTTP request will be aborted if the provided context is
  30725. // canceled.
  30726. func (c *BackendServicesDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesDeleteSignedUrlKeyCall {
  30727. c.ctx_ = ctx
  30728. return c
  30729. }
  30730. // Header returns an http.Header that can be modified by the caller to
  30731. // add HTTP headers to the request.
  30732. func (c *BackendServicesDeleteSignedUrlKeyCall) Header() http.Header {
  30733. if c.header_ == nil {
  30734. c.header_ = make(http.Header)
  30735. }
  30736. return c.header_
  30737. }
  30738. func (c *BackendServicesDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  30739. reqHeaders := make(http.Header)
  30740. for k, v := range c.header_ {
  30741. reqHeaders[k] = v
  30742. }
  30743. reqHeaders.Set("User-Agent", c.s.userAgent())
  30744. var body io.Reader = nil
  30745. c.urlParams_.Set("alt", alt)
  30746. c.urlParams_.Set("prettyPrint", "false")
  30747. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/deleteSignedUrlKey")
  30748. urls += "?" + c.urlParams_.Encode()
  30749. req, err := http.NewRequest("POST", urls, body)
  30750. if err != nil {
  30751. return nil, err
  30752. }
  30753. req.Header = reqHeaders
  30754. googleapi.Expand(req.URL, map[string]string{
  30755. "project": c.project,
  30756. "backendService": c.backendService,
  30757. })
  30758. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30759. }
  30760. // Do executes the "compute.backendServices.deleteSignedUrlKey" call.
  30761. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30762. // status code is an error. Response headers are in either
  30763. // *Operation.ServerResponse.Header or (if a response was returned at
  30764. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30765. // to check whether the returned error was because
  30766. // http.StatusNotModified was returned.
  30767. func (c *BackendServicesDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30768. gensupport.SetOptions(c.urlParams_, opts...)
  30769. res, err := c.doRequest("json")
  30770. if res != nil && res.StatusCode == http.StatusNotModified {
  30771. if res.Body != nil {
  30772. res.Body.Close()
  30773. }
  30774. return nil, &googleapi.Error{
  30775. Code: res.StatusCode,
  30776. Header: res.Header,
  30777. }
  30778. }
  30779. if err != nil {
  30780. return nil, err
  30781. }
  30782. defer googleapi.CloseBody(res)
  30783. if err := googleapi.CheckResponse(res); err != nil {
  30784. return nil, err
  30785. }
  30786. ret := &Operation{
  30787. ServerResponse: googleapi.ServerResponse{
  30788. Header: res.Header,
  30789. HTTPStatusCode: res.StatusCode,
  30790. },
  30791. }
  30792. target := &ret
  30793. if err := gensupport.DecodeResponse(target, res); err != nil {
  30794. return nil, err
  30795. }
  30796. return ret, nil
  30797. // {
  30798. // "description": "Deletes a key for validating requests with signed URLs for this backend service.",
  30799. // "httpMethod": "POST",
  30800. // "id": "compute.backendServices.deleteSignedUrlKey",
  30801. // "parameterOrder": [
  30802. // "project",
  30803. // "backendService",
  30804. // "keyName"
  30805. // ],
  30806. // "parameters": {
  30807. // "backendService": {
  30808. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  30809. // "location": "path",
  30810. // "required": true,
  30811. // "type": "string"
  30812. // },
  30813. // "keyName": {
  30814. // "description": "The name of the Signed URL Key to delete.",
  30815. // "location": "query",
  30816. // "required": true,
  30817. // "type": "string"
  30818. // },
  30819. // "project": {
  30820. // "description": "Project ID for this request.",
  30821. // "location": "path",
  30822. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30823. // "required": true,
  30824. // "type": "string"
  30825. // },
  30826. // "requestId": {
  30827. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  30828. // "location": "query",
  30829. // "type": "string"
  30830. // }
  30831. // },
  30832. // "path": "{project}/global/backendServices/{backendService}/deleteSignedUrlKey",
  30833. // "response": {
  30834. // "$ref": "Operation"
  30835. // },
  30836. // "scopes": [
  30837. // "https://www.googleapis.com/auth/cloud-platform",
  30838. // "https://www.googleapis.com/auth/compute"
  30839. // ]
  30840. // }
  30841. }
  30842. // method id "compute.backendServices.get":
  30843. type BackendServicesGetCall struct {
  30844. s *Service
  30845. project string
  30846. backendService string
  30847. urlParams_ gensupport.URLParams
  30848. ifNoneMatch_ string
  30849. ctx_ context.Context
  30850. header_ http.Header
  30851. }
  30852. // Get: Returns the specified BackendService resource. Gets a list of
  30853. // available backend services.
  30854. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get
  30855. func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
  30856. c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30857. c.project = project
  30858. c.backendService = backendService
  30859. return c
  30860. }
  30861. // Fields allows partial responses to be retrieved. See
  30862. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30863. // for more information.
  30864. func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
  30865. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30866. return c
  30867. }
  30868. // IfNoneMatch sets the optional parameter which makes the operation
  30869. // fail if the object's ETag matches the given value. This is useful for
  30870. // getting updates only after the object has changed since the last
  30871. // request. Use googleapi.IsNotModified to check whether the response
  30872. // error from Do is the result of In-None-Match.
  30873. func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
  30874. c.ifNoneMatch_ = entityTag
  30875. return c
  30876. }
  30877. // Context sets the context to be used in this call's Do method. Any
  30878. // pending HTTP request will be aborted if the provided context is
  30879. // canceled.
  30880. func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
  30881. c.ctx_ = ctx
  30882. return c
  30883. }
  30884. // Header returns an http.Header that can be modified by the caller to
  30885. // add HTTP headers to the request.
  30886. func (c *BackendServicesGetCall) Header() http.Header {
  30887. if c.header_ == nil {
  30888. c.header_ = make(http.Header)
  30889. }
  30890. return c.header_
  30891. }
  30892. func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  30893. reqHeaders := make(http.Header)
  30894. for k, v := range c.header_ {
  30895. reqHeaders[k] = v
  30896. }
  30897. reqHeaders.Set("User-Agent", c.s.userAgent())
  30898. if c.ifNoneMatch_ != "" {
  30899. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30900. }
  30901. var body io.Reader = nil
  30902. c.urlParams_.Set("alt", alt)
  30903. c.urlParams_.Set("prettyPrint", "false")
  30904. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  30905. urls += "?" + c.urlParams_.Encode()
  30906. req, err := http.NewRequest("GET", urls, body)
  30907. if err != nil {
  30908. return nil, err
  30909. }
  30910. req.Header = reqHeaders
  30911. googleapi.Expand(req.URL, map[string]string{
  30912. "project": c.project,
  30913. "backendService": c.backendService,
  30914. })
  30915. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30916. }
  30917. // Do executes the "compute.backendServices.get" call.
  30918. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  30919. // status code is an error. Response headers are in either
  30920. // *BackendService.ServerResponse.Header or (if a response was returned
  30921. // at all) in error.(*googleapi.Error).Header. Use
  30922. // googleapi.IsNotModified to check whether the returned error was
  30923. // because http.StatusNotModified was returned.
  30924. func (c *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  30925. gensupport.SetOptions(c.urlParams_, opts...)
  30926. res, err := c.doRequest("json")
  30927. if res != nil && res.StatusCode == http.StatusNotModified {
  30928. if res.Body != nil {
  30929. res.Body.Close()
  30930. }
  30931. return nil, &googleapi.Error{
  30932. Code: res.StatusCode,
  30933. Header: res.Header,
  30934. }
  30935. }
  30936. if err != nil {
  30937. return nil, err
  30938. }
  30939. defer googleapi.CloseBody(res)
  30940. if err := googleapi.CheckResponse(res); err != nil {
  30941. return nil, err
  30942. }
  30943. ret := &BackendService{
  30944. ServerResponse: googleapi.ServerResponse{
  30945. Header: res.Header,
  30946. HTTPStatusCode: res.StatusCode,
  30947. },
  30948. }
  30949. target := &ret
  30950. if err := gensupport.DecodeResponse(target, res); err != nil {
  30951. return nil, err
  30952. }
  30953. return ret, nil
  30954. // {
  30955. // "description": "Returns the specified BackendService resource. Gets a list of available backend services.",
  30956. // "httpMethod": "GET",
  30957. // "id": "compute.backendServices.get",
  30958. // "parameterOrder": [
  30959. // "project",
  30960. // "backendService"
  30961. // ],
  30962. // "parameters": {
  30963. // "backendService": {
  30964. // "description": "Name of the BackendService resource to return.",
  30965. // "location": "path",
  30966. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  30967. // "required": true,
  30968. // "type": "string"
  30969. // },
  30970. // "project": {
  30971. // "description": "Project ID for this request.",
  30972. // "location": "path",
  30973. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30974. // "required": true,
  30975. // "type": "string"
  30976. // }
  30977. // },
  30978. // "path": "{project}/global/backendServices/{backendService}",
  30979. // "response": {
  30980. // "$ref": "BackendService"
  30981. // },
  30982. // "scopes": [
  30983. // "https://www.googleapis.com/auth/cloud-platform",
  30984. // "https://www.googleapis.com/auth/compute",
  30985. // "https://www.googleapis.com/auth/compute.readonly"
  30986. // ]
  30987. // }
  30988. }
  30989. // method id "compute.backendServices.getHealth":
  30990. type BackendServicesGetHealthCall struct {
  30991. s *Service
  30992. project string
  30993. backendService string
  30994. resourcegroupreference *ResourceGroupReference
  30995. urlParams_ gensupport.URLParams
  30996. ctx_ context.Context
  30997. header_ http.Header
  30998. }
  30999. // GetHealth: Gets the most recent health check results for this
  31000. // BackendService.
  31001. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth
  31002. func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
  31003. c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31004. c.project = project
  31005. c.backendService = backendService
  31006. c.resourcegroupreference = resourcegroupreference
  31007. return c
  31008. }
  31009. // Fields allows partial responses to be retrieved. See
  31010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31011. // for more information.
  31012. func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
  31013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31014. return c
  31015. }
  31016. // Context sets the context to be used in this call's Do method. Any
  31017. // pending HTTP request will be aborted if the provided context is
  31018. // canceled.
  31019. func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
  31020. c.ctx_ = ctx
  31021. return c
  31022. }
  31023. // Header returns an http.Header that can be modified by the caller to
  31024. // add HTTP headers to the request.
  31025. func (c *BackendServicesGetHealthCall) Header() http.Header {
  31026. if c.header_ == nil {
  31027. c.header_ = make(http.Header)
  31028. }
  31029. return c.header_
  31030. }
  31031. func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  31032. reqHeaders := make(http.Header)
  31033. for k, v := range c.header_ {
  31034. reqHeaders[k] = v
  31035. }
  31036. reqHeaders.Set("User-Agent", c.s.userAgent())
  31037. var body io.Reader = nil
  31038. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  31039. if err != nil {
  31040. return nil, err
  31041. }
  31042. reqHeaders.Set("Content-Type", "application/json")
  31043. c.urlParams_.Set("alt", alt)
  31044. c.urlParams_.Set("prettyPrint", "false")
  31045. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth")
  31046. urls += "?" + c.urlParams_.Encode()
  31047. req, err := http.NewRequest("POST", urls, body)
  31048. if err != nil {
  31049. return nil, err
  31050. }
  31051. req.Header = reqHeaders
  31052. googleapi.Expand(req.URL, map[string]string{
  31053. "project": c.project,
  31054. "backendService": c.backendService,
  31055. })
  31056. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31057. }
  31058. // Do executes the "compute.backendServices.getHealth" call.
  31059. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  31060. // Any non-2xx status code is an error. Response headers are in either
  31061. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  31062. // was returned at all) in error.(*googleapi.Error).Header. Use
  31063. // googleapi.IsNotModified to check whether the returned error was
  31064. // because http.StatusNotModified was returned.
  31065. func (c *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  31066. gensupport.SetOptions(c.urlParams_, opts...)
  31067. res, err := c.doRequest("json")
  31068. if res != nil && res.StatusCode == http.StatusNotModified {
  31069. if res.Body != nil {
  31070. res.Body.Close()
  31071. }
  31072. return nil, &googleapi.Error{
  31073. Code: res.StatusCode,
  31074. Header: res.Header,
  31075. }
  31076. }
  31077. if err != nil {
  31078. return nil, err
  31079. }
  31080. defer googleapi.CloseBody(res)
  31081. if err := googleapi.CheckResponse(res); err != nil {
  31082. return nil, err
  31083. }
  31084. ret := &BackendServiceGroupHealth{
  31085. ServerResponse: googleapi.ServerResponse{
  31086. Header: res.Header,
  31087. HTTPStatusCode: res.StatusCode,
  31088. },
  31089. }
  31090. target := &ret
  31091. if err := gensupport.DecodeResponse(target, res); err != nil {
  31092. return nil, err
  31093. }
  31094. return ret, nil
  31095. // {
  31096. // "description": "Gets the most recent health check results for this BackendService.",
  31097. // "httpMethod": "POST",
  31098. // "id": "compute.backendServices.getHealth",
  31099. // "parameterOrder": [
  31100. // "project",
  31101. // "backendService"
  31102. // ],
  31103. // "parameters": {
  31104. // "backendService": {
  31105. // "description": "Name of the BackendService resource to which the queried instance belongs.",
  31106. // "location": "path",
  31107. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  31108. // "required": true,
  31109. // "type": "string"
  31110. // },
  31111. // "project": {
  31112. // "location": "path",
  31113. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31114. // "required": true,
  31115. // "type": "string"
  31116. // }
  31117. // },
  31118. // "path": "{project}/global/backendServices/{backendService}/getHealth",
  31119. // "request": {
  31120. // "$ref": "ResourceGroupReference"
  31121. // },
  31122. // "response": {
  31123. // "$ref": "BackendServiceGroupHealth"
  31124. // },
  31125. // "scopes": [
  31126. // "https://www.googleapis.com/auth/cloud-platform",
  31127. // "https://www.googleapis.com/auth/compute",
  31128. // "https://www.googleapis.com/auth/compute.readonly"
  31129. // ]
  31130. // }
  31131. }
  31132. // method id "compute.backendServices.insert":
  31133. type BackendServicesInsertCall struct {
  31134. s *Service
  31135. project string
  31136. backendservice *BackendService
  31137. urlParams_ gensupport.URLParams
  31138. ctx_ context.Context
  31139. header_ http.Header
  31140. }
  31141. // Insert: Creates a BackendService resource in the specified project
  31142. // using the data included in the request. There are several
  31143. // restrictions and guidelines to keep in mind when creating a backend
  31144. // service. Read Restrictions and Guidelines for more information.
  31145. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert
  31146. func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
  31147. c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31148. c.project = project
  31149. c.backendservice = backendservice
  31150. return c
  31151. }
  31152. // RequestId sets the optional parameter "requestId": An optional
  31153. // request ID to identify requests. Specify a unique request ID so that
  31154. // if you must retry your request, the server will know to ignore the
  31155. // request if it has already been completed.
  31156. //
  31157. // For example, consider a situation where you make an initial request
  31158. // and the request times out. If you make the request again with the
  31159. // same request ID, the server can check if original operation with the
  31160. // same request ID was received, and if so, will ignore the second
  31161. // request. This prevents clients from accidentally creating duplicate
  31162. // commitments.
  31163. //
  31164. // The request ID must be a valid UUID with the exception that zero UUID
  31165. // is not supported (00000000-0000-0000-0000-000000000000).
  31166. func (c *BackendServicesInsertCall) RequestId(requestId string) *BackendServicesInsertCall {
  31167. c.urlParams_.Set("requestId", requestId)
  31168. return c
  31169. }
  31170. // Fields allows partial responses to be retrieved. See
  31171. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31172. // for more information.
  31173. func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
  31174. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31175. return c
  31176. }
  31177. // Context sets the context to be used in this call's Do method. Any
  31178. // pending HTTP request will be aborted if the provided context is
  31179. // canceled.
  31180. func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
  31181. c.ctx_ = ctx
  31182. return c
  31183. }
  31184. // Header returns an http.Header that can be modified by the caller to
  31185. // add HTTP headers to the request.
  31186. func (c *BackendServicesInsertCall) Header() http.Header {
  31187. if c.header_ == nil {
  31188. c.header_ = make(http.Header)
  31189. }
  31190. return c.header_
  31191. }
  31192. func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  31193. reqHeaders := make(http.Header)
  31194. for k, v := range c.header_ {
  31195. reqHeaders[k] = v
  31196. }
  31197. reqHeaders.Set("User-Agent", c.s.userAgent())
  31198. var body io.Reader = nil
  31199. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  31200. if err != nil {
  31201. return nil, err
  31202. }
  31203. reqHeaders.Set("Content-Type", "application/json")
  31204. c.urlParams_.Set("alt", alt)
  31205. c.urlParams_.Set("prettyPrint", "false")
  31206. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  31207. urls += "?" + c.urlParams_.Encode()
  31208. req, err := http.NewRequest("POST", urls, body)
  31209. if err != nil {
  31210. return nil, err
  31211. }
  31212. req.Header = reqHeaders
  31213. googleapi.Expand(req.URL, map[string]string{
  31214. "project": c.project,
  31215. })
  31216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31217. }
  31218. // Do executes the "compute.backendServices.insert" call.
  31219. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31220. // status code is an error. Response headers are in either
  31221. // *Operation.ServerResponse.Header or (if a response was returned at
  31222. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31223. // to check whether the returned error was because
  31224. // http.StatusNotModified was returned.
  31225. func (c *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31226. gensupport.SetOptions(c.urlParams_, opts...)
  31227. res, err := c.doRequest("json")
  31228. if res != nil && res.StatusCode == http.StatusNotModified {
  31229. if res.Body != nil {
  31230. res.Body.Close()
  31231. }
  31232. return nil, &googleapi.Error{
  31233. Code: res.StatusCode,
  31234. Header: res.Header,
  31235. }
  31236. }
  31237. if err != nil {
  31238. return nil, err
  31239. }
  31240. defer googleapi.CloseBody(res)
  31241. if err := googleapi.CheckResponse(res); err != nil {
  31242. return nil, err
  31243. }
  31244. ret := &Operation{
  31245. ServerResponse: googleapi.ServerResponse{
  31246. Header: res.Header,
  31247. HTTPStatusCode: res.StatusCode,
  31248. },
  31249. }
  31250. target := &ret
  31251. if err := gensupport.DecodeResponse(target, res); err != nil {
  31252. return nil, err
  31253. }
  31254. return ret, nil
  31255. // {
  31256. // "description": "Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information.",
  31257. // "httpMethod": "POST",
  31258. // "id": "compute.backendServices.insert",
  31259. // "parameterOrder": [
  31260. // "project"
  31261. // ],
  31262. // "parameters": {
  31263. // "project": {
  31264. // "description": "Project ID for this request.",
  31265. // "location": "path",
  31266. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31267. // "required": true,
  31268. // "type": "string"
  31269. // },
  31270. // "requestId": {
  31271. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  31272. // "location": "query",
  31273. // "type": "string"
  31274. // }
  31275. // },
  31276. // "path": "{project}/global/backendServices",
  31277. // "request": {
  31278. // "$ref": "BackendService"
  31279. // },
  31280. // "response": {
  31281. // "$ref": "Operation"
  31282. // },
  31283. // "scopes": [
  31284. // "https://www.googleapis.com/auth/cloud-platform",
  31285. // "https://www.googleapis.com/auth/compute"
  31286. // ]
  31287. // }
  31288. }
  31289. // method id "compute.backendServices.list":
  31290. type BackendServicesListCall struct {
  31291. s *Service
  31292. project string
  31293. urlParams_ gensupport.URLParams
  31294. ifNoneMatch_ string
  31295. ctx_ context.Context
  31296. header_ http.Header
  31297. }
  31298. // List: Retrieves the list of BackendService resources available to the
  31299. // specified project.
  31300. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list
  31301. func (r *BackendServicesService) List(project string) *BackendServicesListCall {
  31302. c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31303. c.project = project
  31304. return c
  31305. }
  31306. // Filter sets the optional parameter "filter": A filter expression that
  31307. // filters resources listed in the response. The expression must specify
  31308. // the field name, a comparison operator, and the value that you want to
  31309. // use for filtering. The value must be a string, a number, or a
  31310. // boolean. The comparison operator must be either =, !=, >, or <.
  31311. //
  31312. // For example, if you are filtering Compute Engine instances, you can
  31313. // exclude instances named example-instance by specifying name !=
  31314. // example-instance.
  31315. //
  31316. // You can also filter nested fields. For example, you could specify
  31317. // scheduling.automaticRestart = false to include instances only if they
  31318. // are not scheduled for automatic restarts. You can use filtering on
  31319. // nested fields to filter based on resource labels.
  31320. //
  31321. // To filter on multiple expressions, provide each separate expression
  31322. // within parentheses. For example, (scheduling.automaticRestart = true)
  31323. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  31324. // AND expression. However, you can include AND and OR expressions
  31325. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  31326. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  31327. // true).
  31328. func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
  31329. c.urlParams_.Set("filter", filter)
  31330. return c
  31331. }
  31332. // MaxResults sets the optional parameter "maxResults": The maximum
  31333. // number of results per page that should be returned. If the number of
  31334. // available results is larger than maxResults, Compute Engine returns a
  31335. // nextPageToken that can be used to get the next page of results in
  31336. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  31337. // (Default: 500)
  31338. func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
  31339. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31340. return c
  31341. }
  31342. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  31343. // a certain order. By default, results are returned in alphanumerical
  31344. // order based on the resource name.
  31345. //
  31346. // You can also sort results in descending order based on the creation
  31347. // timestamp using orderBy="creationTimestamp desc". This sorts results
  31348. // based on the creationTimestamp field in reverse chronological order
  31349. // (newest result first). Use this to sort resources like operations so
  31350. // that the newest operation is returned first.
  31351. //
  31352. // Currently, only sorting by name or creationTimestamp desc is
  31353. // supported.
  31354. func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall {
  31355. c.urlParams_.Set("orderBy", orderBy)
  31356. return c
  31357. }
  31358. // PageToken sets the optional parameter "pageToken": Specifies a page
  31359. // token to use. Set pageToken to the nextPageToken returned by a
  31360. // previous list request to get the next page of results.
  31361. func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
  31362. c.urlParams_.Set("pageToken", pageToken)
  31363. return c
  31364. }
  31365. // Fields allows partial responses to be retrieved. See
  31366. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31367. // for more information.
  31368. func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
  31369. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31370. return c
  31371. }
  31372. // IfNoneMatch sets the optional parameter which makes the operation
  31373. // fail if the object's ETag matches the given value. This is useful for
  31374. // getting updates only after the object has changed since the last
  31375. // request. Use googleapi.IsNotModified to check whether the response
  31376. // error from Do is the result of In-None-Match.
  31377. func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
  31378. c.ifNoneMatch_ = entityTag
  31379. return c
  31380. }
  31381. // Context sets the context to be used in this call's Do method. Any
  31382. // pending HTTP request will be aborted if the provided context is
  31383. // canceled.
  31384. func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
  31385. c.ctx_ = ctx
  31386. return c
  31387. }
  31388. // Header returns an http.Header that can be modified by the caller to
  31389. // add HTTP headers to the request.
  31390. func (c *BackendServicesListCall) Header() http.Header {
  31391. if c.header_ == nil {
  31392. c.header_ = make(http.Header)
  31393. }
  31394. return c.header_
  31395. }
  31396. func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  31397. reqHeaders := make(http.Header)
  31398. for k, v := range c.header_ {
  31399. reqHeaders[k] = v
  31400. }
  31401. reqHeaders.Set("User-Agent", c.s.userAgent())
  31402. if c.ifNoneMatch_ != "" {
  31403. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31404. }
  31405. var body io.Reader = nil
  31406. c.urlParams_.Set("alt", alt)
  31407. c.urlParams_.Set("prettyPrint", "false")
  31408. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  31409. urls += "?" + c.urlParams_.Encode()
  31410. req, err := http.NewRequest("GET", urls, body)
  31411. if err != nil {
  31412. return nil, err
  31413. }
  31414. req.Header = reqHeaders
  31415. googleapi.Expand(req.URL, map[string]string{
  31416. "project": c.project,
  31417. })
  31418. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31419. }
  31420. // Do executes the "compute.backendServices.list" call.
  31421. // Exactly one of *BackendServiceList or error will be non-nil. Any
  31422. // non-2xx status code is an error. Response headers are in either
  31423. // *BackendServiceList.ServerResponse.Header or (if a response was
  31424. // returned at all) in error.(*googleapi.Error).Header. Use
  31425. // googleapi.IsNotModified to check whether the returned error was
  31426. // because http.StatusNotModified was returned.
  31427. func (c *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  31428. gensupport.SetOptions(c.urlParams_, opts...)
  31429. res, err := c.doRequest("json")
  31430. if res != nil && res.StatusCode == http.StatusNotModified {
  31431. if res.Body != nil {
  31432. res.Body.Close()
  31433. }
  31434. return nil, &googleapi.Error{
  31435. Code: res.StatusCode,
  31436. Header: res.Header,
  31437. }
  31438. }
  31439. if err != nil {
  31440. return nil, err
  31441. }
  31442. defer googleapi.CloseBody(res)
  31443. if err := googleapi.CheckResponse(res); err != nil {
  31444. return nil, err
  31445. }
  31446. ret := &BackendServiceList{
  31447. ServerResponse: googleapi.ServerResponse{
  31448. Header: res.Header,
  31449. HTTPStatusCode: res.StatusCode,
  31450. },
  31451. }
  31452. target := &ret
  31453. if err := gensupport.DecodeResponse(target, res); err != nil {
  31454. return nil, err
  31455. }
  31456. return ret, nil
  31457. // {
  31458. // "description": "Retrieves the list of BackendService resources available to the specified project.",
  31459. // "httpMethod": "GET",
  31460. // "id": "compute.backendServices.list",
  31461. // "parameterOrder": [
  31462. // "project"
  31463. // ],
  31464. // "parameters": {
  31465. // "filter": {
  31466. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  31467. // "location": "query",
  31468. // "type": "string"
  31469. // },
  31470. // "maxResults": {
  31471. // "default": "500",
  31472. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  31473. // "format": "uint32",
  31474. // "location": "query",
  31475. // "minimum": "0",
  31476. // "type": "integer"
  31477. // },
  31478. // "orderBy": {
  31479. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  31480. // "location": "query",
  31481. // "type": "string"
  31482. // },
  31483. // "pageToken": {
  31484. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  31485. // "location": "query",
  31486. // "type": "string"
  31487. // },
  31488. // "project": {
  31489. // "description": "Project ID for this request.",
  31490. // "location": "path",
  31491. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31492. // "required": true,
  31493. // "type": "string"
  31494. // }
  31495. // },
  31496. // "path": "{project}/global/backendServices",
  31497. // "response": {
  31498. // "$ref": "BackendServiceList"
  31499. // },
  31500. // "scopes": [
  31501. // "https://www.googleapis.com/auth/cloud-platform",
  31502. // "https://www.googleapis.com/auth/compute",
  31503. // "https://www.googleapis.com/auth/compute.readonly"
  31504. // ]
  31505. // }
  31506. }
  31507. // Pages invokes f for each page of results.
  31508. // A non-nil error returned from f will halt the iteration.
  31509. // The provided context supersedes any context provided to the Context method.
  31510. func (c *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  31511. c.ctx_ = ctx
  31512. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31513. for {
  31514. x, err := c.Do()
  31515. if err != nil {
  31516. return err
  31517. }
  31518. if err := f(x); err != nil {
  31519. return err
  31520. }
  31521. if x.NextPageToken == "" {
  31522. return nil
  31523. }
  31524. c.PageToken(x.NextPageToken)
  31525. }
  31526. }
  31527. // method id "compute.backendServices.patch":
  31528. type BackendServicesPatchCall struct {
  31529. s *Service
  31530. project string
  31531. backendService string
  31532. backendservice *BackendService
  31533. urlParams_ gensupport.URLParams
  31534. ctx_ context.Context
  31535. header_ http.Header
  31536. }
  31537. // Patch: Patches the specified BackendService resource with the data
  31538. // included in the request. There are several restrictions and
  31539. // guidelines to keep in mind when updating a backend service. Read
  31540. // Restrictions and Guidelines for more information. This method
  31541. // supports PATCH semantics and uses the JSON merge patch format and
  31542. // processing rules.
  31543. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch
  31544. func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
  31545. c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31546. c.project = project
  31547. c.backendService = backendService
  31548. c.backendservice = backendservice
  31549. return c
  31550. }
  31551. // RequestId sets the optional parameter "requestId": An optional
  31552. // request ID to identify requests. Specify a unique request ID so that
  31553. // if you must retry your request, the server will know to ignore the
  31554. // request if it has already been completed.
  31555. //
  31556. // For example, consider a situation where you make an initial request
  31557. // and the request times out. If you make the request again with the
  31558. // same request ID, the server can check if original operation with the
  31559. // same request ID was received, and if so, will ignore the second
  31560. // request. This prevents clients from accidentally creating duplicate
  31561. // commitments.
  31562. //
  31563. // The request ID must be a valid UUID with the exception that zero UUID
  31564. // is not supported (00000000-0000-0000-0000-000000000000).
  31565. func (c *BackendServicesPatchCall) RequestId(requestId string) *BackendServicesPatchCall {
  31566. c.urlParams_.Set("requestId", requestId)
  31567. return c
  31568. }
  31569. // Fields allows partial responses to be retrieved. See
  31570. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31571. // for more information.
  31572. func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
  31573. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31574. return c
  31575. }
  31576. // Context sets the context to be used in this call's Do method. Any
  31577. // pending HTTP request will be aborted if the provided context is
  31578. // canceled.
  31579. func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
  31580. c.ctx_ = ctx
  31581. return c
  31582. }
  31583. // Header returns an http.Header that can be modified by the caller to
  31584. // add HTTP headers to the request.
  31585. func (c *BackendServicesPatchCall) Header() http.Header {
  31586. if c.header_ == nil {
  31587. c.header_ = make(http.Header)
  31588. }
  31589. return c.header_
  31590. }
  31591. func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  31592. reqHeaders := make(http.Header)
  31593. for k, v := range c.header_ {
  31594. reqHeaders[k] = v
  31595. }
  31596. reqHeaders.Set("User-Agent", c.s.userAgent())
  31597. var body io.Reader = nil
  31598. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  31599. if err != nil {
  31600. return nil, err
  31601. }
  31602. reqHeaders.Set("Content-Type", "application/json")
  31603. c.urlParams_.Set("alt", alt)
  31604. c.urlParams_.Set("prettyPrint", "false")
  31605. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  31606. urls += "?" + c.urlParams_.Encode()
  31607. req, err := http.NewRequest("PATCH", urls, body)
  31608. if err != nil {
  31609. return nil, err
  31610. }
  31611. req.Header = reqHeaders
  31612. googleapi.Expand(req.URL, map[string]string{
  31613. "project": c.project,
  31614. "backendService": c.backendService,
  31615. })
  31616. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31617. }
  31618. // Do executes the "compute.backendServices.patch" call.
  31619. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31620. // status code is an error. Response headers are in either
  31621. // *Operation.ServerResponse.Header or (if a response was returned at
  31622. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31623. // to check whether the returned error was because
  31624. // http.StatusNotModified was returned.
  31625. func (c *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31626. gensupport.SetOptions(c.urlParams_, opts...)
  31627. res, err := c.doRequest("json")
  31628. if res != nil && res.StatusCode == http.StatusNotModified {
  31629. if res.Body != nil {
  31630. res.Body.Close()
  31631. }
  31632. return nil, &googleapi.Error{
  31633. Code: res.StatusCode,
  31634. Header: res.Header,
  31635. }
  31636. }
  31637. if err != nil {
  31638. return nil, err
  31639. }
  31640. defer googleapi.CloseBody(res)
  31641. if err := googleapi.CheckResponse(res); err != nil {
  31642. return nil, err
  31643. }
  31644. ret := &Operation{
  31645. ServerResponse: googleapi.ServerResponse{
  31646. Header: res.Header,
  31647. HTTPStatusCode: res.StatusCode,
  31648. },
  31649. }
  31650. target := &ret
  31651. if err := gensupport.DecodeResponse(target, res); err != nil {
  31652. return nil, err
  31653. }
  31654. return ret, nil
  31655. // {
  31656. // "description": "Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  31657. // "httpMethod": "PATCH",
  31658. // "id": "compute.backendServices.patch",
  31659. // "parameterOrder": [
  31660. // "project",
  31661. // "backendService"
  31662. // ],
  31663. // "parameters": {
  31664. // "backendService": {
  31665. // "description": "Name of the BackendService resource to patch.",
  31666. // "location": "path",
  31667. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  31668. // "required": true,
  31669. // "type": "string"
  31670. // },
  31671. // "project": {
  31672. // "description": "Project ID for this request.",
  31673. // "location": "path",
  31674. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31675. // "required": true,
  31676. // "type": "string"
  31677. // },
  31678. // "requestId": {
  31679. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  31680. // "location": "query",
  31681. // "type": "string"
  31682. // }
  31683. // },
  31684. // "path": "{project}/global/backendServices/{backendService}",
  31685. // "request": {
  31686. // "$ref": "BackendService"
  31687. // },
  31688. // "response": {
  31689. // "$ref": "Operation"
  31690. // },
  31691. // "scopes": [
  31692. // "https://www.googleapis.com/auth/cloud-platform",
  31693. // "https://www.googleapis.com/auth/compute"
  31694. // ]
  31695. // }
  31696. }
  31697. // method id "compute.backendServices.setSecurityPolicy":
  31698. type BackendServicesSetSecurityPolicyCall struct {
  31699. s *Service
  31700. project string
  31701. backendService string
  31702. securitypolicyreference *SecurityPolicyReference
  31703. urlParams_ gensupport.URLParams
  31704. ctx_ context.Context
  31705. header_ http.Header
  31706. }
  31707. // SetSecurityPolicy: Sets the security policy for the specified backend
  31708. // service.
  31709. func (r *BackendServicesService) SetSecurityPolicy(project string, backendService string, securitypolicyreference *SecurityPolicyReference) *BackendServicesSetSecurityPolicyCall {
  31710. c := &BackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31711. c.project = project
  31712. c.backendService = backendService
  31713. c.securitypolicyreference = securitypolicyreference
  31714. return c
  31715. }
  31716. // RequestId sets the optional parameter "requestId": An optional
  31717. // request ID to identify requests. Specify a unique request ID so that
  31718. // if you must retry your request, the server will know to ignore the
  31719. // request if it has already been completed.
  31720. //
  31721. // For example, consider a situation where you make an initial request
  31722. // and the request times out. If you make the request again with the
  31723. // same request ID, the server can check if original operation with the
  31724. // same request ID was received, and if so, will ignore the second
  31725. // request. This prevents clients from accidentally creating duplicate
  31726. // commitments.
  31727. //
  31728. // The request ID must be a valid UUID with the exception that zero UUID
  31729. // is not supported (00000000-0000-0000-0000-000000000000).
  31730. func (c *BackendServicesSetSecurityPolicyCall) RequestId(requestId string) *BackendServicesSetSecurityPolicyCall {
  31731. c.urlParams_.Set("requestId", requestId)
  31732. return c
  31733. }
  31734. // Fields allows partial responses to be retrieved. See
  31735. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31736. // for more information.
  31737. func (c *BackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetSecurityPolicyCall {
  31738. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31739. return c
  31740. }
  31741. // Context sets the context to be used in this call's Do method. Any
  31742. // pending HTTP request will be aborted if the provided context is
  31743. // canceled.
  31744. func (c *BackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *BackendServicesSetSecurityPolicyCall {
  31745. c.ctx_ = ctx
  31746. return c
  31747. }
  31748. // Header returns an http.Header that can be modified by the caller to
  31749. // add HTTP headers to the request.
  31750. func (c *BackendServicesSetSecurityPolicyCall) Header() http.Header {
  31751. if c.header_ == nil {
  31752. c.header_ = make(http.Header)
  31753. }
  31754. return c.header_
  31755. }
  31756. func (c *BackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
  31757. reqHeaders := make(http.Header)
  31758. for k, v := range c.header_ {
  31759. reqHeaders[k] = v
  31760. }
  31761. reqHeaders.Set("User-Agent", c.s.userAgent())
  31762. var body io.Reader = nil
  31763. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
  31764. if err != nil {
  31765. return nil, err
  31766. }
  31767. reqHeaders.Set("Content-Type", "application/json")
  31768. c.urlParams_.Set("alt", alt)
  31769. c.urlParams_.Set("prettyPrint", "false")
  31770. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/setSecurityPolicy")
  31771. urls += "?" + c.urlParams_.Encode()
  31772. req, err := http.NewRequest("POST", urls, body)
  31773. if err != nil {
  31774. return nil, err
  31775. }
  31776. req.Header = reqHeaders
  31777. googleapi.Expand(req.URL, map[string]string{
  31778. "project": c.project,
  31779. "backendService": c.backendService,
  31780. })
  31781. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31782. }
  31783. // Do executes the "compute.backendServices.setSecurityPolicy" call.
  31784. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31785. // status code is an error. Response headers are in either
  31786. // *Operation.ServerResponse.Header or (if a response was returned at
  31787. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31788. // to check whether the returned error was because
  31789. // http.StatusNotModified was returned.
  31790. func (c *BackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31791. gensupport.SetOptions(c.urlParams_, opts...)
  31792. res, err := c.doRequest("json")
  31793. if res != nil && res.StatusCode == http.StatusNotModified {
  31794. if res.Body != nil {
  31795. res.Body.Close()
  31796. }
  31797. return nil, &googleapi.Error{
  31798. Code: res.StatusCode,
  31799. Header: res.Header,
  31800. }
  31801. }
  31802. if err != nil {
  31803. return nil, err
  31804. }
  31805. defer googleapi.CloseBody(res)
  31806. if err := googleapi.CheckResponse(res); err != nil {
  31807. return nil, err
  31808. }
  31809. ret := &Operation{
  31810. ServerResponse: googleapi.ServerResponse{
  31811. Header: res.Header,
  31812. HTTPStatusCode: res.StatusCode,
  31813. },
  31814. }
  31815. target := &ret
  31816. if err := gensupport.DecodeResponse(target, res); err != nil {
  31817. return nil, err
  31818. }
  31819. return ret, nil
  31820. // {
  31821. // "description": "Sets the security policy for the specified backend service.",
  31822. // "httpMethod": "POST",
  31823. // "id": "compute.backendServices.setSecurityPolicy",
  31824. // "parameterOrder": [
  31825. // "project",
  31826. // "backendService"
  31827. // ],
  31828. // "parameters": {
  31829. // "backendService": {
  31830. // "description": "Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.",
  31831. // "location": "path",
  31832. // "required": true,
  31833. // "type": "string"
  31834. // },
  31835. // "project": {
  31836. // "description": "Project ID for this request.",
  31837. // "location": "path",
  31838. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31839. // "required": true,
  31840. // "type": "string"
  31841. // },
  31842. // "requestId": {
  31843. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  31844. // "location": "query",
  31845. // "type": "string"
  31846. // }
  31847. // },
  31848. // "path": "{project}/global/backendServices/{backendService}/setSecurityPolicy",
  31849. // "request": {
  31850. // "$ref": "SecurityPolicyReference"
  31851. // },
  31852. // "response": {
  31853. // "$ref": "Operation"
  31854. // },
  31855. // "scopes": [
  31856. // "https://www.googleapis.com/auth/cloud-platform",
  31857. // "https://www.googleapis.com/auth/compute"
  31858. // ]
  31859. // }
  31860. }
  31861. // method id "compute.backendServices.update":
  31862. type BackendServicesUpdateCall struct {
  31863. s *Service
  31864. project string
  31865. backendService string
  31866. backendservice *BackendService
  31867. urlParams_ gensupport.URLParams
  31868. ctx_ context.Context
  31869. header_ http.Header
  31870. }
  31871. // Update: Updates the specified BackendService resource with the data
  31872. // included in the request. There are several restrictions and
  31873. // guidelines to keep in mind when updating a backend service. Read
  31874. // Restrictions and Guidelines for more information.
  31875. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update
  31876. func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
  31877. c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31878. c.project = project
  31879. c.backendService = backendService
  31880. c.backendservice = backendservice
  31881. return c
  31882. }
  31883. // RequestId sets the optional parameter "requestId": An optional
  31884. // request ID to identify requests. Specify a unique request ID so that
  31885. // if you must retry your request, the server will know to ignore the
  31886. // request if it has already been completed.
  31887. //
  31888. // For example, consider a situation where you make an initial request
  31889. // and the request times out. If you make the request again with the
  31890. // same request ID, the server can check if original operation with the
  31891. // same request ID was received, and if so, will ignore the second
  31892. // request. This prevents clients from accidentally creating duplicate
  31893. // commitments.
  31894. //
  31895. // The request ID must be a valid UUID with the exception that zero UUID
  31896. // is not supported (00000000-0000-0000-0000-000000000000).
  31897. func (c *BackendServicesUpdateCall) RequestId(requestId string) *BackendServicesUpdateCall {
  31898. c.urlParams_.Set("requestId", requestId)
  31899. return c
  31900. }
  31901. // Fields allows partial responses to be retrieved. See
  31902. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31903. // for more information.
  31904. func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
  31905. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31906. return c
  31907. }
  31908. // Context sets the context to be used in this call's Do method. Any
  31909. // pending HTTP request will be aborted if the provided context is
  31910. // canceled.
  31911. func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
  31912. c.ctx_ = ctx
  31913. return c
  31914. }
  31915. // Header returns an http.Header that can be modified by the caller to
  31916. // add HTTP headers to the request.
  31917. func (c *BackendServicesUpdateCall) Header() http.Header {
  31918. if c.header_ == nil {
  31919. c.header_ = make(http.Header)
  31920. }
  31921. return c.header_
  31922. }
  31923. func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  31924. reqHeaders := make(http.Header)
  31925. for k, v := range c.header_ {
  31926. reqHeaders[k] = v
  31927. }
  31928. reqHeaders.Set("User-Agent", c.s.userAgent())
  31929. var body io.Reader = nil
  31930. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  31931. if err != nil {
  31932. return nil, err
  31933. }
  31934. reqHeaders.Set("Content-Type", "application/json")
  31935. c.urlParams_.Set("alt", alt)
  31936. c.urlParams_.Set("prettyPrint", "false")
  31937. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  31938. urls += "?" + c.urlParams_.Encode()
  31939. req, err := http.NewRequest("PUT", urls, body)
  31940. if err != nil {
  31941. return nil, err
  31942. }
  31943. req.Header = reqHeaders
  31944. googleapi.Expand(req.URL, map[string]string{
  31945. "project": c.project,
  31946. "backendService": c.backendService,
  31947. })
  31948. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31949. }
  31950. // Do executes the "compute.backendServices.update" call.
  31951. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31952. // status code is an error. Response headers are in either
  31953. // *Operation.ServerResponse.Header or (if a response was returned at
  31954. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31955. // to check whether the returned error was because
  31956. // http.StatusNotModified was returned.
  31957. func (c *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31958. gensupport.SetOptions(c.urlParams_, opts...)
  31959. res, err := c.doRequest("json")
  31960. if res != nil && res.StatusCode == http.StatusNotModified {
  31961. if res.Body != nil {
  31962. res.Body.Close()
  31963. }
  31964. return nil, &googleapi.Error{
  31965. Code: res.StatusCode,
  31966. Header: res.Header,
  31967. }
  31968. }
  31969. if err != nil {
  31970. return nil, err
  31971. }
  31972. defer googleapi.CloseBody(res)
  31973. if err := googleapi.CheckResponse(res); err != nil {
  31974. return nil, err
  31975. }
  31976. ret := &Operation{
  31977. ServerResponse: googleapi.ServerResponse{
  31978. Header: res.Header,
  31979. HTTPStatusCode: res.StatusCode,
  31980. },
  31981. }
  31982. target := &ret
  31983. if err := gensupport.DecodeResponse(target, res); err != nil {
  31984. return nil, err
  31985. }
  31986. return ret, nil
  31987. // {
  31988. // "description": "Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information.",
  31989. // "httpMethod": "PUT",
  31990. // "id": "compute.backendServices.update",
  31991. // "parameterOrder": [
  31992. // "project",
  31993. // "backendService"
  31994. // ],
  31995. // "parameters": {
  31996. // "backendService": {
  31997. // "description": "Name of the BackendService resource to update.",
  31998. // "location": "path",
  31999. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  32000. // "required": true,
  32001. // "type": "string"
  32002. // },
  32003. // "project": {
  32004. // "description": "Project ID for this request.",
  32005. // "location": "path",
  32006. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32007. // "required": true,
  32008. // "type": "string"
  32009. // },
  32010. // "requestId": {
  32011. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  32012. // "location": "query",
  32013. // "type": "string"
  32014. // }
  32015. // },
  32016. // "path": "{project}/global/backendServices/{backendService}",
  32017. // "request": {
  32018. // "$ref": "BackendService"
  32019. // },
  32020. // "response": {
  32021. // "$ref": "Operation"
  32022. // },
  32023. // "scopes": [
  32024. // "https://www.googleapis.com/auth/cloud-platform",
  32025. // "https://www.googleapis.com/auth/compute"
  32026. // ]
  32027. // }
  32028. }
  32029. // method id "compute.diskTypes.aggregatedList":
  32030. type DiskTypesAggregatedListCall struct {
  32031. s *Service
  32032. project string
  32033. urlParams_ gensupport.URLParams
  32034. ifNoneMatch_ string
  32035. ctx_ context.Context
  32036. header_ http.Header
  32037. }
  32038. // AggregatedList: Retrieves an aggregated list of disk types.
  32039. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList
  32040. func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
  32041. c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32042. c.project = project
  32043. return c
  32044. }
  32045. // Filter sets the optional parameter "filter": A filter expression that
  32046. // filters resources listed in the response. The expression must specify
  32047. // the field name, a comparison operator, and the value that you want to
  32048. // use for filtering. The value must be a string, a number, or a
  32049. // boolean. The comparison operator must be either =, !=, >, or <.
  32050. //
  32051. // For example, if you are filtering Compute Engine instances, you can
  32052. // exclude instances named example-instance by specifying name !=
  32053. // example-instance.
  32054. //
  32055. // You can also filter nested fields. For example, you could specify
  32056. // scheduling.automaticRestart = false to include instances only if they
  32057. // are not scheduled for automatic restarts. You can use filtering on
  32058. // nested fields to filter based on resource labels.
  32059. //
  32060. // To filter on multiple expressions, provide each separate expression
  32061. // within parentheses. For example, (scheduling.automaticRestart = true)
  32062. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  32063. // AND expression. However, you can include AND and OR expressions
  32064. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  32065. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  32066. // true).
  32067. func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
  32068. c.urlParams_.Set("filter", filter)
  32069. return c
  32070. }
  32071. // MaxResults sets the optional parameter "maxResults": The maximum
  32072. // number of results per page that should be returned. If the number of
  32073. // available results is larger than maxResults, Compute Engine returns a
  32074. // nextPageToken that can be used to get the next page of results in
  32075. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  32076. // (Default: 500)
  32077. func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
  32078. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32079. return c
  32080. }
  32081. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32082. // a certain order. By default, results are returned in alphanumerical
  32083. // order based on the resource name.
  32084. //
  32085. // You can also sort results in descending order based on the creation
  32086. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32087. // based on the creationTimestamp field in reverse chronological order
  32088. // (newest result first). Use this to sort resources like operations so
  32089. // that the newest operation is returned first.
  32090. //
  32091. // Currently, only sorting by name or creationTimestamp desc is
  32092. // supported.
  32093. func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall {
  32094. c.urlParams_.Set("orderBy", orderBy)
  32095. return c
  32096. }
  32097. // PageToken sets the optional parameter "pageToken": Specifies a page
  32098. // token to use. Set pageToken to the nextPageToken returned by a
  32099. // previous list request to get the next page of results.
  32100. func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
  32101. c.urlParams_.Set("pageToken", pageToken)
  32102. return c
  32103. }
  32104. // Fields allows partial responses to be retrieved. See
  32105. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32106. // for more information.
  32107. func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
  32108. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32109. return c
  32110. }
  32111. // IfNoneMatch sets the optional parameter which makes the operation
  32112. // fail if the object's ETag matches the given value. This is useful for
  32113. // getting updates only after the object has changed since the last
  32114. // request. Use googleapi.IsNotModified to check whether the response
  32115. // error from Do is the result of In-None-Match.
  32116. func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
  32117. c.ifNoneMatch_ = entityTag
  32118. return c
  32119. }
  32120. // Context sets the context to be used in this call's Do method. Any
  32121. // pending HTTP request will be aborted if the provided context is
  32122. // canceled.
  32123. func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
  32124. c.ctx_ = ctx
  32125. return c
  32126. }
  32127. // Header returns an http.Header that can be modified by the caller to
  32128. // add HTTP headers to the request.
  32129. func (c *DiskTypesAggregatedListCall) Header() http.Header {
  32130. if c.header_ == nil {
  32131. c.header_ = make(http.Header)
  32132. }
  32133. return c.header_
  32134. }
  32135. func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  32136. reqHeaders := make(http.Header)
  32137. for k, v := range c.header_ {
  32138. reqHeaders[k] = v
  32139. }
  32140. reqHeaders.Set("User-Agent", c.s.userAgent())
  32141. if c.ifNoneMatch_ != "" {
  32142. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32143. }
  32144. var body io.Reader = nil
  32145. c.urlParams_.Set("alt", alt)
  32146. c.urlParams_.Set("prettyPrint", "false")
  32147. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes")
  32148. urls += "?" + c.urlParams_.Encode()
  32149. req, err := http.NewRequest("GET", urls, body)
  32150. if err != nil {
  32151. return nil, err
  32152. }
  32153. req.Header = reqHeaders
  32154. googleapi.Expand(req.URL, map[string]string{
  32155. "project": c.project,
  32156. })
  32157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32158. }
  32159. // Do executes the "compute.diskTypes.aggregatedList" call.
  32160. // Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any
  32161. // non-2xx status code is an error. Response headers are in either
  32162. // *DiskTypeAggregatedList.ServerResponse.Header or (if a response was
  32163. // returned at all) in error.(*googleapi.Error).Header. Use
  32164. // googleapi.IsNotModified to check whether the returned error was
  32165. // because http.StatusNotModified was returned.
  32166. func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, error) {
  32167. gensupport.SetOptions(c.urlParams_, opts...)
  32168. res, err := c.doRequest("json")
  32169. if res != nil && res.StatusCode == http.StatusNotModified {
  32170. if res.Body != nil {
  32171. res.Body.Close()
  32172. }
  32173. return nil, &googleapi.Error{
  32174. Code: res.StatusCode,
  32175. Header: res.Header,
  32176. }
  32177. }
  32178. if err != nil {
  32179. return nil, err
  32180. }
  32181. defer googleapi.CloseBody(res)
  32182. if err := googleapi.CheckResponse(res); err != nil {
  32183. return nil, err
  32184. }
  32185. ret := &DiskTypeAggregatedList{
  32186. ServerResponse: googleapi.ServerResponse{
  32187. Header: res.Header,
  32188. HTTPStatusCode: res.StatusCode,
  32189. },
  32190. }
  32191. target := &ret
  32192. if err := gensupport.DecodeResponse(target, res); err != nil {
  32193. return nil, err
  32194. }
  32195. return ret, nil
  32196. // {
  32197. // "description": "Retrieves an aggregated list of disk types.",
  32198. // "httpMethod": "GET",
  32199. // "id": "compute.diskTypes.aggregatedList",
  32200. // "parameterOrder": [
  32201. // "project"
  32202. // ],
  32203. // "parameters": {
  32204. // "filter": {
  32205. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  32206. // "location": "query",
  32207. // "type": "string"
  32208. // },
  32209. // "maxResults": {
  32210. // "default": "500",
  32211. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  32212. // "format": "uint32",
  32213. // "location": "query",
  32214. // "minimum": "0",
  32215. // "type": "integer"
  32216. // },
  32217. // "orderBy": {
  32218. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  32219. // "location": "query",
  32220. // "type": "string"
  32221. // },
  32222. // "pageToken": {
  32223. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  32224. // "location": "query",
  32225. // "type": "string"
  32226. // },
  32227. // "project": {
  32228. // "description": "Project ID for this request.",
  32229. // "location": "path",
  32230. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32231. // "required": true,
  32232. // "type": "string"
  32233. // }
  32234. // },
  32235. // "path": "{project}/aggregated/diskTypes",
  32236. // "response": {
  32237. // "$ref": "DiskTypeAggregatedList"
  32238. // },
  32239. // "scopes": [
  32240. // "https://www.googleapis.com/auth/cloud-platform",
  32241. // "https://www.googleapis.com/auth/compute",
  32242. // "https://www.googleapis.com/auth/compute.readonly"
  32243. // ]
  32244. // }
  32245. }
  32246. // Pages invokes f for each page of results.
  32247. // A non-nil error returned from f will halt the iteration.
  32248. // The provided context supersedes any context provided to the Context method.
  32249. func (c *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error {
  32250. c.ctx_ = ctx
  32251. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32252. for {
  32253. x, err := c.Do()
  32254. if err != nil {
  32255. return err
  32256. }
  32257. if err := f(x); err != nil {
  32258. return err
  32259. }
  32260. if x.NextPageToken == "" {
  32261. return nil
  32262. }
  32263. c.PageToken(x.NextPageToken)
  32264. }
  32265. }
  32266. // method id "compute.diskTypes.get":
  32267. type DiskTypesGetCall struct {
  32268. s *Service
  32269. project string
  32270. zone string
  32271. diskType string
  32272. urlParams_ gensupport.URLParams
  32273. ifNoneMatch_ string
  32274. ctx_ context.Context
  32275. header_ http.Header
  32276. }
  32277. // Get: Returns the specified disk type. Gets a list of available disk
  32278. // types by making a list() request.
  32279. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get
  32280. func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
  32281. c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32282. c.project = project
  32283. c.zone = zone
  32284. c.diskType = diskType
  32285. return c
  32286. }
  32287. // Fields allows partial responses to be retrieved. See
  32288. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32289. // for more information.
  32290. func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
  32291. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32292. return c
  32293. }
  32294. // IfNoneMatch sets the optional parameter which makes the operation
  32295. // fail if the object's ETag matches the given value. This is useful for
  32296. // getting updates only after the object has changed since the last
  32297. // request. Use googleapi.IsNotModified to check whether the response
  32298. // error from Do is the result of In-None-Match.
  32299. func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
  32300. c.ifNoneMatch_ = entityTag
  32301. return c
  32302. }
  32303. // Context sets the context to be used in this call's Do method. Any
  32304. // pending HTTP request will be aborted if the provided context is
  32305. // canceled.
  32306. func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
  32307. c.ctx_ = ctx
  32308. return c
  32309. }
  32310. // Header returns an http.Header that can be modified by the caller to
  32311. // add HTTP headers to the request.
  32312. func (c *DiskTypesGetCall) Header() http.Header {
  32313. if c.header_ == nil {
  32314. c.header_ = make(http.Header)
  32315. }
  32316. return c.header_
  32317. }
  32318. func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  32319. reqHeaders := make(http.Header)
  32320. for k, v := range c.header_ {
  32321. reqHeaders[k] = v
  32322. }
  32323. reqHeaders.Set("User-Agent", c.s.userAgent())
  32324. if c.ifNoneMatch_ != "" {
  32325. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32326. }
  32327. var body io.Reader = nil
  32328. c.urlParams_.Set("alt", alt)
  32329. c.urlParams_.Set("prettyPrint", "false")
  32330. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}")
  32331. urls += "?" + c.urlParams_.Encode()
  32332. req, err := http.NewRequest("GET", urls, body)
  32333. if err != nil {
  32334. return nil, err
  32335. }
  32336. req.Header = reqHeaders
  32337. googleapi.Expand(req.URL, map[string]string{
  32338. "project": c.project,
  32339. "zone": c.zone,
  32340. "diskType": c.diskType,
  32341. })
  32342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32343. }
  32344. // Do executes the "compute.diskTypes.get" call.
  32345. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  32346. // code is an error. Response headers are in either
  32347. // *DiskType.ServerResponse.Header or (if a response was returned at
  32348. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32349. // to check whether the returned error was because
  32350. // http.StatusNotModified was returned.
  32351. func (c *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  32352. gensupport.SetOptions(c.urlParams_, opts...)
  32353. res, err := c.doRequest("json")
  32354. if res != nil && res.StatusCode == http.StatusNotModified {
  32355. if res.Body != nil {
  32356. res.Body.Close()
  32357. }
  32358. return nil, &googleapi.Error{
  32359. Code: res.StatusCode,
  32360. Header: res.Header,
  32361. }
  32362. }
  32363. if err != nil {
  32364. return nil, err
  32365. }
  32366. defer googleapi.CloseBody(res)
  32367. if err := googleapi.CheckResponse(res); err != nil {
  32368. return nil, err
  32369. }
  32370. ret := &DiskType{
  32371. ServerResponse: googleapi.ServerResponse{
  32372. Header: res.Header,
  32373. HTTPStatusCode: res.StatusCode,
  32374. },
  32375. }
  32376. target := &ret
  32377. if err := gensupport.DecodeResponse(target, res); err != nil {
  32378. return nil, err
  32379. }
  32380. return ret, nil
  32381. // {
  32382. // "description": "Returns the specified disk type. Gets a list of available disk types by making a list() request.",
  32383. // "httpMethod": "GET",
  32384. // "id": "compute.diskTypes.get",
  32385. // "parameterOrder": [
  32386. // "project",
  32387. // "zone",
  32388. // "diskType"
  32389. // ],
  32390. // "parameters": {
  32391. // "diskType": {
  32392. // "description": "Name of the disk type to return.",
  32393. // "location": "path",
  32394. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  32395. // "required": true,
  32396. // "type": "string"
  32397. // },
  32398. // "project": {
  32399. // "description": "Project ID for this request.",
  32400. // "location": "path",
  32401. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32402. // "required": true,
  32403. // "type": "string"
  32404. // },
  32405. // "zone": {
  32406. // "description": "The name of the zone for this request.",
  32407. // "location": "path",
  32408. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32409. // "required": true,
  32410. // "type": "string"
  32411. // }
  32412. // },
  32413. // "path": "{project}/zones/{zone}/diskTypes/{diskType}",
  32414. // "response": {
  32415. // "$ref": "DiskType"
  32416. // },
  32417. // "scopes": [
  32418. // "https://www.googleapis.com/auth/cloud-platform",
  32419. // "https://www.googleapis.com/auth/compute",
  32420. // "https://www.googleapis.com/auth/compute.readonly"
  32421. // ]
  32422. // }
  32423. }
  32424. // method id "compute.diskTypes.list":
  32425. type DiskTypesListCall struct {
  32426. s *Service
  32427. project string
  32428. zone string
  32429. urlParams_ gensupport.URLParams
  32430. ifNoneMatch_ string
  32431. ctx_ context.Context
  32432. header_ http.Header
  32433. }
  32434. // List: Retrieves a list of disk types available to the specified
  32435. // project.
  32436. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list
  32437. func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
  32438. c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32439. c.project = project
  32440. c.zone = zone
  32441. return c
  32442. }
  32443. // Filter sets the optional parameter "filter": A filter expression that
  32444. // filters resources listed in the response. The expression must specify
  32445. // the field name, a comparison operator, and the value that you want to
  32446. // use for filtering. The value must be a string, a number, or a
  32447. // boolean. The comparison operator must be either =, !=, >, or <.
  32448. //
  32449. // For example, if you are filtering Compute Engine instances, you can
  32450. // exclude instances named example-instance by specifying name !=
  32451. // example-instance.
  32452. //
  32453. // You can also filter nested fields. For example, you could specify
  32454. // scheduling.automaticRestart = false to include instances only if they
  32455. // are not scheduled for automatic restarts. You can use filtering on
  32456. // nested fields to filter based on resource labels.
  32457. //
  32458. // To filter on multiple expressions, provide each separate expression
  32459. // within parentheses. For example, (scheduling.automaticRestart = true)
  32460. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  32461. // AND expression. However, you can include AND and OR expressions
  32462. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  32463. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  32464. // true).
  32465. func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
  32466. c.urlParams_.Set("filter", filter)
  32467. return c
  32468. }
  32469. // MaxResults sets the optional parameter "maxResults": The maximum
  32470. // number of results per page that should be returned. If the number of
  32471. // available results is larger than maxResults, Compute Engine returns a
  32472. // nextPageToken that can be used to get the next page of results in
  32473. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  32474. // (Default: 500)
  32475. func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
  32476. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32477. return c
  32478. }
  32479. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32480. // a certain order. By default, results are returned in alphanumerical
  32481. // order based on the resource name.
  32482. //
  32483. // You can also sort results in descending order based on the creation
  32484. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32485. // based on the creationTimestamp field in reverse chronological order
  32486. // (newest result first). Use this to sort resources like operations so
  32487. // that the newest operation is returned first.
  32488. //
  32489. // Currently, only sorting by name or creationTimestamp desc is
  32490. // supported.
  32491. func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall {
  32492. c.urlParams_.Set("orderBy", orderBy)
  32493. return c
  32494. }
  32495. // PageToken sets the optional parameter "pageToken": Specifies a page
  32496. // token to use. Set pageToken to the nextPageToken returned by a
  32497. // previous list request to get the next page of results.
  32498. func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
  32499. c.urlParams_.Set("pageToken", pageToken)
  32500. return c
  32501. }
  32502. // Fields allows partial responses to be retrieved. See
  32503. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32504. // for more information.
  32505. func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
  32506. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32507. return c
  32508. }
  32509. // IfNoneMatch sets the optional parameter which makes the operation
  32510. // fail if the object's ETag matches the given value. This is useful for
  32511. // getting updates only after the object has changed since the last
  32512. // request. Use googleapi.IsNotModified to check whether the response
  32513. // error from Do is the result of In-None-Match.
  32514. func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
  32515. c.ifNoneMatch_ = entityTag
  32516. return c
  32517. }
  32518. // Context sets the context to be used in this call's Do method. Any
  32519. // pending HTTP request will be aborted if the provided context is
  32520. // canceled.
  32521. func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
  32522. c.ctx_ = ctx
  32523. return c
  32524. }
  32525. // Header returns an http.Header that can be modified by the caller to
  32526. // add HTTP headers to the request.
  32527. func (c *DiskTypesListCall) Header() http.Header {
  32528. if c.header_ == nil {
  32529. c.header_ = make(http.Header)
  32530. }
  32531. return c.header_
  32532. }
  32533. func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  32534. reqHeaders := make(http.Header)
  32535. for k, v := range c.header_ {
  32536. reqHeaders[k] = v
  32537. }
  32538. reqHeaders.Set("User-Agent", c.s.userAgent())
  32539. if c.ifNoneMatch_ != "" {
  32540. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32541. }
  32542. var body io.Reader = nil
  32543. c.urlParams_.Set("alt", alt)
  32544. c.urlParams_.Set("prettyPrint", "false")
  32545. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes")
  32546. urls += "?" + c.urlParams_.Encode()
  32547. req, err := http.NewRequest("GET", urls, body)
  32548. if err != nil {
  32549. return nil, err
  32550. }
  32551. req.Header = reqHeaders
  32552. googleapi.Expand(req.URL, map[string]string{
  32553. "project": c.project,
  32554. "zone": c.zone,
  32555. })
  32556. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32557. }
  32558. // Do executes the "compute.diskTypes.list" call.
  32559. // Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx
  32560. // status code is an error. Response headers are in either
  32561. // *DiskTypeList.ServerResponse.Header or (if a response was returned at
  32562. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32563. // to check whether the returned error was because
  32564. // http.StatusNotModified was returned.
  32565. func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, error) {
  32566. gensupport.SetOptions(c.urlParams_, opts...)
  32567. res, err := c.doRequest("json")
  32568. if res != nil && res.StatusCode == http.StatusNotModified {
  32569. if res.Body != nil {
  32570. res.Body.Close()
  32571. }
  32572. return nil, &googleapi.Error{
  32573. Code: res.StatusCode,
  32574. Header: res.Header,
  32575. }
  32576. }
  32577. if err != nil {
  32578. return nil, err
  32579. }
  32580. defer googleapi.CloseBody(res)
  32581. if err := googleapi.CheckResponse(res); err != nil {
  32582. return nil, err
  32583. }
  32584. ret := &DiskTypeList{
  32585. ServerResponse: googleapi.ServerResponse{
  32586. Header: res.Header,
  32587. HTTPStatusCode: res.StatusCode,
  32588. },
  32589. }
  32590. target := &ret
  32591. if err := gensupport.DecodeResponse(target, res); err != nil {
  32592. return nil, err
  32593. }
  32594. return ret, nil
  32595. // {
  32596. // "description": "Retrieves a list of disk types available to the specified project.",
  32597. // "httpMethod": "GET",
  32598. // "id": "compute.diskTypes.list",
  32599. // "parameterOrder": [
  32600. // "project",
  32601. // "zone"
  32602. // ],
  32603. // "parameters": {
  32604. // "filter": {
  32605. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  32606. // "location": "query",
  32607. // "type": "string"
  32608. // },
  32609. // "maxResults": {
  32610. // "default": "500",
  32611. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  32612. // "format": "uint32",
  32613. // "location": "query",
  32614. // "minimum": "0",
  32615. // "type": "integer"
  32616. // },
  32617. // "orderBy": {
  32618. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  32619. // "location": "query",
  32620. // "type": "string"
  32621. // },
  32622. // "pageToken": {
  32623. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  32624. // "location": "query",
  32625. // "type": "string"
  32626. // },
  32627. // "project": {
  32628. // "description": "Project ID for this request.",
  32629. // "location": "path",
  32630. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32631. // "required": true,
  32632. // "type": "string"
  32633. // },
  32634. // "zone": {
  32635. // "description": "The name of the zone for this request.",
  32636. // "location": "path",
  32637. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32638. // "required": true,
  32639. // "type": "string"
  32640. // }
  32641. // },
  32642. // "path": "{project}/zones/{zone}/diskTypes",
  32643. // "response": {
  32644. // "$ref": "DiskTypeList"
  32645. // },
  32646. // "scopes": [
  32647. // "https://www.googleapis.com/auth/cloud-platform",
  32648. // "https://www.googleapis.com/auth/compute",
  32649. // "https://www.googleapis.com/auth/compute.readonly"
  32650. // ]
  32651. // }
  32652. }
  32653. // Pages invokes f for each page of results.
  32654. // A non-nil error returned from f will halt the iteration.
  32655. // The provided context supersedes any context provided to the Context method.
  32656. func (c *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error {
  32657. c.ctx_ = ctx
  32658. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32659. for {
  32660. x, err := c.Do()
  32661. if err != nil {
  32662. return err
  32663. }
  32664. if err := f(x); err != nil {
  32665. return err
  32666. }
  32667. if x.NextPageToken == "" {
  32668. return nil
  32669. }
  32670. c.PageToken(x.NextPageToken)
  32671. }
  32672. }
  32673. // method id "compute.disks.aggregatedList":
  32674. type DisksAggregatedListCall struct {
  32675. s *Service
  32676. project string
  32677. urlParams_ gensupport.URLParams
  32678. ifNoneMatch_ string
  32679. ctx_ context.Context
  32680. header_ http.Header
  32681. }
  32682. // AggregatedList: Retrieves an aggregated list of persistent disks.
  32683. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList
  32684. func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
  32685. c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32686. c.project = project
  32687. return c
  32688. }
  32689. // Filter sets the optional parameter "filter": A filter expression that
  32690. // filters resources listed in the response. The expression must specify
  32691. // the field name, a comparison operator, and the value that you want to
  32692. // use for filtering. The value must be a string, a number, or a
  32693. // boolean. The comparison operator must be either =, !=, >, or <.
  32694. //
  32695. // For example, if you are filtering Compute Engine instances, you can
  32696. // exclude instances named example-instance by specifying name !=
  32697. // example-instance.
  32698. //
  32699. // You can also filter nested fields. For example, you could specify
  32700. // scheduling.automaticRestart = false to include instances only if they
  32701. // are not scheduled for automatic restarts. You can use filtering on
  32702. // nested fields to filter based on resource labels.
  32703. //
  32704. // To filter on multiple expressions, provide each separate expression
  32705. // within parentheses. For example, (scheduling.automaticRestart = true)
  32706. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  32707. // AND expression. However, you can include AND and OR expressions
  32708. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  32709. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  32710. // true).
  32711. func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
  32712. c.urlParams_.Set("filter", filter)
  32713. return c
  32714. }
  32715. // MaxResults sets the optional parameter "maxResults": The maximum
  32716. // number of results per page that should be returned. If the number of
  32717. // available results is larger than maxResults, Compute Engine returns a
  32718. // nextPageToken that can be used to get the next page of results in
  32719. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  32720. // (Default: 500)
  32721. func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
  32722. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32723. return c
  32724. }
  32725. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32726. // a certain order. By default, results are returned in alphanumerical
  32727. // order based on the resource name.
  32728. //
  32729. // You can also sort results in descending order based on the creation
  32730. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32731. // based on the creationTimestamp field in reverse chronological order
  32732. // (newest result first). Use this to sort resources like operations so
  32733. // that the newest operation is returned first.
  32734. //
  32735. // Currently, only sorting by name or creationTimestamp desc is
  32736. // supported.
  32737. func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall {
  32738. c.urlParams_.Set("orderBy", orderBy)
  32739. return c
  32740. }
  32741. // PageToken sets the optional parameter "pageToken": Specifies a page
  32742. // token to use. Set pageToken to the nextPageToken returned by a
  32743. // previous list request to get the next page of results.
  32744. func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
  32745. c.urlParams_.Set("pageToken", pageToken)
  32746. return c
  32747. }
  32748. // Fields allows partial responses to be retrieved. See
  32749. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32750. // for more information.
  32751. func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
  32752. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32753. return c
  32754. }
  32755. // IfNoneMatch sets the optional parameter which makes the operation
  32756. // fail if the object's ETag matches the given value. This is useful for
  32757. // getting updates only after the object has changed since the last
  32758. // request. Use googleapi.IsNotModified to check whether the response
  32759. // error from Do is the result of In-None-Match.
  32760. func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
  32761. c.ifNoneMatch_ = entityTag
  32762. return c
  32763. }
  32764. // Context sets the context to be used in this call's Do method. Any
  32765. // pending HTTP request will be aborted if the provided context is
  32766. // canceled.
  32767. func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
  32768. c.ctx_ = ctx
  32769. return c
  32770. }
  32771. // Header returns an http.Header that can be modified by the caller to
  32772. // add HTTP headers to the request.
  32773. func (c *DisksAggregatedListCall) Header() http.Header {
  32774. if c.header_ == nil {
  32775. c.header_ = make(http.Header)
  32776. }
  32777. return c.header_
  32778. }
  32779. func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  32780. reqHeaders := make(http.Header)
  32781. for k, v := range c.header_ {
  32782. reqHeaders[k] = v
  32783. }
  32784. reqHeaders.Set("User-Agent", c.s.userAgent())
  32785. if c.ifNoneMatch_ != "" {
  32786. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32787. }
  32788. var body io.Reader = nil
  32789. c.urlParams_.Set("alt", alt)
  32790. c.urlParams_.Set("prettyPrint", "false")
  32791. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks")
  32792. urls += "?" + c.urlParams_.Encode()
  32793. req, err := http.NewRequest("GET", urls, body)
  32794. if err != nil {
  32795. return nil, err
  32796. }
  32797. req.Header = reqHeaders
  32798. googleapi.Expand(req.URL, map[string]string{
  32799. "project": c.project,
  32800. })
  32801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32802. }
  32803. // Do executes the "compute.disks.aggregatedList" call.
  32804. // Exactly one of *DiskAggregatedList or error will be non-nil. Any
  32805. // non-2xx status code is an error. Response headers are in either
  32806. // *DiskAggregatedList.ServerResponse.Header or (if a response was
  32807. // returned at all) in error.(*googleapi.Error).Header. Use
  32808. // googleapi.IsNotModified to check whether the returned error was
  32809. // because http.StatusNotModified was returned.
  32810. func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, error) {
  32811. gensupport.SetOptions(c.urlParams_, opts...)
  32812. res, err := c.doRequest("json")
  32813. if res != nil && res.StatusCode == http.StatusNotModified {
  32814. if res.Body != nil {
  32815. res.Body.Close()
  32816. }
  32817. return nil, &googleapi.Error{
  32818. Code: res.StatusCode,
  32819. Header: res.Header,
  32820. }
  32821. }
  32822. if err != nil {
  32823. return nil, err
  32824. }
  32825. defer googleapi.CloseBody(res)
  32826. if err := googleapi.CheckResponse(res); err != nil {
  32827. return nil, err
  32828. }
  32829. ret := &DiskAggregatedList{
  32830. ServerResponse: googleapi.ServerResponse{
  32831. Header: res.Header,
  32832. HTTPStatusCode: res.StatusCode,
  32833. },
  32834. }
  32835. target := &ret
  32836. if err := gensupport.DecodeResponse(target, res); err != nil {
  32837. return nil, err
  32838. }
  32839. return ret, nil
  32840. // {
  32841. // "description": "Retrieves an aggregated list of persistent disks.",
  32842. // "httpMethod": "GET",
  32843. // "id": "compute.disks.aggregatedList",
  32844. // "parameterOrder": [
  32845. // "project"
  32846. // ],
  32847. // "parameters": {
  32848. // "filter": {
  32849. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  32850. // "location": "query",
  32851. // "type": "string"
  32852. // },
  32853. // "maxResults": {
  32854. // "default": "500",
  32855. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  32856. // "format": "uint32",
  32857. // "location": "query",
  32858. // "minimum": "0",
  32859. // "type": "integer"
  32860. // },
  32861. // "orderBy": {
  32862. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  32863. // "location": "query",
  32864. // "type": "string"
  32865. // },
  32866. // "pageToken": {
  32867. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  32868. // "location": "query",
  32869. // "type": "string"
  32870. // },
  32871. // "project": {
  32872. // "description": "Project ID for this request.",
  32873. // "location": "path",
  32874. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32875. // "required": true,
  32876. // "type": "string"
  32877. // }
  32878. // },
  32879. // "path": "{project}/aggregated/disks",
  32880. // "response": {
  32881. // "$ref": "DiskAggregatedList"
  32882. // },
  32883. // "scopes": [
  32884. // "https://www.googleapis.com/auth/cloud-platform",
  32885. // "https://www.googleapis.com/auth/compute",
  32886. // "https://www.googleapis.com/auth/compute.readonly"
  32887. // ]
  32888. // }
  32889. }
  32890. // Pages invokes f for each page of results.
  32891. // A non-nil error returned from f will halt the iteration.
  32892. // The provided context supersedes any context provided to the Context method.
  32893. func (c *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error {
  32894. c.ctx_ = ctx
  32895. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32896. for {
  32897. x, err := c.Do()
  32898. if err != nil {
  32899. return err
  32900. }
  32901. if err := f(x); err != nil {
  32902. return err
  32903. }
  32904. if x.NextPageToken == "" {
  32905. return nil
  32906. }
  32907. c.PageToken(x.NextPageToken)
  32908. }
  32909. }
  32910. // method id "compute.disks.createSnapshot":
  32911. type DisksCreateSnapshotCall struct {
  32912. s *Service
  32913. project string
  32914. zone string
  32915. disk string
  32916. snapshot *Snapshot
  32917. urlParams_ gensupport.URLParams
  32918. ctx_ context.Context
  32919. header_ http.Header
  32920. }
  32921. // CreateSnapshot: Creates a snapshot of a specified persistent disk.
  32922. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot
  32923. func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
  32924. c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32925. c.project = project
  32926. c.zone = zone
  32927. c.disk = disk
  32928. c.snapshot = snapshot
  32929. return c
  32930. }
  32931. // GuestFlush sets the optional parameter "guestFlush":
  32932. func (c *DisksCreateSnapshotCall) GuestFlush(guestFlush bool) *DisksCreateSnapshotCall {
  32933. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  32934. return c
  32935. }
  32936. // RequestId sets the optional parameter "requestId": An optional
  32937. // request ID to identify requests. Specify a unique request ID so that
  32938. // if you must retry your request, the server will know to ignore the
  32939. // request if it has already been completed.
  32940. //
  32941. // For example, consider a situation where you make an initial request
  32942. // and the request times out. If you make the request again with the
  32943. // same request ID, the server can check if original operation with the
  32944. // same request ID was received, and if so, will ignore the second
  32945. // request. This prevents clients from accidentally creating duplicate
  32946. // commitments.
  32947. //
  32948. // The request ID must be a valid UUID with the exception that zero UUID
  32949. // is not supported (00000000-0000-0000-0000-000000000000).
  32950. func (c *DisksCreateSnapshotCall) RequestId(requestId string) *DisksCreateSnapshotCall {
  32951. c.urlParams_.Set("requestId", requestId)
  32952. return c
  32953. }
  32954. // Fields allows partial responses to be retrieved. See
  32955. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32956. // for more information.
  32957. func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
  32958. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32959. return c
  32960. }
  32961. // Context sets the context to be used in this call's Do method. Any
  32962. // pending HTTP request will be aborted if the provided context is
  32963. // canceled.
  32964. func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
  32965. c.ctx_ = ctx
  32966. return c
  32967. }
  32968. // Header returns an http.Header that can be modified by the caller to
  32969. // add HTTP headers to the request.
  32970. func (c *DisksCreateSnapshotCall) Header() http.Header {
  32971. if c.header_ == nil {
  32972. c.header_ = make(http.Header)
  32973. }
  32974. return c.header_
  32975. }
  32976. func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  32977. reqHeaders := make(http.Header)
  32978. for k, v := range c.header_ {
  32979. reqHeaders[k] = v
  32980. }
  32981. reqHeaders.Set("User-Agent", c.s.userAgent())
  32982. var body io.Reader = nil
  32983. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  32984. if err != nil {
  32985. return nil, err
  32986. }
  32987. reqHeaders.Set("Content-Type", "application/json")
  32988. c.urlParams_.Set("alt", alt)
  32989. c.urlParams_.Set("prettyPrint", "false")
  32990. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot")
  32991. urls += "?" + c.urlParams_.Encode()
  32992. req, err := http.NewRequest("POST", urls, body)
  32993. if err != nil {
  32994. return nil, err
  32995. }
  32996. req.Header = reqHeaders
  32997. googleapi.Expand(req.URL, map[string]string{
  32998. "project": c.project,
  32999. "zone": c.zone,
  33000. "disk": c.disk,
  33001. })
  33002. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33003. }
  33004. // Do executes the "compute.disks.createSnapshot" call.
  33005. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33006. // status code is an error. Response headers are in either
  33007. // *Operation.ServerResponse.Header or (if a response was returned at
  33008. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33009. // to check whether the returned error was because
  33010. // http.StatusNotModified was returned.
  33011. func (c *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33012. gensupport.SetOptions(c.urlParams_, opts...)
  33013. res, err := c.doRequest("json")
  33014. if res != nil && res.StatusCode == http.StatusNotModified {
  33015. if res.Body != nil {
  33016. res.Body.Close()
  33017. }
  33018. return nil, &googleapi.Error{
  33019. Code: res.StatusCode,
  33020. Header: res.Header,
  33021. }
  33022. }
  33023. if err != nil {
  33024. return nil, err
  33025. }
  33026. defer googleapi.CloseBody(res)
  33027. if err := googleapi.CheckResponse(res); err != nil {
  33028. return nil, err
  33029. }
  33030. ret := &Operation{
  33031. ServerResponse: googleapi.ServerResponse{
  33032. Header: res.Header,
  33033. HTTPStatusCode: res.StatusCode,
  33034. },
  33035. }
  33036. target := &ret
  33037. if err := gensupport.DecodeResponse(target, res); err != nil {
  33038. return nil, err
  33039. }
  33040. return ret, nil
  33041. // {
  33042. // "description": "Creates a snapshot of a specified persistent disk.",
  33043. // "httpMethod": "POST",
  33044. // "id": "compute.disks.createSnapshot",
  33045. // "parameterOrder": [
  33046. // "project",
  33047. // "zone",
  33048. // "disk"
  33049. // ],
  33050. // "parameters": {
  33051. // "disk": {
  33052. // "description": "Name of the persistent disk to snapshot.",
  33053. // "location": "path",
  33054. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  33055. // "required": true,
  33056. // "type": "string"
  33057. // },
  33058. // "guestFlush": {
  33059. // "location": "query",
  33060. // "type": "boolean"
  33061. // },
  33062. // "project": {
  33063. // "description": "Project ID for this request.",
  33064. // "location": "path",
  33065. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33066. // "required": true,
  33067. // "type": "string"
  33068. // },
  33069. // "requestId": {
  33070. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  33071. // "location": "query",
  33072. // "type": "string"
  33073. // },
  33074. // "zone": {
  33075. // "description": "The name of the zone for this request.",
  33076. // "location": "path",
  33077. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33078. // "required": true,
  33079. // "type": "string"
  33080. // }
  33081. // },
  33082. // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
  33083. // "request": {
  33084. // "$ref": "Snapshot"
  33085. // },
  33086. // "response": {
  33087. // "$ref": "Operation"
  33088. // },
  33089. // "scopes": [
  33090. // "https://www.googleapis.com/auth/cloud-platform",
  33091. // "https://www.googleapis.com/auth/compute"
  33092. // ]
  33093. // }
  33094. }
  33095. // method id "compute.disks.delete":
  33096. type DisksDeleteCall struct {
  33097. s *Service
  33098. project string
  33099. zone string
  33100. disk string
  33101. urlParams_ gensupport.URLParams
  33102. ctx_ context.Context
  33103. header_ http.Header
  33104. }
  33105. // Delete: Deletes the specified persistent disk. Deleting a disk
  33106. // removes its data permanently and is irreversible. However, deleting a
  33107. // disk does not delete any snapshots previously made from the disk. You
  33108. // must separately delete snapshots.
  33109. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete
  33110. func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
  33111. c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33112. c.project = project
  33113. c.zone = zone
  33114. c.disk = disk
  33115. return c
  33116. }
  33117. // RequestId sets the optional parameter "requestId": An optional
  33118. // request ID to identify requests. Specify a unique request ID so that
  33119. // if you must retry your request, the server will know to ignore the
  33120. // request if it has already been completed.
  33121. //
  33122. // For example, consider a situation where you make an initial request
  33123. // and the request times out. If you make the request again with the
  33124. // same request ID, the server can check if original operation with the
  33125. // same request ID was received, and if so, will ignore the second
  33126. // request. This prevents clients from accidentally creating duplicate
  33127. // commitments.
  33128. //
  33129. // The request ID must be a valid UUID with the exception that zero UUID
  33130. // is not supported (00000000-0000-0000-0000-000000000000).
  33131. func (c *DisksDeleteCall) RequestId(requestId string) *DisksDeleteCall {
  33132. c.urlParams_.Set("requestId", requestId)
  33133. return c
  33134. }
  33135. // Fields allows partial responses to be retrieved. See
  33136. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33137. // for more information.
  33138. func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
  33139. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33140. return c
  33141. }
  33142. // Context sets the context to be used in this call's Do method. Any
  33143. // pending HTTP request will be aborted if the provided context is
  33144. // canceled.
  33145. func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
  33146. c.ctx_ = ctx
  33147. return c
  33148. }
  33149. // Header returns an http.Header that can be modified by the caller to
  33150. // add HTTP headers to the request.
  33151. func (c *DisksDeleteCall) Header() http.Header {
  33152. if c.header_ == nil {
  33153. c.header_ = make(http.Header)
  33154. }
  33155. return c.header_
  33156. }
  33157. func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  33158. reqHeaders := make(http.Header)
  33159. for k, v := range c.header_ {
  33160. reqHeaders[k] = v
  33161. }
  33162. reqHeaders.Set("User-Agent", c.s.userAgent())
  33163. var body io.Reader = nil
  33164. c.urlParams_.Set("alt", alt)
  33165. c.urlParams_.Set("prettyPrint", "false")
  33166. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  33167. urls += "?" + c.urlParams_.Encode()
  33168. req, err := http.NewRequest("DELETE", urls, body)
  33169. if err != nil {
  33170. return nil, err
  33171. }
  33172. req.Header = reqHeaders
  33173. googleapi.Expand(req.URL, map[string]string{
  33174. "project": c.project,
  33175. "zone": c.zone,
  33176. "disk": c.disk,
  33177. })
  33178. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33179. }
  33180. // Do executes the "compute.disks.delete" call.
  33181. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33182. // status code is an error. Response headers are in either
  33183. // *Operation.ServerResponse.Header or (if a response was returned at
  33184. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33185. // to check whether the returned error was because
  33186. // http.StatusNotModified was returned.
  33187. func (c *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33188. gensupport.SetOptions(c.urlParams_, opts...)
  33189. res, err := c.doRequest("json")
  33190. if res != nil && res.StatusCode == http.StatusNotModified {
  33191. if res.Body != nil {
  33192. res.Body.Close()
  33193. }
  33194. return nil, &googleapi.Error{
  33195. Code: res.StatusCode,
  33196. Header: res.Header,
  33197. }
  33198. }
  33199. if err != nil {
  33200. return nil, err
  33201. }
  33202. defer googleapi.CloseBody(res)
  33203. if err := googleapi.CheckResponse(res); err != nil {
  33204. return nil, err
  33205. }
  33206. ret := &Operation{
  33207. ServerResponse: googleapi.ServerResponse{
  33208. Header: res.Header,
  33209. HTTPStatusCode: res.StatusCode,
  33210. },
  33211. }
  33212. target := &ret
  33213. if err := gensupport.DecodeResponse(target, res); err != nil {
  33214. return nil, err
  33215. }
  33216. return ret, nil
  33217. // {
  33218. // "description": "Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.",
  33219. // "httpMethod": "DELETE",
  33220. // "id": "compute.disks.delete",
  33221. // "parameterOrder": [
  33222. // "project",
  33223. // "zone",
  33224. // "disk"
  33225. // ],
  33226. // "parameters": {
  33227. // "disk": {
  33228. // "description": "Name of the persistent disk to delete.",
  33229. // "location": "path",
  33230. // "required": true,
  33231. // "type": "string"
  33232. // },
  33233. // "project": {
  33234. // "description": "Project ID for this request.",
  33235. // "location": "path",
  33236. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33237. // "required": true,
  33238. // "type": "string"
  33239. // },
  33240. // "requestId": {
  33241. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  33242. // "location": "query",
  33243. // "type": "string"
  33244. // },
  33245. // "zone": {
  33246. // "description": "The name of the zone for this request.",
  33247. // "location": "path",
  33248. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33249. // "required": true,
  33250. // "type": "string"
  33251. // }
  33252. // },
  33253. // "path": "{project}/zones/{zone}/disks/{disk}",
  33254. // "response": {
  33255. // "$ref": "Operation"
  33256. // },
  33257. // "scopes": [
  33258. // "https://www.googleapis.com/auth/cloud-platform",
  33259. // "https://www.googleapis.com/auth/compute"
  33260. // ]
  33261. // }
  33262. }
  33263. // method id "compute.disks.get":
  33264. type DisksGetCall struct {
  33265. s *Service
  33266. project string
  33267. zone string
  33268. disk string
  33269. urlParams_ gensupport.URLParams
  33270. ifNoneMatch_ string
  33271. ctx_ context.Context
  33272. header_ http.Header
  33273. }
  33274. // Get: Returns a specified persistent disk. Gets a list of available
  33275. // persistent disks by making a list() request.
  33276. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get
  33277. func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
  33278. c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33279. c.project = project
  33280. c.zone = zone
  33281. c.disk = disk
  33282. return c
  33283. }
  33284. // Fields allows partial responses to be retrieved. See
  33285. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33286. // for more information.
  33287. func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
  33288. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33289. return c
  33290. }
  33291. // IfNoneMatch sets the optional parameter which makes the operation
  33292. // fail if the object's ETag matches the given value. This is useful for
  33293. // getting updates only after the object has changed since the last
  33294. // request. Use googleapi.IsNotModified to check whether the response
  33295. // error from Do is the result of In-None-Match.
  33296. func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
  33297. c.ifNoneMatch_ = entityTag
  33298. return c
  33299. }
  33300. // Context sets the context to be used in this call's Do method. Any
  33301. // pending HTTP request will be aborted if the provided context is
  33302. // canceled.
  33303. func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
  33304. c.ctx_ = ctx
  33305. return c
  33306. }
  33307. // Header returns an http.Header that can be modified by the caller to
  33308. // add HTTP headers to the request.
  33309. func (c *DisksGetCall) Header() http.Header {
  33310. if c.header_ == nil {
  33311. c.header_ = make(http.Header)
  33312. }
  33313. return c.header_
  33314. }
  33315. func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
  33316. reqHeaders := make(http.Header)
  33317. for k, v := range c.header_ {
  33318. reqHeaders[k] = v
  33319. }
  33320. reqHeaders.Set("User-Agent", c.s.userAgent())
  33321. if c.ifNoneMatch_ != "" {
  33322. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33323. }
  33324. var body io.Reader = nil
  33325. c.urlParams_.Set("alt", alt)
  33326. c.urlParams_.Set("prettyPrint", "false")
  33327. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  33328. urls += "?" + c.urlParams_.Encode()
  33329. req, err := http.NewRequest("GET", urls, body)
  33330. if err != nil {
  33331. return nil, err
  33332. }
  33333. req.Header = reqHeaders
  33334. googleapi.Expand(req.URL, map[string]string{
  33335. "project": c.project,
  33336. "zone": c.zone,
  33337. "disk": c.disk,
  33338. })
  33339. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33340. }
  33341. // Do executes the "compute.disks.get" call.
  33342. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  33343. // code is an error. Response headers are in either
  33344. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  33345. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  33346. // whether the returned error was because http.StatusNotModified was
  33347. // returned.
  33348. func (c *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  33349. gensupport.SetOptions(c.urlParams_, opts...)
  33350. res, err := c.doRequest("json")
  33351. if res != nil && res.StatusCode == http.StatusNotModified {
  33352. if res.Body != nil {
  33353. res.Body.Close()
  33354. }
  33355. return nil, &googleapi.Error{
  33356. Code: res.StatusCode,
  33357. Header: res.Header,
  33358. }
  33359. }
  33360. if err != nil {
  33361. return nil, err
  33362. }
  33363. defer googleapi.CloseBody(res)
  33364. if err := googleapi.CheckResponse(res); err != nil {
  33365. return nil, err
  33366. }
  33367. ret := &Disk{
  33368. ServerResponse: googleapi.ServerResponse{
  33369. Header: res.Header,
  33370. HTTPStatusCode: res.StatusCode,
  33371. },
  33372. }
  33373. target := &ret
  33374. if err := gensupport.DecodeResponse(target, res); err != nil {
  33375. return nil, err
  33376. }
  33377. return ret, nil
  33378. // {
  33379. // "description": "Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.",
  33380. // "httpMethod": "GET",
  33381. // "id": "compute.disks.get",
  33382. // "parameterOrder": [
  33383. // "project",
  33384. // "zone",
  33385. // "disk"
  33386. // ],
  33387. // "parameters": {
  33388. // "disk": {
  33389. // "description": "Name of the persistent disk to return.",
  33390. // "location": "path",
  33391. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  33392. // "required": true,
  33393. // "type": "string"
  33394. // },
  33395. // "project": {
  33396. // "description": "Project ID for this request.",
  33397. // "location": "path",
  33398. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33399. // "required": true,
  33400. // "type": "string"
  33401. // },
  33402. // "zone": {
  33403. // "description": "The name of the zone for this request.",
  33404. // "location": "path",
  33405. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33406. // "required": true,
  33407. // "type": "string"
  33408. // }
  33409. // },
  33410. // "path": "{project}/zones/{zone}/disks/{disk}",
  33411. // "response": {
  33412. // "$ref": "Disk"
  33413. // },
  33414. // "scopes": [
  33415. // "https://www.googleapis.com/auth/cloud-platform",
  33416. // "https://www.googleapis.com/auth/compute",
  33417. // "https://www.googleapis.com/auth/compute.readonly"
  33418. // ]
  33419. // }
  33420. }
  33421. // method id "compute.disks.getIamPolicy":
  33422. type DisksGetIamPolicyCall struct {
  33423. s *Service
  33424. project string
  33425. zone string
  33426. resource string
  33427. urlParams_ gensupport.URLParams
  33428. ifNoneMatch_ string
  33429. ctx_ context.Context
  33430. header_ http.Header
  33431. }
  33432. // GetIamPolicy: Gets the access control policy for a resource. May be
  33433. // empty if no such policy or resource exists.
  33434. func (r *DisksService) GetIamPolicy(project string, zone string, resource string) *DisksGetIamPolicyCall {
  33435. c := &DisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33436. c.project = project
  33437. c.zone = zone
  33438. c.resource = resource
  33439. return c
  33440. }
  33441. // Fields allows partial responses to be retrieved. See
  33442. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33443. // for more information.
  33444. func (c *DisksGetIamPolicyCall) Fields(s ...googleapi.Field) *DisksGetIamPolicyCall {
  33445. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33446. return c
  33447. }
  33448. // IfNoneMatch sets the optional parameter which makes the operation
  33449. // fail if the object's ETag matches the given value. This is useful for
  33450. // getting updates only after the object has changed since the last
  33451. // request. Use googleapi.IsNotModified to check whether the response
  33452. // error from Do is the result of In-None-Match.
  33453. func (c *DisksGetIamPolicyCall) IfNoneMatch(entityTag string) *DisksGetIamPolicyCall {
  33454. c.ifNoneMatch_ = entityTag
  33455. return c
  33456. }
  33457. // Context sets the context to be used in this call's Do method. Any
  33458. // pending HTTP request will be aborted if the provided context is
  33459. // canceled.
  33460. func (c *DisksGetIamPolicyCall) Context(ctx context.Context) *DisksGetIamPolicyCall {
  33461. c.ctx_ = ctx
  33462. return c
  33463. }
  33464. // Header returns an http.Header that can be modified by the caller to
  33465. // add HTTP headers to the request.
  33466. func (c *DisksGetIamPolicyCall) Header() http.Header {
  33467. if c.header_ == nil {
  33468. c.header_ = make(http.Header)
  33469. }
  33470. return c.header_
  33471. }
  33472. func (c *DisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  33473. reqHeaders := make(http.Header)
  33474. for k, v := range c.header_ {
  33475. reqHeaders[k] = v
  33476. }
  33477. reqHeaders.Set("User-Agent", c.s.userAgent())
  33478. if c.ifNoneMatch_ != "" {
  33479. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33480. }
  33481. var body io.Reader = nil
  33482. c.urlParams_.Set("alt", alt)
  33483. c.urlParams_.Set("prettyPrint", "false")
  33484. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/getIamPolicy")
  33485. urls += "?" + c.urlParams_.Encode()
  33486. req, err := http.NewRequest("GET", urls, body)
  33487. if err != nil {
  33488. return nil, err
  33489. }
  33490. req.Header = reqHeaders
  33491. googleapi.Expand(req.URL, map[string]string{
  33492. "project": c.project,
  33493. "zone": c.zone,
  33494. "resource": c.resource,
  33495. })
  33496. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33497. }
  33498. // Do executes the "compute.disks.getIamPolicy" call.
  33499. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  33500. // code is an error. Response headers are in either
  33501. // *Policy.ServerResponse.Header or (if a response was returned at all)
  33502. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  33503. // check whether the returned error was because http.StatusNotModified
  33504. // was returned.
  33505. func (c *DisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  33506. gensupport.SetOptions(c.urlParams_, opts...)
  33507. res, err := c.doRequest("json")
  33508. if res != nil && res.StatusCode == http.StatusNotModified {
  33509. if res.Body != nil {
  33510. res.Body.Close()
  33511. }
  33512. return nil, &googleapi.Error{
  33513. Code: res.StatusCode,
  33514. Header: res.Header,
  33515. }
  33516. }
  33517. if err != nil {
  33518. return nil, err
  33519. }
  33520. defer googleapi.CloseBody(res)
  33521. if err := googleapi.CheckResponse(res); err != nil {
  33522. return nil, err
  33523. }
  33524. ret := &Policy{
  33525. ServerResponse: googleapi.ServerResponse{
  33526. Header: res.Header,
  33527. HTTPStatusCode: res.StatusCode,
  33528. },
  33529. }
  33530. target := &ret
  33531. if err := gensupport.DecodeResponse(target, res); err != nil {
  33532. return nil, err
  33533. }
  33534. return ret, nil
  33535. // {
  33536. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  33537. // "httpMethod": "GET",
  33538. // "id": "compute.disks.getIamPolicy",
  33539. // "parameterOrder": [
  33540. // "project",
  33541. // "zone",
  33542. // "resource"
  33543. // ],
  33544. // "parameters": {
  33545. // "project": {
  33546. // "description": "Project ID for this request.",
  33547. // "location": "path",
  33548. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33549. // "required": true,
  33550. // "type": "string"
  33551. // },
  33552. // "resource": {
  33553. // "description": "Name or id of the resource for this request.",
  33554. // "location": "path",
  33555. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  33556. // "required": true,
  33557. // "type": "string"
  33558. // },
  33559. // "zone": {
  33560. // "description": "The name of the zone for this request.",
  33561. // "location": "path",
  33562. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33563. // "required": true,
  33564. // "type": "string"
  33565. // }
  33566. // },
  33567. // "path": "{project}/zones/{zone}/disks/{resource}/getIamPolicy",
  33568. // "response": {
  33569. // "$ref": "Policy"
  33570. // },
  33571. // "scopes": [
  33572. // "https://www.googleapis.com/auth/cloud-platform",
  33573. // "https://www.googleapis.com/auth/compute",
  33574. // "https://www.googleapis.com/auth/compute.readonly"
  33575. // ]
  33576. // }
  33577. }
  33578. // method id "compute.disks.insert":
  33579. type DisksInsertCall struct {
  33580. s *Service
  33581. project string
  33582. zone string
  33583. disk *Disk
  33584. urlParams_ gensupport.URLParams
  33585. ctx_ context.Context
  33586. header_ http.Header
  33587. }
  33588. // Insert: Creates a persistent disk in the specified project using the
  33589. // data in the request. You can create a disk with a sourceImage, a
  33590. // sourceSnapshot, or create an empty 500 GB data disk by omitting all
  33591. // properties. You can also create a disk that is larger than the
  33592. // default size by specifying the sizeGb property.
  33593. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert
  33594. func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
  33595. c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33596. c.project = project
  33597. c.zone = zone
  33598. c.disk = disk
  33599. return c
  33600. }
  33601. // RequestId sets the optional parameter "requestId": An optional
  33602. // request ID to identify requests. Specify a unique request ID so that
  33603. // if you must retry your request, the server will know to ignore the
  33604. // request if it has already been completed.
  33605. //
  33606. // For example, consider a situation where you make an initial request
  33607. // and the request times out. If you make the request again with the
  33608. // same request ID, the server can check if original operation with the
  33609. // same request ID was received, and if so, will ignore the second
  33610. // request. This prevents clients from accidentally creating duplicate
  33611. // commitments.
  33612. //
  33613. // The request ID must be a valid UUID with the exception that zero UUID
  33614. // is not supported (00000000-0000-0000-0000-000000000000).
  33615. func (c *DisksInsertCall) RequestId(requestId string) *DisksInsertCall {
  33616. c.urlParams_.Set("requestId", requestId)
  33617. return c
  33618. }
  33619. // SourceImage sets the optional parameter "sourceImage": Source image
  33620. // to restore onto a disk.
  33621. func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
  33622. c.urlParams_.Set("sourceImage", sourceImage)
  33623. return c
  33624. }
  33625. // Fields allows partial responses to be retrieved. See
  33626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33627. // for more information.
  33628. func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
  33629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33630. return c
  33631. }
  33632. // Context sets the context to be used in this call's Do method. Any
  33633. // pending HTTP request will be aborted if the provided context is
  33634. // canceled.
  33635. func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
  33636. c.ctx_ = ctx
  33637. return c
  33638. }
  33639. // Header returns an http.Header that can be modified by the caller to
  33640. // add HTTP headers to the request.
  33641. func (c *DisksInsertCall) Header() http.Header {
  33642. if c.header_ == nil {
  33643. c.header_ = make(http.Header)
  33644. }
  33645. return c.header_
  33646. }
  33647. func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
  33648. reqHeaders := make(http.Header)
  33649. for k, v := range c.header_ {
  33650. reqHeaders[k] = v
  33651. }
  33652. reqHeaders.Set("User-Agent", c.s.userAgent())
  33653. var body io.Reader = nil
  33654. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  33655. if err != nil {
  33656. return nil, err
  33657. }
  33658. reqHeaders.Set("Content-Type", "application/json")
  33659. c.urlParams_.Set("alt", alt)
  33660. c.urlParams_.Set("prettyPrint", "false")
  33661. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  33662. urls += "?" + c.urlParams_.Encode()
  33663. req, err := http.NewRequest("POST", urls, body)
  33664. if err != nil {
  33665. return nil, err
  33666. }
  33667. req.Header = reqHeaders
  33668. googleapi.Expand(req.URL, map[string]string{
  33669. "project": c.project,
  33670. "zone": c.zone,
  33671. })
  33672. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33673. }
  33674. // Do executes the "compute.disks.insert" call.
  33675. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33676. // status code is an error. Response headers are in either
  33677. // *Operation.ServerResponse.Header or (if a response was returned at
  33678. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33679. // to check whether the returned error was because
  33680. // http.StatusNotModified was returned.
  33681. func (c *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33682. gensupport.SetOptions(c.urlParams_, opts...)
  33683. res, err := c.doRequest("json")
  33684. if res != nil && res.StatusCode == http.StatusNotModified {
  33685. if res.Body != nil {
  33686. res.Body.Close()
  33687. }
  33688. return nil, &googleapi.Error{
  33689. Code: res.StatusCode,
  33690. Header: res.Header,
  33691. }
  33692. }
  33693. if err != nil {
  33694. return nil, err
  33695. }
  33696. defer googleapi.CloseBody(res)
  33697. if err := googleapi.CheckResponse(res); err != nil {
  33698. return nil, err
  33699. }
  33700. ret := &Operation{
  33701. ServerResponse: googleapi.ServerResponse{
  33702. Header: res.Header,
  33703. HTTPStatusCode: res.StatusCode,
  33704. },
  33705. }
  33706. target := &ret
  33707. if err := gensupport.DecodeResponse(target, res); err != nil {
  33708. return nil, err
  33709. }
  33710. return ret, nil
  33711. // {
  33712. // "description": "Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property.",
  33713. // "httpMethod": "POST",
  33714. // "id": "compute.disks.insert",
  33715. // "parameterOrder": [
  33716. // "project",
  33717. // "zone"
  33718. // ],
  33719. // "parameters": {
  33720. // "project": {
  33721. // "description": "Project ID for this request.",
  33722. // "location": "path",
  33723. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33724. // "required": true,
  33725. // "type": "string"
  33726. // },
  33727. // "requestId": {
  33728. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  33729. // "location": "query",
  33730. // "type": "string"
  33731. // },
  33732. // "sourceImage": {
  33733. // "description": "Optional. Source image to restore onto a disk.",
  33734. // "location": "query",
  33735. // "type": "string"
  33736. // },
  33737. // "zone": {
  33738. // "description": "The name of the zone for this request.",
  33739. // "location": "path",
  33740. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33741. // "required": true,
  33742. // "type": "string"
  33743. // }
  33744. // },
  33745. // "path": "{project}/zones/{zone}/disks",
  33746. // "request": {
  33747. // "$ref": "Disk"
  33748. // },
  33749. // "response": {
  33750. // "$ref": "Operation"
  33751. // },
  33752. // "scopes": [
  33753. // "https://www.googleapis.com/auth/cloud-platform",
  33754. // "https://www.googleapis.com/auth/compute"
  33755. // ]
  33756. // }
  33757. }
  33758. // method id "compute.disks.list":
  33759. type DisksListCall struct {
  33760. s *Service
  33761. project string
  33762. zone string
  33763. urlParams_ gensupport.URLParams
  33764. ifNoneMatch_ string
  33765. ctx_ context.Context
  33766. header_ http.Header
  33767. }
  33768. // List: Retrieves a list of persistent disks contained within the
  33769. // specified zone.
  33770. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list
  33771. func (r *DisksService) List(project string, zone string) *DisksListCall {
  33772. c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33773. c.project = project
  33774. c.zone = zone
  33775. return c
  33776. }
  33777. // Filter sets the optional parameter "filter": A filter expression that
  33778. // filters resources listed in the response. The expression must specify
  33779. // the field name, a comparison operator, and the value that you want to
  33780. // use for filtering. The value must be a string, a number, or a
  33781. // boolean. The comparison operator must be either =, !=, >, or <.
  33782. //
  33783. // For example, if you are filtering Compute Engine instances, you can
  33784. // exclude instances named example-instance by specifying name !=
  33785. // example-instance.
  33786. //
  33787. // You can also filter nested fields. For example, you could specify
  33788. // scheduling.automaticRestart = false to include instances only if they
  33789. // are not scheduled for automatic restarts. You can use filtering on
  33790. // nested fields to filter based on resource labels.
  33791. //
  33792. // To filter on multiple expressions, provide each separate expression
  33793. // within parentheses. For example, (scheduling.automaticRestart = true)
  33794. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  33795. // AND expression. However, you can include AND and OR expressions
  33796. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  33797. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  33798. // true).
  33799. func (c *DisksListCall) Filter(filter string) *DisksListCall {
  33800. c.urlParams_.Set("filter", filter)
  33801. return c
  33802. }
  33803. // MaxResults sets the optional parameter "maxResults": The maximum
  33804. // number of results per page that should be returned. If the number of
  33805. // available results is larger than maxResults, Compute Engine returns a
  33806. // nextPageToken that can be used to get the next page of results in
  33807. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  33808. // (Default: 500)
  33809. func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
  33810. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33811. return c
  33812. }
  33813. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  33814. // a certain order. By default, results are returned in alphanumerical
  33815. // order based on the resource name.
  33816. //
  33817. // You can also sort results in descending order based on the creation
  33818. // timestamp using orderBy="creationTimestamp desc". This sorts results
  33819. // based on the creationTimestamp field in reverse chronological order
  33820. // (newest result first). Use this to sort resources like operations so
  33821. // that the newest operation is returned first.
  33822. //
  33823. // Currently, only sorting by name or creationTimestamp desc is
  33824. // supported.
  33825. func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall {
  33826. c.urlParams_.Set("orderBy", orderBy)
  33827. return c
  33828. }
  33829. // PageToken sets the optional parameter "pageToken": Specifies a page
  33830. // token to use. Set pageToken to the nextPageToken returned by a
  33831. // previous list request to get the next page of results.
  33832. func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
  33833. c.urlParams_.Set("pageToken", pageToken)
  33834. return c
  33835. }
  33836. // Fields allows partial responses to be retrieved. See
  33837. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33838. // for more information.
  33839. func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
  33840. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33841. return c
  33842. }
  33843. // IfNoneMatch sets the optional parameter which makes the operation
  33844. // fail if the object's ETag matches the given value. This is useful for
  33845. // getting updates only after the object has changed since the last
  33846. // request. Use googleapi.IsNotModified to check whether the response
  33847. // error from Do is the result of In-None-Match.
  33848. func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
  33849. c.ifNoneMatch_ = entityTag
  33850. return c
  33851. }
  33852. // Context sets the context to be used in this call's Do method. Any
  33853. // pending HTTP request will be aborted if the provided context is
  33854. // canceled.
  33855. func (c *DisksListCall) Context(ctx context.Context) *DisksListCall {
  33856. c.ctx_ = ctx
  33857. return c
  33858. }
  33859. // Header returns an http.Header that can be modified by the caller to
  33860. // add HTTP headers to the request.
  33861. func (c *DisksListCall) Header() http.Header {
  33862. if c.header_ == nil {
  33863. c.header_ = make(http.Header)
  33864. }
  33865. return c.header_
  33866. }
  33867. func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
  33868. reqHeaders := make(http.Header)
  33869. for k, v := range c.header_ {
  33870. reqHeaders[k] = v
  33871. }
  33872. reqHeaders.Set("User-Agent", c.s.userAgent())
  33873. if c.ifNoneMatch_ != "" {
  33874. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33875. }
  33876. var body io.Reader = nil
  33877. c.urlParams_.Set("alt", alt)
  33878. c.urlParams_.Set("prettyPrint", "false")
  33879. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  33880. urls += "?" + c.urlParams_.Encode()
  33881. req, err := http.NewRequest("GET", urls, body)
  33882. if err != nil {
  33883. return nil, err
  33884. }
  33885. req.Header = reqHeaders
  33886. googleapi.Expand(req.URL, map[string]string{
  33887. "project": c.project,
  33888. "zone": c.zone,
  33889. })
  33890. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33891. }
  33892. // Do executes the "compute.disks.list" call.
  33893. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  33894. // code is an error. Response headers are in either
  33895. // *DiskList.ServerResponse.Header or (if a response was returned at
  33896. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33897. // to check whether the returned error was because
  33898. // http.StatusNotModified was returned.
  33899. func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  33900. gensupport.SetOptions(c.urlParams_, opts...)
  33901. res, err := c.doRequest("json")
  33902. if res != nil && res.StatusCode == http.StatusNotModified {
  33903. if res.Body != nil {
  33904. res.Body.Close()
  33905. }
  33906. return nil, &googleapi.Error{
  33907. Code: res.StatusCode,
  33908. Header: res.Header,
  33909. }
  33910. }
  33911. if err != nil {
  33912. return nil, err
  33913. }
  33914. defer googleapi.CloseBody(res)
  33915. if err := googleapi.CheckResponse(res); err != nil {
  33916. return nil, err
  33917. }
  33918. ret := &DiskList{
  33919. ServerResponse: googleapi.ServerResponse{
  33920. Header: res.Header,
  33921. HTTPStatusCode: res.StatusCode,
  33922. },
  33923. }
  33924. target := &ret
  33925. if err := gensupport.DecodeResponse(target, res); err != nil {
  33926. return nil, err
  33927. }
  33928. return ret, nil
  33929. // {
  33930. // "description": "Retrieves a list of persistent disks contained within the specified zone.",
  33931. // "httpMethod": "GET",
  33932. // "id": "compute.disks.list",
  33933. // "parameterOrder": [
  33934. // "project",
  33935. // "zone"
  33936. // ],
  33937. // "parameters": {
  33938. // "filter": {
  33939. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  33940. // "location": "query",
  33941. // "type": "string"
  33942. // },
  33943. // "maxResults": {
  33944. // "default": "500",
  33945. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  33946. // "format": "uint32",
  33947. // "location": "query",
  33948. // "minimum": "0",
  33949. // "type": "integer"
  33950. // },
  33951. // "orderBy": {
  33952. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  33953. // "location": "query",
  33954. // "type": "string"
  33955. // },
  33956. // "pageToken": {
  33957. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  33958. // "location": "query",
  33959. // "type": "string"
  33960. // },
  33961. // "project": {
  33962. // "description": "Project ID for this request.",
  33963. // "location": "path",
  33964. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33965. // "required": true,
  33966. // "type": "string"
  33967. // },
  33968. // "zone": {
  33969. // "description": "The name of the zone for this request.",
  33970. // "location": "path",
  33971. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33972. // "required": true,
  33973. // "type": "string"
  33974. // }
  33975. // },
  33976. // "path": "{project}/zones/{zone}/disks",
  33977. // "response": {
  33978. // "$ref": "DiskList"
  33979. // },
  33980. // "scopes": [
  33981. // "https://www.googleapis.com/auth/cloud-platform",
  33982. // "https://www.googleapis.com/auth/compute",
  33983. // "https://www.googleapis.com/auth/compute.readonly"
  33984. // ]
  33985. // }
  33986. }
  33987. // Pages invokes f for each page of results.
  33988. // A non-nil error returned from f will halt the iteration.
  33989. // The provided context supersedes any context provided to the Context method.
  33990. func (c *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  33991. c.ctx_ = ctx
  33992. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33993. for {
  33994. x, err := c.Do()
  33995. if err != nil {
  33996. return err
  33997. }
  33998. if err := f(x); err != nil {
  33999. return err
  34000. }
  34001. if x.NextPageToken == "" {
  34002. return nil
  34003. }
  34004. c.PageToken(x.NextPageToken)
  34005. }
  34006. }
  34007. // method id "compute.disks.resize":
  34008. type DisksResizeCall struct {
  34009. s *Service
  34010. project string
  34011. zone string
  34012. disk string
  34013. disksresizerequest *DisksResizeRequest
  34014. urlParams_ gensupport.URLParams
  34015. ctx_ context.Context
  34016. header_ http.Header
  34017. }
  34018. // Resize: Resizes the specified persistent disk. You can only increase
  34019. // the size of the disk.
  34020. func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
  34021. c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34022. c.project = project
  34023. c.zone = zone
  34024. c.disk = disk
  34025. c.disksresizerequest = disksresizerequest
  34026. return c
  34027. }
  34028. // RequestId sets the optional parameter "requestId": An optional
  34029. // request ID to identify requests. Specify a unique request ID so that
  34030. // if you must retry your request, the server will know to ignore the
  34031. // request if it has already been completed.
  34032. //
  34033. // For example, consider a situation where you make an initial request
  34034. // and the request times out. If you make the request again with the
  34035. // same request ID, the server can check if original operation with the
  34036. // same request ID was received, and if so, will ignore the second
  34037. // request. This prevents clients from accidentally creating duplicate
  34038. // commitments.
  34039. //
  34040. // The request ID must be a valid UUID with the exception that zero UUID
  34041. // is not supported (00000000-0000-0000-0000-000000000000).
  34042. func (c *DisksResizeCall) RequestId(requestId string) *DisksResizeCall {
  34043. c.urlParams_.Set("requestId", requestId)
  34044. return c
  34045. }
  34046. // Fields allows partial responses to be retrieved. See
  34047. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34048. // for more information.
  34049. func (c *DisksResizeCall) Fields(s ...googleapi.Field) *DisksResizeCall {
  34050. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34051. return c
  34052. }
  34053. // Context sets the context to be used in this call's Do method. Any
  34054. // pending HTTP request will be aborted if the provided context is
  34055. // canceled.
  34056. func (c *DisksResizeCall) Context(ctx context.Context) *DisksResizeCall {
  34057. c.ctx_ = ctx
  34058. return c
  34059. }
  34060. // Header returns an http.Header that can be modified by the caller to
  34061. // add HTTP headers to the request.
  34062. func (c *DisksResizeCall) Header() http.Header {
  34063. if c.header_ == nil {
  34064. c.header_ = make(http.Header)
  34065. }
  34066. return c.header_
  34067. }
  34068. func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) {
  34069. reqHeaders := make(http.Header)
  34070. for k, v := range c.header_ {
  34071. reqHeaders[k] = v
  34072. }
  34073. reqHeaders.Set("User-Agent", c.s.userAgent())
  34074. var body io.Reader = nil
  34075. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest)
  34076. if err != nil {
  34077. return nil, err
  34078. }
  34079. reqHeaders.Set("Content-Type", "application/json")
  34080. c.urlParams_.Set("alt", alt)
  34081. c.urlParams_.Set("prettyPrint", "false")
  34082. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/resize")
  34083. urls += "?" + c.urlParams_.Encode()
  34084. req, err := http.NewRequest("POST", urls, body)
  34085. if err != nil {
  34086. return nil, err
  34087. }
  34088. req.Header = reqHeaders
  34089. googleapi.Expand(req.URL, map[string]string{
  34090. "project": c.project,
  34091. "zone": c.zone,
  34092. "disk": c.disk,
  34093. })
  34094. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34095. }
  34096. // Do executes the "compute.disks.resize" call.
  34097. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34098. // status code is an error. Response headers are in either
  34099. // *Operation.ServerResponse.Header or (if a response was returned at
  34100. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34101. // to check whether the returned error was because
  34102. // http.StatusNotModified was returned.
  34103. func (c *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34104. gensupport.SetOptions(c.urlParams_, opts...)
  34105. res, err := c.doRequest("json")
  34106. if res != nil && res.StatusCode == http.StatusNotModified {
  34107. if res.Body != nil {
  34108. res.Body.Close()
  34109. }
  34110. return nil, &googleapi.Error{
  34111. Code: res.StatusCode,
  34112. Header: res.Header,
  34113. }
  34114. }
  34115. if err != nil {
  34116. return nil, err
  34117. }
  34118. defer googleapi.CloseBody(res)
  34119. if err := googleapi.CheckResponse(res); err != nil {
  34120. return nil, err
  34121. }
  34122. ret := &Operation{
  34123. ServerResponse: googleapi.ServerResponse{
  34124. Header: res.Header,
  34125. HTTPStatusCode: res.StatusCode,
  34126. },
  34127. }
  34128. target := &ret
  34129. if err := gensupport.DecodeResponse(target, res); err != nil {
  34130. return nil, err
  34131. }
  34132. return ret, nil
  34133. // {
  34134. // "description": "Resizes the specified persistent disk. You can only increase the size of the disk.",
  34135. // "httpMethod": "POST",
  34136. // "id": "compute.disks.resize",
  34137. // "parameterOrder": [
  34138. // "project",
  34139. // "zone",
  34140. // "disk"
  34141. // ],
  34142. // "parameters": {
  34143. // "disk": {
  34144. // "description": "The name of the persistent disk.",
  34145. // "location": "path",
  34146. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34147. // "required": true,
  34148. // "type": "string"
  34149. // },
  34150. // "project": {
  34151. // "description": "Project ID for this request.",
  34152. // "location": "path",
  34153. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34154. // "required": true,
  34155. // "type": "string"
  34156. // },
  34157. // "requestId": {
  34158. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34159. // "location": "query",
  34160. // "type": "string"
  34161. // },
  34162. // "zone": {
  34163. // "description": "The name of the zone for this request.",
  34164. // "location": "path",
  34165. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34166. // "required": true,
  34167. // "type": "string"
  34168. // }
  34169. // },
  34170. // "path": "{project}/zones/{zone}/disks/{disk}/resize",
  34171. // "request": {
  34172. // "$ref": "DisksResizeRequest"
  34173. // },
  34174. // "response": {
  34175. // "$ref": "Operation"
  34176. // },
  34177. // "scopes": [
  34178. // "https://www.googleapis.com/auth/cloud-platform",
  34179. // "https://www.googleapis.com/auth/compute"
  34180. // ]
  34181. // }
  34182. }
  34183. // method id "compute.disks.setIamPolicy":
  34184. type DisksSetIamPolicyCall struct {
  34185. s *Service
  34186. project string
  34187. zone string
  34188. resource string
  34189. zonesetpolicyrequest *ZoneSetPolicyRequest
  34190. urlParams_ gensupport.URLParams
  34191. ctx_ context.Context
  34192. header_ http.Header
  34193. }
  34194. // SetIamPolicy: Sets the access control policy on the specified
  34195. // resource. Replaces any existing policy.
  34196. func (r *DisksService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *DisksSetIamPolicyCall {
  34197. c := &DisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34198. c.project = project
  34199. c.zone = zone
  34200. c.resource = resource
  34201. c.zonesetpolicyrequest = zonesetpolicyrequest
  34202. return c
  34203. }
  34204. // Fields allows partial responses to be retrieved. See
  34205. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34206. // for more information.
  34207. func (c *DisksSetIamPolicyCall) Fields(s ...googleapi.Field) *DisksSetIamPolicyCall {
  34208. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34209. return c
  34210. }
  34211. // Context sets the context to be used in this call's Do method. Any
  34212. // pending HTTP request will be aborted if the provided context is
  34213. // canceled.
  34214. func (c *DisksSetIamPolicyCall) Context(ctx context.Context) *DisksSetIamPolicyCall {
  34215. c.ctx_ = ctx
  34216. return c
  34217. }
  34218. // Header returns an http.Header that can be modified by the caller to
  34219. // add HTTP headers to the request.
  34220. func (c *DisksSetIamPolicyCall) Header() http.Header {
  34221. if c.header_ == nil {
  34222. c.header_ = make(http.Header)
  34223. }
  34224. return c.header_
  34225. }
  34226. func (c *DisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  34227. reqHeaders := make(http.Header)
  34228. for k, v := range c.header_ {
  34229. reqHeaders[k] = v
  34230. }
  34231. reqHeaders.Set("User-Agent", c.s.userAgent())
  34232. var body io.Reader = nil
  34233. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  34234. if err != nil {
  34235. return nil, err
  34236. }
  34237. reqHeaders.Set("Content-Type", "application/json")
  34238. c.urlParams_.Set("alt", alt)
  34239. c.urlParams_.Set("prettyPrint", "false")
  34240. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setIamPolicy")
  34241. urls += "?" + c.urlParams_.Encode()
  34242. req, err := http.NewRequest("POST", urls, body)
  34243. if err != nil {
  34244. return nil, err
  34245. }
  34246. req.Header = reqHeaders
  34247. googleapi.Expand(req.URL, map[string]string{
  34248. "project": c.project,
  34249. "zone": c.zone,
  34250. "resource": c.resource,
  34251. })
  34252. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34253. }
  34254. // Do executes the "compute.disks.setIamPolicy" call.
  34255. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  34256. // code is an error. Response headers are in either
  34257. // *Policy.ServerResponse.Header or (if a response was returned at all)
  34258. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  34259. // check whether the returned error was because http.StatusNotModified
  34260. // was returned.
  34261. func (c *DisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  34262. gensupport.SetOptions(c.urlParams_, opts...)
  34263. res, err := c.doRequest("json")
  34264. if res != nil && res.StatusCode == http.StatusNotModified {
  34265. if res.Body != nil {
  34266. res.Body.Close()
  34267. }
  34268. return nil, &googleapi.Error{
  34269. Code: res.StatusCode,
  34270. Header: res.Header,
  34271. }
  34272. }
  34273. if err != nil {
  34274. return nil, err
  34275. }
  34276. defer googleapi.CloseBody(res)
  34277. if err := googleapi.CheckResponse(res); err != nil {
  34278. return nil, err
  34279. }
  34280. ret := &Policy{
  34281. ServerResponse: googleapi.ServerResponse{
  34282. Header: res.Header,
  34283. HTTPStatusCode: res.StatusCode,
  34284. },
  34285. }
  34286. target := &ret
  34287. if err := gensupport.DecodeResponse(target, res); err != nil {
  34288. return nil, err
  34289. }
  34290. return ret, nil
  34291. // {
  34292. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  34293. // "httpMethod": "POST",
  34294. // "id": "compute.disks.setIamPolicy",
  34295. // "parameterOrder": [
  34296. // "project",
  34297. // "zone",
  34298. // "resource"
  34299. // ],
  34300. // "parameters": {
  34301. // "project": {
  34302. // "description": "Project ID for this request.",
  34303. // "location": "path",
  34304. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34305. // "required": true,
  34306. // "type": "string"
  34307. // },
  34308. // "resource": {
  34309. // "description": "Name or id of the resource for this request.",
  34310. // "location": "path",
  34311. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34312. // "required": true,
  34313. // "type": "string"
  34314. // },
  34315. // "zone": {
  34316. // "description": "The name of the zone for this request.",
  34317. // "location": "path",
  34318. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34319. // "required": true,
  34320. // "type": "string"
  34321. // }
  34322. // },
  34323. // "path": "{project}/zones/{zone}/disks/{resource}/setIamPolicy",
  34324. // "request": {
  34325. // "$ref": "ZoneSetPolicyRequest"
  34326. // },
  34327. // "response": {
  34328. // "$ref": "Policy"
  34329. // },
  34330. // "scopes": [
  34331. // "https://www.googleapis.com/auth/cloud-platform",
  34332. // "https://www.googleapis.com/auth/compute"
  34333. // ]
  34334. // }
  34335. }
  34336. // method id "compute.disks.setLabels":
  34337. type DisksSetLabelsCall struct {
  34338. s *Service
  34339. project string
  34340. zone string
  34341. resource string
  34342. zonesetlabelsrequest *ZoneSetLabelsRequest
  34343. urlParams_ gensupport.URLParams
  34344. ctx_ context.Context
  34345. header_ http.Header
  34346. }
  34347. // SetLabels: Sets the labels on a disk. To learn more about labels,
  34348. // read the Labeling Resources documentation.
  34349. func (r *DisksService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *DisksSetLabelsCall {
  34350. c := &DisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34351. c.project = project
  34352. c.zone = zone
  34353. c.resource = resource
  34354. c.zonesetlabelsrequest = zonesetlabelsrequest
  34355. return c
  34356. }
  34357. // RequestId sets the optional parameter "requestId": An optional
  34358. // request ID to identify requests. Specify a unique request ID so that
  34359. // if you must retry your request, the server will know to ignore the
  34360. // request if it has already been completed.
  34361. //
  34362. // For example, consider a situation where you make an initial request
  34363. // and the request times out. If you make the request again with the
  34364. // same request ID, the server can check if original operation with the
  34365. // same request ID was received, and if so, will ignore the second
  34366. // request. This prevents clients from accidentally creating duplicate
  34367. // commitments.
  34368. //
  34369. // The request ID must be a valid UUID with the exception that zero UUID
  34370. // is not supported (00000000-0000-0000-0000-000000000000).
  34371. func (c *DisksSetLabelsCall) RequestId(requestId string) *DisksSetLabelsCall {
  34372. c.urlParams_.Set("requestId", requestId)
  34373. return c
  34374. }
  34375. // Fields allows partial responses to be retrieved. See
  34376. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34377. // for more information.
  34378. func (c *DisksSetLabelsCall) Fields(s ...googleapi.Field) *DisksSetLabelsCall {
  34379. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34380. return c
  34381. }
  34382. // Context sets the context to be used in this call's Do method. Any
  34383. // pending HTTP request will be aborted if the provided context is
  34384. // canceled.
  34385. func (c *DisksSetLabelsCall) Context(ctx context.Context) *DisksSetLabelsCall {
  34386. c.ctx_ = ctx
  34387. return c
  34388. }
  34389. // Header returns an http.Header that can be modified by the caller to
  34390. // add HTTP headers to the request.
  34391. func (c *DisksSetLabelsCall) Header() http.Header {
  34392. if c.header_ == nil {
  34393. c.header_ = make(http.Header)
  34394. }
  34395. return c.header_
  34396. }
  34397. func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  34398. reqHeaders := make(http.Header)
  34399. for k, v := range c.header_ {
  34400. reqHeaders[k] = v
  34401. }
  34402. reqHeaders.Set("User-Agent", c.s.userAgent())
  34403. var body io.Reader = nil
  34404. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest)
  34405. if err != nil {
  34406. return nil, err
  34407. }
  34408. reqHeaders.Set("Content-Type", "application/json")
  34409. c.urlParams_.Set("alt", alt)
  34410. c.urlParams_.Set("prettyPrint", "false")
  34411. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setLabels")
  34412. urls += "?" + c.urlParams_.Encode()
  34413. req, err := http.NewRequest("POST", urls, body)
  34414. if err != nil {
  34415. return nil, err
  34416. }
  34417. req.Header = reqHeaders
  34418. googleapi.Expand(req.URL, map[string]string{
  34419. "project": c.project,
  34420. "zone": c.zone,
  34421. "resource": c.resource,
  34422. })
  34423. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34424. }
  34425. // Do executes the "compute.disks.setLabels" call.
  34426. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34427. // status code is an error. Response headers are in either
  34428. // *Operation.ServerResponse.Header or (if a response was returned at
  34429. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34430. // to check whether the returned error was because
  34431. // http.StatusNotModified was returned.
  34432. func (c *DisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34433. gensupport.SetOptions(c.urlParams_, opts...)
  34434. res, err := c.doRequest("json")
  34435. if res != nil && res.StatusCode == http.StatusNotModified {
  34436. if res.Body != nil {
  34437. res.Body.Close()
  34438. }
  34439. return nil, &googleapi.Error{
  34440. Code: res.StatusCode,
  34441. Header: res.Header,
  34442. }
  34443. }
  34444. if err != nil {
  34445. return nil, err
  34446. }
  34447. defer googleapi.CloseBody(res)
  34448. if err := googleapi.CheckResponse(res); err != nil {
  34449. return nil, err
  34450. }
  34451. ret := &Operation{
  34452. ServerResponse: googleapi.ServerResponse{
  34453. Header: res.Header,
  34454. HTTPStatusCode: res.StatusCode,
  34455. },
  34456. }
  34457. target := &ret
  34458. if err := gensupport.DecodeResponse(target, res); err != nil {
  34459. return nil, err
  34460. }
  34461. return ret, nil
  34462. // {
  34463. // "description": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.",
  34464. // "httpMethod": "POST",
  34465. // "id": "compute.disks.setLabels",
  34466. // "parameterOrder": [
  34467. // "project",
  34468. // "zone",
  34469. // "resource"
  34470. // ],
  34471. // "parameters": {
  34472. // "project": {
  34473. // "description": "Project ID for this request.",
  34474. // "location": "path",
  34475. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34476. // "required": true,
  34477. // "type": "string"
  34478. // },
  34479. // "requestId": {
  34480. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34481. // "location": "query",
  34482. // "type": "string"
  34483. // },
  34484. // "resource": {
  34485. // "description": "Name or id of the resource for this request.",
  34486. // "location": "path",
  34487. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34488. // "required": true,
  34489. // "type": "string"
  34490. // },
  34491. // "zone": {
  34492. // "description": "The name of the zone for this request.",
  34493. // "location": "path",
  34494. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34495. // "required": true,
  34496. // "type": "string"
  34497. // }
  34498. // },
  34499. // "path": "{project}/zones/{zone}/disks/{resource}/setLabels",
  34500. // "request": {
  34501. // "$ref": "ZoneSetLabelsRequest"
  34502. // },
  34503. // "response": {
  34504. // "$ref": "Operation"
  34505. // },
  34506. // "scopes": [
  34507. // "https://www.googleapis.com/auth/cloud-platform",
  34508. // "https://www.googleapis.com/auth/compute"
  34509. // ]
  34510. // }
  34511. }
  34512. // method id "compute.disks.testIamPermissions":
  34513. type DisksTestIamPermissionsCall struct {
  34514. s *Service
  34515. project string
  34516. zone string
  34517. resource string
  34518. testpermissionsrequest *TestPermissionsRequest
  34519. urlParams_ gensupport.URLParams
  34520. ctx_ context.Context
  34521. header_ http.Header
  34522. }
  34523. // TestIamPermissions: Returns permissions that a caller has on the
  34524. // specified resource.
  34525. func (r *DisksService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *DisksTestIamPermissionsCall {
  34526. c := &DisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34527. c.project = project
  34528. c.zone = zone
  34529. c.resource = resource
  34530. c.testpermissionsrequest = testpermissionsrequest
  34531. return c
  34532. }
  34533. // Fields allows partial responses to be retrieved. See
  34534. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34535. // for more information.
  34536. func (c *DisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *DisksTestIamPermissionsCall {
  34537. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34538. return c
  34539. }
  34540. // Context sets the context to be used in this call's Do method. Any
  34541. // pending HTTP request will be aborted if the provided context is
  34542. // canceled.
  34543. func (c *DisksTestIamPermissionsCall) Context(ctx context.Context) *DisksTestIamPermissionsCall {
  34544. c.ctx_ = ctx
  34545. return c
  34546. }
  34547. // Header returns an http.Header that can be modified by the caller to
  34548. // add HTTP headers to the request.
  34549. func (c *DisksTestIamPermissionsCall) Header() http.Header {
  34550. if c.header_ == nil {
  34551. c.header_ = make(http.Header)
  34552. }
  34553. return c.header_
  34554. }
  34555. func (c *DisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  34556. reqHeaders := make(http.Header)
  34557. for k, v := range c.header_ {
  34558. reqHeaders[k] = v
  34559. }
  34560. reqHeaders.Set("User-Agent", c.s.userAgent())
  34561. var body io.Reader = nil
  34562. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  34563. if err != nil {
  34564. return nil, err
  34565. }
  34566. reqHeaders.Set("Content-Type", "application/json")
  34567. c.urlParams_.Set("alt", alt)
  34568. c.urlParams_.Set("prettyPrint", "false")
  34569. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/testIamPermissions")
  34570. urls += "?" + c.urlParams_.Encode()
  34571. req, err := http.NewRequest("POST", urls, body)
  34572. if err != nil {
  34573. return nil, err
  34574. }
  34575. req.Header = reqHeaders
  34576. googleapi.Expand(req.URL, map[string]string{
  34577. "project": c.project,
  34578. "zone": c.zone,
  34579. "resource": c.resource,
  34580. })
  34581. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34582. }
  34583. // Do executes the "compute.disks.testIamPermissions" call.
  34584. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  34585. // non-2xx status code is an error. Response headers are in either
  34586. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  34587. // returned at all) in error.(*googleapi.Error).Header. Use
  34588. // googleapi.IsNotModified to check whether the returned error was
  34589. // because http.StatusNotModified was returned.
  34590. func (c *DisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  34591. gensupport.SetOptions(c.urlParams_, opts...)
  34592. res, err := c.doRequest("json")
  34593. if res != nil && res.StatusCode == http.StatusNotModified {
  34594. if res.Body != nil {
  34595. res.Body.Close()
  34596. }
  34597. return nil, &googleapi.Error{
  34598. Code: res.StatusCode,
  34599. Header: res.Header,
  34600. }
  34601. }
  34602. if err != nil {
  34603. return nil, err
  34604. }
  34605. defer googleapi.CloseBody(res)
  34606. if err := googleapi.CheckResponse(res); err != nil {
  34607. return nil, err
  34608. }
  34609. ret := &TestPermissionsResponse{
  34610. ServerResponse: googleapi.ServerResponse{
  34611. Header: res.Header,
  34612. HTTPStatusCode: res.StatusCode,
  34613. },
  34614. }
  34615. target := &ret
  34616. if err := gensupport.DecodeResponse(target, res); err != nil {
  34617. return nil, err
  34618. }
  34619. return ret, nil
  34620. // {
  34621. // "description": "Returns permissions that a caller has on the specified resource.",
  34622. // "httpMethod": "POST",
  34623. // "id": "compute.disks.testIamPermissions",
  34624. // "parameterOrder": [
  34625. // "project",
  34626. // "zone",
  34627. // "resource"
  34628. // ],
  34629. // "parameters": {
  34630. // "project": {
  34631. // "description": "Project ID for this request.",
  34632. // "location": "path",
  34633. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34634. // "required": true,
  34635. // "type": "string"
  34636. // },
  34637. // "resource": {
  34638. // "description": "Name or id of the resource for this request.",
  34639. // "location": "path",
  34640. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34641. // "required": true,
  34642. // "type": "string"
  34643. // },
  34644. // "zone": {
  34645. // "description": "The name of the zone for this request.",
  34646. // "location": "path",
  34647. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34648. // "required": true,
  34649. // "type": "string"
  34650. // }
  34651. // },
  34652. // "path": "{project}/zones/{zone}/disks/{resource}/testIamPermissions",
  34653. // "request": {
  34654. // "$ref": "TestPermissionsRequest"
  34655. // },
  34656. // "response": {
  34657. // "$ref": "TestPermissionsResponse"
  34658. // },
  34659. // "scopes": [
  34660. // "https://www.googleapis.com/auth/cloud-platform",
  34661. // "https://www.googleapis.com/auth/compute",
  34662. // "https://www.googleapis.com/auth/compute.readonly"
  34663. // ]
  34664. // }
  34665. }
  34666. // method id "compute.firewalls.delete":
  34667. type FirewallsDeleteCall struct {
  34668. s *Service
  34669. project string
  34670. firewall string
  34671. urlParams_ gensupport.URLParams
  34672. ctx_ context.Context
  34673. header_ http.Header
  34674. }
  34675. // Delete: Deletes the specified firewall.
  34676. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete
  34677. func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
  34678. c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34679. c.project = project
  34680. c.firewall = firewall
  34681. return c
  34682. }
  34683. // RequestId sets the optional parameter "requestId": An optional
  34684. // request ID to identify requests. Specify a unique request ID so that
  34685. // if you must retry your request, the server will know to ignore the
  34686. // request if it has already been completed.
  34687. //
  34688. // For example, consider a situation where you make an initial request
  34689. // and the request times out. If you make the request again with the
  34690. // same request ID, the server can check if original operation with the
  34691. // same request ID was received, and if so, will ignore the second
  34692. // request. This prevents clients from accidentally creating duplicate
  34693. // commitments.
  34694. //
  34695. // The request ID must be a valid UUID with the exception that zero UUID
  34696. // is not supported (00000000-0000-0000-0000-000000000000).
  34697. func (c *FirewallsDeleteCall) RequestId(requestId string) *FirewallsDeleteCall {
  34698. c.urlParams_.Set("requestId", requestId)
  34699. return c
  34700. }
  34701. // Fields allows partial responses to be retrieved. See
  34702. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34703. // for more information.
  34704. func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
  34705. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34706. return c
  34707. }
  34708. // Context sets the context to be used in this call's Do method. Any
  34709. // pending HTTP request will be aborted if the provided context is
  34710. // canceled.
  34711. func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
  34712. c.ctx_ = ctx
  34713. return c
  34714. }
  34715. // Header returns an http.Header that can be modified by the caller to
  34716. // add HTTP headers to the request.
  34717. func (c *FirewallsDeleteCall) Header() http.Header {
  34718. if c.header_ == nil {
  34719. c.header_ = make(http.Header)
  34720. }
  34721. return c.header_
  34722. }
  34723. func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  34724. reqHeaders := make(http.Header)
  34725. for k, v := range c.header_ {
  34726. reqHeaders[k] = v
  34727. }
  34728. reqHeaders.Set("User-Agent", c.s.userAgent())
  34729. var body io.Reader = nil
  34730. c.urlParams_.Set("alt", alt)
  34731. c.urlParams_.Set("prettyPrint", "false")
  34732. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  34733. urls += "?" + c.urlParams_.Encode()
  34734. req, err := http.NewRequest("DELETE", urls, body)
  34735. if err != nil {
  34736. return nil, err
  34737. }
  34738. req.Header = reqHeaders
  34739. googleapi.Expand(req.URL, map[string]string{
  34740. "project": c.project,
  34741. "firewall": c.firewall,
  34742. })
  34743. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34744. }
  34745. // Do executes the "compute.firewalls.delete" call.
  34746. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34747. // status code is an error. Response headers are in either
  34748. // *Operation.ServerResponse.Header or (if a response was returned at
  34749. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34750. // to check whether the returned error was because
  34751. // http.StatusNotModified was returned.
  34752. func (c *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34753. gensupport.SetOptions(c.urlParams_, opts...)
  34754. res, err := c.doRequest("json")
  34755. if res != nil && res.StatusCode == http.StatusNotModified {
  34756. if res.Body != nil {
  34757. res.Body.Close()
  34758. }
  34759. return nil, &googleapi.Error{
  34760. Code: res.StatusCode,
  34761. Header: res.Header,
  34762. }
  34763. }
  34764. if err != nil {
  34765. return nil, err
  34766. }
  34767. defer googleapi.CloseBody(res)
  34768. if err := googleapi.CheckResponse(res); err != nil {
  34769. return nil, err
  34770. }
  34771. ret := &Operation{
  34772. ServerResponse: googleapi.ServerResponse{
  34773. Header: res.Header,
  34774. HTTPStatusCode: res.StatusCode,
  34775. },
  34776. }
  34777. target := &ret
  34778. if err := gensupport.DecodeResponse(target, res); err != nil {
  34779. return nil, err
  34780. }
  34781. return ret, nil
  34782. // {
  34783. // "description": "Deletes the specified firewall.",
  34784. // "httpMethod": "DELETE",
  34785. // "id": "compute.firewalls.delete",
  34786. // "parameterOrder": [
  34787. // "project",
  34788. // "firewall"
  34789. // ],
  34790. // "parameters": {
  34791. // "firewall": {
  34792. // "description": "Name of the firewall rule to delete.",
  34793. // "location": "path",
  34794. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34795. // "required": true,
  34796. // "type": "string"
  34797. // },
  34798. // "project": {
  34799. // "description": "Project ID for this request.",
  34800. // "location": "path",
  34801. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34802. // "required": true,
  34803. // "type": "string"
  34804. // },
  34805. // "requestId": {
  34806. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34807. // "location": "query",
  34808. // "type": "string"
  34809. // }
  34810. // },
  34811. // "path": "{project}/global/firewalls/{firewall}",
  34812. // "response": {
  34813. // "$ref": "Operation"
  34814. // },
  34815. // "scopes": [
  34816. // "https://www.googleapis.com/auth/cloud-platform",
  34817. // "https://www.googleapis.com/auth/compute"
  34818. // ]
  34819. // }
  34820. }
  34821. // method id "compute.firewalls.get":
  34822. type FirewallsGetCall struct {
  34823. s *Service
  34824. project string
  34825. firewall string
  34826. urlParams_ gensupport.URLParams
  34827. ifNoneMatch_ string
  34828. ctx_ context.Context
  34829. header_ http.Header
  34830. }
  34831. // Get: Returns the specified firewall.
  34832. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get
  34833. func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
  34834. c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34835. c.project = project
  34836. c.firewall = firewall
  34837. return c
  34838. }
  34839. // Fields allows partial responses to be retrieved. See
  34840. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34841. // for more information.
  34842. func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
  34843. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34844. return c
  34845. }
  34846. // IfNoneMatch sets the optional parameter which makes the operation
  34847. // fail if the object's ETag matches the given value. This is useful for
  34848. // getting updates only after the object has changed since the last
  34849. // request. Use googleapi.IsNotModified to check whether the response
  34850. // error from Do is the result of In-None-Match.
  34851. func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
  34852. c.ifNoneMatch_ = entityTag
  34853. return c
  34854. }
  34855. // Context sets the context to be used in this call's Do method. Any
  34856. // pending HTTP request will be aborted if the provided context is
  34857. // canceled.
  34858. func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
  34859. c.ctx_ = ctx
  34860. return c
  34861. }
  34862. // Header returns an http.Header that can be modified by the caller to
  34863. // add HTTP headers to the request.
  34864. func (c *FirewallsGetCall) Header() http.Header {
  34865. if c.header_ == nil {
  34866. c.header_ = make(http.Header)
  34867. }
  34868. return c.header_
  34869. }
  34870. func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
  34871. reqHeaders := make(http.Header)
  34872. for k, v := range c.header_ {
  34873. reqHeaders[k] = v
  34874. }
  34875. reqHeaders.Set("User-Agent", c.s.userAgent())
  34876. if c.ifNoneMatch_ != "" {
  34877. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34878. }
  34879. var body io.Reader = nil
  34880. c.urlParams_.Set("alt", alt)
  34881. c.urlParams_.Set("prettyPrint", "false")
  34882. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  34883. urls += "?" + c.urlParams_.Encode()
  34884. req, err := http.NewRequest("GET", urls, body)
  34885. if err != nil {
  34886. return nil, err
  34887. }
  34888. req.Header = reqHeaders
  34889. googleapi.Expand(req.URL, map[string]string{
  34890. "project": c.project,
  34891. "firewall": c.firewall,
  34892. })
  34893. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34894. }
  34895. // Do executes the "compute.firewalls.get" call.
  34896. // Exactly one of *Firewall or error will be non-nil. Any non-2xx status
  34897. // code is an error. Response headers are in either
  34898. // *Firewall.ServerResponse.Header or (if a response was returned at
  34899. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34900. // to check whether the returned error was because
  34901. // http.StatusNotModified was returned.
  34902. func (c *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, error) {
  34903. gensupport.SetOptions(c.urlParams_, opts...)
  34904. res, err := c.doRequest("json")
  34905. if res != nil && res.StatusCode == http.StatusNotModified {
  34906. if res.Body != nil {
  34907. res.Body.Close()
  34908. }
  34909. return nil, &googleapi.Error{
  34910. Code: res.StatusCode,
  34911. Header: res.Header,
  34912. }
  34913. }
  34914. if err != nil {
  34915. return nil, err
  34916. }
  34917. defer googleapi.CloseBody(res)
  34918. if err := googleapi.CheckResponse(res); err != nil {
  34919. return nil, err
  34920. }
  34921. ret := &Firewall{
  34922. ServerResponse: googleapi.ServerResponse{
  34923. Header: res.Header,
  34924. HTTPStatusCode: res.StatusCode,
  34925. },
  34926. }
  34927. target := &ret
  34928. if err := gensupport.DecodeResponse(target, res); err != nil {
  34929. return nil, err
  34930. }
  34931. return ret, nil
  34932. // {
  34933. // "description": "Returns the specified firewall.",
  34934. // "httpMethod": "GET",
  34935. // "id": "compute.firewalls.get",
  34936. // "parameterOrder": [
  34937. // "project",
  34938. // "firewall"
  34939. // ],
  34940. // "parameters": {
  34941. // "firewall": {
  34942. // "description": "Name of the firewall rule to return.",
  34943. // "location": "path",
  34944. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34945. // "required": true,
  34946. // "type": "string"
  34947. // },
  34948. // "project": {
  34949. // "description": "Project ID for this request.",
  34950. // "location": "path",
  34951. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34952. // "required": true,
  34953. // "type": "string"
  34954. // }
  34955. // },
  34956. // "path": "{project}/global/firewalls/{firewall}",
  34957. // "response": {
  34958. // "$ref": "Firewall"
  34959. // },
  34960. // "scopes": [
  34961. // "https://www.googleapis.com/auth/cloud-platform",
  34962. // "https://www.googleapis.com/auth/compute",
  34963. // "https://www.googleapis.com/auth/compute.readonly"
  34964. // ]
  34965. // }
  34966. }
  34967. // method id "compute.firewalls.insert":
  34968. type FirewallsInsertCall struct {
  34969. s *Service
  34970. project string
  34971. firewall *Firewall
  34972. urlParams_ gensupport.URLParams
  34973. ctx_ context.Context
  34974. header_ http.Header
  34975. }
  34976. // Insert: Creates a firewall rule in the specified project using the
  34977. // data included in the request.
  34978. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert
  34979. func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
  34980. c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34981. c.project = project
  34982. c.firewall = firewall
  34983. return c
  34984. }
  34985. // RequestId sets the optional parameter "requestId": An optional
  34986. // request ID to identify requests. Specify a unique request ID so that
  34987. // if you must retry your request, the server will know to ignore the
  34988. // request if it has already been completed.
  34989. //
  34990. // For example, consider a situation where you make an initial request
  34991. // and the request times out. If you make the request again with the
  34992. // same request ID, the server can check if original operation with the
  34993. // same request ID was received, and if so, will ignore the second
  34994. // request. This prevents clients from accidentally creating duplicate
  34995. // commitments.
  34996. //
  34997. // The request ID must be a valid UUID with the exception that zero UUID
  34998. // is not supported (00000000-0000-0000-0000-000000000000).
  34999. func (c *FirewallsInsertCall) RequestId(requestId string) *FirewallsInsertCall {
  35000. c.urlParams_.Set("requestId", requestId)
  35001. return c
  35002. }
  35003. // Fields allows partial responses to be retrieved. See
  35004. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35005. // for more information.
  35006. func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
  35007. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35008. return c
  35009. }
  35010. // Context sets the context to be used in this call's Do method. Any
  35011. // pending HTTP request will be aborted if the provided context is
  35012. // canceled.
  35013. func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
  35014. c.ctx_ = ctx
  35015. return c
  35016. }
  35017. // Header returns an http.Header that can be modified by the caller to
  35018. // add HTTP headers to the request.
  35019. func (c *FirewallsInsertCall) Header() http.Header {
  35020. if c.header_ == nil {
  35021. c.header_ = make(http.Header)
  35022. }
  35023. return c.header_
  35024. }
  35025. func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
  35026. reqHeaders := make(http.Header)
  35027. for k, v := range c.header_ {
  35028. reqHeaders[k] = v
  35029. }
  35030. reqHeaders.Set("User-Agent", c.s.userAgent())
  35031. var body io.Reader = nil
  35032. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
  35033. if err != nil {
  35034. return nil, err
  35035. }
  35036. reqHeaders.Set("Content-Type", "application/json")
  35037. c.urlParams_.Set("alt", alt)
  35038. c.urlParams_.Set("prettyPrint", "false")
  35039. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  35040. urls += "?" + c.urlParams_.Encode()
  35041. req, err := http.NewRequest("POST", urls, body)
  35042. if err != nil {
  35043. return nil, err
  35044. }
  35045. req.Header = reqHeaders
  35046. googleapi.Expand(req.URL, map[string]string{
  35047. "project": c.project,
  35048. })
  35049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35050. }
  35051. // Do executes the "compute.firewalls.insert" call.
  35052. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35053. // status code is an error. Response headers are in either
  35054. // *Operation.ServerResponse.Header or (if a response was returned at
  35055. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35056. // to check whether the returned error was because
  35057. // http.StatusNotModified was returned.
  35058. func (c *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35059. gensupport.SetOptions(c.urlParams_, opts...)
  35060. res, err := c.doRequest("json")
  35061. if res != nil && res.StatusCode == http.StatusNotModified {
  35062. if res.Body != nil {
  35063. res.Body.Close()
  35064. }
  35065. return nil, &googleapi.Error{
  35066. Code: res.StatusCode,
  35067. Header: res.Header,
  35068. }
  35069. }
  35070. if err != nil {
  35071. return nil, err
  35072. }
  35073. defer googleapi.CloseBody(res)
  35074. if err := googleapi.CheckResponse(res); err != nil {
  35075. return nil, err
  35076. }
  35077. ret := &Operation{
  35078. ServerResponse: googleapi.ServerResponse{
  35079. Header: res.Header,
  35080. HTTPStatusCode: res.StatusCode,
  35081. },
  35082. }
  35083. target := &ret
  35084. if err := gensupport.DecodeResponse(target, res); err != nil {
  35085. return nil, err
  35086. }
  35087. return ret, nil
  35088. // {
  35089. // "description": "Creates a firewall rule in the specified project using the data included in the request.",
  35090. // "httpMethod": "POST",
  35091. // "id": "compute.firewalls.insert",
  35092. // "parameterOrder": [
  35093. // "project"
  35094. // ],
  35095. // "parameters": {
  35096. // "project": {
  35097. // "description": "Project ID for this request.",
  35098. // "location": "path",
  35099. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35100. // "required": true,
  35101. // "type": "string"
  35102. // },
  35103. // "requestId": {
  35104. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35105. // "location": "query",
  35106. // "type": "string"
  35107. // }
  35108. // },
  35109. // "path": "{project}/global/firewalls",
  35110. // "request": {
  35111. // "$ref": "Firewall"
  35112. // },
  35113. // "response": {
  35114. // "$ref": "Operation"
  35115. // },
  35116. // "scopes": [
  35117. // "https://www.googleapis.com/auth/cloud-platform",
  35118. // "https://www.googleapis.com/auth/compute"
  35119. // ]
  35120. // }
  35121. }
  35122. // method id "compute.firewalls.list":
  35123. type FirewallsListCall struct {
  35124. s *Service
  35125. project string
  35126. urlParams_ gensupport.URLParams
  35127. ifNoneMatch_ string
  35128. ctx_ context.Context
  35129. header_ http.Header
  35130. }
  35131. // List: Retrieves the list of firewall rules available to the specified
  35132. // project.
  35133. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list
  35134. func (r *FirewallsService) List(project string) *FirewallsListCall {
  35135. c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35136. c.project = project
  35137. return c
  35138. }
  35139. // Filter sets the optional parameter "filter": A filter expression that
  35140. // filters resources listed in the response. The expression must specify
  35141. // the field name, a comparison operator, and the value that you want to
  35142. // use for filtering. The value must be a string, a number, or a
  35143. // boolean. The comparison operator must be either =, !=, >, or <.
  35144. //
  35145. // For example, if you are filtering Compute Engine instances, you can
  35146. // exclude instances named example-instance by specifying name !=
  35147. // example-instance.
  35148. //
  35149. // You can also filter nested fields. For example, you could specify
  35150. // scheduling.automaticRestart = false to include instances only if they
  35151. // are not scheduled for automatic restarts. You can use filtering on
  35152. // nested fields to filter based on resource labels.
  35153. //
  35154. // To filter on multiple expressions, provide each separate expression
  35155. // within parentheses. For example, (scheduling.automaticRestart = true)
  35156. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  35157. // AND expression. However, you can include AND and OR expressions
  35158. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  35159. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  35160. // true).
  35161. func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
  35162. c.urlParams_.Set("filter", filter)
  35163. return c
  35164. }
  35165. // MaxResults sets the optional parameter "maxResults": The maximum
  35166. // number of results per page that should be returned. If the number of
  35167. // available results is larger than maxResults, Compute Engine returns a
  35168. // nextPageToken that can be used to get the next page of results in
  35169. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  35170. // (Default: 500)
  35171. func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
  35172. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35173. return c
  35174. }
  35175. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  35176. // a certain order. By default, results are returned in alphanumerical
  35177. // order based on the resource name.
  35178. //
  35179. // You can also sort results in descending order based on the creation
  35180. // timestamp using orderBy="creationTimestamp desc". This sorts results
  35181. // based on the creationTimestamp field in reverse chronological order
  35182. // (newest result first). Use this to sort resources like operations so
  35183. // that the newest operation is returned first.
  35184. //
  35185. // Currently, only sorting by name or creationTimestamp desc is
  35186. // supported.
  35187. func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall {
  35188. c.urlParams_.Set("orderBy", orderBy)
  35189. return c
  35190. }
  35191. // PageToken sets the optional parameter "pageToken": Specifies a page
  35192. // token to use. Set pageToken to the nextPageToken returned by a
  35193. // previous list request to get the next page of results.
  35194. func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
  35195. c.urlParams_.Set("pageToken", pageToken)
  35196. return c
  35197. }
  35198. // Fields allows partial responses to be retrieved. See
  35199. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35200. // for more information.
  35201. func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
  35202. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35203. return c
  35204. }
  35205. // IfNoneMatch sets the optional parameter which makes the operation
  35206. // fail if the object's ETag matches the given value. This is useful for
  35207. // getting updates only after the object has changed since the last
  35208. // request. Use googleapi.IsNotModified to check whether the response
  35209. // error from Do is the result of In-None-Match.
  35210. func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
  35211. c.ifNoneMatch_ = entityTag
  35212. return c
  35213. }
  35214. // Context sets the context to be used in this call's Do method. Any
  35215. // pending HTTP request will be aborted if the provided context is
  35216. // canceled.
  35217. func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
  35218. c.ctx_ = ctx
  35219. return c
  35220. }
  35221. // Header returns an http.Header that can be modified by the caller to
  35222. // add HTTP headers to the request.
  35223. func (c *FirewallsListCall) Header() http.Header {
  35224. if c.header_ == nil {
  35225. c.header_ = make(http.Header)
  35226. }
  35227. return c.header_
  35228. }
  35229. func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
  35230. reqHeaders := make(http.Header)
  35231. for k, v := range c.header_ {
  35232. reqHeaders[k] = v
  35233. }
  35234. reqHeaders.Set("User-Agent", c.s.userAgent())
  35235. if c.ifNoneMatch_ != "" {
  35236. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35237. }
  35238. var body io.Reader = nil
  35239. c.urlParams_.Set("alt", alt)
  35240. c.urlParams_.Set("prettyPrint", "false")
  35241. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  35242. urls += "?" + c.urlParams_.Encode()
  35243. req, err := http.NewRequest("GET", urls, body)
  35244. if err != nil {
  35245. return nil, err
  35246. }
  35247. req.Header = reqHeaders
  35248. googleapi.Expand(req.URL, map[string]string{
  35249. "project": c.project,
  35250. })
  35251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35252. }
  35253. // Do executes the "compute.firewalls.list" call.
  35254. // Exactly one of *FirewallList or error will be non-nil. Any non-2xx
  35255. // status code is an error. Response headers are in either
  35256. // *FirewallList.ServerResponse.Header or (if a response was returned at
  35257. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35258. // to check whether the returned error was because
  35259. // http.StatusNotModified was returned.
  35260. func (c *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, error) {
  35261. gensupport.SetOptions(c.urlParams_, opts...)
  35262. res, err := c.doRequest("json")
  35263. if res != nil && res.StatusCode == http.StatusNotModified {
  35264. if res.Body != nil {
  35265. res.Body.Close()
  35266. }
  35267. return nil, &googleapi.Error{
  35268. Code: res.StatusCode,
  35269. Header: res.Header,
  35270. }
  35271. }
  35272. if err != nil {
  35273. return nil, err
  35274. }
  35275. defer googleapi.CloseBody(res)
  35276. if err := googleapi.CheckResponse(res); err != nil {
  35277. return nil, err
  35278. }
  35279. ret := &FirewallList{
  35280. ServerResponse: googleapi.ServerResponse{
  35281. Header: res.Header,
  35282. HTTPStatusCode: res.StatusCode,
  35283. },
  35284. }
  35285. target := &ret
  35286. if err := gensupport.DecodeResponse(target, res); err != nil {
  35287. return nil, err
  35288. }
  35289. return ret, nil
  35290. // {
  35291. // "description": "Retrieves the list of firewall rules available to the specified project.",
  35292. // "httpMethod": "GET",
  35293. // "id": "compute.firewalls.list",
  35294. // "parameterOrder": [
  35295. // "project"
  35296. // ],
  35297. // "parameters": {
  35298. // "filter": {
  35299. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  35300. // "location": "query",
  35301. // "type": "string"
  35302. // },
  35303. // "maxResults": {
  35304. // "default": "500",
  35305. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  35306. // "format": "uint32",
  35307. // "location": "query",
  35308. // "minimum": "0",
  35309. // "type": "integer"
  35310. // },
  35311. // "orderBy": {
  35312. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  35313. // "location": "query",
  35314. // "type": "string"
  35315. // },
  35316. // "pageToken": {
  35317. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  35318. // "location": "query",
  35319. // "type": "string"
  35320. // },
  35321. // "project": {
  35322. // "description": "Project ID for this request.",
  35323. // "location": "path",
  35324. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35325. // "required": true,
  35326. // "type": "string"
  35327. // }
  35328. // },
  35329. // "path": "{project}/global/firewalls",
  35330. // "response": {
  35331. // "$ref": "FirewallList"
  35332. // },
  35333. // "scopes": [
  35334. // "https://www.googleapis.com/auth/cloud-platform",
  35335. // "https://www.googleapis.com/auth/compute",
  35336. // "https://www.googleapis.com/auth/compute.readonly"
  35337. // ]
  35338. // }
  35339. }
  35340. // Pages invokes f for each page of results.
  35341. // A non-nil error returned from f will halt the iteration.
  35342. // The provided context supersedes any context provided to the Context method.
  35343. func (c *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error {
  35344. c.ctx_ = ctx
  35345. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35346. for {
  35347. x, err := c.Do()
  35348. if err != nil {
  35349. return err
  35350. }
  35351. if err := f(x); err != nil {
  35352. return err
  35353. }
  35354. if x.NextPageToken == "" {
  35355. return nil
  35356. }
  35357. c.PageToken(x.NextPageToken)
  35358. }
  35359. }
  35360. // method id "compute.firewalls.patch":
  35361. type FirewallsPatchCall struct {
  35362. s *Service
  35363. project string
  35364. firewall string
  35365. firewall2 *Firewall
  35366. urlParams_ gensupport.URLParams
  35367. ctx_ context.Context
  35368. header_ http.Header
  35369. }
  35370. // Patch: Updates the specified firewall rule with the data included in
  35371. // the request. This method supports PATCH semantics and uses the JSON
  35372. // merge patch format and processing rules.
  35373. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch
  35374. func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
  35375. c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35376. c.project = project
  35377. c.firewall = firewall
  35378. c.firewall2 = firewall2
  35379. return c
  35380. }
  35381. // RequestId sets the optional parameter "requestId": An optional
  35382. // request ID to identify requests. Specify a unique request ID so that
  35383. // if you must retry your request, the server will know to ignore the
  35384. // request if it has already been completed.
  35385. //
  35386. // For example, consider a situation where you make an initial request
  35387. // and the request times out. If you make the request again with the
  35388. // same request ID, the server can check if original operation with the
  35389. // same request ID was received, and if so, will ignore the second
  35390. // request. This prevents clients from accidentally creating duplicate
  35391. // commitments.
  35392. //
  35393. // The request ID must be a valid UUID with the exception that zero UUID
  35394. // is not supported (00000000-0000-0000-0000-000000000000).
  35395. func (c *FirewallsPatchCall) RequestId(requestId string) *FirewallsPatchCall {
  35396. c.urlParams_.Set("requestId", requestId)
  35397. return c
  35398. }
  35399. // Fields allows partial responses to be retrieved. See
  35400. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35401. // for more information.
  35402. func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
  35403. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35404. return c
  35405. }
  35406. // Context sets the context to be used in this call's Do method. Any
  35407. // pending HTTP request will be aborted if the provided context is
  35408. // canceled.
  35409. func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
  35410. c.ctx_ = ctx
  35411. return c
  35412. }
  35413. // Header returns an http.Header that can be modified by the caller to
  35414. // add HTTP headers to the request.
  35415. func (c *FirewallsPatchCall) Header() http.Header {
  35416. if c.header_ == nil {
  35417. c.header_ = make(http.Header)
  35418. }
  35419. return c.header_
  35420. }
  35421. func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
  35422. reqHeaders := make(http.Header)
  35423. for k, v := range c.header_ {
  35424. reqHeaders[k] = v
  35425. }
  35426. reqHeaders.Set("User-Agent", c.s.userAgent())
  35427. var body io.Reader = nil
  35428. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  35429. if err != nil {
  35430. return nil, err
  35431. }
  35432. reqHeaders.Set("Content-Type", "application/json")
  35433. c.urlParams_.Set("alt", alt)
  35434. c.urlParams_.Set("prettyPrint", "false")
  35435. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  35436. urls += "?" + c.urlParams_.Encode()
  35437. req, err := http.NewRequest("PATCH", urls, body)
  35438. if err != nil {
  35439. return nil, err
  35440. }
  35441. req.Header = reqHeaders
  35442. googleapi.Expand(req.URL, map[string]string{
  35443. "project": c.project,
  35444. "firewall": c.firewall,
  35445. })
  35446. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35447. }
  35448. // Do executes the "compute.firewalls.patch" call.
  35449. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35450. // status code is an error. Response headers are in either
  35451. // *Operation.ServerResponse.Header or (if a response was returned at
  35452. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35453. // to check whether the returned error was because
  35454. // http.StatusNotModified was returned.
  35455. func (c *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35456. gensupport.SetOptions(c.urlParams_, opts...)
  35457. res, err := c.doRequest("json")
  35458. if res != nil && res.StatusCode == http.StatusNotModified {
  35459. if res.Body != nil {
  35460. res.Body.Close()
  35461. }
  35462. return nil, &googleapi.Error{
  35463. Code: res.StatusCode,
  35464. Header: res.Header,
  35465. }
  35466. }
  35467. if err != nil {
  35468. return nil, err
  35469. }
  35470. defer googleapi.CloseBody(res)
  35471. if err := googleapi.CheckResponse(res); err != nil {
  35472. return nil, err
  35473. }
  35474. ret := &Operation{
  35475. ServerResponse: googleapi.ServerResponse{
  35476. Header: res.Header,
  35477. HTTPStatusCode: res.StatusCode,
  35478. },
  35479. }
  35480. target := &ret
  35481. if err := gensupport.DecodeResponse(target, res); err != nil {
  35482. return nil, err
  35483. }
  35484. return ret, nil
  35485. // {
  35486. // "description": "Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  35487. // "httpMethod": "PATCH",
  35488. // "id": "compute.firewalls.patch",
  35489. // "parameterOrder": [
  35490. // "project",
  35491. // "firewall"
  35492. // ],
  35493. // "parameters": {
  35494. // "firewall": {
  35495. // "description": "Name of the firewall rule to patch.",
  35496. // "location": "path",
  35497. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  35498. // "required": true,
  35499. // "type": "string"
  35500. // },
  35501. // "project": {
  35502. // "description": "Project ID for this request.",
  35503. // "location": "path",
  35504. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35505. // "required": true,
  35506. // "type": "string"
  35507. // },
  35508. // "requestId": {
  35509. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35510. // "location": "query",
  35511. // "type": "string"
  35512. // }
  35513. // },
  35514. // "path": "{project}/global/firewalls/{firewall}",
  35515. // "request": {
  35516. // "$ref": "Firewall"
  35517. // },
  35518. // "response": {
  35519. // "$ref": "Operation"
  35520. // },
  35521. // "scopes": [
  35522. // "https://www.googleapis.com/auth/cloud-platform",
  35523. // "https://www.googleapis.com/auth/compute"
  35524. // ]
  35525. // }
  35526. }
  35527. // method id "compute.firewalls.update":
  35528. type FirewallsUpdateCall struct {
  35529. s *Service
  35530. project string
  35531. firewall string
  35532. firewall2 *Firewall
  35533. urlParams_ gensupport.URLParams
  35534. ctx_ context.Context
  35535. header_ http.Header
  35536. }
  35537. // Update: Updates the specified firewall rule with the data included in
  35538. // the request. The PUT method can only update the following fields of
  35539. // firewall rule: allowed, description, sourceRanges, sourceTags,
  35540. // targetTags.
  35541. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update
  35542. func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
  35543. c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35544. c.project = project
  35545. c.firewall = firewall
  35546. c.firewall2 = firewall2
  35547. return c
  35548. }
  35549. // RequestId sets the optional parameter "requestId": An optional
  35550. // request ID to identify requests. Specify a unique request ID so that
  35551. // if you must retry your request, the server will know to ignore the
  35552. // request if it has already been completed.
  35553. //
  35554. // For example, consider a situation where you make an initial request
  35555. // and the request times out. If you make the request again with the
  35556. // same request ID, the server can check if original operation with the
  35557. // same request ID was received, and if so, will ignore the second
  35558. // request. This prevents clients from accidentally creating duplicate
  35559. // commitments.
  35560. //
  35561. // The request ID must be a valid UUID with the exception that zero UUID
  35562. // is not supported (00000000-0000-0000-0000-000000000000).
  35563. func (c *FirewallsUpdateCall) RequestId(requestId string) *FirewallsUpdateCall {
  35564. c.urlParams_.Set("requestId", requestId)
  35565. return c
  35566. }
  35567. // Fields allows partial responses to be retrieved. See
  35568. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35569. // for more information.
  35570. func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
  35571. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35572. return c
  35573. }
  35574. // Context sets the context to be used in this call's Do method. Any
  35575. // pending HTTP request will be aborted if the provided context is
  35576. // canceled.
  35577. func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
  35578. c.ctx_ = ctx
  35579. return c
  35580. }
  35581. // Header returns an http.Header that can be modified by the caller to
  35582. // add HTTP headers to the request.
  35583. func (c *FirewallsUpdateCall) Header() http.Header {
  35584. if c.header_ == nil {
  35585. c.header_ = make(http.Header)
  35586. }
  35587. return c.header_
  35588. }
  35589. func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  35590. reqHeaders := make(http.Header)
  35591. for k, v := range c.header_ {
  35592. reqHeaders[k] = v
  35593. }
  35594. reqHeaders.Set("User-Agent", c.s.userAgent())
  35595. var body io.Reader = nil
  35596. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  35597. if err != nil {
  35598. return nil, err
  35599. }
  35600. reqHeaders.Set("Content-Type", "application/json")
  35601. c.urlParams_.Set("alt", alt)
  35602. c.urlParams_.Set("prettyPrint", "false")
  35603. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  35604. urls += "?" + c.urlParams_.Encode()
  35605. req, err := http.NewRequest("PUT", urls, body)
  35606. if err != nil {
  35607. return nil, err
  35608. }
  35609. req.Header = reqHeaders
  35610. googleapi.Expand(req.URL, map[string]string{
  35611. "project": c.project,
  35612. "firewall": c.firewall,
  35613. })
  35614. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35615. }
  35616. // Do executes the "compute.firewalls.update" call.
  35617. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35618. // status code is an error. Response headers are in either
  35619. // *Operation.ServerResponse.Header or (if a response was returned at
  35620. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35621. // to check whether the returned error was because
  35622. // http.StatusNotModified was returned.
  35623. func (c *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35624. gensupport.SetOptions(c.urlParams_, opts...)
  35625. res, err := c.doRequest("json")
  35626. if res != nil && res.StatusCode == http.StatusNotModified {
  35627. if res.Body != nil {
  35628. res.Body.Close()
  35629. }
  35630. return nil, &googleapi.Error{
  35631. Code: res.StatusCode,
  35632. Header: res.Header,
  35633. }
  35634. }
  35635. if err != nil {
  35636. return nil, err
  35637. }
  35638. defer googleapi.CloseBody(res)
  35639. if err := googleapi.CheckResponse(res); err != nil {
  35640. return nil, err
  35641. }
  35642. ret := &Operation{
  35643. ServerResponse: googleapi.ServerResponse{
  35644. Header: res.Header,
  35645. HTTPStatusCode: res.StatusCode,
  35646. },
  35647. }
  35648. target := &ret
  35649. if err := gensupport.DecodeResponse(target, res); err != nil {
  35650. return nil, err
  35651. }
  35652. return ret, nil
  35653. // {
  35654. // "description": "Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags.",
  35655. // "httpMethod": "PUT",
  35656. // "id": "compute.firewalls.update",
  35657. // "parameterOrder": [
  35658. // "project",
  35659. // "firewall"
  35660. // ],
  35661. // "parameters": {
  35662. // "firewall": {
  35663. // "description": "Name of the firewall rule to update.",
  35664. // "location": "path",
  35665. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  35666. // "required": true,
  35667. // "type": "string"
  35668. // },
  35669. // "project": {
  35670. // "description": "Project ID for this request.",
  35671. // "location": "path",
  35672. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35673. // "required": true,
  35674. // "type": "string"
  35675. // },
  35676. // "requestId": {
  35677. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35678. // "location": "query",
  35679. // "type": "string"
  35680. // }
  35681. // },
  35682. // "path": "{project}/global/firewalls/{firewall}",
  35683. // "request": {
  35684. // "$ref": "Firewall"
  35685. // },
  35686. // "response": {
  35687. // "$ref": "Operation"
  35688. // },
  35689. // "scopes": [
  35690. // "https://www.googleapis.com/auth/cloud-platform",
  35691. // "https://www.googleapis.com/auth/compute"
  35692. // ]
  35693. // }
  35694. }
  35695. // method id "compute.forwardingRules.aggregatedList":
  35696. type ForwardingRulesAggregatedListCall struct {
  35697. s *Service
  35698. project string
  35699. urlParams_ gensupport.URLParams
  35700. ifNoneMatch_ string
  35701. ctx_ context.Context
  35702. header_ http.Header
  35703. }
  35704. // AggregatedList: Retrieves an aggregated list of forwarding rules.
  35705. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList
  35706. func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
  35707. c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35708. c.project = project
  35709. return c
  35710. }
  35711. // Filter sets the optional parameter "filter": A filter expression that
  35712. // filters resources listed in the response. The expression must specify
  35713. // the field name, a comparison operator, and the value that you want to
  35714. // use for filtering. The value must be a string, a number, or a
  35715. // boolean. The comparison operator must be either =, !=, >, or <.
  35716. //
  35717. // For example, if you are filtering Compute Engine instances, you can
  35718. // exclude instances named example-instance by specifying name !=
  35719. // example-instance.
  35720. //
  35721. // You can also filter nested fields. For example, you could specify
  35722. // scheduling.automaticRestart = false to include instances only if they
  35723. // are not scheduled for automatic restarts. You can use filtering on
  35724. // nested fields to filter based on resource labels.
  35725. //
  35726. // To filter on multiple expressions, provide each separate expression
  35727. // within parentheses. For example, (scheduling.automaticRestart = true)
  35728. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  35729. // AND expression. However, you can include AND and OR expressions
  35730. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  35731. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  35732. // true).
  35733. func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
  35734. c.urlParams_.Set("filter", filter)
  35735. return c
  35736. }
  35737. // MaxResults sets the optional parameter "maxResults": The maximum
  35738. // number of results per page that should be returned. If the number of
  35739. // available results is larger than maxResults, Compute Engine returns a
  35740. // nextPageToken that can be used to get the next page of results in
  35741. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  35742. // (Default: 500)
  35743. func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
  35744. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35745. return c
  35746. }
  35747. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  35748. // a certain order. By default, results are returned in alphanumerical
  35749. // order based on the resource name.
  35750. //
  35751. // You can also sort results in descending order based on the creation
  35752. // timestamp using orderBy="creationTimestamp desc". This sorts results
  35753. // based on the creationTimestamp field in reverse chronological order
  35754. // (newest result first). Use this to sort resources like operations so
  35755. // that the newest operation is returned first.
  35756. //
  35757. // Currently, only sorting by name or creationTimestamp desc is
  35758. // supported.
  35759. func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall {
  35760. c.urlParams_.Set("orderBy", orderBy)
  35761. return c
  35762. }
  35763. // PageToken sets the optional parameter "pageToken": Specifies a page
  35764. // token to use. Set pageToken to the nextPageToken returned by a
  35765. // previous list request to get the next page of results.
  35766. func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
  35767. c.urlParams_.Set("pageToken", pageToken)
  35768. return c
  35769. }
  35770. // Fields allows partial responses to be retrieved. See
  35771. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35772. // for more information.
  35773. func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
  35774. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35775. return c
  35776. }
  35777. // IfNoneMatch sets the optional parameter which makes the operation
  35778. // fail if the object's ETag matches the given value. This is useful for
  35779. // getting updates only after the object has changed since the last
  35780. // request. Use googleapi.IsNotModified to check whether the response
  35781. // error from Do is the result of In-None-Match.
  35782. func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
  35783. c.ifNoneMatch_ = entityTag
  35784. return c
  35785. }
  35786. // Context sets the context to be used in this call's Do method. Any
  35787. // pending HTTP request will be aborted if the provided context is
  35788. // canceled.
  35789. func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
  35790. c.ctx_ = ctx
  35791. return c
  35792. }
  35793. // Header returns an http.Header that can be modified by the caller to
  35794. // add HTTP headers to the request.
  35795. func (c *ForwardingRulesAggregatedListCall) Header() http.Header {
  35796. if c.header_ == nil {
  35797. c.header_ = make(http.Header)
  35798. }
  35799. return c.header_
  35800. }
  35801. func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  35802. reqHeaders := make(http.Header)
  35803. for k, v := range c.header_ {
  35804. reqHeaders[k] = v
  35805. }
  35806. reqHeaders.Set("User-Agent", c.s.userAgent())
  35807. if c.ifNoneMatch_ != "" {
  35808. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35809. }
  35810. var body io.Reader = nil
  35811. c.urlParams_.Set("alt", alt)
  35812. c.urlParams_.Set("prettyPrint", "false")
  35813. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules")
  35814. urls += "?" + c.urlParams_.Encode()
  35815. req, err := http.NewRequest("GET", urls, body)
  35816. if err != nil {
  35817. return nil, err
  35818. }
  35819. req.Header = reqHeaders
  35820. googleapi.Expand(req.URL, map[string]string{
  35821. "project": c.project,
  35822. })
  35823. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35824. }
  35825. // Do executes the "compute.forwardingRules.aggregatedList" call.
  35826. // Exactly one of *ForwardingRuleAggregatedList or error will be
  35827. // non-nil. Any non-2xx status code is an error. Response headers are in
  35828. // either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a
  35829. // response was returned at all) in error.(*googleapi.Error).Header. Use
  35830. // googleapi.IsNotModified to check whether the returned error was
  35831. // because http.StatusNotModified was returned.
  35832. func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, error) {
  35833. gensupport.SetOptions(c.urlParams_, opts...)
  35834. res, err := c.doRequest("json")
  35835. if res != nil && res.StatusCode == http.StatusNotModified {
  35836. if res.Body != nil {
  35837. res.Body.Close()
  35838. }
  35839. return nil, &googleapi.Error{
  35840. Code: res.StatusCode,
  35841. Header: res.Header,
  35842. }
  35843. }
  35844. if err != nil {
  35845. return nil, err
  35846. }
  35847. defer googleapi.CloseBody(res)
  35848. if err := googleapi.CheckResponse(res); err != nil {
  35849. return nil, err
  35850. }
  35851. ret := &ForwardingRuleAggregatedList{
  35852. ServerResponse: googleapi.ServerResponse{
  35853. Header: res.Header,
  35854. HTTPStatusCode: res.StatusCode,
  35855. },
  35856. }
  35857. target := &ret
  35858. if err := gensupport.DecodeResponse(target, res); err != nil {
  35859. return nil, err
  35860. }
  35861. return ret, nil
  35862. // {
  35863. // "description": "Retrieves an aggregated list of forwarding rules.",
  35864. // "httpMethod": "GET",
  35865. // "id": "compute.forwardingRules.aggregatedList",
  35866. // "parameterOrder": [
  35867. // "project"
  35868. // ],
  35869. // "parameters": {
  35870. // "filter": {
  35871. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  35872. // "location": "query",
  35873. // "type": "string"
  35874. // },
  35875. // "maxResults": {
  35876. // "default": "500",
  35877. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  35878. // "format": "uint32",
  35879. // "location": "query",
  35880. // "minimum": "0",
  35881. // "type": "integer"
  35882. // },
  35883. // "orderBy": {
  35884. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  35885. // "location": "query",
  35886. // "type": "string"
  35887. // },
  35888. // "pageToken": {
  35889. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  35890. // "location": "query",
  35891. // "type": "string"
  35892. // },
  35893. // "project": {
  35894. // "description": "Project ID for this request.",
  35895. // "location": "path",
  35896. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35897. // "required": true,
  35898. // "type": "string"
  35899. // }
  35900. // },
  35901. // "path": "{project}/aggregated/forwardingRules",
  35902. // "response": {
  35903. // "$ref": "ForwardingRuleAggregatedList"
  35904. // },
  35905. // "scopes": [
  35906. // "https://www.googleapis.com/auth/cloud-platform",
  35907. // "https://www.googleapis.com/auth/compute",
  35908. // "https://www.googleapis.com/auth/compute.readonly"
  35909. // ]
  35910. // }
  35911. }
  35912. // Pages invokes f for each page of results.
  35913. // A non-nil error returned from f will halt the iteration.
  35914. // The provided context supersedes any context provided to the Context method.
  35915. func (c *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error {
  35916. c.ctx_ = ctx
  35917. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35918. for {
  35919. x, err := c.Do()
  35920. if err != nil {
  35921. return err
  35922. }
  35923. if err := f(x); err != nil {
  35924. return err
  35925. }
  35926. if x.NextPageToken == "" {
  35927. return nil
  35928. }
  35929. c.PageToken(x.NextPageToken)
  35930. }
  35931. }
  35932. // method id "compute.forwardingRules.delete":
  35933. type ForwardingRulesDeleteCall struct {
  35934. s *Service
  35935. project string
  35936. region string
  35937. forwardingRule string
  35938. urlParams_ gensupport.URLParams
  35939. ctx_ context.Context
  35940. header_ http.Header
  35941. }
  35942. // Delete: Deletes the specified ForwardingRule resource.
  35943. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete
  35944. func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
  35945. c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35946. c.project = project
  35947. c.region = region
  35948. c.forwardingRule = forwardingRule
  35949. return c
  35950. }
  35951. // RequestId sets the optional parameter "requestId": An optional
  35952. // request ID to identify requests. Specify a unique request ID so that
  35953. // if you must retry your request, the server will know to ignore the
  35954. // request if it has already been completed.
  35955. //
  35956. // For example, consider a situation where you make an initial request
  35957. // and the request times out. If you make the request again with the
  35958. // same request ID, the server can check if original operation with the
  35959. // same request ID was received, and if so, will ignore the second
  35960. // request. This prevents clients from accidentally creating duplicate
  35961. // commitments.
  35962. //
  35963. // The request ID must be a valid UUID with the exception that zero UUID
  35964. // is not supported (00000000-0000-0000-0000-000000000000).
  35965. func (c *ForwardingRulesDeleteCall) RequestId(requestId string) *ForwardingRulesDeleteCall {
  35966. c.urlParams_.Set("requestId", requestId)
  35967. return c
  35968. }
  35969. // Fields allows partial responses to be retrieved. See
  35970. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35971. // for more information.
  35972. func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
  35973. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35974. return c
  35975. }
  35976. // Context sets the context to be used in this call's Do method. Any
  35977. // pending HTTP request will be aborted if the provided context is
  35978. // canceled.
  35979. func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
  35980. c.ctx_ = ctx
  35981. return c
  35982. }
  35983. // Header returns an http.Header that can be modified by the caller to
  35984. // add HTTP headers to the request.
  35985. func (c *ForwardingRulesDeleteCall) Header() http.Header {
  35986. if c.header_ == nil {
  35987. c.header_ = make(http.Header)
  35988. }
  35989. return c.header_
  35990. }
  35991. func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  35992. reqHeaders := make(http.Header)
  35993. for k, v := range c.header_ {
  35994. reqHeaders[k] = v
  35995. }
  35996. reqHeaders.Set("User-Agent", c.s.userAgent())
  35997. var body io.Reader = nil
  35998. c.urlParams_.Set("alt", alt)
  35999. c.urlParams_.Set("prettyPrint", "false")
  36000. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  36001. urls += "?" + c.urlParams_.Encode()
  36002. req, err := http.NewRequest("DELETE", urls, body)
  36003. if err != nil {
  36004. return nil, err
  36005. }
  36006. req.Header = reqHeaders
  36007. googleapi.Expand(req.URL, map[string]string{
  36008. "project": c.project,
  36009. "region": c.region,
  36010. "forwardingRule": c.forwardingRule,
  36011. })
  36012. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36013. }
  36014. // Do executes the "compute.forwardingRules.delete" call.
  36015. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36016. // status code is an error. Response headers are in either
  36017. // *Operation.ServerResponse.Header or (if a response was returned at
  36018. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36019. // to check whether the returned error was because
  36020. // http.StatusNotModified was returned.
  36021. func (c *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36022. gensupport.SetOptions(c.urlParams_, opts...)
  36023. res, err := c.doRequest("json")
  36024. if res != nil && res.StatusCode == http.StatusNotModified {
  36025. if res.Body != nil {
  36026. res.Body.Close()
  36027. }
  36028. return nil, &googleapi.Error{
  36029. Code: res.StatusCode,
  36030. Header: res.Header,
  36031. }
  36032. }
  36033. if err != nil {
  36034. return nil, err
  36035. }
  36036. defer googleapi.CloseBody(res)
  36037. if err := googleapi.CheckResponse(res); err != nil {
  36038. return nil, err
  36039. }
  36040. ret := &Operation{
  36041. ServerResponse: googleapi.ServerResponse{
  36042. Header: res.Header,
  36043. HTTPStatusCode: res.StatusCode,
  36044. },
  36045. }
  36046. target := &ret
  36047. if err := gensupport.DecodeResponse(target, res); err != nil {
  36048. return nil, err
  36049. }
  36050. return ret, nil
  36051. // {
  36052. // "description": "Deletes the specified ForwardingRule resource.",
  36053. // "httpMethod": "DELETE",
  36054. // "id": "compute.forwardingRules.delete",
  36055. // "parameterOrder": [
  36056. // "project",
  36057. // "region",
  36058. // "forwardingRule"
  36059. // ],
  36060. // "parameters": {
  36061. // "forwardingRule": {
  36062. // "description": "Name of the ForwardingRule resource to delete.",
  36063. // "location": "path",
  36064. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  36065. // "required": true,
  36066. // "type": "string"
  36067. // },
  36068. // "project": {
  36069. // "description": "Project ID for this request.",
  36070. // "location": "path",
  36071. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36072. // "required": true,
  36073. // "type": "string"
  36074. // },
  36075. // "region": {
  36076. // "description": "Name of the region scoping this request.",
  36077. // "location": "path",
  36078. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36079. // "required": true,
  36080. // "type": "string"
  36081. // },
  36082. // "requestId": {
  36083. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36084. // "location": "query",
  36085. // "type": "string"
  36086. // }
  36087. // },
  36088. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  36089. // "response": {
  36090. // "$ref": "Operation"
  36091. // },
  36092. // "scopes": [
  36093. // "https://www.googleapis.com/auth/cloud-platform",
  36094. // "https://www.googleapis.com/auth/compute"
  36095. // ]
  36096. // }
  36097. }
  36098. // method id "compute.forwardingRules.get":
  36099. type ForwardingRulesGetCall struct {
  36100. s *Service
  36101. project string
  36102. region string
  36103. forwardingRule string
  36104. urlParams_ gensupport.URLParams
  36105. ifNoneMatch_ string
  36106. ctx_ context.Context
  36107. header_ http.Header
  36108. }
  36109. // Get: Returns the specified ForwardingRule resource.
  36110. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get
  36111. func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
  36112. c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36113. c.project = project
  36114. c.region = region
  36115. c.forwardingRule = forwardingRule
  36116. return c
  36117. }
  36118. // Fields allows partial responses to be retrieved. See
  36119. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36120. // for more information.
  36121. func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
  36122. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36123. return c
  36124. }
  36125. // IfNoneMatch sets the optional parameter which makes the operation
  36126. // fail if the object's ETag matches the given value. This is useful for
  36127. // getting updates only after the object has changed since the last
  36128. // request. Use googleapi.IsNotModified to check whether the response
  36129. // error from Do is the result of In-None-Match.
  36130. func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
  36131. c.ifNoneMatch_ = entityTag
  36132. return c
  36133. }
  36134. // Context sets the context to be used in this call's Do method. Any
  36135. // pending HTTP request will be aborted if the provided context is
  36136. // canceled.
  36137. func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
  36138. c.ctx_ = ctx
  36139. return c
  36140. }
  36141. // Header returns an http.Header that can be modified by the caller to
  36142. // add HTTP headers to the request.
  36143. func (c *ForwardingRulesGetCall) Header() http.Header {
  36144. if c.header_ == nil {
  36145. c.header_ = make(http.Header)
  36146. }
  36147. return c.header_
  36148. }
  36149. func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  36150. reqHeaders := make(http.Header)
  36151. for k, v := range c.header_ {
  36152. reqHeaders[k] = v
  36153. }
  36154. reqHeaders.Set("User-Agent", c.s.userAgent())
  36155. if c.ifNoneMatch_ != "" {
  36156. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36157. }
  36158. var body io.Reader = nil
  36159. c.urlParams_.Set("alt", alt)
  36160. c.urlParams_.Set("prettyPrint", "false")
  36161. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  36162. urls += "?" + c.urlParams_.Encode()
  36163. req, err := http.NewRequest("GET", urls, body)
  36164. if err != nil {
  36165. return nil, err
  36166. }
  36167. req.Header = reqHeaders
  36168. googleapi.Expand(req.URL, map[string]string{
  36169. "project": c.project,
  36170. "region": c.region,
  36171. "forwardingRule": c.forwardingRule,
  36172. })
  36173. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36174. }
  36175. // Do executes the "compute.forwardingRules.get" call.
  36176. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  36177. // status code is an error. Response headers are in either
  36178. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  36179. // at all) in error.(*googleapi.Error).Header. Use
  36180. // googleapi.IsNotModified to check whether the returned error was
  36181. // because http.StatusNotModified was returned.
  36182. func (c *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  36183. gensupport.SetOptions(c.urlParams_, opts...)
  36184. res, err := c.doRequest("json")
  36185. if res != nil && res.StatusCode == http.StatusNotModified {
  36186. if res.Body != nil {
  36187. res.Body.Close()
  36188. }
  36189. return nil, &googleapi.Error{
  36190. Code: res.StatusCode,
  36191. Header: res.Header,
  36192. }
  36193. }
  36194. if err != nil {
  36195. return nil, err
  36196. }
  36197. defer googleapi.CloseBody(res)
  36198. if err := googleapi.CheckResponse(res); err != nil {
  36199. return nil, err
  36200. }
  36201. ret := &ForwardingRule{
  36202. ServerResponse: googleapi.ServerResponse{
  36203. Header: res.Header,
  36204. HTTPStatusCode: res.StatusCode,
  36205. },
  36206. }
  36207. target := &ret
  36208. if err := gensupport.DecodeResponse(target, res); err != nil {
  36209. return nil, err
  36210. }
  36211. return ret, nil
  36212. // {
  36213. // "description": "Returns the specified ForwardingRule resource.",
  36214. // "httpMethod": "GET",
  36215. // "id": "compute.forwardingRules.get",
  36216. // "parameterOrder": [
  36217. // "project",
  36218. // "region",
  36219. // "forwardingRule"
  36220. // ],
  36221. // "parameters": {
  36222. // "forwardingRule": {
  36223. // "description": "Name of the ForwardingRule resource to return.",
  36224. // "location": "path",
  36225. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  36226. // "required": true,
  36227. // "type": "string"
  36228. // },
  36229. // "project": {
  36230. // "description": "Project ID for this request.",
  36231. // "location": "path",
  36232. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36233. // "required": true,
  36234. // "type": "string"
  36235. // },
  36236. // "region": {
  36237. // "description": "Name of the region scoping this request.",
  36238. // "location": "path",
  36239. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36240. // "required": true,
  36241. // "type": "string"
  36242. // }
  36243. // },
  36244. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  36245. // "response": {
  36246. // "$ref": "ForwardingRule"
  36247. // },
  36248. // "scopes": [
  36249. // "https://www.googleapis.com/auth/cloud-platform",
  36250. // "https://www.googleapis.com/auth/compute",
  36251. // "https://www.googleapis.com/auth/compute.readonly"
  36252. // ]
  36253. // }
  36254. }
  36255. // method id "compute.forwardingRules.insert":
  36256. type ForwardingRulesInsertCall struct {
  36257. s *Service
  36258. project string
  36259. region string
  36260. forwardingrule *ForwardingRule
  36261. urlParams_ gensupport.URLParams
  36262. ctx_ context.Context
  36263. header_ http.Header
  36264. }
  36265. // Insert: Creates a ForwardingRule resource in the specified project
  36266. // and region using the data included in the request.
  36267. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert
  36268. func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
  36269. c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36270. c.project = project
  36271. c.region = region
  36272. c.forwardingrule = forwardingrule
  36273. return c
  36274. }
  36275. // RequestId sets the optional parameter "requestId": An optional
  36276. // request ID to identify requests. Specify a unique request ID so that
  36277. // if you must retry your request, the server will know to ignore the
  36278. // request if it has already been completed.
  36279. //
  36280. // For example, consider a situation where you make an initial request
  36281. // and the request times out. If you make the request again with the
  36282. // same request ID, the server can check if original operation with the
  36283. // same request ID was received, and if so, will ignore the second
  36284. // request. This prevents clients from accidentally creating duplicate
  36285. // commitments.
  36286. //
  36287. // The request ID must be a valid UUID with the exception that zero UUID
  36288. // is not supported (00000000-0000-0000-0000-000000000000).
  36289. func (c *ForwardingRulesInsertCall) RequestId(requestId string) *ForwardingRulesInsertCall {
  36290. c.urlParams_.Set("requestId", requestId)
  36291. return c
  36292. }
  36293. // Fields allows partial responses to be retrieved. See
  36294. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36295. // for more information.
  36296. func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
  36297. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36298. return c
  36299. }
  36300. // Context sets the context to be used in this call's Do method. Any
  36301. // pending HTTP request will be aborted if the provided context is
  36302. // canceled.
  36303. func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
  36304. c.ctx_ = ctx
  36305. return c
  36306. }
  36307. // Header returns an http.Header that can be modified by the caller to
  36308. // add HTTP headers to the request.
  36309. func (c *ForwardingRulesInsertCall) Header() http.Header {
  36310. if c.header_ == nil {
  36311. c.header_ = make(http.Header)
  36312. }
  36313. return c.header_
  36314. }
  36315. func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  36316. reqHeaders := make(http.Header)
  36317. for k, v := range c.header_ {
  36318. reqHeaders[k] = v
  36319. }
  36320. reqHeaders.Set("User-Agent", c.s.userAgent())
  36321. var body io.Reader = nil
  36322. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  36323. if err != nil {
  36324. return nil, err
  36325. }
  36326. reqHeaders.Set("Content-Type", "application/json")
  36327. c.urlParams_.Set("alt", alt)
  36328. c.urlParams_.Set("prettyPrint", "false")
  36329. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  36330. urls += "?" + c.urlParams_.Encode()
  36331. req, err := http.NewRequest("POST", urls, body)
  36332. if err != nil {
  36333. return nil, err
  36334. }
  36335. req.Header = reqHeaders
  36336. googleapi.Expand(req.URL, map[string]string{
  36337. "project": c.project,
  36338. "region": c.region,
  36339. })
  36340. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36341. }
  36342. // Do executes the "compute.forwardingRules.insert" call.
  36343. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36344. // status code is an error. Response headers are in either
  36345. // *Operation.ServerResponse.Header or (if a response was returned at
  36346. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36347. // to check whether the returned error was because
  36348. // http.StatusNotModified was returned.
  36349. func (c *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36350. gensupport.SetOptions(c.urlParams_, opts...)
  36351. res, err := c.doRequest("json")
  36352. if res != nil && res.StatusCode == http.StatusNotModified {
  36353. if res.Body != nil {
  36354. res.Body.Close()
  36355. }
  36356. return nil, &googleapi.Error{
  36357. Code: res.StatusCode,
  36358. Header: res.Header,
  36359. }
  36360. }
  36361. if err != nil {
  36362. return nil, err
  36363. }
  36364. defer googleapi.CloseBody(res)
  36365. if err := googleapi.CheckResponse(res); err != nil {
  36366. return nil, err
  36367. }
  36368. ret := &Operation{
  36369. ServerResponse: googleapi.ServerResponse{
  36370. Header: res.Header,
  36371. HTTPStatusCode: res.StatusCode,
  36372. },
  36373. }
  36374. target := &ret
  36375. if err := gensupport.DecodeResponse(target, res); err != nil {
  36376. return nil, err
  36377. }
  36378. return ret, nil
  36379. // {
  36380. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  36381. // "httpMethod": "POST",
  36382. // "id": "compute.forwardingRules.insert",
  36383. // "parameterOrder": [
  36384. // "project",
  36385. // "region"
  36386. // ],
  36387. // "parameters": {
  36388. // "project": {
  36389. // "description": "Project ID for this request.",
  36390. // "location": "path",
  36391. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36392. // "required": true,
  36393. // "type": "string"
  36394. // },
  36395. // "region": {
  36396. // "description": "Name of the region scoping this request.",
  36397. // "location": "path",
  36398. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36399. // "required": true,
  36400. // "type": "string"
  36401. // },
  36402. // "requestId": {
  36403. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36404. // "location": "query",
  36405. // "type": "string"
  36406. // }
  36407. // },
  36408. // "path": "{project}/regions/{region}/forwardingRules",
  36409. // "request": {
  36410. // "$ref": "ForwardingRule"
  36411. // },
  36412. // "response": {
  36413. // "$ref": "Operation"
  36414. // },
  36415. // "scopes": [
  36416. // "https://www.googleapis.com/auth/cloud-platform",
  36417. // "https://www.googleapis.com/auth/compute"
  36418. // ]
  36419. // }
  36420. }
  36421. // method id "compute.forwardingRules.list":
  36422. type ForwardingRulesListCall struct {
  36423. s *Service
  36424. project string
  36425. region string
  36426. urlParams_ gensupport.URLParams
  36427. ifNoneMatch_ string
  36428. ctx_ context.Context
  36429. header_ http.Header
  36430. }
  36431. // List: Retrieves a list of ForwardingRule resources available to the
  36432. // specified project and region.
  36433. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list
  36434. func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
  36435. c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36436. c.project = project
  36437. c.region = region
  36438. return c
  36439. }
  36440. // Filter sets the optional parameter "filter": A filter expression that
  36441. // filters resources listed in the response. The expression must specify
  36442. // the field name, a comparison operator, and the value that you want to
  36443. // use for filtering. The value must be a string, a number, or a
  36444. // boolean. The comparison operator must be either =, !=, >, or <.
  36445. //
  36446. // For example, if you are filtering Compute Engine instances, you can
  36447. // exclude instances named example-instance by specifying name !=
  36448. // example-instance.
  36449. //
  36450. // You can also filter nested fields. For example, you could specify
  36451. // scheduling.automaticRestart = false to include instances only if they
  36452. // are not scheduled for automatic restarts. You can use filtering on
  36453. // nested fields to filter based on resource labels.
  36454. //
  36455. // To filter on multiple expressions, provide each separate expression
  36456. // within parentheses. For example, (scheduling.automaticRestart = true)
  36457. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  36458. // AND expression. However, you can include AND and OR expressions
  36459. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  36460. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  36461. // true).
  36462. func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
  36463. c.urlParams_.Set("filter", filter)
  36464. return c
  36465. }
  36466. // MaxResults sets the optional parameter "maxResults": The maximum
  36467. // number of results per page that should be returned. If the number of
  36468. // available results is larger than maxResults, Compute Engine returns a
  36469. // nextPageToken that can be used to get the next page of results in
  36470. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  36471. // (Default: 500)
  36472. func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
  36473. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36474. return c
  36475. }
  36476. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  36477. // a certain order. By default, results are returned in alphanumerical
  36478. // order based on the resource name.
  36479. //
  36480. // You can also sort results in descending order based on the creation
  36481. // timestamp using orderBy="creationTimestamp desc". This sorts results
  36482. // based on the creationTimestamp field in reverse chronological order
  36483. // (newest result first). Use this to sort resources like operations so
  36484. // that the newest operation is returned first.
  36485. //
  36486. // Currently, only sorting by name or creationTimestamp desc is
  36487. // supported.
  36488. func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall {
  36489. c.urlParams_.Set("orderBy", orderBy)
  36490. return c
  36491. }
  36492. // PageToken sets the optional parameter "pageToken": Specifies a page
  36493. // token to use. Set pageToken to the nextPageToken returned by a
  36494. // previous list request to get the next page of results.
  36495. func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
  36496. c.urlParams_.Set("pageToken", pageToken)
  36497. return c
  36498. }
  36499. // Fields allows partial responses to be retrieved. See
  36500. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36501. // for more information.
  36502. func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
  36503. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36504. return c
  36505. }
  36506. // IfNoneMatch sets the optional parameter which makes the operation
  36507. // fail if the object's ETag matches the given value. This is useful for
  36508. // getting updates only after the object has changed since the last
  36509. // request. Use googleapi.IsNotModified to check whether the response
  36510. // error from Do is the result of In-None-Match.
  36511. func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
  36512. c.ifNoneMatch_ = entityTag
  36513. return c
  36514. }
  36515. // Context sets the context to be used in this call's Do method. Any
  36516. // pending HTTP request will be aborted if the provided context is
  36517. // canceled.
  36518. func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
  36519. c.ctx_ = ctx
  36520. return c
  36521. }
  36522. // Header returns an http.Header that can be modified by the caller to
  36523. // add HTTP headers to the request.
  36524. func (c *ForwardingRulesListCall) Header() http.Header {
  36525. if c.header_ == nil {
  36526. c.header_ = make(http.Header)
  36527. }
  36528. return c.header_
  36529. }
  36530. func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  36531. reqHeaders := make(http.Header)
  36532. for k, v := range c.header_ {
  36533. reqHeaders[k] = v
  36534. }
  36535. reqHeaders.Set("User-Agent", c.s.userAgent())
  36536. if c.ifNoneMatch_ != "" {
  36537. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36538. }
  36539. var body io.Reader = nil
  36540. c.urlParams_.Set("alt", alt)
  36541. c.urlParams_.Set("prettyPrint", "false")
  36542. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  36543. urls += "?" + c.urlParams_.Encode()
  36544. req, err := http.NewRequest("GET", urls, body)
  36545. if err != nil {
  36546. return nil, err
  36547. }
  36548. req.Header = reqHeaders
  36549. googleapi.Expand(req.URL, map[string]string{
  36550. "project": c.project,
  36551. "region": c.region,
  36552. })
  36553. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36554. }
  36555. // Do executes the "compute.forwardingRules.list" call.
  36556. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  36557. // non-2xx status code is an error. Response headers are in either
  36558. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  36559. // returned at all) in error.(*googleapi.Error).Header. Use
  36560. // googleapi.IsNotModified to check whether the returned error was
  36561. // because http.StatusNotModified was returned.
  36562. func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  36563. gensupport.SetOptions(c.urlParams_, opts...)
  36564. res, err := c.doRequest("json")
  36565. if res != nil && res.StatusCode == http.StatusNotModified {
  36566. if res.Body != nil {
  36567. res.Body.Close()
  36568. }
  36569. return nil, &googleapi.Error{
  36570. Code: res.StatusCode,
  36571. Header: res.Header,
  36572. }
  36573. }
  36574. if err != nil {
  36575. return nil, err
  36576. }
  36577. defer googleapi.CloseBody(res)
  36578. if err := googleapi.CheckResponse(res); err != nil {
  36579. return nil, err
  36580. }
  36581. ret := &ForwardingRuleList{
  36582. ServerResponse: googleapi.ServerResponse{
  36583. Header: res.Header,
  36584. HTTPStatusCode: res.StatusCode,
  36585. },
  36586. }
  36587. target := &ret
  36588. if err := gensupport.DecodeResponse(target, res); err != nil {
  36589. return nil, err
  36590. }
  36591. return ret, nil
  36592. // {
  36593. // "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.",
  36594. // "httpMethod": "GET",
  36595. // "id": "compute.forwardingRules.list",
  36596. // "parameterOrder": [
  36597. // "project",
  36598. // "region"
  36599. // ],
  36600. // "parameters": {
  36601. // "filter": {
  36602. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  36603. // "location": "query",
  36604. // "type": "string"
  36605. // },
  36606. // "maxResults": {
  36607. // "default": "500",
  36608. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  36609. // "format": "uint32",
  36610. // "location": "query",
  36611. // "minimum": "0",
  36612. // "type": "integer"
  36613. // },
  36614. // "orderBy": {
  36615. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  36616. // "location": "query",
  36617. // "type": "string"
  36618. // },
  36619. // "pageToken": {
  36620. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  36621. // "location": "query",
  36622. // "type": "string"
  36623. // },
  36624. // "project": {
  36625. // "description": "Project ID for this request.",
  36626. // "location": "path",
  36627. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36628. // "required": true,
  36629. // "type": "string"
  36630. // },
  36631. // "region": {
  36632. // "description": "Name of the region scoping this request.",
  36633. // "location": "path",
  36634. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36635. // "required": true,
  36636. // "type": "string"
  36637. // }
  36638. // },
  36639. // "path": "{project}/regions/{region}/forwardingRules",
  36640. // "response": {
  36641. // "$ref": "ForwardingRuleList"
  36642. // },
  36643. // "scopes": [
  36644. // "https://www.googleapis.com/auth/cloud-platform",
  36645. // "https://www.googleapis.com/auth/compute",
  36646. // "https://www.googleapis.com/auth/compute.readonly"
  36647. // ]
  36648. // }
  36649. }
  36650. // Pages invokes f for each page of results.
  36651. // A non-nil error returned from f will halt the iteration.
  36652. // The provided context supersedes any context provided to the Context method.
  36653. func (c *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  36654. c.ctx_ = ctx
  36655. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36656. for {
  36657. x, err := c.Do()
  36658. if err != nil {
  36659. return err
  36660. }
  36661. if err := f(x); err != nil {
  36662. return err
  36663. }
  36664. if x.NextPageToken == "" {
  36665. return nil
  36666. }
  36667. c.PageToken(x.NextPageToken)
  36668. }
  36669. }
  36670. // method id "compute.forwardingRules.setTarget":
  36671. type ForwardingRulesSetTargetCall struct {
  36672. s *Service
  36673. project string
  36674. region string
  36675. forwardingRule string
  36676. targetreference *TargetReference
  36677. urlParams_ gensupport.URLParams
  36678. ctx_ context.Context
  36679. header_ http.Header
  36680. }
  36681. // SetTarget: Changes target URL for forwarding rule. The new target
  36682. // should be of the same type as the old target.
  36683. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget
  36684. func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
  36685. c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36686. c.project = project
  36687. c.region = region
  36688. c.forwardingRule = forwardingRule
  36689. c.targetreference = targetreference
  36690. return c
  36691. }
  36692. // RequestId sets the optional parameter "requestId": An optional
  36693. // request ID to identify requests. Specify a unique request ID so that
  36694. // if you must retry your request, the server will know to ignore the
  36695. // request if it has already been completed.
  36696. //
  36697. // For example, consider a situation where you make an initial request
  36698. // and the request times out. If you make the request again with the
  36699. // same request ID, the server can check if original operation with the
  36700. // same request ID was received, and if so, will ignore the second
  36701. // request. This prevents clients from accidentally creating duplicate
  36702. // commitments.
  36703. //
  36704. // The request ID must be a valid UUID with the exception that zero UUID
  36705. // is not supported (00000000-0000-0000-0000-000000000000).
  36706. func (c *ForwardingRulesSetTargetCall) RequestId(requestId string) *ForwardingRulesSetTargetCall {
  36707. c.urlParams_.Set("requestId", requestId)
  36708. return c
  36709. }
  36710. // Fields allows partial responses to be retrieved. See
  36711. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36712. // for more information.
  36713. func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
  36714. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36715. return c
  36716. }
  36717. // Context sets the context to be used in this call's Do method. Any
  36718. // pending HTTP request will be aborted if the provided context is
  36719. // canceled.
  36720. func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
  36721. c.ctx_ = ctx
  36722. return c
  36723. }
  36724. // Header returns an http.Header that can be modified by the caller to
  36725. // add HTTP headers to the request.
  36726. func (c *ForwardingRulesSetTargetCall) Header() http.Header {
  36727. if c.header_ == nil {
  36728. c.header_ = make(http.Header)
  36729. }
  36730. return c.header_
  36731. }
  36732. func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  36733. reqHeaders := make(http.Header)
  36734. for k, v := range c.header_ {
  36735. reqHeaders[k] = v
  36736. }
  36737. reqHeaders.Set("User-Agent", c.s.userAgent())
  36738. var body io.Reader = nil
  36739. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  36740. if err != nil {
  36741. return nil, err
  36742. }
  36743. reqHeaders.Set("Content-Type", "application/json")
  36744. c.urlParams_.Set("alt", alt)
  36745. c.urlParams_.Set("prettyPrint", "false")
  36746. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
  36747. urls += "?" + c.urlParams_.Encode()
  36748. req, err := http.NewRequest("POST", urls, body)
  36749. if err != nil {
  36750. return nil, err
  36751. }
  36752. req.Header = reqHeaders
  36753. googleapi.Expand(req.URL, map[string]string{
  36754. "project": c.project,
  36755. "region": c.region,
  36756. "forwardingRule": c.forwardingRule,
  36757. })
  36758. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36759. }
  36760. // Do executes the "compute.forwardingRules.setTarget" call.
  36761. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36762. // status code is an error. Response headers are in either
  36763. // *Operation.ServerResponse.Header or (if a response was returned at
  36764. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36765. // to check whether the returned error was because
  36766. // http.StatusNotModified was returned.
  36767. func (c *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36768. gensupport.SetOptions(c.urlParams_, opts...)
  36769. res, err := c.doRequest("json")
  36770. if res != nil && res.StatusCode == http.StatusNotModified {
  36771. if res.Body != nil {
  36772. res.Body.Close()
  36773. }
  36774. return nil, &googleapi.Error{
  36775. Code: res.StatusCode,
  36776. Header: res.Header,
  36777. }
  36778. }
  36779. if err != nil {
  36780. return nil, err
  36781. }
  36782. defer googleapi.CloseBody(res)
  36783. if err := googleapi.CheckResponse(res); err != nil {
  36784. return nil, err
  36785. }
  36786. ret := &Operation{
  36787. ServerResponse: googleapi.ServerResponse{
  36788. Header: res.Header,
  36789. HTTPStatusCode: res.StatusCode,
  36790. },
  36791. }
  36792. target := &ret
  36793. if err := gensupport.DecodeResponse(target, res); err != nil {
  36794. return nil, err
  36795. }
  36796. return ret, nil
  36797. // {
  36798. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  36799. // "httpMethod": "POST",
  36800. // "id": "compute.forwardingRules.setTarget",
  36801. // "parameterOrder": [
  36802. // "project",
  36803. // "region",
  36804. // "forwardingRule"
  36805. // ],
  36806. // "parameters": {
  36807. // "forwardingRule": {
  36808. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  36809. // "location": "path",
  36810. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  36811. // "required": true,
  36812. // "type": "string"
  36813. // },
  36814. // "project": {
  36815. // "description": "Project ID for this request.",
  36816. // "location": "path",
  36817. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36818. // "required": true,
  36819. // "type": "string"
  36820. // },
  36821. // "region": {
  36822. // "description": "Name of the region scoping this request.",
  36823. // "location": "path",
  36824. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36825. // "required": true,
  36826. // "type": "string"
  36827. // },
  36828. // "requestId": {
  36829. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36830. // "location": "query",
  36831. // "type": "string"
  36832. // }
  36833. // },
  36834. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
  36835. // "request": {
  36836. // "$ref": "TargetReference"
  36837. // },
  36838. // "response": {
  36839. // "$ref": "Operation"
  36840. // },
  36841. // "scopes": [
  36842. // "https://www.googleapis.com/auth/cloud-platform",
  36843. // "https://www.googleapis.com/auth/compute"
  36844. // ]
  36845. // }
  36846. }
  36847. // method id "compute.globalAddresses.delete":
  36848. type GlobalAddressesDeleteCall struct {
  36849. s *Service
  36850. project string
  36851. address string
  36852. urlParams_ gensupport.URLParams
  36853. ctx_ context.Context
  36854. header_ http.Header
  36855. }
  36856. // Delete: Deletes the specified address resource.
  36857. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete
  36858. func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
  36859. c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36860. c.project = project
  36861. c.address = address
  36862. return c
  36863. }
  36864. // RequestId sets the optional parameter "requestId": An optional
  36865. // request ID to identify requests. Specify a unique request ID so that
  36866. // if you must retry your request, the server will know to ignore the
  36867. // request if it has already been completed.
  36868. //
  36869. // For example, consider a situation where you make an initial request
  36870. // and the request times out. If you make the request again with the
  36871. // same request ID, the server can check if original operation with the
  36872. // same request ID was received, and if so, will ignore the second
  36873. // request. This prevents clients from accidentally creating duplicate
  36874. // commitments.
  36875. //
  36876. // The request ID must be a valid UUID with the exception that zero UUID
  36877. // is not supported (00000000-0000-0000-0000-000000000000).
  36878. func (c *GlobalAddressesDeleteCall) RequestId(requestId string) *GlobalAddressesDeleteCall {
  36879. c.urlParams_.Set("requestId", requestId)
  36880. return c
  36881. }
  36882. // Fields allows partial responses to be retrieved. See
  36883. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36884. // for more information.
  36885. func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
  36886. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36887. return c
  36888. }
  36889. // Context sets the context to be used in this call's Do method. Any
  36890. // pending HTTP request will be aborted if the provided context is
  36891. // canceled.
  36892. func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
  36893. c.ctx_ = ctx
  36894. return c
  36895. }
  36896. // Header returns an http.Header that can be modified by the caller to
  36897. // add HTTP headers to the request.
  36898. func (c *GlobalAddressesDeleteCall) Header() http.Header {
  36899. if c.header_ == nil {
  36900. c.header_ = make(http.Header)
  36901. }
  36902. return c.header_
  36903. }
  36904. func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  36905. reqHeaders := make(http.Header)
  36906. for k, v := range c.header_ {
  36907. reqHeaders[k] = v
  36908. }
  36909. reqHeaders.Set("User-Agent", c.s.userAgent())
  36910. var body io.Reader = nil
  36911. c.urlParams_.Set("alt", alt)
  36912. c.urlParams_.Set("prettyPrint", "false")
  36913. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  36914. urls += "?" + c.urlParams_.Encode()
  36915. req, err := http.NewRequest("DELETE", urls, body)
  36916. if err != nil {
  36917. return nil, err
  36918. }
  36919. req.Header = reqHeaders
  36920. googleapi.Expand(req.URL, map[string]string{
  36921. "project": c.project,
  36922. "address": c.address,
  36923. })
  36924. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36925. }
  36926. // Do executes the "compute.globalAddresses.delete" call.
  36927. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36928. // status code is an error. Response headers are in either
  36929. // *Operation.ServerResponse.Header or (if a response was returned at
  36930. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36931. // to check whether the returned error was because
  36932. // http.StatusNotModified was returned.
  36933. func (c *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36934. gensupport.SetOptions(c.urlParams_, opts...)
  36935. res, err := c.doRequest("json")
  36936. if res != nil && res.StatusCode == http.StatusNotModified {
  36937. if res.Body != nil {
  36938. res.Body.Close()
  36939. }
  36940. return nil, &googleapi.Error{
  36941. Code: res.StatusCode,
  36942. Header: res.Header,
  36943. }
  36944. }
  36945. if err != nil {
  36946. return nil, err
  36947. }
  36948. defer googleapi.CloseBody(res)
  36949. if err := googleapi.CheckResponse(res); err != nil {
  36950. return nil, err
  36951. }
  36952. ret := &Operation{
  36953. ServerResponse: googleapi.ServerResponse{
  36954. Header: res.Header,
  36955. HTTPStatusCode: res.StatusCode,
  36956. },
  36957. }
  36958. target := &ret
  36959. if err := gensupport.DecodeResponse(target, res); err != nil {
  36960. return nil, err
  36961. }
  36962. return ret, nil
  36963. // {
  36964. // "description": "Deletes the specified address resource.",
  36965. // "httpMethod": "DELETE",
  36966. // "id": "compute.globalAddresses.delete",
  36967. // "parameterOrder": [
  36968. // "project",
  36969. // "address"
  36970. // ],
  36971. // "parameters": {
  36972. // "address": {
  36973. // "description": "Name of the address resource to delete.",
  36974. // "location": "path",
  36975. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  36976. // "required": true,
  36977. // "type": "string"
  36978. // },
  36979. // "project": {
  36980. // "description": "Project ID for this request.",
  36981. // "location": "path",
  36982. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36983. // "required": true,
  36984. // "type": "string"
  36985. // },
  36986. // "requestId": {
  36987. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36988. // "location": "query",
  36989. // "type": "string"
  36990. // }
  36991. // },
  36992. // "path": "{project}/global/addresses/{address}",
  36993. // "response": {
  36994. // "$ref": "Operation"
  36995. // },
  36996. // "scopes": [
  36997. // "https://www.googleapis.com/auth/cloud-platform",
  36998. // "https://www.googleapis.com/auth/compute"
  36999. // ]
  37000. // }
  37001. }
  37002. // method id "compute.globalAddresses.get":
  37003. type GlobalAddressesGetCall struct {
  37004. s *Service
  37005. project string
  37006. address string
  37007. urlParams_ gensupport.URLParams
  37008. ifNoneMatch_ string
  37009. ctx_ context.Context
  37010. header_ http.Header
  37011. }
  37012. // Get: Returns the specified address resource. Gets a list of available
  37013. // addresses by making a list() request.
  37014. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get
  37015. func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
  37016. c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37017. c.project = project
  37018. c.address = address
  37019. return c
  37020. }
  37021. // Fields allows partial responses to be retrieved. See
  37022. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37023. // for more information.
  37024. func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
  37025. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37026. return c
  37027. }
  37028. // IfNoneMatch sets the optional parameter which makes the operation
  37029. // fail if the object's ETag matches the given value. This is useful for
  37030. // getting updates only after the object has changed since the last
  37031. // request. Use googleapi.IsNotModified to check whether the response
  37032. // error from Do is the result of In-None-Match.
  37033. func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
  37034. c.ifNoneMatch_ = entityTag
  37035. return c
  37036. }
  37037. // Context sets the context to be used in this call's Do method. Any
  37038. // pending HTTP request will be aborted if the provided context is
  37039. // canceled.
  37040. func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
  37041. c.ctx_ = ctx
  37042. return c
  37043. }
  37044. // Header returns an http.Header that can be modified by the caller to
  37045. // add HTTP headers to the request.
  37046. func (c *GlobalAddressesGetCall) Header() http.Header {
  37047. if c.header_ == nil {
  37048. c.header_ = make(http.Header)
  37049. }
  37050. return c.header_
  37051. }
  37052. func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
  37053. reqHeaders := make(http.Header)
  37054. for k, v := range c.header_ {
  37055. reqHeaders[k] = v
  37056. }
  37057. reqHeaders.Set("User-Agent", c.s.userAgent())
  37058. if c.ifNoneMatch_ != "" {
  37059. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37060. }
  37061. var body io.Reader = nil
  37062. c.urlParams_.Set("alt", alt)
  37063. c.urlParams_.Set("prettyPrint", "false")
  37064. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  37065. urls += "?" + c.urlParams_.Encode()
  37066. req, err := http.NewRequest("GET", urls, body)
  37067. if err != nil {
  37068. return nil, err
  37069. }
  37070. req.Header = reqHeaders
  37071. googleapi.Expand(req.URL, map[string]string{
  37072. "project": c.project,
  37073. "address": c.address,
  37074. })
  37075. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37076. }
  37077. // Do executes the "compute.globalAddresses.get" call.
  37078. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  37079. // code is an error. Response headers are in either
  37080. // *Address.ServerResponse.Header or (if a response was returned at all)
  37081. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  37082. // check whether the returned error was because http.StatusNotModified
  37083. // was returned.
  37084. func (c *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  37085. gensupport.SetOptions(c.urlParams_, opts...)
  37086. res, err := c.doRequest("json")
  37087. if res != nil && res.StatusCode == http.StatusNotModified {
  37088. if res.Body != nil {
  37089. res.Body.Close()
  37090. }
  37091. return nil, &googleapi.Error{
  37092. Code: res.StatusCode,
  37093. Header: res.Header,
  37094. }
  37095. }
  37096. if err != nil {
  37097. return nil, err
  37098. }
  37099. defer googleapi.CloseBody(res)
  37100. if err := googleapi.CheckResponse(res); err != nil {
  37101. return nil, err
  37102. }
  37103. ret := &Address{
  37104. ServerResponse: googleapi.ServerResponse{
  37105. Header: res.Header,
  37106. HTTPStatusCode: res.StatusCode,
  37107. },
  37108. }
  37109. target := &ret
  37110. if err := gensupport.DecodeResponse(target, res); err != nil {
  37111. return nil, err
  37112. }
  37113. return ret, nil
  37114. // {
  37115. // "description": "Returns the specified address resource. Gets a list of available addresses by making a list() request.",
  37116. // "httpMethod": "GET",
  37117. // "id": "compute.globalAddresses.get",
  37118. // "parameterOrder": [
  37119. // "project",
  37120. // "address"
  37121. // ],
  37122. // "parameters": {
  37123. // "address": {
  37124. // "description": "Name of the address resource to return.",
  37125. // "location": "path",
  37126. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  37127. // "required": true,
  37128. // "type": "string"
  37129. // },
  37130. // "project": {
  37131. // "description": "Project ID for this request.",
  37132. // "location": "path",
  37133. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37134. // "required": true,
  37135. // "type": "string"
  37136. // }
  37137. // },
  37138. // "path": "{project}/global/addresses/{address}",
  37139. // "response": {
  37140. // "$ref": "Address"
  37141. // },
  37142. // "scopes": [
  37143. // "https://www.googleapis.com/auth/cloud-platform",
  37144. // "https://www.googleapis.com/auth/compute",
  37145. // "https://www.googleapis.com/auth/compute.readonly"
  37146. // ]
  37147. // }
  37148. }
  37149. // method id "compute.globalAddresses.insert":
  37150. type GlobalAddressesInsertCall struct {
  37151. s *Service
  37152. project string
  37153. address *Address
  37154. urlParams_ gensupport.URLParams
  37155. ctx_ context.Context
  37156. header_ http.Header
  37157. }
  37158. // Insert: Creates an address resource in the specified project using
  37159. // the data included in the request.
  37160. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert
  37161. func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
  37162. c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37163. c.project = project
  37164. c.address = address
  37165. return c
  37166. }
  37167. // RequestId sets the optional parameter "requestId": An optional
  37168. // request ID to identify requests. Specify a unique request ID so that
  37169. // if you must retry your request, the server will know to ignore the
  37170. // request if it has already been completed.
  37171. //
  37172. // For example, consider a situation where you make an initial request
  37173. // and the request times out. If you make the request again with the
  37174. // same request ID, the server can check if original operation with the
  37175. // same request ID was received, and if so, will ignore the second
  37176. // request. This prevents clients from accidentally creating duplicate
  37177. // commitments.
  37178. //
  37179. // The request ID must be a valid UUID with the exception that zero UUID
  37180. // is not supported (00000000-0000-0000-0000-000000000000).
  37181. func (c *GlobalAddressesInsertCall) RequestId(requestId string) *GlobalAddressesInsertCall {
  37182. c.urlParams_.Set("requestId", requestId)
  37183. return c
  37184. }
  37185. // Fields allows partial responses to be retrieved. See
  37186. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37187. // for more information.
  37188. func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
  37189. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37190. return c
  37191. }
  37192. // Context sets the context to be used in this call's Do method. Any
  37193. // pending HTTP request will be aborted if the provided context is
  37194. // canceled.
  37195. func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
  37196. c.ctx_ = ctx
  37197. return c
  37198. }
  37199. // Header returns an http.Header that can be modified by the caller to
  37200. // add HTTP headers to the request.
  37201. func (c *GlobalAddressesInsertCall) Header() http.Header {
  37202. if c.header_ == nil {
  37203. c.header_ = make(http.Header)
  37204. }
  37205. return c.header_
  37206. }
  37207. func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  37208. reqHeaders := make(http.Header)
  37209. for k, v := range c.header_ {
  37210. reqHeaders[k] = v
  37211. }
  37212. reqHeaders.Set("User-Agent", c.s.userAgent())
  37213. var body io.Reader = nil
  37214. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  37215. if err != nil {
  37216. return nil, err
  37217. }
  37218. reqHeaders.Set("Content-Type", "application/json")
  37219. c.urlParams_.Set("alt", alt)
  37220. c.urlParams_.Set("prettyPrint", "false")
  37221. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  37222. urls += "?" + c.urlParams_.Encode()
  37223. req, err := http.NewRequest("POST", urls, body)
  37224. if err != nil {
  37225. return nil, err
  37226. }
  37227. req.Header = reqHeaders
  37228. googleapi.Expand(req.URL, map[string]string{
  37229. "project": c.project,
  37230. })
  37231. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37232. }
  37233. // Do executes the "compute.globalAddresses.insert" call.
  37234. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37235. // status code is an error. Response headers are in either
  37236. // *Operation.ServerResponse.Header or (if a response was returned at
  37237. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37238. // to check whether the returned error was because
  37239. // http.StatusNotModified was returned.
  37240. func (c *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37241. gensupport.SetOptions(c.urlParams_, opts...)
  37242. res, err := c.doRequest("json")
  37243. if res != nil && res.StatusCode == http.StatusNotModified {
  37244. if res.Body != nil {
  37245. res.Body.Close()
  37246. }
  37247. return nil, &googleapi.Error{
  37248. Code: res.StatusCode,
  37249. Header: res.Header,
  37250. }
  37251. }
  37252. if err != nil {
  37253. return nil, err
  37254. }
  37255. defer googleapi.CloseBody(res)
  37256. if err := googleapi.CheckResponse(res); err != nil {
  37257. return nil, err
  37258. }
  37259. ret := &Operation{
  37260. ServerResponse: googleapi.ServerResponse{
  37261. Header: res.Header,
  37262. HTTPStatusCode: res.StatusCode,
  37263. },
  37264. }
  37265. target := &ret
  37266. if err := gensupport.DecodeResponse(target, res); err != nil {
  37267. return nil, err
  37268. }
  37269. return ret, nil
  37270. // {
  37271. // "description": "Creates an address resource in the specified project using the data included in the request.",
  37272. // "httpMethod": "POST",
  37273. // "id": "compute.globalAddresses.insert",
  37274. // "parameterOrder": [
  37275. // "project"
  37276. // ],
  37277. // "parameters": {
  37278. // "project": {
  37279. // "description": "Project ID for this request.",
  37280. // "location": "path",
  37281. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37282. // "required": true,
  37283. // "type": "string"
  37284. // },
  37285. // "requestId": {
  37286. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37287. // "location": "query",
  37288. // "type": "string"
  37289. // }
  37290. // },
  37291. // "path": "{project}/global/addresses",
  37292. // "request": {
  37293. // "$ref": "Address"
  37294. // },
  37295. // "response": {
  37296. // "$ref": "Operation"
  37297. // },
  37298. // "scopes": [
  37299. // "https://www.googleapis.com/auth/cloud-platform",
  37300. // "https://www.googleapis.com/auth/compute"
  37301. // ]
  37302. // }
  37303. }
  37304. // method id "compute.globalAddresses.list":
  37305. type GlobalAddressesListCall struct {
  37306. s *Service
  37307. project string
  37308. urlParams_ gensupport.URLParams
  37309. ifNoneMatch_ string
  37310. ctx_ context.Context
  37311. header_ http.Header
  37312. }
  37313. // List: Retrieves a list of global addresses.
  37314. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list
  37315. func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
  37316. c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37317. c.project = project
  37318. return c
  37319. }
  37320. // Filter sets the optional parameter "filter": A filter expression that
  37321. // filters resources listed in the response. The expression must specify
  37322. // the field name, a comparison operator, and the value that you want to
  37323. // use for filtering. The value must be a string, a number, or a
  37324. // boolean. The comparison operator must be either =, !=, >, or <.
  37325. //
  37326. // For example, if you are filtering Compute Engine instances, you can
  37327. // exclude instances named example-instance by specifying name !=
  37328. // example-instance.
  37329. //
  37330. // You can also filter nested fields. For example, you could specify
  37331. // scheduling.automaticRestart = false to include instances only if they
  37332. // are not scheduled for automatic restarts. You can use filtering on
  37333. // nested fields to filter based on resource labels.
  37334. //
  37335. // To filter on multiple expressions, provide each separate expression
  37336. // within parentheses. For example, (scheduling.automaticRestart = true)
  37337. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  37338. // AND expression. However, you can include AND and OR expressions
  37339. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  37340. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  37341. // true).
  37342. func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
  37343. c.urlParams_.Set("filter", filter)
  37344. return c
  37345. }
  37346. // MaxResults sets the optional parameter "maxResults": The maximum
  37347. // number of results per page that should be returned. If the number of
  37348. // available results is larger than maxResults, Compute Engine returns a
  37349. // nextPageToken that can be used to get the next page of results in
  37350. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37351. // (Default: 500)
  37352. func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
  37353. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37354. return c
  37355. }
  37356. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37357. // a certain order. By default, results are returned in alphanumerical
  37358. // order based on the resource name.
  37359. //
  37360. // You can also sort results in descending order based on the creation
  37361. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37362. // based on the creationTimestamp field in reverse chronological order
  37363. // (newest result first). Use this to sort resources like operations so
  37364. // that the newest operation is returned first.
  37365. //
  37366. // Currently, only sorting by name or creationTimestamp desc is
  37367. // supported.
  37368. func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall {
  37369. c.urlParams_.Set("orderBy", orderBy)
  37370. return c
  37371. }
  37372. // PageToken sets the optional parameter "pageToken": Specifies a page
  37373. // token to use. Set pageToken to the nextPageToken returned by a
  37374. // previous list request to get the next page of results.
  37375. func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
  37376. c.urlParams_.Set("pageToken", pageToken)
  37377. return c
  37378. }
  37379. // Fields allows partial responses to be retrieved. See
  37380. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37381. // for more information.
  37382. func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
  37383. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37384. return c
  37385. }
  37386. // IfNoneMatch sets the optional parameter which makes the operation
  37387. // fail if the object's ETag matches the given value. This is useful for
  37388. // getting updates only after the object has changed since the last
  37389. // request. Use googleapi.IsNotModified to check whether the response
  37390. // error from Do is the result of In-None-Match.
  37391. func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
  37392. c.ifNoneMatch_ = entityTag
  37393. return c
  37394. }
  37395. // Context sets the context to be used in this call's Do method. Any
  37396. // pending HTTP request will be aborted if the provided context is
  37397. // canceled.
  37398. func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
  37399. c.ctx_ = ctx
  37400. return c
  37401. }
  37402. // Header returns an http.Header that can be modified by the caller to
  37403. // add HTTP headers to the request.
  37404. func (c *GlobalAddressesListCall) Header() http.Header {
  37405. if c.header_ == nil {
  37406. c.header_ = make(http.Header)
  37407. }
  37408. return c.header_
  37409. }
  37410. func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
  37411. reqHeaders := make(http.Header)
  37412. for k, v := range c.header_ {
  37413. reqHeaders[k] = v
  37414. }
  37415. reqHeaders.Set("User-Agent", c.s.userAgent())
  37416. if c.ifNoneMatch_ != "" {
  37417. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37418. }
  37419. var body io.Reader = nil
  37420. c.urlParams_.Set("alt", alt)
  37421. c.urlParams_.Set("prettyPrint", "false")
  37422. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  37423. urls += "?" + c.urlParams_.Encode()
  37424. req, err := http.NewRequest("GET", urls, body)
  37425. if err != nil {
  37426. return nil, err
  37427. }
  37428. req.Header = reqHeaders
  37429. googleapi.Expand(req.URL, map[string]string{
  37430. "project": c.project,
  37431. })
  37432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37433. }
  37434. // Do executes the "compute.globalAddresses.list" call.
  37435. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  37436. // status code is an error. Response headers are in either
  37437. // *AddressList.ServerResponse.Header or (if a response was returned at
  37438. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37439. // to check whether the returned error was because
  37440. // http.StatusNotModified was returned.
  37441. func (c *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  37442. gensupport.SetOptions(c.urlParams_, opts...)
  37443. res, err := c.doRequest("json")
  37444. if res != nil && res.StatusCode == http.StatusNotModified {
  37445. if res.Body != nil {
  37446. res.Body.Close()
  37447. }
  37448. return nil, &googleapi.Error{
  37449. Code: res.StatusCode,
  37450. Header: res.Header,
  37451. }
  37452. }
  37453. if err != nil {
  37454. return nil, err
  37455. }
  37456. defer googleapi.CloseBody(res)
  37457. if err := googleapi.CheckResponse(res); err != nil {
  37458. return nil, err
  37459. }
  37460. ret := &AddressList{
  37461. ServerResponse: googleapi.ServerResponse{
  37462. Header: res.Header,
  37463. HTTPStatusCode: res.StatusCode,
  37464. },
  37465. }
  37466. target := &ret
  37467. if err := gensupport.DecodeResponse(target, res); err != nil {
  37468. return nil, err
  37469. }
  37470. return ret, nil
  37471. // {
  37472. // "description": "Retrieves a list of global addresses.",
  37473. // "httpMethod": "GET",
  37474. // "id": "compute.globalAddresses.list",
  37475. // "parameterOrder": [
  37476. // "project"
  37477. // ],
  37478. // "parameters": {
  37479. // "filter": {
  37480. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  37481. // "location": "query",
  37482. // "type": "string"
  37483. // },
  37484. // "maxResults": {
  37485. // "default": "500",
  37486. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  37487. // "format": "uint32",
  37488. // "location": "query",
  37489. // "minimum": "0",
  37490. // "type": "integer"
  37491. // },
  37492. // "orderBy": {
  37493. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  37494. // "location": "query",
  37495. // "type": "string"
  37496. // },
  37497. // "pageToken": {
  37498. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  37499. // "location": "query",
  37500. // "type": "string"
  37501. // },
  37502. // "project": {
  37503. // "description": "Project ID for this request.",
  37504. // "location": "path",
  37505. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37506. // "required": true,
  37507. // "type": "string"
  37508. // }
  37509. // },
  37510. // "path": "{project}/global/addresses",
  37511. // "response": {
  37512. // "$ref": "AddressList"
  37513. // },
  37514. // "scopes": [
  37515. // "https://www.googleapis.com/auth/cloud-platform",
  37516. // "https://www.googleapis.com/auth/compute",
  37517. // "https://www.googleapis.com/auth/compute.readonly"
  37518. // ]
  37519. // }
  37520. }
  37521. // Pages invokes f for each page of results.
  37522. // A non-nil error returned from f will halt the iteration.
  37523. // The provided context supersedes any context provided to the Context method.
  37524. func (c *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  37525. c.ctx_ = ctx
  37526. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37527. for {
  37528. x, err := c.Do()
  37529. if err != nil {
  37530. return err
  37531. }
  37532. if err := f(x); err != nil {
  37533. return err
  37534. }
  37535. if x.NextPageToken == "" {
  37536. return nil
  37537. }
  37538. c.PageToken(x.NextPageToken)
  37539. }
  37540. }
  37541. // method id "compute.globalForwardingRules.delete":
  37542. type GlobalForwardingRulesDeleteCall struct {
  37543. s *Service
  37544. project string
  37545. forwardingRule string
  37546. urlParams_ gensupport.URLParams
  37547. ctx_ context.Context
  37548. header_ http.Header
  37549. }
  37550. // Delete: Deletes the specified GlobalForwardingRule resource.
  37551. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete
  37552. func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
  37553. c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37554. c.project = project
  37555. c.forwardingRule = forwardingRule
  37556. return c
  37557. }
  37558. // RequestId sets the optional parameter "requestId": An optional
  37559. // request ID to identify requests. Specify a unique request ID so that
  37560. // if you must retry your request, the server will know to ignore the
  37561. // request if it has already been completed.
  37562. //
  37563. // For example, consider a situation where you make an initial request
  37564. // and the request times out. If you make the request again with the
  37565. // same request ID, the server can check if original operation with the
  37566. // same request ID was received, and if so, will ignore the second
  37567. // request. This prevents clients from accidentally creating duplicate
  37568. // commitments.
  37569. //
  37570. // The request ID must be a valid UUID with the exception that zero UUID
  37571. // is not supported (00000000-0000-0000-0000-000000000000).
  37572. func (c *GlobalForwardingRulesDeleteCall) RequestId(requestId string) *GlobalForwardingRulesDeleteCall {
  37573. c.urlParams_.Set("requestId", requestId)
  37574. return c
  37575. }
  37576. // Fields allows partial responses to be retrieved. See
  37577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37578. // for more information.
  37579. func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
  37580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37581. return c
  37582. }
  37583. // Context sets the context to be used in this call's Do method. Any
  37584. // pending HTTP request will be aborted if the provided context is
  37585. // canceled.
  37586. func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
  37587. c.ctx_ = ctx
  37588. return c
  37589. }
  37590. // Header returns an http.Header that can be modified by the caller to
  37591. // add HTTP headers to the request.
  37592. func (c *GlobalForwardingRulesDeleteCall) Header() http.Header {
  37593. if c.header_ == nil {
  37594. c.header_ = make(http.Header)
  37595. }
  37596. return c.header_
  37597. }
  37598. func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  37599. reqHeaders := make(http.Header)
  37600. for k, v := range c.header_ {
  37601. reqHeaders[k] = v
  37602. }
  37603. reqHeaders.Set("User-Agent", c.s.userAgent())
  37604. var body io.Reader = nil
  37605. c.urlParams_.Set("alt", alt)
  37606. c.urlParams_.Set("prettyPrint", "false")
  37607. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  37608. urls += "?" + c.urlParams_.Encode()
  37609. req, err := http.NewRequest("DELETE", urls, body)
  37610. if err != nil {
  37611. return nil, err
  37612. }
  37613. req.Header = reqHeaders
  37614. googleapi.Expand(req.URL, map[string]string{
  37615. "project": c.project,
  37616. "forwardingRule": c.forwardingRule,
  37617. })
  37618. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37619. }
  37620. // Do executes the "compute.globalForwardingRules.delete" call.
  37621. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37622. // status code is an error. Response headers are in either
  37623. // *Operation.ServerResponse.Header or (if a response was returned at
  37624. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37625. // to check whether the returned error was because
  37626. // http.StatusNotModified was returned.
  37627. func (c *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37628. gensupport.SetOptions(c.urlParams_, opts...)
  37629. res, err := c.doRequest("json")
  37630. if res != nil && res.StatusCode == http.StatusNotModified {
  37631. if res.Body != nil {
  37632. res.Body.Close()
  37633. }
  37634. return nil, &googleapi.Error{
  37635. Code: res.StatusCode,
  37636. Header: res.Header,
  37637. }
  37638. }
  37639. if err != nil {
  37640. return nil, err
  37641. }
  37642. defer googleapi.CloseBody(res)
  37643. if err := googleapi.CheckResponse(res); err != nil {
  37644. return nil, err
  37645. }
  37646. ret := &Operation{
  37647. ServerResponse: googleapi.ServerResponse{
  37648. Header: res.Header,
  37649. HTTPStatusCode: res.StatusCode,
  37650. },
  37651. }
  37652. target := &ret
  37653. if err := gensupport.DecodeResponse(target, res); err != nil {
  37654. return nil, err
  37655. }
  37656. return ret, nil
  37657. // {
  37658. // "description": "Deletes the specified GlobalForwardingRule resource.",
  37659. // "httpMethod": "DELETE",
  37660. // "id": "compute.globalForwardingRules.delete",
  37661. // "parameterOrder": [
  37662. // "project",
  37663. // "forwardingRule"
  37664. // ],
  37665. // "parameters": {
  37666. // "forwardingRule": {
  37667. // "description": "Name of the ForwardingRule resource to delete.",
  37668. // "location": "path",
  37669. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  37670. // "required": true,
  37671. // "type": "string"
  37672. // },
  37673. // "project": {
  37674. // "description": "Project ID for this request.",
  37675. // "location": "path",
  37676. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37677. // "required": true,
  37678. // "type": "string"
  37679. // },
  37680. // "requestId": {
  37681. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37682. // "location": "query",
  37683. // "type": "string"
  37684. // }
  37685. // },
  37686. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  37687. // "response": {
  37688. // "$ref": "Operation"
  37689. // },
  37690. // "scopes": [
  37691. // "https://www.googleapis.com/auth/cloud-platform",
  37692. // "https://www.googleapis.com/auth/compute"
  37693. // ]
  37694. // }
  37695. }
  37696. // method id "compute.globalForwardingRules.get":
  37697. type GlobalForwardingRulesGetCall struct {
  37698. s *Service
  37699. project string
  37700. forwardingRule string
  37701. urlParams_ gensupport.URLParams
  37702. ifNoneMatch_ string
  37703. ctx_ context.Context
  37704. header_ http.Header
  37705. }
  37706. // Get: Returns the specified GlobalForwardingRule resource. Gets a list
  37707. // of available forwarding rules by making a list() request.
  37708. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get
  37709. func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
  37710. c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37711. c.project = project
  37712. c.forwardingRule = forwardingRule
  37713. return c
  37714. }
  37715. // Fields allows partial responses to be retrieved. See
  37716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37717. // for more information.
  37718. func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
  37719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37720. return c
  37721. }
  37722. // IfNoneMatch sets the optional parameter which makes the operation
  37723. // fail if the object's ETag matches the given value. This is useful for
  37724. // getting updates only after the object has changed since the last
  37725. // request. Use googleapi.IsNotModified to check whether the response
  37726. // error from Do is the result of In-None-Match.
  37727. func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
  37728. c.ifNoneMatch_ = entityTag
  37729. return c
  37730. }
  37731. // Context sets the context to be used in this call's Do method. Any
  37732. // pending HTTP request will be aborted if the provided context is
  37733. // canceled.
  37734. func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
  37735. c.ctx_ = ctx
  37736. return c
  37737. }
  37738. // Header returns an http.Header that can be modified by the caller to
  37739. // add HTTP headers to the request.
  37740. func (c *GlobalForwardingRulesGetCall) Header() http.Header {
  37741. if c.header_ == nil {
  37742. c.header_ = make(http.Header)
  37743. }
  37744. return c.header_
  37745. }
  37746. func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  37747. reqHeaders := make(http.Header)
  37748. for k, v := range c.header_ {
  37749. reqHeaders[k] = v
  37750. }
  37751. reqHeaders.Set("User-Agent", c.s.userAgent())
  37752. if c.ifNoneMatch_ != "" {
  37753. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37754. }
  37755. var body io.Reader = nil
  37756. c.urlParams_.Set("alt", alt)
  37757. c.urlParams_.Set("prettyPrint", "false")
  37758. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  37759. urls += "?" + c.urlParams_.Encode()
  37760. req, err := http.NewRequest("GET", urls, body)
  37761. if err != nil {
  37762. return nil, err
  37763. }
  37764. req.Header = reqHeaders
  37765. googleapi.Expand(req.URL, map[string]string{
  37766. "project": c.project,
  37767. "forwardingRule": c.forwardingRule,
  37768. })
  37769. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37770. }
  37771. // Do executes the "compute.globalForwardingRules.get" call.
  37772. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  37773. // status code is an error. Response headers are in either
  37774. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  37775. // at all) in error.(*googleapi.Error).Header. Use
  37776. // googleapi.IsNotModified to check whether the returned error was
  37777. // because http.StatusNotModified was returned.
  37778. func (c *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  37779. gensupport.SetOptions(c.urlParams_, opts...)
  37780. res, err := c.doRequest("json")
  37781. if res != nil && res.StatusCode == http.StatusNotModified {
  37782. if res.Body != nil {
  37783. res.Body.Close()
  37784. }
  37785. return nil, &googleapi.Error{
  37786. Code: res.StatusCode,
  37787. Header: res.Header,
  37788. }
  37789. }
  37790. if err != nil {
  37791. return nil, err
  37792. }
  37793. defer googleapi.CloseBody(res)
  37794. if err := googleapi.CheckResponse(res); err != nil {
  37795. return nil, err
  37796. }
  37797. ret := &ForwardingRule{
  37798. ServerResponse: googleapi.ServerResponse{
  37799. Header: res.Header,
  37800. HTTPStatusCode: res.StatusCode,
  37801. },
  37802. }
  37803. target := &ret
  37804. if err := gensupport.DecodeResponse(target, res); err != nil {
  37805. return nil, err
  37806. }
  37807. return ret, nil
  37808. // {
  37809. // "description": "Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request.",
  37810. // "httpMethod": "GET",
  37811. // "id": "compute.globalForwardingRules.get",
  37812. // "parameterOrder": [
  37813. // "project",
  37814. // "forwardingRule"
  37815. // ],
  37816. // "parameters": {
  37817. // "forwardingRule": {
  37818. // "description": "Name of the ForwardingRule resource to return.",
  37819. // "location": "path",
  37820. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  37821. // "required": true,
  37822. // "type": "string"
  37823. // },
  37824. // "project": {
  37825. // "description": "Project ID for this request.",
  37826. // "location": "path",
  37827. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37828. // "required": true,
  37829. // "type": "string"
  37830. // }
  37831. // },
  37832. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  37833. // "response": {
  37834. // "$ref": "ForwardingRule"
  37835. // },
  37836. // "scopes": [
  37837. // "https://www.googleapis.com/auth/cloud-platform",
  37838. // "https://www.googleapis.com/auth/compute",
  37839. // "https://www.googleapis.com/auth/compute.readonly"
  37840. // ]
  37841. // }
  37842. }
  37843. // method id "compute.globalForwardingRules.insert":
  37844. type GlobalForwardingRulesInsertCall struct {
  37845. s *Service
  37846. project string
  37847. forwardingrule *ForwardingRule
  37848. urlParams_ gensupport.URLParams
  37849. ctx_ context.Context
  37850. header_ http.Header
  37851. }
  37852. // Insert: Creates a GlobalForwardingRule resource in the specified
  37853. // project using the data included in the request.
  37854. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert
  37855. func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
  37856. c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37857. c.project = project
  37858. c.forwardingrule = forwardingrule
  37859. return c
  37860. }
  37861. // RequestId sets the optional parameter "requestId": An optional
  37862. // request ID to identify requests. Specify a unique request ID so that
  37863. // if you must retry your request, the server will know to ignore the
  37864. // request if it has already been completed.
  37865. //
  37866. // For example, consider a situation where you make an initial request
  37867. // and the request times out. If you make the request again with the
  37868. // same request ID, the server can check if original operation with the
  37869. // same request ID was received, and if so, will ignore the second
  37870. // request. This prevents clients from accidentally creating duplicate
  37871. // commitments.
  37872. //
  37873. // The request ID must be a valid UUID with the exception that zero UUID
  37874. // is not supported (00000000-0000-0000-0000-000000000000).
  37875. func (c *GlobalForwardingRulesInsertCall) RequestId(requestId string) *GlobalForwardingRulesInsertCall {
  37876. c.urlParams_.Set("requestId", requestId)
  37877. return c
  37878. }
  37879. // Fields allows partial responses to be retrieved. See
  37880. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37881. // for more information.
  37882. func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
  37883. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37884. return c
  37885. }
  37886. // Context sets the context to be used in this call's Do method. Any
  37887. // pending HTTP request will be aborted if the provided context is
  37888. // canceled.
  37889. func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
  37890. c.ctx_ = ctx
  37891. return c
  37892. }
  37893. // Header returns an http.Header that can be modified by the caller to
  37894. // add HTTP headers to the request.
  37895. func (c *GlobalForwardingRulesInsertCall) Header() http.Header {
  37896. if c.header_ == nil {
  37897. c.header_ = make(http.Header)
  37898. }
  37899. return c.header_
  37900. }
  37901. func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  37902. reqHeaders := make(http.Header)
  37903. for k, v := range c.header_ {
  37904. reqHeaders[k] = v
  37905. }
  37906. reqHeaders.Set("User-Agent", c.s.userAgent())
  37907. var body io.Reader = nil
  37908. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  37909. if err != nil {
  37910. return nil, err
  37911. }
  37912. reqHeaders.Set("Content-Type", "application/json")
  37913. c.urlParams_.Set("alt", alt)
  37914. c.urlParams_.Set("prettyPrint", "false")
  37915. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  37916. urls += "?" + c.urlParams_.Encode()
  37917. req, err := http.NewRequest("POST", urls, body)
  37918. if err != nil {
  37919. return nil, err
  37920. }
  37921. req.Header = reqHeaders
  37922. googleapi.Expand(req.URL, map[string]string{
  37923. "project": c.project,
  37924. })
  37925. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37926. }
  37927. // Do executes the "compute.globalForwardingRules.insert" call.
  37928. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37929. // status code is an error. Response headers are in either
  37930. // *Operation.ServerResponse.Header or (if a response was returned at
  37931. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37932. // to check whether the returned error was because
  37933. // http.StatusNotModified was returned.
  37934. func (c *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37935. gensupport.SetOptions(c.urlParams_, opts...)
  37936. res, err := c.doRequest("json")
  37937. if res != nil && res.StatusCode == http.StatusNotModified {
  37938. if res.Body != nil {
  37939. res.Body.Close()
  37940. }
  37941. return nil, &googleapi.Error{
  37942. Code: res.StatusCode,
  37943. Header: res.Header,
  37944. }
  37945. }
  37946. if err != nil {
  37947. return nil, err
  37948. }
  37949. defer googleapi.CloseBody(res)
  37950. if err := googleapi.CheckResponse(res); err != nil {
  37951. return nil, err
  37952. }
  37953. ret := &Operation{
  37954. ServerResponse: googleapi.ServerResponse{
  37955. Header: res.Header,
  37956. HTTPStatusCode: res.StatusCode,
  37957. },
  37958. }
  37959. target := &ret
  37960. if err := gensupport.DecodeResponse(target, res); err != nil {
  37961. return nil, err
  37962. }
  37963. return ret, nil
  37964. // {
  37965. // "description": "Creates a GlobalForwardingRule resource in the specified project using the data included in the request.",
  37966. // "httpMethod": "POST",
  37967. // "id": "compute.globalForwardingRules.insert",
  37968. // "parameterOrder": [
  37969. // "project"
  37970. // ],
  37971. // "parameters": {
  37972. // "project": {
  37973. // "description": "Project ID for this request.",
  37974. // "location": "path",
  37975. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37976. // "required": true,
  37977. // "type": "string"
  37978. // },
  37979. // "requestId": {
  37980. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37981. // "location": "query",
  37982. // "type": "string"
  37983. // }
  37984. // },
  37985. // "path": "{project}/global/forwardingRules",
  37986. // "request": {
  37987. // "$ref": "ForwardingRule"
  37988. // },
  37989. // "response": {
  37990. // "$ref": "Operation"
  37991. // },
  37992. // "scopes": [
  37993. // "https://www.googleapis.com/auth/cloud-platform",
  37994. // "https://www.googleapis.com/auth/compute"
  37995. // ]
  37996. // }
  37997. }
  37998. // method id "compute.globalForwardingRules.list":
  37999. type GlobalForwardingRulesListCall struct {
  38000. s *Service
  38001. project string
  38002. urlParams_ gensupport.URLParams
  38003. ifNoneMatch_ string
  38004. ctx_ context.Context
  38005. header_ http.Header
  38006. }
  38007. // List: Retrieves a list of GlobalForwardingRule resources available to
  38008. // the specified project.
  38009. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list
  38010. func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
  38011. c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38012. c.project = project
  38013. return c
  38014. }
  38015. // Filter sets the optional parameter "filter": A filter expression that
  38016. // filters resources listed in the response. The expression must specify
  38017. // the field name, a comparison operator, and the value that you want to
  38018. // use for filtering. The value must be a string, a number, or a
  38019. // boolean. The comparison operator must be either =, !=, >, or <.
  38020. //
  38021. // For example, if you are filtering Compute Engine instances, you can
  38022. // exclude instances named example-instance by specifying name !=
  38023. // example-instance.
  38024. //
  38025. // You can also filter nested fields. For example, you could specify
  38026. // scheduling.automaticRestart = false to include instances only if they
  38027. // are not scheduled for automatic restarts. You can use filtering on
  38028. // nested fields to filter based on resource labels.
  38029. //
  38030. // To filter on multiple expressions, provide each separate expression
  38031. // within parentheses. For example, (scheduling.automaticRestart = true)
  38032. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38033. // AND expression. However, you can include AND and OR expressions
  38034. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38035. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38036. // true).
  38037. func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
  38038. c.urlParams_.Set("filter", filter)
  38039. return c
  38040. }
  38041. // MaxResults sets the optional parameter "maxResults": The maximum
  38042. // number of results per page that should be returned. If the number of
  38043. // available results is larger than maxResults, Compute Engine returns a
  38044. // nextPageToken that can be used to get the next page of results in
  38045. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38046. // (Default: 500)
  38047. func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
  38048. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38049. return c
  38050. }
  38051. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38052. // a certain order. By default, results are returned in alphanumerical
  38053. // order based on the resource name.
  38054. //
  38055. // You can also sort results in descending order based on the creation
  38056. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38057. // based on the creationTimestamp field in reverse chronological order
  38058. // (newest result first). Use this to sort resources like operations so
  38059. // that the newest operation is returned first.
  38060. //
  38061. // Currently, only sorting by name or creationTimestamp desc is
  38062. // supported.
  38063. func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall {
  38064. c.urlParams_.Set("orderBy", orderBy)
  38065. return c
  38066. }
  38067. // PageToken sets the optional parameter "pageToken": Specifies a page
  38068. // token to use. Set pageToken to the nextPageToken returned by a
  38069. // previous list request to get the next page of results.
  38070. func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
  38071. c.urlParams_.Set("pageToken", pageToken)
  38072. return c
  38073. }
  38074. // Fields allows partial responses to be retrieved. See
  38075. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38076. // for more information.
  38077. func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
  38078. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38079. return c
  38080. }
  38081. // IfNoneMatch sets the optional parameter which makes the operation
  38082. // fail if the object's ETag matches the given value. This is useful for
  38083. // getting updates only after the object has changed since the last
  38084. // request. Use googleapi.IsNotModified to check whether the response
  38085. // error from Do is the result of In-None-Match.
  38086. func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
  38087. c.ifNoneMatch_ = entityTag
  38088. return c
  38089. }
  38090. // Context sets the context to be used in this call's Do method. Any
  38091. // pending HTTP request will be aborted if the provided context is
  38092. // canceled.
  38093. func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
  38094. c.ctx_ = ctx
  38095. return c
  38096. }
  38097. // Header returns an http.Header that can be modified by the caller to
  38098. // add HTTP headers to the request.
  38099. func (c *GlobalForwardingRulesListCall) Header() http.Header {
  38100. if c.header_ == nil {
  38101. c.header_ = make(http.Header)
  38102. }
  38103. return c.header_
  38104. }
  38105. func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  38106. reqHeaders := make(http.Header)
  38107. for k, v := range c.header_ {
  38108. reqHeaders[k] = v
  38109. }
  38110. reqHeaders.Set("User-Agent", c.s.userAgent())
  38111. if c.ifNoneMatch_ != "" {
  38112. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38113. }
  38114. var body io.Reader = nil
  38115. c.urlParams_.Set("alt", alt)
  38116. c.urlParams_.Set("prettyPrint", "false")
  38117. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  38118. urls += "?" + c.urlParams_.Encode()
  38119. req, err := http.NewRequest("GET", urls, body)
  38120. if err != nil {
  38121. return nil, err
  38122. }
  38123. req.Header = reqHeaders
  38124. googleapi.Expand(req.URL, map[string]string{
  38125. "project": c.project,
  38126. })
  38127. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38128. }
  38129. // Do executes the "compute.globalForwardingRules.list" call.
  38130. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  38131. // non-2xx status code is an error. Response headers are in either
  38132. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  38133. // returned at all) in error.(*googleapi.Error).Header. Use
  38134. // googleapi.IsNotModified to check whether the returned error was
  38135. // because http.StatusNotModified was returned.
  38136. func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  38137. gensupport.SetOptions(c.urlParams_, opts...)
  38138. res, err := c.doRequest("json")
  38139. if res != nil && res.StatusCode == http.StatusNotModified {
  38140. if res.Body != nil {
  38141. res.Body.Close()
  38142. }
  38143. return nil, &googleapi.Error{
  38144. Code: res.StatusCode,
  38145. Header: res.Header,
  38146. }
  38147. }
  38148. if err != nil {
  38149. return nil, err
  38150. }
  38151. defer googleapi.CloseBody(res)
  38152. if err := googleapi.CheckResponse(res); err != nil {
  38153. return nil, err
  38154. }
  38155. ret := &ForwardingRuleList{
  38156. ServerResponse: googleapi.ServerResponse{
  38157. Header: res.Header,
  38158. HTTPStatusCode: res.StatusCode,
  38159. },
  38160. }
  38161. target := &ret
  38162. if err := gensupport.DecodeResponse(target, res); err != nil {
  38163. return nil, err
  38164. }
  38165. return ret, nil
  38166. // {
  38167. // "description": "Retrieves a list of GlobalForwardingRule resources available to the specified project.",
  38168. // "httpMethod": "GET",
  38169. // "id": "compute.globalForwardingRules.list",
  38170. // "parameterOrder": [
  38171. // "project"
  38172. // ],
  38173. // "parameters": {
  38174. // "filter": {
  38175. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  38176. // "location": "query",
  38177. // "type": "string"
  38178. // },
  38179. // "maxResults": {
  38180. // "default": "500",
  38181. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  38182. // "format": "uint32",
  38183. // "location": "query",
  38184. // "minimum": "0",
  38185. // "type": "integer"
  38186. // },
  38187. // "orderBy": {
  38188. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  38189. // "location": "query",
  38190. // "type": "string"
  38191. // },
  38192. // "pageToken": {
  38193. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  38194. // "location": "query",
  38195. // "type": "string"
  38196. // },
  38197. // "project": {
  38198. // "description": "Project ID for this request.",
  38199. // "location": "path",
  38200. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38201. // "required": true,
  38202. // "type": "string"
  38203. // }
  38204. // },
  38205. // "path": "{project}/global/forwardingRules",
  38206. // "response": {
  38207. // "$ref": "ForwardingRuleList"
  38208. // },
  38209. // "scopes": [
  38210. // "https://www.googleapis.com/auth/cloud-platform",
  38211. // "https://www.googleapis.com/auth/compute",
  38212. // "https://www.googleapis.com/auth/compute.readonly"
  38213. // ]
  38214. // }
  38215. }
  38216. // Pages invokes f for each page of results.
  38217. // A non-nil error returned from f will halt the iteration.
  38218. // The provided context supersedes any context provided to the Context method.
  38219. func (c *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  38220. c.ctx_ = ctx
  38221. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38222. for {
  38223. x, err := c.Do()
  38224. if err != nil {
  38225. return err
  38226. }
  38227. if err := f(x); err != nil {
  38228. return err
  38229. }
  38230. if x.NextPageToken == "" {
  38231. return nil
  38232. }
  38233. c.PageToken(x.NextPageToken)
  38234. }
  38235. }
  38236. // method id "compute.globalForwardingRules.setTarget":
  38237. type GlobalForwardingRulesSetTargetCall struct {
  38238. s *Service
  38239. project string
  38240. forwardingRule string
  38241. targetreference *TargetReference
  38242. urlParams_ gensupport.URLParams
  38243. ctx_ context.Context
  38244. header_ http.Header
  38245. }
  38246. // SetTarget: Changes target URL for the GlobalForwardingRule resource.
  38247. // The new target should be of the same type as the old target.
  38248. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget
  38249. func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
  38250. c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38251. c.project = project
  38252. c.forwardingRule = forwardingRule
  38253. c.targetreference = targetreference
  38254. return c
  38255. }
  38256. // RequestId sets the optional parameter "requestId": An optional
  38257. // request ID to identify requests. Specify a unique request ID so that
  38258. // if you must retry your request, the server will know to ignore the
  38259. // request if it has already been completed.
  38260. //
  38261. // For example, consider a situation where you make an initial request
  38262. // and the request times out. If you make the request again with the
  38263. // same request ID, the server can check if original operation with the
  38264. // same request ID was received, and if so, will ignore the second
  38265. // request. This prevents clients from accidentally creating duplicate
  38266. // commitments.
  38267. //
  38268. // The request ID must be a valid UUID with the exception that zero UUID
  38269. // is not supported (00000000-0000-0000-0000-000000000000).
  38270. func (c *GlobalForwardingRulesSetTargetCall) RequestId(requestId string) *GlobalForwardingRulesSetTargetCall {
  38271. c.urlParams_.Set("requestId", requestId)
  38272. return c
  38273. }
  38274. // Fields allows partial responses to be retrieved. See
  38275. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38276. // for more information.
  38277. func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
  38278. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38279. return c
  38280. }
  38281. // Context sets the context to be used in this call's Do method. Any
  38282. // pending HTTP request will be aborted if the provided context is
  38283. // canceled.
  38284. func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
  38285. c.ctx_ = ctx
  38286. return c
  38287. }
  38288. // Header returns an http.Header that can be modified by the caller to
  38289. // add HTTP headers to the request.
  38290. func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header {
  38291. if c.header_ == nil {
  38292. c.header_ = make(http.Header)
  38293. }
  38294. return c.header_
  38295. }
  38296. func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  38297. reqHeaders := make(http.Header)
  38298. for k, v := range c.header_ {
  38299. reqHeaders[k] = v
  38300. }
  38301. reqHeaders.Set("User-Agent", c.s.userAgent())
  38302. var body io.Reader = nil
  38303. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  38304. if err != nil {
  38305. return nil, err
  38306. }
  38307. reqHeaders.Set("Content-Type", "application/json")
  38308. c.urlParams_.Set("alt", alt)
  38309. c.urlParams_.Set("prettyPrint", "false")
  38310. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget")
  38311. urls += "?" + c.urlParams_.Encode()
  38312. req, err := http.NewRequest("POST", urls, body)
  38313. if err != nil {
  38314. return nil, err
  38315. }
  38316. req.Header = reqHeaders
  38317. googleapi.Expand(req.URL, map[string]string{
  38318. "project": c.project,
  38319. "forwardingRule": c.forwardingRule,
  38320. })
  38321. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38322. }
  38323. // Do executes the "compute.globalForwardingRules.setTarget" call.
  38324. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38325. // status code is an error. Response headers are in either
  38326. // *Operation.ServerResponse.Header or (if a response was returned at
  38327. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38328. // to check whether the returned error was because
  38329. // http.StatusNotModified was returned.
  38330. func (c *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38331. gensupport.SetOptions(c.urlParams_, opts...)
  38332. res, err := c.doRequest("json")
  38333. if res != nil && res.StatusCode == http.StatusNotModified {
  38334. if res.Body != nil {
  38335. res.Body.Close()
  38336. }
  38337. return nil, &googleapi.Error{
  38338. Code: res.StatusCode,
  38339. Header: res.Header,
  38340. }
  38341. }
  38342. if err != nil {
  38343. return nil, err
  38344. }
  38345. defer googleapi.CloseBody(res)
  38346. if err := googleapi.CheckResponse(res); err != nil {
  38347. return nil, err
  38348. }
  38349. ret := &Operation{
  38350. ServerResponse: googleapi.ServerResponse{
  38351. Header: res.Header,
  38352. HTTPStatusCode: res.StatusCode,
  38353. },
  38354. }
  38355. target := &ret
  38356. if err := gensupport.DecodeResponse(target, res); err != nil {
  38357. return nil, err
  38358. }
  38359. return ret, nil
  38360. // {
  38361. // "description": "Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.",
  38362. // "httpMethod": "POST",
  38363. // "id": "compute.globalForwardingRules.setTarget",
  38364. // "parameterOrder": [
  38365. // "project",
  38366. // "forwardingRule"
  38367. // ],
  38368. // "parameters": {
  38369. // "forwardingRule": {
  38370. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  38371. // "location": "path",
  38372. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38373. // "required": true,
  38374. // "type": "string"
  38375. // },
  38376. // "project": {
  38377. // "description": "Project ID for this request.",
  38378. // "location": "path",
  38379. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38380. // "required": true,
  38381. // "type": "string"
  38382. // },
  38383. // "requestId": {
  38384. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38385. // "location": "query",
  38386. // "type": "string"
  38387. // }
  38388. // },
  38389. // "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget",
  38390. // "request": {
  38391. // "$ref": "TargetReference"
  38392. // },
  38393. // "response": {
  38394. // "$ref": "Operation"
  38395. // },
  38396. // "scopes": [
  38397. // "https://www.googleapis.com/auth/cloud-platform",
  38398. // "https://www.googleapis.com/auth/compute"
  38399. // ]
  38400. // }
  38401. }
  38402. // method id "compute.globalOperations.aggregatedList":
  38403. type GlobalOperationsAggregatedListCall struct {
  38404. s *Service
  38405. project string
  38406. urlParams_ gensupport.URLParams
  38407. ifNoneMatch_ string
  38408. ctx_ context.Context
  38409. header_ http.Header
  38410. }
  38411. // AggregatedList: Retrieves an aggregated list of all operations.
  38412. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList
  38413. func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
  38414. c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38415. c.project = project
  38416. return c
  38417. }
  38418. // Filter sets the optional parameter "filter": A filter expression that
  38419. // filters resources listed in the response. The expression must specify
  38420. // the field name, a comparison operator, and the value that you want to
  38421. // use for filtering. The value must be a string, a number, or a
  38422. // boolean. The comparison operator must be either =, !=, >, or <.
  38423. //
  38424. // For example, if you are filtering Compute Engine instances, you can
  38425. // exclude instances named example-instance by specifying name !=
  38426. // example-instance.
  38427. //
  38428. // You can also filter nested fields. For example, you could specify
  38429. // scheduling.automaticRestart = false to include instances only if they
  38430. // are not scheduled for automatic restarts. You can use filtering on
  38431. // nested fields to filter based on resource labels.
  38432. //
  38433. // To filter on multiple expressions, provide each separate expression
  38434. // within parentheses. For example, (scheduling.automaticRestart = true)
  38435. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38436. // AND expression. However, you can include AND and OR expressions
  38437. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38438. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38439. // true).
  38440. func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
  38441. c.urlParams_.Set("filter", filter)
  38442. return c
  38443. }
  38444. // MaxResults sets the optional parameter "maxResults": The maximum
  38445. // number of results per page that should be returned. If the number of
  38446. // available results is larger than maxResults, Compute Engine returns a
  38447. // nextPageToken that can be used to get the next page of results in
  38448. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38449. // (Default: 500)
  38450. func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
  38451. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38452. return c
  38453. }
  38454. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38455. // a certain order. By default, results are returned in alphanumerical
  38456. // order based on the resource name.
  38457. //
  38458. // You can also sort results in descending order based on the creation
  38459. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38460. // based on the creationTimestamp field in reverse chronological order
  38461. // (newest result first). Use this to sort resources like operations so
  38462. // that the newest operation is returned first.
  38463. //
  38464. // Currently, only sorting by name or creationTimestamp desc is
  38465. // supported.
  38466. func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall {
  38467. c.urlParams_.Set("orderBy", orderBy)
  38468. return c
  38469. }
  38470. // PageToken sets the optional parameter "pageToken": Specifies a page
  38471. // token to use. Set pageToken to the nextPageToken returned by a
  38472. // previous list request to get the next page of results.
  38473. func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
  38474. c.urlParams_.Set("pageToken", pageToken)
  38475. return c
  38476. }
  38477. // Fields allows partial responses to be retrieved. See
  38478. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38479. // for more information.
  38480. func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
  38481. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38482. return c
  38483. }
  38484. // IfNoneMatch sets the optional parameter which makes the operation
  38485. // fail if the object's ETag matches the given value. This is useful for
  38486. // getting updates only after the object has changed since the last
  38487. // request. Use googleapi.IsNotModified to check whether the response
  38488. // error from Do is the result of In-None-Match.
  38489. func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
  38490. c.ifNoneMatch_ = entityTag
  38491. return c
  38492. }
  38493. // Context sets the context to be used in this call's Do method. Any
  38494. // pending HTTP request will be aborted if the provided context is
  38495. // canceled.
  38496. func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
  38497. c.ctx_ = ctx
  38498. return c
  38499. }
  38500. // Header returns an http.Header that can be modified by the caller to
  38501. // add HTTP headers to the request.
  38502. func (c *GlobalOperationsAggregatedListCall) Header() http.Header {
  38503. if c.header_ == nil {
  38504. c.header_ = make(http.Header)
  38505. }
  38506. return c.header_
  38507. }
  38508. func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  38509. reqHeaders := make(http.Header)
  38510. for k, v := range c.header_ {
  38511. reqHeaders[k] = v
  38512. }
  38513. reqHeaders.Set("User-Agent", c.s.userAgent())
  38514. if c.ifNoneMatch_ != "" {
  38515. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38516. }
  38517. var body io.Reader = nil
  38518. c.urlParams_.Set("alt", alt)
  38519. c.urlParams_.Set("prettyPrint", "false")
  38520. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations")
  38521. urls += "?" + c.urlParams_.Encode()
  38522. req, err := http.NewRequest("GET", urls, body)
  38523. if err != nil {
  38524. return nil, err
  38525. }
  38526. req.Header = reqHeaders
  38527. googleapi.Expand(req.URL, map[string]string{
  38528. "project": c.project,
  38529. })
  38530. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38531. }
  38532. // Do executes the "compute.globalOperations.aggregatedList" call.
  38533. // Exactly one of *OperationAggregatedList or error will be non-nil. Any
  38534. // non-2xx status code is an error. Response headers are in either
  38535. // *OperationAggregatedList.ServerResponse.Header or (if a response was
  38536. // returned at all) in error.(*googleapi.Error).Header. Use
  38537. // googleapi.IsNotModified to check whether the returned error was
  38538. // because http.StatusNotModified was returned.
  38539. func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, error) {
  38540. gensupport.SetOptions(c.urlParams_, opts...)
  38541. res, err := c.doRequest("json")
  38542. if res != nil && res.StatusCode == http.StatusNotModified {
  38543. if res.Body != nil {
  38544. res.Body.Close()
  38545. }
  38546. return nil, &googleapi.Error{
  38547. Code: res.StatusCode,
  38548. Header: res.Header,
  38549. }
  38550. }
  38551. if err != nil {
  38552. return nil, err
  38553. }
  38554. defer googleapi.CloseBody(res)
  38555. if err := googleapi.CheckResponse(res); err != nil {
  38556. return nil, err
  38557. }
  38558. ret := &OperationAggregatedList{
  38559. ServerResponse: googleapi.ServerResponse{
  38560. Header: res.Header,
  38561. HTTPStatusCode: res.StatusCode,
  38562. },
  38563. }
  38564. target := &ret
  38565. if err := gensupport.DecodeResponse(target, res); err != nil {
  38566. return nil, err
  38567. }
  38568. return ret, nil
  38569. // {
  38570. // "description": "Retrieves an aggregated list of all operations.",
  38571. // "httpMethod": "GET",
  38572. // "id": "compute.globalOperations.aggregatedList",
  38573. // "parameterOrder": [
  38574. // "project"
  38575. // ],
  38576. // "parameters": {
  38577. // "filter": {
  38578. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  38579. // "location": "query",
  38580. // "type": "string"
  38581. // },
  38582. // "maxResults": {
  38583. // "default": "500",
  38584. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  38585. // "format": "uint32",
  38586. // "location": "query",
  38587. // "minimum": "0",
  38588. // "type": "integer"
  38589. // },
  38590. // "orderBy": {
  38591. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  38592. // "location": "query",
  38593. // "type": "string"
  38594. // },
  38595. // "pageToken": {
  38596. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  38597. // "location": "query",
  38598. // "type": "string"
  38599. // },
  38600. // "project": {
  38601. // "description": "Project ID for this request.",
  38602. // "location": "path",
  38603. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38604. // "required": true,
  38605. // "type": "string"
  38606. // }
  38607. // },
  38608. // "path": "{project}/aggregated/operations",
  38609. // "response": {
  38610. // "$ref": "OperationAggregatedList"
  38611. // },
  38612. // "scopes": [
  38613. // "https://www.googleapis.com/auth/cloud-platform",
  38614. // "https://www.googleapis.com/auth/compute",
  38615. // "https://www.googleapis.com/auth/compute.readonly"
  38616. // ]
  38617. // }
  38618. }
  38619. // Pages invokes f for each page of results.
  38620. // A non-nil error returned from f will halt the iteration.
  38621. // The provided context supersedes any context provided to the Context method.
  38622. func (c *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error {
  38623. c.ctx_ = ctx
  38624. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38625. for {
  38626. x, err := c.Do()
  38627. if err != nil {
  38628. return err
  38629. }
  38630. if err := f(x); err != nil {
  38631. return err
  38632. }
  38633. if x.NextPageToken == "" {
  38634. return nil
  38635. }
  38636. c.PageToken(x.NextPageToken)
  38637. }
  38638. }
  38639. // method id "compute.globalOperations.delete":
  38640. type GlobalOperationsDeleteCall struct {
  38641. s *Service
  38642. project string
  38643. operation string
  38644. urlParams_ gensupport.URLParams
  38645. ctx_ context.Context
  38646. header_ http.Header
  38647. }
  38648. // Delete: Deletes the specified Operations resource.
  38649. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete
  38650. func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall {
  38651. c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38652. c.project = project
  38653. c.operation = operation
  38654. return c
  38655. }
  38656. // Fields allows partial responses to be retrieved. See
  38657. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38658. // for more information.
  38659. func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
  38660. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38661. return c
  38662. }
  38663. // Context sets the context to be used in this call's Do method. Any
  38664. // pending HTTP request will be aborted if the provided context is
  38665. // canceled.
  38666. func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
  38667. c.ctx_ = ctx
  38668. return c
  38669. }
  38670. // Header returns an http.Header that can be modified by the caller to
  38671. // add HTTP headers to the request.
  38672. func (c *GlobalOperationsDeleteCall) Header() http.Header {
  38673. if c.header_ == nil {
  38674. c.header_ = make(http.Header)
  38675. }
  38676. return c.header_
  38677. }
  38678. func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  38679. reqHeaders := make(http.Header)
  38680. for k, v := range c.header_ {
  38681. reqHeaders[k] = v
  38682. }
  38683. reqHeaders.Set("User-Agent", c.s.userAgent())
  38684. var body io.Reader = nil
  38685. c.urlParams_.Set("alt", alt)
  38686. c.urlParams_.Set("prettyPrint", "false")
  38687. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  38688. urls += "?" + c.urlParams_.Encode()
  38689. req, err := http.NewRequest("DELETE", urls, body)
  38690. if err != nil {
  38691. return nil, err
  38692. }
  38693. req.Header = reqHeaders
  38694. googleapi.Expand(req.URL, map[string]string{
  38695. "project": c.project,
  38696. "operation": c.operation,
  38697. })
  38698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38699. }
  38700. // Do executes the "compute.globalOperations.delete" call.
  38701. func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  38702. gensupport.SetOptions(c.urlParams_, opts...)
  38703. res, err := c.doRequest("json")
  38704. if err != nil {
  38705. return err
  38706. }
  38707. defer googleapi.CloseBody(res)
  38708. if err := googleapi.CheckResponse(res); err != nil {
  38709. return err
  38710. }
  38711. return nil
  38712. // {
  38713. // "description": "Deletes the specified Operations resource.",
  38714. // "httpMethod": "DELETE",
  38715. // "id": "compute.globalOperations.delete",
  38716. // "parameterOrder": [
  38717. // "project",
  38718. // "operation"
  38719. // ],
  38720. // "parameters": {
  38721. // "operation": {
  38722. // "description": "Name of the Operations resource to delete.",
  38723. // "location": "path",
  38724. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38725. // "required": true,
  38726. // "type": "string"
  38727. // },
  38728. // "project": {
  38729. // "description": "Project ID for this request.",
  38730. // "location": "path",
  38731. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38732. // "required": true,
  38733. // "type": "string"
  38734. // }
  38735. // },
  38736. // "path": "{project}/global/operations/{operation}",
  38737. // "scopes": [
  38738. // "https://www.googleapis.com/auth/cloud-platform",
  38739. // "https://www.googleapis.com/auth/compute"
  38740. // ]
  38741. // }
  38742. }
  38743. // method id "compute.globalOperations.get":
  38744. type GlobalOperationsGetCall struct {
  38745. s *Service
  38746. project string
  38747. operation string
  38748. urlParams_ gensupport.URLParams
  38749. ifNoneMatch_ string
  38750. ctx_ context.Context
  38751. header_ http.Header
  38752. }
  38753. // Get: Retrieves the specified Operations resource. Gets a list of
  38754. // operations by making a list() request.
  38755. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get
  38756. func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall {
  38757. c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38758. c.project = project
  38759. c.operation = operation
  38760. return c
  38761. }
  38762. // Fields allows partial responses to be retrieved. See
  38763. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38764. // for more information.
  38765. func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
  38766. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38767. return c
  38768. }
  38769. // IfNoneMatch sets the optional parameter which makes the operation
  38770. // fail if the object's ETag matches the given value. This is useful for
  38771. // getting updates only after the object has changed since the last
  38772. // request. Use googleapi.IsNotModified to check whether the response
  38773. // error from Do is the result of In-None-Match.
  38774. func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
  38775. c.ifNoneMatch_ = entityTag
  38776. return c
  38777. }
  38778. // Context sets the context to be used in this call's Do method. Any
  38779. // pending HTTP request will be aborted if the provided context is
  38780. // canceled.
  38781. func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
  38782. c.ctx_ = ctx
  38783. return c
  38784. }
  38785. // Header returns an http.Header that can be modified by the caller to
  38786. // add HTTP headers to the request.
  38787. func (c *GlobalOperationsGetCall) Header() http.Header {
  38788. if c.header_ == nil {
  38789. c.header_ = make(http.Header)
  38790. }
  38791. return c.header_
  38792. }
  38793. func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  38794. reqHeaders := make(http.Header)
  38795. for k, v := range c.header_ {
  38796. reqHeaders[k] = v
  38797. }
  38798. reqHeaders.Set("User-Agent", c.s.userAgent())
  38799. if c.ifNoneMatch_ != "" {
  38800. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38801. }
  38802. var body io.Reader = nil
  38803. c.urlParams_.Set("alt", alt)
  38804. c.urlParams_.Set("prettyPrint", "false")
  38805. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  38806. urls += "?" + c.urlParams_.Encode()
  38807. req, err := http.NewRequest("GET", urls, body)
  38808. if err != nil {
  38809. return nil, err
  38810. }
  38811. req.Header = reqHeaders
  38812. googleapi.Expand(req.URL, map[string]string{
  38813. "project": c.project,
  38814. "operation": c.operation,
  38815. })
  38816. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38817. }
  38818. // Do executes the "compute.globalOperations.get" call.
  38819. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38820. // status code is an error. Response headers are in either
  38821. // *Operation.ServerResponse.Header or (if a response was returned at
  38822. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38823. // to check whether the returned error was because
  38824. // http.StatusNotModified was returned.
  38825. func (c *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38826. gensupport.SetOptions(c.urlParams_, opts...)
  38827. res, err := c.doRequest("json")
  38828. if res != nil && res.StatusCode == http.StatusNotModified {
  38829. if res.Body != nil {
  38830. res.Body.Close()
  38831. }
  38832. return nil, &googleapi.Error{
  38833. Code: res.StatusCode,
  38834. Header: res.Header,
  38835. }
  38836. }
  38837. if err != nil {
  38838. return nil, err
  38839. }
  38840. defer googleapi.CloseBody(res)
  38841. if err := googleapi.CheckResponse(res); err != nil {
  38842. return nil, err
  38843. }
  38844. ret := &Operation{
  38845. ServerResponse: googleapi.ServerResponse{
  38846. Header: res.Header,
  38847. HTTPStatusCode: res.StatusCode,
  38848. },
  38849. }
  38850. target := &ret
  38851. if err := gensupport.DecodeResponse(target, res); err != nil {
  38852. return nil, err
  38853. }
  38854. return ret, nil
  38855. // {
  38856. // "description": "Retrieves the specified Operations resource. Gets a list of operations by making a list() request.",
  38857. // "httpMethod": "GET",
  38858. // "id": "compute.globalOperations.get",
  38859. // "parameterOrder": [
  38860. // "project",
  38861. // "operation"
  38862. // ],
  38863. // "parameters": {
  38864. // "operation": {
  38865. // "description": "Name of the Operations resource to return.",
  38866. // "location": "path",
  38867. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38868. // "required": true,
  38869. // "type": "string"
  38870. // },
  38871. // "project": {
  38872. // "description": "Project ID for this request.",
  38873. // "location": "path",
  38874. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38875. // "required": true,
  38876. // "type": "string"
  38877. // }
  38878. // },
  38879. // "path": "{project}/global/operations/{operation}",
  38880. // "response": {
  38881. // "$ref": "Operation"
  38882. // },
  38883. // "scopes": [
  38884. // "https://www.googleapis.com/auth/cloud-platform",
  38885. // "https://www.googleapis.com/auth/compute",
  38886. // "https://www.googleapis.com/auth/compute.readonly"
  38887. // ]
  38888. // }
  38889. }
  38890. // method id "compute.globalOperations.list":
  38891. type GlobalOperationsListCall struct {
  38892. s *Service
  38893. project string
  38894. urlParams_ gensupport.URLParams
  38895. ifNoneMatch_ string
  38896. ctx_ context.Context
  38897. header_ http.Header
  38898. }
  38899. // List: Retrieves a list of Operation resources contained within the
  38900. // specified project.
  38901. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list
  38902. func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
  38903. c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38904. c.project = project
  38905. return c
  38906. }
  38907. // Filter sets the optional parameter "filter": A filter expression that
  38908. // filters resources listed in the response. The expression must specify
  38909. // the field name, a comparison operator, and the value that you want to
  38910. // use for filtering. The value must be a string, a number, or a
  38911. // boolean. The comparison operator must be either =, !=, >, or <.
  38912. //
  38913. // For example, if you are filtering Compute Engine instances, you can
  38914. // exclude instances named example-instance by specifying name !=
  38915. // example-instance.
  38916. //
  38917. // You can also filter nested fields. For example, you could specify
  38918. // scheduling.automaticRestart = false to include instances only if they
  38919. // are not scheduled for automatic restarts. You can use filtering on
  38920. // nested fields to filter based on resource labels.
  38921. //
  38922. // To filter on multiple expressions, provide each separate expression
  38923. // within parentheses. For example, (scheduling.automaticRestart = true)
  38924. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38925. // AND expression. However, you can include AND and OR expressions
  38926. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38927. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38928. // true).
  38929. func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
  38930. c.urlParams_.Set("filter", filter)
  38931. return c
  38932. }
  38933. // MaxResults sets the optional parameter "maxResults": The maximum
  38934. // number of results per page that should be returned. If the number of
  38935. // available results is larger than maxResults, Compute Engine returns a
  38936. // nextPageToken that can be used to get the next page of results in
  38937. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38938. // (Default: 500)
  38939. func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
  38940. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38941. return c
  38942. }
  38943. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38944. // a certain order. By default, results are returned in alphanumerical
  38945. // order based on the resource name.
  38946. //
  38947. // You can also sort results in descending order based on the creation
  38948. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38949. // based on the creationTimestamp field in reverse chronological order
  38950. // (newest result first). Use this to sort resources like operations so
  38951. // that the newest operation is returned first.
  38952. //
  38953. // Currently, only sorting by name or creationTimestamp desc is
  38954. // supported.
  38955. func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall {
  38956. c.urlParams_.Set("orderBy", orderBy)
  38957. return c
  38958. }
  38959. // PageToken sets the optional parameter "pageToken": Specifies a page
  38960. // token to use. Set pageToken to the nextPageToken returned by a
  38961. // previous list request to get the next page of results.
  38962. func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
  38963. c.urlParams_.Set("pageToken", pageToken)
  38964. return c
  38965. }
  38966. // Fields allows partial responses to be retrieved. See
  38967. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38968. // for more information.
  38969. func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
  38970. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38971. return c
  38972. }
  38973. // IfNoneMatch sets the optional parameter which makes the operation
  38974. // fail if the object's ETag matches the given value. This is useful for
  38975. // getting updates only after the object has changed since the last
  38976. // request. Use googleapi.IsNotModified to check whether the response
  38977. // error from Do is the result of In-None-Match.
  38978. func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
  38979. c.ifNoneMatch_ = entityTag
  38980. return c
  38981. }
  38982. // Context sets the context to be used in this call's Do method. Any
  38983. // pending HTTP request will be aborted if the provided context is
  38984. // canceled.
  38985. func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
  38986. c.ctx_ = ctx
  38987. return c
  38988. }
  38989. // Header returns an http.Header that can be modified by the caller to
  38990. // add HTTP headers to the request.
  38991. func (c *GlobalOperationsListCall) Header() http.Header {
  38992. if c.header_ == nil {
  38993. c.header_ = make(http.Header)
  38994. }
  38995. return c.header_
  38996. }
  38997. func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
  38998. reqHeaders := make(http.Header)
  38999. for k, v := range c.header_ {
  39000. reqHeaders[k] = v
  39001. }
  39002. reqHeaders.Set("User-Agent", c.s.userAgent())
  39003. if c.ifNoneMatch_ != "" {
  39004. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39005. }
  39006. var body io.Reader = nil
  39007. c.urlParams_.Set("alt", alt)
  39008. c.urlParams_.Set("prettyPrint", "false")
  39009. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  39010. urls += "?" + c.urlParams_.Encode()
  39011. req, err := http.NewRequest("GET", urls, body)
  39012. if err != nil {
  39013. return nil, err
  39014. }
  39015. req.Header = reqHeaders
  39016. googleapi.Expand(req.URL, map[string]string{
  39017. "project": c.project,
  39018. })
  39019. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39020. }
  39021. // Do executes the "compute.globalOperations.list" call.
  39022. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  39023. // status code is an error. Response headers are in either
  39024. // *OperationList.ServerResponse.Header or (if a response was returned
  39025. // at all) in error.(*googleapi.Error).Header. Use
  39026. // googleapi.IsNotModified to check whether the returned error was
  39027. // because http.StatusNotModified was returned.
  39028. func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  39029. gensupport.SetOptions(c.urlParams_, opts...)
  39030. res, err := c.doRequest("json")
  39031. if res != nil && res.StatusCode == http.StatusNotModified {
  39032. if res.Body != nil {
  39033. res.Body.Close()
  39034. }
  39035. return nil, &googleapi.Error{
  39036. Code: res.StatusCode,
  39037. Header: res.Header,
  39038. }
  39039. }
  39040. if err != nil {
  39041. return nil, err
  39042. }
  39043. defer googleapi.CloseBody(res)
  39044. if err := googleapi.CheckResponse(res); err != nil {
  39045. return nil, err
  39046. }
  39047. ret := &OperationList{
  39048. ServerResponse: googleapi.ServerResponse{
  39049. Header: res.Header,
  39050. HTTPStatusCode: res.StatusCode,
  39051. },
  39052. }
  39053. target := &ret
  39054. if err := gensupport.DecodeResponse(target, res); err != nil {
  39055. return nil, err
  39056. }
  39057. return ret, nil
  39058. // {
  39059. // "description": "Retrieves a list of Operation resources contained within the specified project.",
  39060. // "httpMethod": "GET",
  39061. // "id": "compute.globalOperations.list",
  39062. // "parameterOrder": [
  39063. // "project"
  39064. // ],
  39065. // "parameters": {
  39066. // "filter": {
  39067. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  39068. // "location": "query",
  39069. // "type": "string"
  39070. // },
  39071. // "maxResults": {
  39072. // "default": "500",
  39073. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  39074. // "format": "uint32",
  39075. // "location": "query",
  39076. // "minimum": "0",
  39077. // "type": "integer"
  39078. // },
  39079. // "orderBy": {
  39080. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  39081. // "location": "query",
  39082. // "type": "string"
  39083. // },
  39084. // "pageToken": {
  39085. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  39086. // "location": "query",
  39087. // "type": "string"
  39088. // },
  39089. // "project": {
  39090. // "description": "Project ID for this request.",
  39091. // "location": "path",
  39092. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39093. // "required": true,
  39094. // "type": "string"
  39095. // }
  39096. // },
  39097. // "path": "{project}/global/operations",
  39098. // "response": {
  39099. // "$ref": "OperationList"
  39100. // },
  39101. // "scopes": [
  39102. // "https://www.googleapis.com/auth/cloud-platform",
  39103. // "https://www.googleapis.com/auth/compute",
  39104. // "https://www.googleapis.com/auth/compute.readonly"
  39105. // ]
  39106. // }
  39107. }
  39108. // Pages invokes f for each page of results.
  39109. // A non-nil error returned from f will halt the iteration.
  39110. // The provided context supersedes any context provided to the Context method.
  39111. func (c *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  39112. c.ctx_ = ctx
  39113. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39114. for {
  39115. x, err := c.Do()
  39116. if err != nil {
  39117. return err
  39118. }
  39119. if err := f(x); err != nil {
  39120. return err
  39121. }
  39122. if x.NextPageToken == "" {
  39123. return nil
  39124. }
  39125. c.PageToken(x.NextPageToken)
  39126. }
  39127. }
  39128. // method id "compute.healthChecks.delete":
  39129. type HealthChecksDeleteCall struct {
  39130. s *Service
  39131. project string
  39132. healthCheck string
  39133. urlParams_ gensupport.URLParams
  39134. ctx_ context.Context
  39135. header_ http.Header
  39136. }
  39137. // Delete: Deletes the specified HealthCheck resource.
  39138. func (r *HealthChecksService) Delete(project string, healthCheck string) *HealthChecksDeleteCall {
  39139. c := &HealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39140. c.project = project
  39141. c.healthCheck = healthCheck
  39142. return c
  39143. }
  39144. // RequestId sets the optional parameter "requestId": An optional
  39145. // request ID to identify requests. Specify a unique request ID so that
  39146. // if you must retry your request, the server will know to ignore the
  39147. // request if it has already been completed.
  39148. //
  39149. // For example, consider a situation where you make an initial request
  39150. // and the request times out. If you make the request again with the
  39151. // same request ID, the server can check if original operation with the
  39152. // same request ID was received, and if so, will ignore the second
  39153. // request. This prevents clients from accidentally creating duplicate
  39154. // commitments.
  39155. //
  39156. // The request ID must be a valid UUID with the exception that zero UUID
  39157. // is not supported (00000000-0000-0000-0000-000000000000).
  39158. func (c *HealthChecksDeleteCall) RequestId(requestId string) *HealthChecksDeleteCall {
  39159. c.urlParams_.Set("requestId", requestId)
  39160. return c
  39161. }
  39162. // Fields allows partial responses to be retrieved. See
  39163. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39164. // for more information.
  39165. func (c *HealthChecksDeleteCall) Fields(s ...googleapi.Field) *HealthChecksDeleteCall {
  39166. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39167. return c
  39168. }
  39169. // Context sets the context to be used in this call's Do method. Any
  39170. // pending HTTP request will be aborted if the provided context is
  39171. // canceled.
  39172. func (c *HealthChecksDeleteCall) Context(ctx context.Context) *HealthChecksDeleteCall {
  39173. c.ctx_ = ctx
  39174. return c
  39175. }
  39176. // Header returns an http.Header that can be modified by the caller to
  39177. // add HTTP headers to the request.
  39178. func (c *HealthChecksDeleteCall) Header() http.Header {
  39179. if c.header_ == nil {
  39180. c.header_ = make(http.Header)
  39181. }
  39182. return c.header_
  39183. }
  39184. func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  39185. reqHeaders := make(http.Header)
  39186. for k, v := range c.header_ {
  39187. reqHeaders[k] = v
  39188. }
  39189. reqHeaders.Set("User-Agent", c.s.userAgent())
  39190. var body io.Reader = nil
  39191. c.urlParams_.Set("alt", alt)
  39192. c.urlParams_.Set("prettyPrint", "false")
  39193. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  39194. urls += "?" + c.urlParams_.Encode()
  39195. req, err := http.NewRequest("DELETE", urls, body)
  39196. if err != nil {
  39197. return nil, err
  39198. }
  39199. req.Header = reqHeaders
  39200. googleapi.Expand(req.URL, map[string]string{
  39201. "project": c.project,
  39202. "healthCheck": c.healthCheck,
  39203. })
  39204. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39205. }
  39206. // Do executes the "compute.healthChecks.delete" call.
  39207. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39208. // status code is an error. Response headers are in either
  39209. // *Operation.ServerResponse.Header or (if a response was returned at
  39210. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39211. // to check whether the returned error was because
  39212. // http.StatusNotModified was returned.
  39213. func (c *HealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39214. gensupport.SetOptions(c.urlParams_, opts...)
  39215. res, err := c.doRequest("json")
  39216. if res != nil && res.StatusCode == http.StatusNotModified {
  39217. if res.Body != nil {
  39218. res.Body.Close()
  39219. }
  39220. return nil, &googleapi.Error{
  39221. Code: res.StatusCode,
  39222. Header: res.Header,
  39223. }
  39224. }
  39225. if err != nil {
  39226. return nil, err
  39227. }
  39228. defer googleapi.CloseBody(res)
  39229. if err := googleapi.CheckResponse(res); err != nil {
  39230. return nil, err
  39231. }
  39232. ret := &Operation{
  39233. ServerResponse: googleapi.ServerResponse{
  39234. Header: res.Header,
  39235. HTTPStatusCode: res.StatusCode,
  39236. },
  39237. }
  39238. target := &ret
  39239. if err := gensupport.DecodeResponse(target, res); err != nil {
  39240. return nil, err
  39241. }
  39242. return ret, nil
  39243. // {
  39244. // "description": "Deletes the specified HealthCheck resource.",
  39245. // "httpMethod": "DELETE",
  39246. // "id": "compute.healthChecks.delete",
  39247. // "parameterOrder": [
  39248. // "project",
  39249. // "healthCheck"
  39250. // ],
  39251. // "parameters": {
  39252. // "healthCheck": {
  39253. // "description": "Name of the HealthCheck resource to delete.",
  39254. // "location": "path",
  39255. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39256. // "required": true,
  39257. // "type": "string"
  39258. // },
  39259. // "project": {
  39260. // "description": "Project ID for this request.",
  39261. // "location": "path",
  39262. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39263. // "required": true,
  39264. // "type": "string"
  39265. // },
  39266. // "requestId": {
  39267. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39268. // "location": "query",
  39269. // "type": "string"
  39270. // }
  39271. // },
  39272. // "path": "{project}/global/healthChecks/{healthCheck}",
  39273. // "response": {
  39274. // "$ref": "Operation"
  39275. // },
  39276. // "scopes": [
  39277. // "https://www.googleapis.com/auth/cloud-platform",
  39278. // "https://www.googleapis.com/auth/compute"
  39279. // ]
  39280. // }
  39281. }
  39282. // method id "compute.healthChecks.get":
  39283. type HealthChecksGetCall struct {
  39284. s *Service
  39285. project string
  39286. healthCheck string
  39287. urlParams_ gensupport.URLParams
  39288. ifNoneMatch_ string
  39289. ctx_ context.Context
  39290. header_ http.Header
  39291. }
  39292. // Get: Returns the specified HealthCheck resource. Gets a list of
  39293. // available health checks by making a list() request.
  39294. func (r *HealthChecksService) Get(project string, healthCheck string) *HealthChecksGetCall {
  39295. c := &HealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39296. c.project = project
  39297. c.healthCheck = healthCheck
  39298. return c
  39299. }
  39300. // Fields allows partial responses to be retrieved. See
  39301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39302. // for more information.
  39303. func (c *HealthChecksGetCall) Fields(s ...googleapi.Field) *HealthChecksGetCall {
  39304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39305. return c
  39306. }
  39307. // IfNoneMatch sets the optional parameter which makes the operation
  39308. // fail if the object's ETag matches the given value. This is useful for
  39309. // getting updates only after the object has changed since the last
  39310. // request. Use googleapi.IsNotModified to check whether the response
  39311. // error from Do is the result of In-None-Match.
  39312. func (c *HealthChecksGetCall) IfNoneMatch(entityTag string) *HealthChecksGetCall {
  39313. c.ifNoneMatch_ = entityTag
  39314. return c
  39315. }
  39316. // Context sets the context to be used in this call's Do method. Any
  39317. // pending HTTP request will be aborted if the provided context is
  39318. // canceled.
  39319. func (c *HealthChecksGetCall) Context(ctx context.Context) *HealthChecksGetCall {
  39320. c.ctx_ = ctx
  39321. return c
  39322. }
  39323. // Header returns an http.Header that can be modified by the caller to
  39324. // add HTTP headers to the request.
  39325. func (c *HealthChecksGetCall) Header() http.Header {
  39326. if c.header_ == nil {
  39327. c.header_ = make(http.Header)
  39328. }
  39329. return c.header_
  39330. }
  39331. func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  39332. reqHeaders := make(http.Header)
  39333. for k, v := range c.header_ {
  39334. reqHeaders[k] = v
  39335. }
  39336. reqHeaders.Set("User-Agent", c.s.userAgent())
  39337. if c.ifNoneMatch_ != "" {
  39338. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39339. }
  39340. var body io.Reader = nil
  39341. c.urlParams_.Set("alt", alt)
  39342. c.urlParams_.Set("prettyPrint", "false")
  39343. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  39344. urls += "?" + c.urlParams_.Encode()
  39345. req, err := http.NewRequest("GET", urls, body)
  39346. if err != nil {
  39347. return nil, err
  39348. }
  39349. req.Header = reqHeaders
  39350. googleapi.Expand(req.URL, map[string]string{
  39351. "project": c.project,
  39352. "healthCheck": c.healthCheck,
  39353. })
  39354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39355. }
  39356. // Do executes the "compute.healthChecks.get" call.
  39357. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  39358. // status code is an error. Response headers are in either
  39359. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  39360. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39361. // to check whether the returned error was because
  39362. // http.StatusNotModified was returned.
  39363. func (c *HealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  39364. gensupport.SetOptions(c.urlParams_, opts...)
  39365. res, err := c.doRequest("json")
  39366. if res != nil && res.StatusCode == http.StatusNotModified {
  39367. if res.Body != nil {
  39368. res.Body.Close()
  39369. }
  39370. return nil, &googleapi.Error{
  39371. Code: res.StatusCode,
  39372. Header: res.Header,
  39373. }
  39374. }
  39375. if err != nil {
  39376. return nil, err
  39377. }
  39378. defer googleapi.CloseBody(res)
  39379. if err := googleapi.CheckResponse(res); err != nil {
  39380. return nil, err
  39381. }
  39382. ret := &HealthCheck{
  39383. ServerResponse: googleapi.ServerResponse{
  39384. Header: res.Header,
  39385. HTTPStatusCode: res.StatusCode,
  39386. },
  39387. }
  39388. target := &ret
  39389. if err := gensupport.DecodeResponse(target, res); err != nil {
  39390. return nil, err
  39391. }
  39392. return ret, nil
  39393. // {
  39394. // "description": "Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.",
  39395. // "httpMethod": "GET",
  39396. // "id": "compute.healthChecks.get",
  39397. // "parameterOrder": [
  39398. // "project",
  39399. // "healthCheck"
  39400. // ],
  39401. // "parameters": {
  39402. // "healthCheck": {
  39403. // "description": "Name of the HealthCheck resource to return.",
  39404. // "location": "path",
  39405. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39406. // "required": true,
  39407. // "type": "string"
  39408. // },
  39409. // "project": {
  39410. // "description": "Project ID for this request.",
  39411. // "location": "path",
  39412. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39413. // "required": true,
  39414. // "type": "string"
  39415. // }
  39416. // },
  39417. // "path": "{project}/global/healthChecks/{healthCheck}",
  39418. // "response": {
  39419. // "$ref": "HealthCheck"
  39420. // },
  39421. // "scopes": [
  39422. // "https://www.googleapis.com/auth/cloud-platform",
  39423. // "https://www.googleapis.com/auth/compute",
  39424. // "https://www.googleapis.com/auth/compute.readonly"
  39425. // ]
  39426. // }
  39427. }
  39428. // method id "compute.healthChecks.insert":
  39429. type HealthChecksInsertCall struct {
  39430. s *Service
  39431. project string
  39432. healthcheck *HealthCheck
  39433. urlParams_ gensupport.URLParams
  39434. ctx_ context.Context
  39435. header_ http.Header
  39436. }
  39437. // Insert: Creates a HealthCheck resource in the specified project using
  39438. // the data included in the request.
  39439. func (r *HealthChecksService) Insert(project string, healthcheck *HealthCheck) *HealthChecksInsertCall {
  39440. c := &HealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39441. c.project = project
  39442. c.healthcheck = healthcheck
  39443. return c
  39444. }
  39445. // RequestId sets the optional parameter "requestId": An optional
  39446. // request ID to identify requests. Specify a unique request ID so that
  39447. // if you must retry your request, the server will know to ignore the
  39448. // request if it has already been completed.
  39449. //
  39450. // For example, consider a situation where you make an initial request
  39451. // and the request times out. If you make the request again with the
  39452. // same request ID, the server can check if original operation with the
  39453. // same request ID was received, and if so, will ignore the second
  39454. // request. This prevents clients from accidentally creating duplicate
  39455. // commitments.
  39456. //
  39457. // The request ID must be a valid UUID with the exception that zero UUID
  39458. // is not supported (00000000-0000-0000-0000-000000000000).
  39459. func (c *HealthChecksInsertCall) RequestId(requestId string) *HealthChecksInsertCall {
  39460. c.urlParams_.Set("requestId", requestId)
  39461. return c
  39462. }
  39463. // Fields allows partial responses to be retrieved. See
  39464. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39465. // for more information.
  39466. func (c *HealthChecksInsertCall) Fields(s ...googleapi.Field) *HealthChecksInsertCall {
  39467. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39468. return c
  39469. }
  39470. // Context sets the context to be used in this call's Do method. Any
  39471. // pending HTTP request will be aborted if the provided context is
  39472. // canceled.
  39473. func (c *HealthChecksInsertCall) Context(ctx context.Context) *HealthChecksInsertCall {
  39474. c.ctx_ = ctx
  39475. return c
  39476. }
  39477. // Header returns an http.Header that can be modified by the caller to
  39478. // add HTTP headers to the request.
  39479. func (c *HealthChecksInsertCall) Header() http.Header {
  39480. if c.header_ == nil {
  39481. c.header_ = make(http.Header)
  39482. }
  39483. return c.header_
  39484. }
  39485. func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  39486. reqHeaders := make(http.Header)
  39487. for k, v := range c.header_ {
  39488. reqHeaders[k] = v
  39489. }
  39490. reqHeaders.Set("User-Agent", c.s.userAgent())
  39491. var body io.Reader = nil
  39492. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  39493. if err != nil {
  39494. return nil, err
  39495. }
  39496. reqHeaders.Set("Content-Type", "application/json")
  39497. c.urlParams_.Set("alt", alt)
  39498. c.urlParams_.Set("prettyPrint", "false")
  39499. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  39500. urls += "?" + c.urlParams_.Encode()
  39501. req, err := http.NewRequest("POST", urls, body)
  39502. if err != nil {
  39503. return nil, err
  39504. }
  39505. req.Header = reqHeaders
  39506. googleapi.Expand(req.URL, map[string]string{
  39507. "project": c.project,
  39508. })
  39509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39510. }
  39511. // Do executes the "compute.healthChecks.insert" call.
  39512. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39513. // status code is an error. Response headers are in either
  39514. // *Operation.ServerResponse.Header or (if a response was returned at
  39515. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39516. // to check whether the returned error was because
  39517. // http.StatusNotModified was returned.
  39518. func (c *HealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39519. gensupport.SetOptions(c.urlParams_, opts...)
  39520. res, err := c.doRequest("json")
  39521. if res != nil && res.StatusCode == http.StatusNotModified {
  39522. if res.Body != nil {
  39523. res.Body.Close()
  39524. }
  39525. return nil, &googleapi.Error{
  39526. Code: res.StatusCode,
  39527. Header: res.Header,
  39528. }
  39529. }
  39530. if err != nil {
  39531. return nil, err
  39532. }
  39533. defer googleapi.CloseBody(res)
  39534. if err := googleapi.CheckResponse(res); err != nil {
  39535. return nil, err
  39536. }
  39537. ret := &Operation{
  39538. ServerResponse: googleapi.ServerResponse{
  39539. Header: res.Header,
  39540. HTTPStatusCode: res.StatusCode,
  39541. },
  39542. }
  39543. target := &ret
  39544. if err := gensupport.DecodeResponse(target, res); err != nil {
  39545. return nil, err
  39546. }
  39547. return ret, nil
  39548. // {
  39549. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  39550. // "httpMethod": "POST",
  39551. // "id": "compute.healthChecks.insert",
  39552. // "parameterOrder": [
  39553. // "project"
  39554. // ],
  39555. // "parameters": {
  39556. // "project": {
  39557. // "description": "Project ID for this request.",
  39558. // "location": "path",
  39559. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39560. // "required": true,
  39561. // "type": "string"
  39562. // },
  39563. // "requestId": {
  39564. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39565. // "location": "query",
  39566. // "type": "string"
  39567. // }
  39568. // },
  39569. // "path": "{project}/global/healthChecks",
  39570. // "request": {
  39571. // "$ref": "HealthCheck"
  39572. // },
  39573. // "response": {
  39574. // "$ref": "Operation"
  39575. // },
  39576. // "scopes": [
  39577. // "https://www.googleapis.com/auth/cloud-platform",
  39578. // "https://www.googleapis.com/auth/compute"
  39579. // ]
  39580. // }
  39581. }
  39582. // method id "compute.healthChecks.list":
  39583. type HealthChecksListCall struct {
  39584. s *Service
  39585. project string
  39586. urlParams_ gensupport.URLParams
  39587. ifNoneMatch_ string
  39588. ctx_ context.Context
  39589. header_ http.Header
  39590. }
  39591. // List: Retrieves the list of HealthCheck resources available to the
  39592. // specified project.
  39593. func (r *HealthChecksService) List(project string) *HealthChecksListCall {
  39594. c := &HealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39595. c.project = project
  39596. return c
  39597. }
  39598. // Filter sets the optional parameter "filter": A filter expression that
  39599. // filters resources listed in the response. The expression must specify
  39600. // the field name, a comparison operator, and the value that you want to
  39601. // use for filtering. The value must be a string, a number, or a
  39602. // boolean. The comparison operator must be either =, !=, >, or <.
  39603. //
  39604. // For example, if you are filtering Compute Engine instances, you can
  39605. // exclude instances named example-instance by specifying name !=
  39606. // example-instance.
  39607. //
  39608. // You can also filter nested fields. For example, you could specify
  39609. // scheduling.automaticRestart = false to include instances only if they
  39610. // are not scheduled for automatic restarts. You can use filtering on
  39611. // nested fields to filter based on resource labels.
  39612. //
  39613. // To filter on multiple expressions, provide each separate expression
  39614. // within parentheses. For example, (scheduling.automaticRestart = true)
  39615. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  39616. // AND expression. However, you can include AND and OR expressions
  39617. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  39618. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  39619. // true).
  39620. func (c *HealthChecksListCall) Filter(filter string) *HealthChecksListCall {
  39621. c.urlParams_.Set("filter", filter)
  39622. return c
  39623. }
  39624. // MaxResults sets the optional parameter "maxResults": The maximum
  39625. // number of results per page that should be returned. If the number of
  39626. // available results is larger than maxResults, Compute Engine returns a
  39627. // nextPageToken that can be used to get the next page of results in
  39628. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  39629. // (Default: 500)
  39630. func (c *HealthChecksListCall) MaxResults(maxResults int64) *HealthChecksListCall {
  39631. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39632. return c
  39633. }
  39634. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  39635. // a certain order. By default, results are returned in alphanumerical
  39636. // order based on the resource name.
  39637. //
  39638. // You can also sort results in descending order based on the creation
  39639. // timestamp using orderBy="creationTimestamp desc". This sorts results
  39640. // based on the creationTimestamp field in reverse chronological order
  39641. // (newest result first). Use this to sort resources like operations so
  39642. // that the newest operation is returned first.
  39643. //
  39644. // Currently, only sorting by name or creationTimestamp desc is
  39645. // supported.
  39646. func (c *HealthChecksListCall) OrderBy(orderBy string) *HealthChecksListCall {
  39647. c.urlParams_.Set("orderBy", orderBy)
  39648. return c
  39649. }
  39650. // PageToken sets the optional parameter "pageToken": Specifies a page
  39651. // token to use. Set pageToken to the nextPageToken returned by a
  39652. // previous list request to get the next page of results.
  39653. func (c *HealthChecksListCall) PageToken(pageToken string) *HealthChecksListCall {
  39654. c.urlParams_.Set("pageToken", pageToken)
  39655. return c
  39656. }
  39657. // Fields allows partial responses to be retrieved. See
  39658. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39659. // for more information.
  39660. func (c *HealthChecksListCall) Fields(s ...googleapi.Field) *HealthChecksListCall {
  39661. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39662. return c
  39663. }
  39664. // IfNoneMatch sets the optional parameter which makes the operation
  39665. // fail if the object's ETag matches the given value. This is useful for
  39666. // getting updates only after the object has changed since the last
  39667. // request. Use googleapi.IsNotModified to check whether the response
  39668. // error from Do is the result of In-None-Match.
  39669. func (c *HealthChecksListCall) IfNoneMatch(entityTag string) *HealthChecksListCall {
  39670. c.ifNoneMatch_ = entityTag
  39671. return c
  39672. }
  39673. // Context sets the context to be used in this call's Do method. Any
  39674. // pending HTTP request will be aborted if the provided context is
  39675. // canceled.
  39676. func (c *HealthChecksListCall) Context(ctx context.Context) *HealthChecksListCall {
  39677. c.ctx_ = ctx
  39678. return c
  39679. }
  39680. // Header returns an http.Header that can be modified by the caller to
  39681. // add HTTP headers to the request.
  39682. func (c *HealthChecksListCall) Header() http.Header {
  39683. if c.header_ == nil {
  39684. c.header_ = make(http.Header)
  39685. }
  39686. return c.header_
  39687. }
  39688. func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  39689. reqHeaders := make(http.Header)
  39690. for k, v := range c.header_ {
  39691. reqHeaders[k] = v
  39692. }
  39693. reqHeaders.Set("User-Agent", c.s.userAgent())
  39694. if c.ifNoneMatch_ != "" {
  39695. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39696. }
  39697. var body io.Reader = nil
  39698. c.urlParams_.Set("alt", alt)
  39699. c.urlParams_.Set("prettyPrint", "false")
  39700. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  39701. urls += "?" + c.urlParams_.Encode()
  39702. req, err := http.NewRequest("GET", urls, body)
  39703. if err != nil {
  39704. return nil, err
  39705. }
  39706. req.Header = reqHeaders
  39707. googleapi.Expand(req.URL, map[string]string{
  39708. "project": c.project,
  39709. })
  39710. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39711. }
  39712. // Do executes the "compute.healthChecks.list" call.
  39713. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  39714. // status code is an error. Response headers are in either
  39715. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  39716. // at all) in error.(*googleapi.Error).Header. Use
  39717. // googleapi.IsNotModified to check whether the returned error was
  39718. // because http.StatusNotModified was returned.
  39719. func (c *HealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) {
  39720. gensupport.SetOptions(c.urlParams_, opts...)
  39721. res, err := c.doRequest("json")
  39722. if res != nil && res.StatusCode == http.StatusNotModified {
  39723. if res.Body != nil {
  39724. res.Body.Close()
  39725. }
  39726. return nil, &googleapi.Error{
  39727. Code: res.StatusCode,
  39728. Header: res.Header,
  39729. }
  39730. }
  39731. if err != nil {
  39732. return nil, err
  39733. }
  39734. defer googleapi.CloseBody(res)
  39735. if err := googleapi.CheckResponse(res); err != nil {
  39736. return nil, err
  39737. }
  39738. ret := &HealthCheckList{
  39739. ServerResponse: googleapi.ServerResponse{
  39740. Header: res.Header,
  39741. HTTPStatusCode: res.StatusCode,
  39742. },
  39743. }
  39744. target := &ret
  39745. if err := gensupport.DecodeResponse(target, res); err != nil {
  39746. return nil, err
  39747. }
  39748. return ret, nil
  39749. // {
  39750. // "description": "Retrieves the list of HealthCheck resources available to the specified project.",
  39751. // "httpMethod": "GET",
  39752. // "id": "compute.healthChecks.list",
  39753. // "parameterOrder": [
  39754. // "project"
  39755. // ],
  39756. // "parameters": {
  39757. // "filter": {
  39758. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  39759. // "location": "query",
  39760. // "type": "string"
  39761. // },
  39762. // "maxResults": {
  39763. // "default": "500",
  39764. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  39765. // "format": "uint32",
  39766. // "location": "query",
  39767. // "minimum": "0",
  39768. // "type": "integer"
  39769. // },
  39770. // "orderBy": {
  39771. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  39772. // "location": "query",
  39773. // "type": "string"
  39774. // },
  39775. // "pageToken": {
  39776. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  39777. // "location": "query",
  39778. // "type": "string"
  39779. // },
  39780. // "project": {
  39781. // "description": "Project ID for this request.",
  39782. // "location": "path",
  39783. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39784. // "required": true,
  39785. // "type": "string"
  39786. // }
  39787. // },
  39788. // "path": "{project}/global/healthChecks",
  39789. // "response": {
  39790. // "$ref": "HealthCheckList"
  39791. // },
  39792. // "scopes": [
  39793. // "https://www.googleapis.com/auth/cloud-platform",
  39794. // "https://www.googleapis.com/auth/compute",
  39795. // "https://www.googleapis.com/auth/compute.readonly"
  39796. // ]
  39797. // }
  39798. }
  39799. // Pages invokes f for each page of results.
  39800. // A non-nil error returned from f will halt the iteration.
  39801. // The provided context supersedes any context provided to the Context method.
  39802. func (c *HealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  39803. c.ctx_ = ctx
  39804. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39805. for {
  39806. x, err := c.Do()
  39807. if err != nil {
  39808. return err
  39809. }
  39810. if err := f(x); err != nil {
  39811. return err
  39812. }
  39813. if x.NextPageToken == "" {
  39814. return nil
  39815. }
  39816. c.PageToken(x.NextPageToken)
  39817. }
  39818. }
  39819. // method id "compute.healthChecks.patch":
  39820. type HealthChecksPatchCall struct {
  39821. s *Service
  39822. project string
  39823. healthCheck string
  39824. healthcheck *HealthCheck
  39825. urlParams_ gensupport.URLParams
  39826. ctx_ context.Context
  39827. header_ http.Header
  39828. }
  39829. // Patch: Updates a HealthCheck resource in the specified project using
  39830. // the data included in the request. This method supports PATCH
  39831. // semantics and uses the JSON merge patch format and processing rules.
  39832. func (r *HealthChecksService) Patch(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksPatchCall {
  39833. c := &HealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39834. c.project = project
  39835. c.healthCheck = healthCheck
  39836. c.healthcheck = healthcheck
  39837. return c
  39838. }
  39839. // RequestId sets the optional parameter "requestId": An optional
  39840. // request ID to identify requests. Specify a unique request ID so that
  39841. // if you must retry your request, the server will know to ignore the
  39842. // request if it has already been completed.
  39843. //
  39844. // For example, consider a situation where you make an initial request
  39845. // and the request times out. If you make the request again with the
  39846. // same request ID, the server can check if original operation with the
  39847. // same request ID was received, and if so, will ignore the second
  39848. // request. This prevents clients from accidentally creating duplicate
  39849. // commitments.
  39850. //
  39851. // The request ID must be a valid UUID with the exception that zero UUID
  39852. // is not supported (00000000-0000-0000-0000-000000000000).
  39853. func (c *HealthChecksPatchCall) RequestId(requestId string) *HealthChecksPatchCall {
  39854. c.urlParams_.Set("requestId", requestId)
  39855. return c
  39856. }
  39857. // Fields allows partial responses to be retrieved. See
  39858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39859. // for more information.
  39860. func (c *HealthChecksPatchCall) Fields(s ...googleapi.Field) *HealthChecksPatchCall {
  39861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39862. return c
  39863. }
  39864. // Context sets the context to be used in this call's Do method. Any
  39865. // pending HTTP request will be aborted if the provided context is
  39866. // canceled.
  39867. func (c *HealthChecksPatchCall) Context(ctx context.Context) *HealthChecksPatchCall {
  39868. c.ctx_ = ctx
  39869. return c
  39870. }
  39871. // Header returns an http.Header that can be modified by the caller to
  39872. // add HTTP headers to the request.
  39873. func (c *HealthChecksPatchCall) Header() http.Header {
  39874. if c.header_ == nil {
  39875. c.header_ = make(http.Header)
  39876. }
  39877. return c.header_
  39878. }
  39879. func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  39880. reqHeaders := make(http.Header)
  39881. for k, v := range c.header_ {
  39882. reqHeaders[k] = v
  39883. }
  39884. reqHeaders.Set("User-Agent", c.s.userAgent())
  39885. var body io.Reader = nil
  39886. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  39887. if err != nil {
  39888. return nil, err
  39889. }
  39890. reqHeaders.Set("Content-Type", "application/json")
  39891. c.urlParams_.Set("alt", alt)
  39892. c.urlParams_.Set("prettyPrint", "false")
  39893. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  39894. urls += "?" + c.urlParams_.Encode()
  39895. req, err := http.NewRequest("PATCH", urls, body)
  39896. if err != nil {
  39897. return nil, err
  39898. }
  39899. req.Header = reqHeaders
  39900. googleapi.Expand(req.URL, map[string]string{
  39901. "project": c.project,
  39902. "healthCheck": c.healthCheck,
  39903. })
  39904. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39905. }
  39906. // Do executes the "compute.healthChecks.patch" call.
  39907. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39908. // status code is an error. Response headers are in either
  39909. // *Operation.ServerResponse.Header or (if a response was returned at
  39910. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39911. // to check whether the returned error was because
  39912. // http.StatusNotModified was returned.
  39913. func (c *HealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39914. gensupport.SetOptions(c.urlParams_, opts...)
  39915. res, err := c.doRequest("json")
  39916. if res != nil && res.StatusCode == http.StatusNotModified {
  39917. if res.Body != nil {
  39918. res.Body.Close()
  39919. }
  39920. return nil, &googleapi.Error{
  39921. Code: res.StatusCode,
  39922. Header: res.Header,
  39923. }
  39924. }
  39925. if err != nil {
  39926. return nil, err
  39927. }
  39928. defer googleapi.CloseBody(res)
  39929. if err := googleapi.CheckResponse(res); err != nil {
  39930. return nil, err
  39931. }
  39932. ret := &Operation{
  39933. ServerResponse: googleapi.ServerResponse{
  39934. Header: res.Header,
  39935. HTTPStatusCode: res.StatusCode,
  39936. },
  39937. }
  39938. target := &ret
  39939. if err := gensupport.DecodeResponse(target, res); err != nil {
  39940. return nil, err
  39941. }
  39942. return ret, nil
  39943. // {
  39944. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  39945. // "httpMethod": "PATCH",
  39946. // "id": "compute.healthChecks.patch",
  39947. // "parameterOrder": [
  39948. // "project",
  39949. // "healthCheck"
  39950. // ],
  39951. // "parameters": {
  39952. // "healthCheck": {
  39953. // "description": "Name of the HealthCheck resource to patch.",
  39954. // "location": "path",
  39955. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39956. // "required": true,
  39957. // "type": "string"
  39958. // },
  39959. // "project": {
  39960. // "description": "Project ID for this request.",
  39961. // "location": "path",
  39962. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39963. // "required": true,
  39964. // "type": "string"
  39965. // },
  39966. // "requestId": {
  39967. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39968. // "location": "query",
  39969. // "type": "string"
  39970. // }
  39971. // },
  39972. // "path": "{project}/global/healthChecks/{healthCheck}",
  39973. // "request": {
  39974. // "$ref": "HealthCheck"
  39975. // },
  39976. // "response": {
  39977. // "$ref": "Operation"
  39978. // },
  39979. // "scopes": [
  39980. // "https://www.googleapis.com/auth/cloud-platform",
  39981. // "https://www.googleapis.com/auth/compute"
  39982. // ]
  39983. // }
  39984. }
  39985. // method id "compute.healthChecks.update":
  39986. type HealthChecksUpdateCall struct {
  39987. s *Service
  39988. project string
  39989. healthCheck string
  39990. healthcheck *HealthCheck
  39991. urlParams_ gensupport.URLParams
  39992. ctx_ context.Context
  39993. header_ http.Header
  39994. }
  39995. // Update: Updates a HealthCheck resource in the specified project using
  39996. // the data included in the request.
  39997. func (r *HealthChecksService) Update(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksUpdateCall {
  39998. c := &HealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39999. c.project = project
  40000. c.healthCheck = healthCheck
  40001. c.healthcheck = healthcheck
  40002. return c
  40003. }
  40004. // RequestId sets the optional parameter "requestId": An optional
  40005. // request ID to identify requests. Specify a unique request ID so that
  40006. // if you must retry your request, the server will know to ignore the
  40007. // request if it has already been completed.
  40008. //
  40009. // For example, consider a situation where you make an initial request
  40010. // and the request times out. If you make the request again with the
  40011. // same request ID, the server can check if original operation with the
  40012. // same request ID was received, and if so, will ignore the second
  40013. // request. This prevents clients from accidentally creating duplicate
  40014. // commitments.
  40015. //
  40016. // The request ID must be a valid UUID with the exception that zero UUID
  40017. // is not supported (00000000-0000-0000-0000-000000000000).
  40018. func (c *HealthChecksUpdateCall) RequestId(requestId string) *HealthChecksUpdateCall {
  40019. c.urlParams_.Set("requestId", requestId)
  40020. return c
  40021. }
  40022. // Fields allows partial responses to be retrieved. See
  40023. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40024. // for more information.
  40025. func (c *HealthChecksUpdateCall) Fields(s ...googleapi.Field) *HealthChecksUpdateCall {
  40026. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40027. return c
  40028. }
  40029. // Context sets the context to be used in this call's Do method. Any
  40030. // pending HTTP request will be aborted if the provided context is
  40031. // canceled.
  40032. func (c *HealthChecksUpdateCall) Context(ctx context.Context) *HealthChecksUpdateCall {
  40033. c.ctx_ = ctx
  40034. return c
  40035. }
  40036. // Header returns an http.Header that can be modified by the caller to
  40037. // add HTTP headers to the request.
  40038. func (c *HealthChecksUpdateCall) Header() http.Header {
  40039. if c.header_ == nil {
  40040. c.header_ = make(http.Header)
  40041. }
  40042. return c.header_
  40043. }
  40044. func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  40045. reqHeaders := make(http.Header)
  40046. for k, v := range c.header_ {
  40047. reqHeaders[k] = v
  40048. }
  40049. reqHeaders.Set("User-Agent", c.s.userAgent())
  40050. var body io.Reader = nil
  40051. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  40052. if err != nil {
  40053. return nil, err
  40054. }
  40055. reqHeaders.Set("Content-Type", "application/json")
  40056. c.urlParams_.Set("alt", alt)
  40057. c.urlParams_.Set("prettyPrint", "false")
  40058. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  40059. urls += "?" + c.urlParams_.Encode()
  40060. req, err := http.NewRequest("PUT", urls, body)
  40061. if err != nil {
  40062. return nil, err
  40063. }
  40064. req.Header = reqHeaders
  40065. googleapi.Expand(req.URL, map[string]string{
  40066. "project": c.project,
  40067. "healthCheck": c.healthCheck,
  40068. })
  40069. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40070. }
  40071. // Do executes the "compute.healthChecks.update" call.
  40072. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40073. // status code is an error. Response headers are in either
  40074. // *Operation.ServerResponse.Header or (if a response was returned at
  40075. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40076. // to check whether the returned error was because
  40077. // http.StatusNotModified was returned.
  40078. func (c *HealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40079. gensupport.SetOptions(c.urlParams_, opts...)
  40080. res, err := c.doRequest("json")
  40081. if res != nil && res.StatusCode == http.StatusNotModified {
  40082. if res.Body != nil {
  40083. res.Body.Close()
  40084. }
  40085. return nil, &googleapi.Error{
  40086. Code: res.StatusCode,
  40087. Header: res.Header,
  40088. }
  40089. }
  40090. if err != nil {
  40091. return nil, err
  40092. }
  40093. defer googleapi.CloseBody(res)
  40094. if err := googleapi.CheckResponse(res); err != nil {
  40095. return nil, err
  40096. }
  40097. ret := &Operation{
  40098. ServerResponse: googleapi.ServerResponse{
  40099. Header: res.Header,
  40100. HTTPStatusCode: res.StatusCode,
  40101. },
  40102. }
  40103. target := &ret
  40104. if err := gensupport.DecodeResponse(target, res); err != nil {
  40105. return nil, err
  40106. }
  40107. return ret, nil
  40108. // {
  40109. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  40110. // "httpMethod": "PUT",
  40111. // "id": "compute.healthChecks.update",
  40112. // "parameterOrder": [
  40113. // "project",
  40114. // "healthCheck"
  40115. // ],
  40116. // "parameters": {
  40117. // "healthCheck": {
  40118. // "description": "Name of the HealthCheck resource to update.",
  40119. // "location": "path",
  40120. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40121. // "required": true,
  40122. // "type": "string"
  40123. // },
  40124. // "project": {
  40125. // "description": "Project ID for this request.",
  40126. // "location": "path",
  40127. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40128. // "required": true,
  40129. // "type": "string"
  40130. // },
  40131. // "requestId": {
  40132. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40133. // "location": "query",
  40134. // "type": "string"
  40135. // }
  40136. // },
  40137. // "path": "{project}/global/healthChecks/{healthCheck}",
  40138. // "request": {
  40139. // "$ref": "HealthCheck"
  40140. // },
  40141. // "response": {
  40142. // "$ref": "Operation"
  40143. // },
  40144. // "scopes": [
  40145. // "https://www.googleapis.com/auth/cloud-platform",
  40146. // "https://www.googleapis.com/auth/compute"
  40147. // ]
  40148. // }
  40149. }
  40150. // method id "compute.httpHealthChecks.delete":
  40151. type HttpHealthChecksDeleteCall struct {
  40152. s *Service
  40153. project string
  40154. httpHealthCheck string
  40155. urlParams_ gensupport.URLParams
  40156. ctx_ context.Context
  40157. header_ http.Header
  40158. }
  40159. // Delete: Deletes the specified HttpHealthCheck resource.
  40160. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete
  40161. func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
  40162. c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40163. c.project = project
  40164. c.httpHealthCheck = httpHealthCheck
  40165. return c
  40166. }
  40167. // RequestId sets the optional parameter "requestId": An optional
  40168. // request ID to identify requests. Specify a unique request ID so that
  40169. // if you must retry your request, the server will know to ignore the
  40170. // request if it has already been completed.
  40171. //
  40172. // For example, consider a situation where you make an initial request
  40173. // and the request times out. If you make the request again with the
  40174. // same request ID, the server can check if original operation with the
  40175. // same request ID was received, and if so, will ignore the second
  40176. // request. This prevents clients from accidentally creating duplicate
  40177. // commitments.
  40178. //
  40179. // The request ID must be a valid UUID with the exception that zero UUID
  40180. // is not supported (00000000-0000-0000-0000-000000000000).
  40181. func (c *HttpHealthChecksDeleteCall) RequestId(requestId string) *HttpHealthChecksDeleteCall {
  40182. c.urlParams_.Set("requestId", requestId)
  40183. return c
  40184. }
  40185. // Fields allows partial responses to be retrieved. See
  40186. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40187. // for more information.
  40188. func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
  40189. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40190. return c
  40191. }
  40192. // Context sets the context to be used in this call's Do method. Any
  40193. // pending HTTP request will be aborted if the provided context is
  40194. // canceled.
  40195. func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
  40196. c.ctx_ = ctx
  40197. return c
  40198. }
  40199. // Header returns an http.Header that can be modified by the caller to
  40200. // add HTTP headers to the request.
  40201. func (c *HttpHealthChecksDeleteCall) Header() http.Header {
  40202. if c.header_ == nil {
  40203. c.header_ = make(http.Header)
  40204. }
  40205. return c.header_
  40206. }
  40207. func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  40208. reqHeaders := make(http.Header)
  40209. for k, v := range c.header_ {
  40210. reqHeaders[k] = v
  40211. }
  40212. reqHeaders.Set("User-Agent", c.s.userAgent())
  40213. var body io.Reader = nil
  40214. c.urlParams_.Set("alt", alt)
  40215. c.urlParams_.Set("prettyPrint", "false")
  40216. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  40217. urls += "?" + c.urlParams_.Encode()
  40218. req, err := http.NewRequest("DELETE", urls, body)
  40219. if err != nil {
  40220. return nil, err
  40221. }
  40222. req.Header = reqHeaders
  40223. googleapi.Expand(req.URL, map[string]string{
  40224. "project": c.project,
  40225. "httpHealthCheck": c.httpHealthCheck,
  40226. })
  40227. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40228. }
  40229. // Do executes the "compute.httpHealthChecks.delete" call.
  40230. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40231. // status code is an error. Response headers are in either
  40232. // *Operation.ServerResponse.Header or (if a response was returned at
  40233. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40234. // to check whether the returned error was because
  40235. // http.StatusNotModified was returned.
  40236. func (c *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40237. gensupport.SetOptions(c.urlParams_, opts...)
  40238. res, err := c.doRequest("json")
  40239. if res != nil && res.StatusCode == http.StatusNotModified {
  40240. if res.Body != nil {
  40241. res.Body.Close()
  40242. }
  40243. return nil, &googleapi.Error{
  40244. Code: res.StatusCode,
  40245. Header: res.Header,
  40246. }
  40247. }
  40248. if err != nil {
  40249. return nil, err
  40250. }
  40251. defer googleapi.CloseBody(res)
  40252. if err := googleapi.CheckResponse(res); err != nil {
  40253. return nil, err
  40254. }
  40255. ret := &Operation{
  40256. ServerResponse: googleapi.ServerResponse{
  40257. Header: res.Header,
  40258. HTTPStatusCode: res.StatusCode,
  40259. },
  40260. }
  40261. target := &ret
  40262. if err := gensupport.DecodeResponse(target, res); err != nil {
  40263. return nil, err
  40264. }
  40265. return ret, nil
  40266. // {
  40267. // "description": "Deletes the specified HttpHealthCheck resource.",
  40268. // "httpMethod": "DELETE",
  40269. // "id": "compute.httpHealthChecks.delete",
  40270. // "parameterOrder": [
  40271. // "project",
  40272. // "httpHealthCheck"
  40273. // ],
  40274. // "parameters": {
  40275. // "httpHealthCheck": {
  40276. // "description": "Name of the HttpHealthCheck resource to delete.",
  40277. // "location": "path",
  40278. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40279. // "required": true,
  40280. // "type": "string"
  40281. // },
  40282. // "project": {
  40283. // "description": "Project ID for this request.",
  40284. // "location": "path",
  40285. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40286. // "required": true,
  40287. // "type": "string"
  40288. // },
  40289. // "requestId": {
  40290. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40291. // "location": "query",
  40292. // "type": "string"
  40293. // }
  40294. // },
  40295. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  40296. // "response": {
  40297. // "$ref": "Operation"
  40298. // },
  40299. // "scopes": [
  40300. // "https://www.googleapis.com/auth/cloud-platform",
  40301. // "https://www.googleapis.com/auth/compute"
  40302. // ]
  40303. // }
  40304. }
  40305. // method id "compute.httpHealthChecks.get":
  40306. type HttpHealthChecksGetCall struct {
  40307. s *Service
  40308. project string
  40309. httpHealthCheck string
  40310. urlParams_ gensupport.URLParams
  40311. ifNoneMatch_ string
  40312. ctx_ context.Context
  40313. header_ http.Header
  40314. }
  40315. // Get: Returns the specified HttpHealthCheck resource. Gets a list of
  40316. // available HTTP health checks by making a list() request.
  40317. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get
  40318. func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
  40319. c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40320. c.project = project
  40321. c.httpHealthCheck = httpHealthCheck
  40322. return c
  40323. }
  40324. // Fields allows partial responses to be retrieved. See
  40325. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40326. // for more information.
  40327. func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
  40328. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40329. return c
  40330. }
  40331. // IfNoneMatch sets the optional parameter which makes the operation
  40332. // fail if the object's ETag matches the given value. This is useful for
  40333. // getting updates only after the object has changed since the last
  40334. // request. Use googleapi.IsNotModified to check whether the response
  40335. // error from Do is the result of In-None-Match.
  40336. func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
  40337. c.ifNoneMatch_ = entityTag
  40338. return c
  40339. }
  40340. // Context sets the context to be used in this call's Do method. Any
  40341. // pending HTTP request will be aborted if the provided context is
  40342. // canceled.
  40343. func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
  40344. c.ctx_ = ctx
  40345. return c
  40346. }
  40347. // Header returns an http.Header that can be modified by the caller to
  40348. // add HTTP headers to the request.
  40349. func (c *HttpHealthChecksGetCall) Header() http.Header {
  40350. if c.header_ == nil {
  40351. c.header_ = make(http.Header)
  40352. }
  40353. return c.header_
  40354. }
  40355. func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  40356. reqHeaders := make(http.Header)
  40357. for k, v := range c.header_ {
  40358. reqHeaders[k] = v
  40359. }
  40360. reqHeaders.Set("User-Agent", c.s.userAgent())
  40361. if c.ifNoneMatch_ != "" {
  40362. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40363. }
  40364. var body io.Reader = nil
  40365. c.urlParams_.Set("alt", alt)
  40366. c.urlParams_.Set("prettyPrint", "false")
  40367. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  40368. urls += "?" + c.urlParams_.Encode()
  40369. req, err := http.NewRequest("GET", urls, body)
  40370. if err != nil {
  40371. return nil, err
  40372. }
  40373. req.Header = reqHeaders
  40374. googleapi.Expand(req.URL, map[string]string{
  40375. "project": c.project,
  40376. "httpHealthCheck": c.httpHealthCheck,
  40377. })
  40378. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40379. }
  40380. // Do executes the "compute.httpHealthChecks.get" call.
  40381. // Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx
  40382. // status code is an error. Response headers are in either
  40383. // *HttpHealthCheck.ServerResponse.Header or (if a response was returned
  40384. // at all) in error.(*googleapi.Error).Header. Use
  40385. // googleapi.IsNotModified to check whether the returned error was
  40386. // because http.StatusNotModified was returned.
  40387. func (c *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, error) {
  40388. gensupport.SetOptions(c.urlParams_, opts...)
  40389. res, err := c.doRequest("json")
  40390. if res != nil && res.StatusCode == http.StatusNotModified {
  40391. if res.Body != nil {
  40392. res.Body.Close()
  40393. }
  40394. return nil, &googleapi.Error{
  40395. Code: res.StatusCode,
  40396. Header: res.Header,
  40397. }
  40398. }
  40399. if err != nil {
  40400. return nil, err
  40401. }
  40402. defer googleapi.CloseBody(res)
  40403. if err := googleapi.CheckResponse(res); err != nil {
  40404. return nil, err
  40405. }
  40406. ret := &HttpHealthCheck{
  40407. ServerResponse: googleapi.ServerResponse{
  40408. Header: res.Header,
  40409. HTTPStatusCode: res.StatusCode,
  40410. },
  40411. }
  40412. target := &ret
  40413. if err := gensupport.DecodeResponse(target, res); err != nil {
  40414. return nil, err
  40415. }
  40416. return ret, nil
  40417. // {
  40418. // "description": "Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request.",
  40419. // "httpMethod": "GET",
  40420. // "id": "compute.httpHealthChecks.get",
  40421. // "parameterOrder": [
  40422. // "project",
  40423. // "httpHealthCheck"
  40424. // ],
  40425. // "parameters": {
  40426. // "httpHealthCheck": {
  40427. // "description": "Name of the HttpHealthCheck resource to return.",
  40428. // "location": "path",
  40429. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40430. // "required": true,
  40431. // "type": "string"
  40432. // },
  40433. // "project": {
  40434. // "description": "Project ID for this request.",
  40435. // "location": "path",
  40436. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40437. // "required": true,
  40438. // "type": "string"
  40439. // }
  40440. // },
  40441. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  40442. // "response": {
  40443. // "$ref": "HttpHealthCheck"
  40444. // },
  40445. // "scopes": [
  40446. // "https://www.googleapis.com/auth/cloud-platform",
  40447. // "https://www.googleapis.com/auth/compute",
  40448. // "https://www.googleapis.com/auth/compute.readonly"
  40449. // ]
  40450. // }
  40451. }
  40452. // method id "compute.httpHealthChecks.insert":
  40453. type HttpHealthChecksInsertCall struct {
  40454. s *Service
  40455. project string
  40456. httphealthcheck *HttpHealthCheck
  40457. urlParams_ gensupport.URLParams
  40458. ctx_ context.Context
  40459. header_ http.Header
  40460. }
  40461. // Insert: Creates a HttpHealthCheck resource in the specified project
  40462. // using the data included in the request.
  40463. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert
  40464. func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
  40465. c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40466. c.project = project
  40467. c.httphealthcheck = httphealthcheck
  40468. return c
  40469. }
  40470. // RequestId sets the optional parameter "requestId": An optional
  40471. // request ID to identify requests. Specify a unique request ID so that
  40472. // if you must retry your request, the server will know to ignore the
  40473. // request if it has already been completed.
  40474. //
  40475. // For example, consider a situation where you make an initial request
  40476. // and the request times out. If you make the request again with the
  40477. // same request ID, the server can check if original operation with the
  40478. // same request ID was received, and if so, will ignore the second
  40479. // request. This prevents clients from accidentally creating duplicate
  40480. // commitments.
  40481. //
  40482. // The request ID must be a valid UUID with the exception that zero UUID
  40483. // is not supported (00000000-0000-0000-0000-000000000000).
  40484. func (c *HttpHealthChecksInsertCall) RequestId(requestId string) *HttpHealthChecksInsertCall {
  40485. c.urlParams_.Set("requestId", requestId)
  40486. return c
  40487. }
  40488. // Fields allows partial responses to be retrieved. See
  40489. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40490. // for more information.
  40491. func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
  40492. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40493. return c
  40494. }
  40495. // Context sets the context to be used in this call's Do method. Any
  40496. // pending HTTP request will be aborted if the provided context is
  40497. // canceled.
  40498. func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
  40499. c.ctx_ = ctx
  40500. return c
  40501. }
  40502. // Header returns an http.Header that can be modified by the caller to
  40503. // add HTTP headers to the request.
  40504. func (c *HttpHealthChecksInsertCall) Header() http.Header {
  40505. if c.header_ == nil {
  40506. c.header_ = make(http.Header)
  40507. }
  40508. return c.header_
  40509. }
  40510. func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  40511. reqHeaders := make(http.Header)
  40512. for k, v := range c.header_ {
  40513. reqHeaders[k] = v
  40514. }
  40515. reqHeaders.Set("User-Agent", c.s.userAgent())
  40516. var body io.Reader = nil
  40517. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  40518. if err != nil {
  40519. return nil, err
  40520. }
  40521. reqHeaders.Set("Content-Type", "application/json")
  40522. c.urlParams_.Set("alt", alt)
  40523. c.urlParams_.Set("prettyPrint", "false")
  40524. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  40525. urls += "?" + c.urlParams_.Encode()
  40526. req, err := http.NewRequest("POST", urls, body)
  40527. if err != nil {
  40528. return nil, err
  40529. }
  40530. req.Header = reqHeaders
  40531. googleapi.Expand(req.URL, map[string]string{
  40532. "project": c.project,
  40533. })
  40534. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40535. }
  40536. // Do executes the "compute.httpHealthChecks.insert" call.
  40537. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40538. // status code is an error. Response headers are in either
  40539. // *Operation.ServerResponse.Header or (if a response was returned at
  40540. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40541. // to check whether the returned error was because
  40542. // http.StatusNotModified was returned.
  40543. func (c *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40544. gensupport.SetOptions(c.urlParams_, opts...)
  40545. res, err := c.doRequest("json")
  40546. if res != nil && res.StatusCode == http.StatusNotModified {
  40547. if res.Body != nil {
  40548. res.Body.Close()
  40549. }
  40550. return nil, &googleapi.Error{
  40551. Code: res.StatusCode,
  40552. Header: res.Header,
  40553. }
  40554. }
  40555. if err != nil {
  40556. return nil, err
  40557. }
  40558. defer googleapi.CloseBody(res)
  40559. if err := googleapi.CheckResponse(res); err != nil {
  40560. return nil, err
  40561. }
  40562. ret := &Operation{
  40563. ServerResponse: googleapi.ServerResponse{
  40564. Header: res.Header,
  40565. HTTPStatusCode: res.StatusCode,
  40566. },
  40567. }
  40568. target := &ret
  40569. if err := gensupport.DecodeResponse(target, res); err != nil {
  40570. return nil, err
  40571. }
  40572. return ret, nil
  40573. // {
  40574. // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.",
  40575. // "httpMethod": "POST",
  40576. // "id": "compute.httpHealthChecks.insert",
  40577. // "parameterOrder": [
  40578. // "project"
  40579. // ],
  40580. // "parameters": {
  40581. // "project": {
  40582. // "description": "Project ID for this request.",
  40583. // "location": "path",
  40584. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40585. // "required": true,
  40586. // "type": "string"
  40587. // },
  40588. // "requestId": {
  40589. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40590. // "location": "query",
  40591. // "type": "string"
  40592. // }
  40593. // },
  40594. // "path": "{project}/global/httpHealthChecks",
  40595. // "request": {
  40596. // "$ref": "HttpHealthCheck"
  40597. // },
  40598. // "response": {
  40599. // "$ref": "Operation"
  40600. // },
  40601. // "scopes": [
  40602. // "https://www.googleapis.com/auth/cloud-platform",
  40603. // "https://www.googleapis.com/auth/compute"
  40604. // ]
  40605. // }
  40606. }
  40607. // method id "compute.httpHealthChecks.list":
  40608. type HttpHealthChecksListCall struct {
  40609. s *Service
  40610. project string
  40611. urlParams_ gensupport.URLParams
  40612. ifNoneMatch_ string
  40613. ctx_ context.Context
  40614. header_ http.Header
  40615. }
  40616. // List: Retrieves the list of HttpHealthCheck resources available to
  40617. // the specified project.
  40618. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list
  40619. func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
  40620. c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40621. c.project = project
  40622. return c
  40623. }
  40624. // Filter sets the optional parameter "filter": A filter expression that
  40625. // filters resources listed in the response. The expression must specify
  40626. // the field name, a comparison operator, and the value that you want to
  40627. // use for filtering. The value must be a string, a number, or a
  40628. // boolean. The comparison operator must be either =, !=, >, or <.
  40629. //
  40630. // For example, if you are filtering Compute Engine instances, you can
  40631. // exclude instances named example-instance by specifying name !=
  40632. // example-instance.
  40633. //
  40634. // You can also filter nested fields. For example, you could specify
  40635. // scheduling.automaticRestart = false to include instances only if they
  40636. // are not scheduled for automatic restarts. You can use filtering on
  40637. // nested fields to filter based on resource labels.
  40638. //
  40639. // To filter on multiple expressions, provide each separate expression
  40640. // within parentheses. For example, (scheduling.automaticRestart = true)
  40641. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  40642. // AND expression. However, you can include AND and OR expressions
  40643. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  40644. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  40645. // true).
  40646. func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
  40647. c.urlParams_.Set("filter", filter)
  40648. return c
  40649. }
  40650. // MaxResults sets the optional parameter "maxResults": The maximum
  40651. // number of results per page that should be returned. If the number of
  40652. // available results is larger than maxResults, Compute Engine returns a
  40653. // nextPageToken that can be used to get the next page of results in
  40654. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  40655. // (Default: 500)
  40656. func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
  40657. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40658. return c
  40659. }
  40660. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  40661. // a certain order. By default, results are returned in alphanumerical
  40662. // order based on the resource name.
  40663. //
  40664. // You can also sort results in descending order based on the creation
  40665. // timestamp using orderBy="creationTimestamp desc". This sorts results
  40666. // based on the creationTimestamp field in reverse chronological order
  40667. // (newest result first). Use this to sort resources like operations so
  40668. // that the newest operation is returned first.
  40669. //
  40670. // Currently, only sorting by name or creationTimestamp desc is
  40671. // supported.
  40672. func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall {
  40673. c.urlParams_.Set("orderBy", orderBy)
  40674. return c
  40675. }
  40676. // PageToken sets the optional parameter "pageToken": Specifies a page
  40677. // token to use. Set pageToken to the nextPageToken returned by a
  40678. // previous list request to get the next page of results.
  40679. func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
  40680. c.urlParams_.Set("pageToken", pageToken)
  40681. return c
  40682. }
  40683. // Fields allows partial responses to be retrieved. See
  40684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40685. // for more information.
  40686. func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
  40687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40688. return c
  40689. }
  40690. // IfNoneMatch sets the optional parameter which makes the operation
  40691. // fail if the object's ETag matches the given value. This is useful for
  40692. // getting updates only after the object has changed since the last
  40693. // request. Use googleapi.IsNotModified to check whether the response
  40694. // error from Do is the result of In-None-Match.
  40695. func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
  40696. c.ifNoneMatch_ = entityTag
  40697. return c
  40698. }
  40699. // Context sets the context to be used in this call's Do method. Any
  40700. // pending HTTP request will be aborted if the provided context is
  40701. // canceled.
  40702. func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
  40703. c.ctx_ = ctx
  40704. return c
  40705. }
  40706. // Header returns an http.Header that can be modified by the caller to
  40707. // add HTTP headers to the request.
  40708. func (c *HttpHealthChecksListCall) Header() http.Header {
  40709. if c.header_ == nil {
  40710. c.header_ = make(http.Header)
  40711. }
  40712. return c.header_
  40713. }
  40714. func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  40715. reqHeaders := make(http.Header)
  40716. for k, v := range c.header_ {
  40717. reqHeaders[k] = v
  40718. }
  40719. reqHeaders.Set("User-Agent", c.s.userAgent())
  40720. if c.ifNoneMatch_ != "" {
  40721. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40722. }
  40723. var body io.Reader = nil
  40724. c.urlParams_.Set("alt", alt)
  40725. c.urlParams_.Set("prettyPrint", "false")
  40726. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  40727. urls += "?" + c.urlParams_.Encode()
  40728. req, err := http.NewRequest("GET", urls, body)
  40729. if err != nil {
  40730. return nil, err
  40731. }
  40732. req.Header = reqHeaders
  40733. googleapi.Expand(req.URL, map[string]string{
  40734. "project": c.project,
  40735. })
  40736. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40737. }
  40738. // Do executes the "compute.httpHealthChecks.list" call.
  40739. // Exactly one of *HttpHealthCheckList or error will be non-nil. Any
  40740. // non-2xx status code is an error. Response headers are in either
  40741. // *HttpHealthCheckList.ServerResponse.Header or (if a response was
  40742. // returned at all) in error.(*googleapi.Error).Header. Use
  40743. // googleapi.IsNotModified to check whether the returned error was
  40744. // because http.StatusNotModified was returned.
  40745. func (c *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, error) {
  40746. gensupport.SetOptions(c.urlParams_, opts...)
  40747. res, err := c.doRequest("json")
  40748. if res != nil && res.StatusCode == http.StatusNotModified {
  40749. if res.Body != nil {
  40750. res.Body.Close()
  40751. }
  40752. return nil, &googleapi.Error{
  40753. Code: res.StatusCode,
  40754. Header: res.Header,
  40755. }
  40756. }
  40757. if err != nil {
  40758. return nil, err
  40759. }
  40760. defer googleapi.CloseBody(res)
  40761. if err := googleapi.CheckResponse(res); err != nil {
  40762. return nil, err
  40763. }
  40764. ret := &HttpHealthCheckList{
  40765. ServerResponse: googleapi.ServerResponse{
  40766. Header: res.Header,
  40767. HTTPStatusCode: res.StatusCode,
  40768. },
  40769. }
  40770. target := &ret
  40771. if err := gensupport.DecodeResponse(target, res); err != nil {
  40772. return nil, err
  40773. }
  40774. return ret, nil
  40775. // {
  40776. // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.",
  40777. // "httpMethod": "GET",
  40778. // "id": "compute.httpHealthChecks.list",
  40779. // "parameterOrder": [
  40780. // "project"
  40781. // ],
  40782. // "parameters": {
  40783. // "filter": {
  40784. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  40785. // "location": "query",
  40786. // "type": "string"
  40787. // },
  40788. // "maxResults": {
  40789. // "default": "500",
  40790. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  40791. // "format": "uint32",
  40792. // "location": "query",
  40793. // "minimum": "0",
  40794. // "type": "integer"
  40795. // },
  40796. // "orderBy": {
  40797. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  40798. // "location": "query",
  40799. // "type": "string"
  40800. // },
  40801. // "pageToken": {
  40802. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  40803. // "location": "query",
  40804. // "type": "string"
  40805. // },
  40806. // "project": {
  40807. // "description": "Project ID for this request.",
  40808. // "location": "path",
  40809. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40810. // "required": true,
  40811. // "type": "string"
  40812. // }
  40813. // },
  40814. // "path": "{project}/global/httpHealthChecks",
  40815. // "response": {
  40816. // "$ref": "HttpHealthCheckList"
  40817. // },
  40818. // "scopes": [
  40819. // "https://www.googleapis.com/auth/cloud-platform",
  40820. // "https://www.googleapis.com/auth/compute",
  40821. // "https://www.googleapis.com/auth/compute.readonly"
  40822. // ]
  40823. // }
  40824. }
  40825. // Pages invokes f for each page of results.
  40826. // A non-nil error returned from f will halt the iteration.
  40827. // The provided context supersedes any context provided to the Context method.
  40828. func (c *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error {
  40829. c.ctx_ = ctx
  40830. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40831. for {
  40832. x, err := c.Do()
  40833. if err != nil {
  40834. return err
  40835. }
  40836. if err := f(x); err != nil {
  40837. return err
  40838. }
  40839. if x.NextPageToken == "" {
  40840. return nil
  40841. }
  40842. c.PageToken(x.NextPageToken)
  40843. }
  40844. }
  40845. // method id "compute.httpHealthChecks.patch":
  40846. type HttpHealthChecksPatchCall struct {
  40847. s *Service
  40848. project string
  40849. httpHealthCheck string
  40850. httphealthcheck *HttpHealthCheck
  40851. urlParams_ gensupport.URLParams
  40852. ctx_ context.Context
  40853. header_ http.Header
  40854. }
  40855. // Patch: Updates a HttpHealthCheck resource in the specified project
  40856. // using the data included in the request. This method supports PATCH
  40857. // semantics and uses the JSON merge patch format and processing rules.
  40858. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch
  40859. func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
  40860. c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40861. c.project = project
  40862. c.httpHealthCheck = httpHealthCheck
  40863. c.httphealthcheck = httphealthcheck
  40864. return c
  40865. }
  40866. // RequestId sets the optional parameter "requestId": An optional
  40867. // request ID to identify requests. Specify a unique request ID so that
  40868. // if you must retry your request, the server will know to ignore the
  40869. // request if it has already been completed.
  40870. //
  40871. // For example, consider a situation where you make an initial request
  40872. // and the request times out. If you make the request again with the
  40873. // same request ID, the server can check if original operation with the
  40874. // same request ID was received, and if so, will ignore the second
  40875. // request. This prevents clients from accidentally creating duplicate
  40876. // commitments.
  40877. //
  40878. // The request ID must be a valid UUID with the exception that zero UUID
  40879. // is not supported (00000000-0000-0000-0000-000000000000).
  40880. func (c *HttpHealthChecksPatchCall) RequestId(requestId string) *HttpHealthChecksPatchCall {
  40881. c.urlParams_.Set("requestId", requestId)
  40882. return c
  40883. }
  40884. // Fields allows partial responses to be retrieved. See
  40885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40886. // for more information.
  40887. func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
  40888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40889. return c
  40890. }
  40891. // Context sets the context to be used in this call's Do method. Any
  40892. // pending HTTP request will be aborted if the provided context is
  40893. // canceled.
  40894. func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
  40895. c.ctx_ = ctx
  40896. return c
  40897. }
  40898. // Header returns an http.Header that can be modified by the caller to
  40899. // add HTTP headers to the request.
  40900. func (c *HttpHealthChecksPatchCall) Header() http.Header {
  40901. if c.header_ == nil {
  40902. c.header_ = make(http.Header)
  40903. }
  40904. return c.header_
  40905. }
  40906. func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  40907. reqHeaders := make(http.Header)
  40908. for k, v := range c.header_ {
  40909. reqHeaders[k] = v
  40910. }
  40911. reqHeaders.Set("User-Agent", c.s.userAgent())
  40912. var body io.Reader = nil
  40913. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  40914. if err != nil {
  40915. return nil, err
  40916. }
  40917. reqHeaders.Set("Content-Type", "application/json")
  40918. c.urlParams_.Set("alt", alt)
  40919. c.urlParams_.Set("prettyPrint", "false")
  40920. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  40921. urls += "?" + c.urlParams_.Encode()
  40922. req, err := http.NewRequest("PATCH", urls, body)
  40923. if err != nil {
  40924. return nil, err
  40925. }
  40926. req.Header = reqHeaders
  40927. googleapi.Expand(req.URL, map[string]string{
  40928. "project": c.project,
  40929. "httpHealthCheck": c.httpHealthCheck,
  40930. })
  40931. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40932. }
  40933. // Do executes the "compute.httpHealthChecks.patch" call.
  40934. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40935. // status code is an error. Response headers are in either
  40936. // *Operation.ServerResponse.Header or (if a response was returned at
  40937. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40938. // to check whether the returned error was because
  40939. // http.StatusNotModified was returned.
  40940. func (c *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40941. gensupport.SetOptions(c.urlParams_, opts...)
  40942. res, err := c.doRequest("json")
  40943. if res != nil && res.StatusCode == http.StatusNotModified {
  40944. if res.Body != nil {
  40945. res.Body.Close()
  40946. }
  40947. return nil, &googleapi.Error{
  40948. Code: res.StatusCode,
  40949. Header: res.Header,
  40950. }
  40951. }
  40952. if err != nil {
  40953. return nil, err
  40954. }
  40955. defer googleapi.CloseBody(res)
  40956. if err := googleapi.CheckResponse(res); err != nil {
  40957. return nil, err
  40958. }
  40959. ret := &Operation{
  40960. ServerResponse: googleapi.ServerResponse{
  40961. Header: res.Header,
  40962. HTTPStatusCode: res.StatusCode,
  40963. },
  40964. }
  40965. target := &ret
  40966. if err := gensupport.DecodeResponse(target, res); err != nil {
  40967. return nil, err
  40968. }
  40969. return ret, nil
  40970. // {
  40971. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  40972. // "httpMethod": "PATCH",
  40973. // "id": "compute.httpHealthChecks.patch",
  40974. // "parameterOrder": [
  40975. // "project",
  40976. // "httpHealthCheck"
  40977. // ],
  40978. // "parameters": {
  40979. // "httpHealthCheck": {
  40980. // "description": "Name of the HttpHealthCheck resource to patch.",
  40981. // "location": "path",
  40982. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40983. // "required": true,
  40984. // "type": "string"
  40985. // },
  40986. // "project": {
  40987. // "description": "Project ID for this request.",
  40988. // "location": "path",
  40989. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40990. // "required": true,
  40991. // "type": "string"
  40992. // },
  40993. // "requestId": {
  40994. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40995. // "location": "query",
  40996. // "type": "string"
  40997. // }
  40998. // },
  40999. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  41000. // "request": {
  41001. // "$ref": "HttpHealthCheck"
  41002. // },
  41003. // "response": {
  41004. // "$ref": "Operation"
  41005. // },
  41006. // "scopes": [
  41007. // "https://www.googleapis.com/auth/cloud-platform",
  41008. // "https://www.googleapis.com/auth/compute"
  41009. // ]
  41010. // }
  41011. }
  41012. // method id "compute.httpHealthChecks.update":
  41013. type HttpHealthChecksUpdateCall struct {
  41014. s *Service
  41015. project string
  41016. httpHealthCheck string
  41017. httphealthcheck *HttpHealthCheck
  41018. urlParams_ gensupport.URLParams
  41019. ctx_ context.Context
  41020. header_ http.Header
  41021. }
  41022. // Update: Updates a HttpHealthCheck resource in the specified project
  41023. // using the data included in the request.
  41024. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update
  41025. func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
  41026. c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41027. c.project = project
  41028. c.httpHealthCheck = httpHealthCheck
  41029. c.httphealthcheck = httphealthcheck
  41030. return c
  41031. }
  41032. // RequestId sets the optional parameter "requestId": An optional
  41033. // request ID to identify requests. Specify a unique request ID so that
  41034. // if you must retry your request, the server will know to ignore the
  41035. // request if it has already been completed.
  41036. //
  41037. // For example, consider a situation where you make an initial request
  41038. // and the request times out. If you make the request again with the
  41039. // same request ID, the server can check if original operation with the
  41040. // same request ID was received, and if so, will ignore the second
  41041. // request. This prevents clients from accidentally creating duplicate
  41042. // commitments.
  41043. //
  41044. // The request ID must be a valid UUID with the exception that zero UUID
  41045. // is not supported (00000000-0000-0000-0000-000000000000).
  41046. func (c *HttpHealthChecksUpdateCall) RequestId(requestId string) *HttpHealthChecksUpdateCall {
  41047. c.urlParams_.Set("requestId", requestId)
  41048. return c
  41049. }
  41050. // Fields allows partial responses to be retrieved. See
  41051. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41052. // for more information.
  41053. func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
  41054. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41055. return c
  41056. }
  41057. // Context sets the context to be used in this call's Do method. Any
  41058. // pending HTTP request will be aborted if the provided context is
  41059. // canceled.
  41060. func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
  41061. c.ctx_ = ctx
  41062. return c
  41063. }
  41064. // Header returns an http.Header that can be modified by the caller to
  41065. // add HTTP headers to the request.
  41066. func (c *HttpHealthChecksUpdateCall) Header() http.Header {
  41067. if c.header_ == nil {
  41068. c.header_ = make(http.Header)
  41069. }
  41070. return c.header_
  41071. }
  41072. func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  41073. reqHeaders := make(http.Header)
  41074. for k, v := range c.header_ {
  41075. reqHeaders[k] = v
  41076. }
  41077. reqHeaders.Set("User-Agent", c.s.userAgent())
  41078. var body io.Reader = nil
  41079. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  41080. if err != nil {
  41081. return nil, err
  41082. }
  41083. reqHeaders.Set("Content-Type", "application/json")
  41084. c.urlParams_.Set("alt", alt)
  41085. c.urlParams_.Set("prettyPrint", "false")
  41086. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  41087. urls += "?" + c.urlParams_.Encode()
  41088. req, err := http.NewRequest("PUT", urls, body)
  41089. if err != nil {
  41090. return nil, err
  41091. }
  41092. req.Header = reqHeaders
  41093. googleapi.Expand(req.URL, map[string]string{
  41094. "project": c.project,
  41095. "httpHealthCheck": c.httpHealthCheck,
  41096. })
  41097. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41098. }
  41099. // Do executes the "compute.httpHealthChecks.update" call.
  41100. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41101. // status code is an error. Response headers are in either
  41102. // *Operation.ServerResponse.Header or (if a response was returned at
  41103. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41104. // to check whether the returned error was because
  41105. // http.StatusNotModified was returned.
  41106. func (c *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41107. gensupport.SetOptions(c.urlParams_, opts...)
  41108. res, err := c.doRequest("json")
  41109. if res != nil && res.StatusCode == http.StatusNotModified {
  41110. if res.Body != nil {
  41111. res.Body.Close()
  41112. }
  41113. return nil, &googleapi.Error{
  41114. Code: res.StatusCode,
  41115. Header: res.Header,
  41116. }
  41117. }
  41118. if err != nil {
  41119. return nil, err
  41120. }
  41121. defer googleapi.CloseBody(res)
  41122. if err := googleapi.CheckResponse(res); err != nil {
  41123. return nil, err
  41124. }
  41125. ret := &Operation{
  41126. ServerResponse: googleapi.ServerResponse{
  41127. Header: res.Header,
  41128. HTTPStatusCode: res.StatusCode,
  41129. },
  41130. }
  41131. target := &ret
  41132. if err := gensupport.DecodeResponse(target, res); err != nil {
  41133. return nil, err
  41134. }
  41135. return ret, nil
  41136. // {
  41137. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.",
  41138. // "httpMethod": "PUT",
  41139. // "id": "compute.httpHealthChecks.update",
  41140. // "parameterOrder": [
  41141. // "project",
  41142. // "httpHealthCheck"
  41143. // ],
  41144. // "parameters": {
  41145. // "httpHealthCheck": {
  41146. // "description": "Name of the HttpHealthCheck resource to update.",
  41147. // "location": "path",
  41148. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41149. // "required": true,
  41150. // "type": "string"
  41151. // },
  41152. // "project": {
  41153. // "description": "Project ID for this request.",
  41154. // "location": "path",
  41155. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41156. // "required": true,
  41157. // "type": "string"
  41158. // },
  41159. // "requestId": {
  41160. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41161. // "location": "query",
  41162. // "type": "string"
  41163. // }
  41164. // },
  41165. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  41166. // "request": {
  41167. // "$ref": "HttpHealthCheck"
  41168. // },
  41169. // "response": {
  41170. // "$ref": "Operation"
  41171. // },
  41172. // "scopes": [
  41173. // "https://www.googleapis.com/auth/cloud-platform",
  41174. // "https://www.googleapis.com/auth/compute"
  41175. // ]
  41176. // }
  41177. }
  41178. // method id "compute.httpsHealthChecks.delete":
  41179. type HttpsHealthChecksDeleteCall struct {
  41180. s *Service
  41181. project string
  41182. httpsHealthCheck string
  41183. urlParams_ gensupport.URLParams
  41184. ctx_ context.Context
  41185. header_ http.Header
  41186. }
  41187. // Delete: Deletes the specified HttpsHealthCheck resource.
  41188. func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
  41189. c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41190. c.project = project
  41191. c.httpsHealthCheck = httpsHealthCheck
  41192. return c
  41193. }
  41194. // RequestId sets the optional parameter "requestId": An optional
  41195. // request ID to identify requests. Specify a unique request ID so that
  41196. // if you must retry your request, the server will know to ignore the
  41197. // request if it has already been completed.
  41198. //
  41199. // For example, consider a situation where you make an initial request
  41200. // and the request times out. If you make the request again with the
  41201. // same request ID, the server can check if original operation with the
  41202. // same request ID was received, and if so, will ignore the second
  41203. // request. This prevents clients from accidentally creating duplicate
  41204. // commitments.
  41205. //
  41206. // The request ID must be a valid UUID with the exception that zero UUID
  41207. // is not supported (00000000-0000-0000-0000-000000000000).
  41208. func (c *HttpsHealthChecksDeleteCall) RequestId(requestId string) *HttpsHealthChecksDeleteCall {
  41209. c.urlParams_.Set("requestId", requestId)
  41210. return c
  41211. }
  41212. // Fields allows partial responses to be retrieved. See
  41213. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41214. // for more information.
  41215. func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
  41216. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41217. return c
  41218. }
  41219. // Context sets the context to be used in this call's Do method. Any
  41220. // pending HTTP request will be aborted if the provided context is
  41221. // canceled.
  41222. func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
  41223. c.ctx_ = ctx
  41224. return c
  41225. }
  41226. // Header returns an http.Header that can be modified by the caller to
  41227. // add HTTP headers to the request.
  41228. func (c *HttpsHealthChecksDeleteCall) Header() http.Header {
  41229. if c.header_ == nil {
  41230. c.header_ = make(http.Header)
  41231. }
  41232. return c.header_
  41233. }
  41234. func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  41235. reqHeaders := make(http.Header)
  41236. for k, v := range c.header_ {
  41237. reqHeaders[k] = v
  41238. }
  41239. reqHeaders.Set("User-Agent", c.s.userAgent())
  41240. var body io.Reader = nil
  41241. c.urlParams_.Set("alt", alt)
  41242. c.urlParams_.Set("prettyPrint", "false")
  41243. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  41244. urls += "?" + c.urlParams_.Encode()
  41245. req, err := http.NewRequest("DELETE", urls, body)
  41246. if err != nil {
  41247. return nil, err
  41248. }
  41249. req.Header = reqHeaders
  41250. googleapi.Expand(req.URL, map[string]string{
  41251. "project": c.project,
  41252. "httpsHealthCheck": c.httpsHealthCheck,
  41253. })
  41254. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41255. }
  41256. // Do executes the "compute.httpsHealthChecks.delete" call.
  41257. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41258. // status code is an error. Response headers are in either
  41259. // *Operation.ServerResponse.Header or (if a response was returned at
  41260. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41261. // to check whether the returned error was because
  41262. // http.StatusNotModified was returned.
  41263. func (c *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41264. gensupport.SetOptions(c.urlParams_, opts...)
  41265. res, err := c.doRequest("json")
  41266. if res != nil && res.StatusCode == http.StatusNotModified {
  41267. if res.Body != nil {
  41268. res.Body.Close()
  41269. }
  41270. return nil, &googleapi.Error{
  41271. Code: res.StatusCode,
  41272. Header: res.Header,
  41273. }
  41274. }
  41275. if err != nil {
  41276. return nil, err
  41277. }
  41278. defer googleapi.CloseBody(res)
  41279. if err := googleapi.CheckResponse(res); err != nil {
  41280. return nil, err
  41281. }
  41282. ret := &Operation{
  41283. ServerResponse: googleapi.ServerResponse{
  41284. Header: res.Header,
  41285. HTTPStatusCode: res.StatusCode,
  41286. },
  41287. }
  41288. target := &ret
  41289. if err := gensupport.DecodeResponse(target, res); err != nil {
  41290. return nil, err
  41291. }
  41292. return ret, nil
  41293. // {
  41294. // "description": "Deletes the specified HttpsHealthCheck resource.",
  41295. // "httpMethod": "DELETE",
  41296. // "id": "compute.httpsHealthChecks.delete",
  41297. // "parameterOrder": [
  41298. // "project",
  41299. // "httpsHealthCheck"
  41300. // ],
  41301. // "parameters": {
  41302. // "httpsHealthCheck": {
  41303. // "description": "Name of the HttpsHealthCheck resource to delete.",
  41304. // "location": "path",
  41305. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41306. // "required": true,
  41307. // "type": "string"
  41308. // },
  41309. // "project": {
  41310. // "description": "Project ID for this request.",
  41311. // "location": "path",
  41312. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41313. // "required": true,
  41314. // "type": "string"
  41315. // },
  41316. // "requestId": {
  41317. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41318. // "location": "query",
  41319. // "type": "string"
  41320. // }
  41321. // },
  41322. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  41323. // "response": {
  41324. // "$ref": "Operation"
  41325. // },
  41326. // "scopes": [
  41327. // "https://www.googleapis.com/auth/cloud-platform",
  41328. // "https://www.googleapis.com/auth/compute"
  41329. // ]
  41330. // }
  41331. }
  41332. // method id "compute.httpsHealthChecks.get":
  41333. type HttpsHealthChecksGetCall struct {
  41334. s *Service
  41335. project string
  41336. httpsHealthCheck string
  41337. urlParams_ gensupport.URLParams
  41338. ifNoneMatch_ string
  41339. ctx_ context.Context
  41340. header_ http.Header
  41341. }
  41342. // Get: Returns the specified HttpsHealthCheck resource. Gets a list of
  41343. // available HTTPS health checks by making a list() request.
  41344. func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
  41345. c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41346. c.project = project
  41347. c.httpsHealthCheck = httpsHealthCheck
  41348. return c
  41349. }
  41350. // Fields allows partial responses to be retrieved. See
  41351. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41352. // for more information.
  41353. func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
  41354. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41355. return c
  41356. }
  41357. // IfNoneMatch sets the optional parameter which makes the operation
  41358. // fail if the object's ETag matches the given value. This is useful for
  41359. // getting updates only after the object has changed since the last
  41360. // request. Use googleapi.IsNotModified to check whether the response
  41361. // error from Do is the result of In-None-Match.
  41362. func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
  41363. c.ifNoneMatch_ = entityTag
  41364. return c
  41365. }
  41366. // Context sets the context to be used in this call's Do method. Any
  41367. // pending HTTP request will be aborted if the provided context is
  41368. // canceled.
  41369. func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
  41370. c.ctx_ = ctx
  41371. return c
  41372. }
  41373. // Header returns an http.Header that can be modified by the caller to
  41374. // add HTTP headers to the request.
  41375. func (c *HttpsHealthChecksGetCall) Header() http.Header {
  41376. if c.header_ == nil {
  41377. c.header_ = make(http.Header)
  41378. }
  41379. return c.header_
  41380. }
  41381. func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  41382. reqHeaders := make(http.Header)
  41383. for k, v := range c.header_ {
  41384. reqHeaders[k] = v
  41385. }
  41386. reqHeaders.Set("User-Agent", c.s.userAgent())
  41387. if c.ifNoneMatch_ != "" {
  41388. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41389. }
  41390. var body io.Reader = nil
  41391. c.urlParams_.Set("alt", alt)
  41392. c.urlParams_.Set("prettyPrint", "false")
  41393. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  41394. urls += "?" + c.urlParams_.Encode()
  41395. req, err := http.NewRequest("GET", urls, body)
  41396. if err != nil {
  41397. return nil, err
  41398. }
  41399. req.Header = reqHeaders
  41400. googleapi.Expand(req.URL, map[string]string{
  41401. "project": c.project,
  41402. "httpsHealthCheck": c.httpsHealthCheck,
  41403. })
  41404. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41405. }
  41406. // Do executes the "compute.httpsHealthChecks.get" call.
  41407. // Exactly one of *HttpsHealthCheck or error will be non-nil. Any
  41408. // non-2xx status code is an error. Response headers are in either
  41409. // *HttpsHealthCheck.ServerResponse.Header or (if a response was
  41410. // returned at all) in error.(*googleapi.Error).Header. Use
  41411. // googleapi.IsNotModified to check whether the returned error was
  41412. // because http.StatusNotModified was returned.
  41413. func (c *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, error) {
  41414. gensupport.SetOptions(c.urlParams_, opts...)
  41415. res, err := c.doRequest("json")
  41416. if res != nil && res.StatusCode == http.StatusNotModified {
  41417. if res.Body != nil {
  41418. res.Body.Close()
  41419. }
  41420. return nil, &googleapi.Error{
  41421. Code: res.StatusCode,
  41422. Header: res.Header,
  41423. }
  41424. }
  41425. if err != nil {
  41426. return nil, err
  41427. }
  41428. defer googleapi.CloseBody(res)
  41429. if err := googleapi.CheckResponse(res); err != nil {
  41430. return nil, err
  41431. }
  41432. ret := &HttpsHealthCheck{
  41433. ServerResponse: googleapi.ServerResponse{
  41434. Header: res.Header,
  41435. HTTPStatusCode: res.StatusCode,
  41436. },
  41437. }
  41438. target := &ret
  41439. if err := gensupport.DecodeResponse(target, res); err != nil {
  41440. return nil, err
  41441. }
  41442. return ret, nil
  41443. // {
  41444. // "description": "Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks by making a list() request.",
  41445. // "httpMethod": "GET",
  41446. // "id": "compute.httpsHealthChecks.get",
  41447. // "parameterOrder": [
  41448. // "project",
  41449. // "httpsHealthCheck"
  41450. // ],
  41451. // "parameters": {
  41452. // "httpsHealthCheck": {
  41453. // "description": "Name of the HttpsHealthCheck resource to return.",
  41454. // "location": "path",
  41455. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41456. // "required": true,
  41457. // "type": "string"
  41458. // },
  41459. // "project": {
  41460. // "description": "Project ID for this request.",
  41461. // "location": "path",
  41462. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41463. // "required": true,
  41464. // "type": "string"
  41465. // }
  41466. // },
  41467. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  41468. // "response": {
  41469. // "$ref": "HttpsHealthCheck"
  41470. // },
  41471. // "scopes": [
  41472. // "https://www.googleapis.com/auth/cloud-platform",
  41473. // "https://www.googleapis.com/auth/compute",
  41474. // "https://www.googleapis.com/auth/compute.readonly"
  41475. // ]
  41476. // }
  41477. }
  41478. // method id "compute.httpsHealthChecks.insert":
  41479. type HttpsHealthChecksInsertCall struct {
  41480. s *Service
  41481. project string
  41482. httpshealthcheck *HttpsHealthCheck
  41483. urlParams_ gensupport.URLParams
  41484. ctx_ context.Context
  41485. header_ http.Header
  41486. }
  41487. // Insert: Creates a HttpsHealthCheck resource in the specified project
  41488. // using the data included in the request.
  41489. func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
  41490. c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41491. c.project = project
  41492. c.httpshealthcheck = httpshealthcheck
  41493. return c
  41494. }
  41495. // RequestId sets the optional parameter "requestId": An optional
  41496. // request ID to identify requests. Specify a unique request ID so that
  41497. // if you must retry your request, the server will know to ignore the
  41498. // request if it has already been completed.
  41499. //
  41500. // For example, consider a situation where you make an initial request
  41501. // and the request times out. If you make the request again with the
  41502. // same request ID, the server can check if original operation with the
  41503. // same request ID was received, and if so, will ignore the second
  41504. // request. This prevents clients from accidentally creating duplicate
  41505. // commitments.
  41506. //
  41507. // The request ID must be a valid UUID with the exception that zero UUID
  41508. // is not supported (00000000-0000-0000-0000-000000000000).
  41509. func (c *HttpsHealthChecksInsertCall) RequestId(requestId string) *HttpsHealthChecksInsertCall {
  41510. c.urlParams_.Set("requestId", requestId)
  41511. return c
  41512. }
  41513. // Fields allows partial responses to be retrieved. See
  41514. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41515. // for more information.
  41516. func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
  41517. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41518. return c
  41519. }
  41520. // Context sets the context to be used in this call's Do method. Any
  41521. // pending HTTP request will be aborted if the provided context is
  41522. // canceled.
  41523. func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
  41524. c.ctx_ = ctx
  41525. return c
  41526. }
  41527. // Header returns an http.Header that can be modified by the caller to
  41528. // add HTTP headers to the request.
  41529. func (c *HttpsHealthChecksInsertCall) Header() http.Header {
  41530. if c.header_ == nil {
  41531. c.header_ = make(http.Header)
  41532. }
  41533. return c.header_
  41534. }
  41535. func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  41536. reqHeaders := make(http.Header)
  41537. for k, v := range c.header_ {
  41538. reqHeaders[k] = v
  41539. }
  41540. reqHeaders.Set("User-Agent", c.s.userAgent())
  41541. var body io.Reader = nil
  41542. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  41543. if err != nil {
  41544. return nil, err
  41545. }
  41546. reqHeaders.Set("Content-Type", "application/json")
  41547. c.urlParams_.Set("alt", alt)
  41548. c.urlParams_.Set("prettyPrint", "false")
  41549. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  41550. urls += "?" + c.urlParams_.Encode()
  41551. req, err := http.NewRequest("POST", urls, body)
  41552. if err != nil {
  41553. return nil, err
  41554. }
  41555. req.Header = reqHeaders
  41556. googleapi.Expand(req.URL, map[string]string{
  41557. "project": c.project,
  41558. })
  41559. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41560. }
  41561. // Do executes the "compute.httpsHealthChecks.insert" call.
  41562. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41563. // status code is an error. Response headers are in either
  41564. // *Operation.ServerResponse.Header or (if a response was returned at
  41565. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41566. // to check whether the returned error was because
  41567. // http.StatusNotModified was returned.
  41568. func (c *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41569. gensupport.SetOptions(c.urlParams_, opts...)
  41570. res, err := c.doRequest("json")
  41571. if res != nil && res.StatusCode == http.StatusNotModified {
  41572. if res.Body != nil {
  41573. res.Body.Close()
  41574. }
  41575. return nil, &googleapi.Error{
  41576. Code: res.StatusCode,
  41577. Header: res.Header,
  41578. }
  41579. }
  41580. if err != nil {
  41581. return nil, err
  41582. }
  41583. defer googleapi.CloseBody(res)
  41584. if err := googleapi.CheckResponse(res); err != nil {
  41585. return nil, err
  41586. }
  41587. ret := &Operation{
  41588. ServerResponse: googleapi.ServerResponse{
  41589. Header: res.Header,
  41590. HTTPStatusCode: res.StatusCode,
  41591. },
  41592. }
  41593. target := &ret
  41594. if err := gensupport.DecodeResponse(target, res); err != nil {
  41595. return nil, err
  41596. }
  41597. return ret, nil
  41598. // {
  41599. // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  41600. // "httpMethod": "POST",
  41601. // "id": "compute.httpsHealthChecks.insert",
  41602. // "parameterOrder": [
  41603. // "project"
  41604. // ],
  41605. // "parameters": {
  41606. // "project": {
  41607. // "description": "Project ID for this request.",
  41608. // "location": "path",
  41609. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41610. // "required": true,
  41611. // "type": "string"
  41612. // },
  41613. // "requestId": {
  41614. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41615. // "location": "query",
  41616. // "type": "string"
  41617. // }
  41618. // },
  41619. // "path": "{project}/global/httpsHealthChecks",
  41620. // "request": {
  41621. // "$ref": "HttpsHealthCheck"
  41622. // },
  41623. // "response": {
  41624. // "$ref": "Operation"
  41625. // },
  41626. // "scopes": [
  41627. // "https://www.googleapis.com/auth/cloud-platform",
  41628. // "https://www.googleapis.com/auth/compute"
  41629. // ]
  41630. // }
  41631. }
  41632. // method id "compute.httpsHealthChecks.list":
  41633. type HttpsHealthChecksListCall struct {
  41634. s *Service
  41635. project string
  41636. urlParams_ gensupport.URLParams
  41637. ifNoneMatch_ string
  41638. ctx_ context.Context
  41639. header_ http.Header
  41640. }
  41641. // List: Retrieves the list of HttpsHealthCheck resources available to
  41642. // the specified project.
  41643. func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
  41644. c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41645. c.project = project
  41646. return c
  41647. }
  41648. // Filter sets the optional parameter "filter": A filter expression that
  41649. // filters resources listed in the response. The expression must specify
  41650. // the field name, a comparison operator, and the value that you want to
  41651. // use for filtering. The value must be a string, a number, or a
  41652. // boolean. The comparison operator must be either =, !=, >, or <.
  41653. //
  41654. // For example, if you are filtering Compute Engine instances, you can
  41655. // exclude instances named example-instance by specifying name !=
  41656. // example-instance.
  41657. //
  41658. // You can also filter nested fields. For example, you could specify
  41659. // scheduling.automaticRestart = false to include instances only if they
  41660. // are not scheduled for automatic restarts. You can use filtering on
  41661. // nested fields to filter based on resource labels.
  41662. //
  41663. // To filter on multiple expressions, provide each separate expression
  41664. // within parentheses. For example, (scheduling.automaticRestart = true)
  41665. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  41666. // AND expression. However, you can include AND and OR expressions
  41667. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  41668. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  41669. // true).
  41670. func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
  41671. c.urlParams_.Set("filter", filter)
  41672. return c
  41673. }
  41674. // MaxResults sets the optional parameter "maxResults": The maximum
  41675. // number of results per page that should be returned. If the number of
  41676. // available results is larger than maxResults, Compute Engine returns a
  41677. // nextPageToken that can be used to get the next page of results in
  41678. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  41679. // (Default: 500)
  41680. func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
  41681. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41682. return c
  41683. }
  41684. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  41685. // a certain order. By default, results are returned in alphanumerical
  41686. // order based on the resource name.
  41687. //
  41688. // You can also sort results in descending order based on the creation
  41689. // timestamp using orderBy="creationTimestamp desc". This sorts results
  41690. // based on the creationTimestamp field in reverse chronological order
  41691. // (newest result first). Use this to sort resources like operations so
  41692. // that the newest operation is returned first.
  41693. //
  41694. // Currently, only sorting by name or creationTimestamp desc is
  41695. // supported.
  41696. func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall {
  41697. c.urlParams_.Set("orderBy", orderBy)
  41698. return c
  41699. }
  41700. // PageToken sets the optional parameter "pageToken": Specifies a page
  41701. // token to use. Set pageToken to the nextPageToken returned by a
  41702. // previous list request to get the next page of results.
  41703. func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
  41704. c.urlParams_.Set("pageToken", pageToken)
  41705. return c
  41706. }
  41707. // Fields allows partial responses to be retrieved. See
  41708. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41709. // for more information.
  41710. func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
  41711. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41712. return c
  41713. }
  41714. // IfNoneMatch sets the optional parameter which makes the operation
  41715. // fail if the object's ETag matches the given value. This is useful for
  41716. // getting updates only after the object has changed since the last
  41717. // request. Use googleapi.IsNotModified to check whether the response
  41718. // error from Do is the result of In-None-Match.
  41719. func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
  41720. c.ifNoneMatch_ = entityTag
  41721. return c
  41722. }
  41723. // Context sets the context to be used in this call's Do method. Any
  41724. // pending HTTP request will be aborted if the provided context is
  41725. // canceled.
  41726. func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
  41727. c.ctx_ = ctx
  41728. return c
  41729. }
  41730. // Header returns an http.Header that can be modified by the caller to
  41731. // add HTTP headers to the request.
  41732. func (c *HttpsHealthChecksListCall) Header() http.Header {
  41733. if c.header_ == nil {
  41734. c.header_ = make(http.Header)
  41735. }
  41736. return c.header_
  41737. }
  41738. func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  41739. reqHeaders := make(http.Header)
  41740. for k, v := range c.header_ {
  41741. reqHeaders[k] = v
  41742. }
  41743. reqHeaders.Set("User-Agent", c.s.userAgent())
  41744. if c.ifNoneMatch_ != "" {
  41745. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41746. }
  41747. var body io.Reader = nil
  41748. c.urlParams_.Set("alt", alt)
  41749. c.urlParams_.Set("prettyPrint", "false")
  41750. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  41751. urls += "?" + c.urlParams_.Encode()
  41752. req, err := http.NewRequest("GET", urls, body)
  41753. if err != nil {
  41754. return nil, err
  41755. }
  41756. req.Header = reqHeaders
  41757. googleapi.Expand(req.URL, map[string]string{
  41758. "project": c.project,
  41759. })
  41760. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41761. }
  41762. // Do executes the "compute.httpsHealthChecks.list" call.
  41763. // Exactly one of *HttpsHealthCheckList or error will be non-nil. Any
  41764. // non-2xx status code is an error. Response headers are in either
  41765. // *HttpsHealthCheckList.ServerResponse.Header or (if a response was
  41766. // returned at all) in error.(*googleapi.Error).Header. Use
  41767. // googleapi.IsNotModified to check whether the returned error was
  41768. // because http.StatusNotModified was returned.
  41769. func (c *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, error) {
  41770. gensupport.SetOptions(c.urlParams_, opts...)
  41771. res, err := c.doRequest("json")
  41772. if res != nil && res.StatusCode == http.StatusNotModified {
  41773. if res.Body != nil {
  41774. res.Body.Close()
  41775. }
  41776. return nil, &googleapi.Error{
  41777. Code: res.StatusCode,
  41778. Header: res.Header,
  41779. }
  41780. }
  41781. if err != nil {
  41782. return nil, err
  41783. }
  41784. defer googleapi.CloseBody(res)
  41785. if err := googleapi.CheckResponse(res); err != nil {
  41786. return nil, err
  41787. }
  41788. ret := &HttpsHealthCheckList{
  41789. ServerResponse: googleapi.ServerResponse{
  41790. Header: res.Header,
  41791. HTTPStatusCode: res.StatusCode,
  41792. },
  41793. }
  41794. target := &ret
  41795. if err := gensupport.DecodeResponse(target, res); err != nil {
  41796. return nil, err
  41797. }
  41798. return ret, nil
  41799. // {
  41800. // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.",
  41801. // "httpMethod": "GET",
  41802. // "id": "compute.httpsHealthChecks.list",
  41803. // "parameterOrder": [
  41804. // "project"
  41805. // ],
  41806. // "parameters": {
  41807. // "filter": {
  41808. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  41809. // "location": "query",
  41810. // "type": "string"
  41811. // },
  41812. // "maxResults": {
  41813. // "default": "500",
  41814. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  41815. // "format": "uint32",
  41816. // "location": "query",
  41817. // "minimum": "0",
  41818. // "type": "integer"
  41819. // },
  41820. // "orderBy": {
  41821. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  41822. // "location": "query",
  41823. // "type": "string"
  41824. // },
  41825. // "pageToken": {
  41826. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  41827. // "location": "query",
  41828. // "type": "string"
  41829. // },
  41830. // "project": {
  41831. // "description": "Project ID for this request.",
  41832. // "location": "path",
  41833. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41834. // "required": true,
  41835. // "type": "string"
  41836. // }
  41837. // },
  41838. // "path": "{project}/global/httpsHealthChecks",
  41839. // "response": {
  41840. // "$ref": "HttpsHealthCheckList"
  41841. // },
  41842. // "scopes": [
  41843. // "https://www.googleapis.com/auth/cloud-platform",
  41844. // "https://www.googleapis.com/auth/compute",
  41845. // "https://www.googleapis.com/auth/compute.readonly"
  41846. // ]
  41847. // }
  41848. }
  41849. // Pages invokes f for each page of results.
  41850. // A non-nil error returned from f will halt the iteration.
  41851. // The provided context supersedes any context provided to the Context method.
  41852. func (c *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error {
  41853. c.ctx_ = ctx
  41854. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41855. for {
  41856. x, err := c.Do()
  41857. if err != nil {
  41858. return err
  41859. }
  41860. if err := f(x); err != nil {
  41861. return err
  41862. }
  41863. if x.NextPageToken == "" {
  41864. return nil
  41865. }
  41866. c.PageToken(x.NextPageToken)
  41867. }
  41868. }
  41869. // method id "compute.httpsHealthChecks.patch":
  41870. type HttpsHealthChecksPatchCall struct {
  41871. s *Service
  41872. project string
  41873. httpsHealthCheck string
  41874. httpshealthcheck *HttpsHealthCheck
  41875. urlParams_ gensupport.URLParams
  41876. ctx_ context.Context
  41877. header_ http.Header
  41878. }
  41879. // Patch: Updates a HttpsHealthCheck resource in the specified project
  41880. // using the data included in the request. This method supports PATCH
  41881. // semantics and uses the JSON merge patch format and processing rules.
  41882. func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
  41883. c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41884. c.project = project
  41885. c.httpsHealthCheck = httpsHealthCheck
  41886. c.httpshealthcheck = httpshealthcheck
  41887. return c
  41888. }
  41889. // RequestId sets the optional parameter "requestId": An optional
  41890. // request ID to identify requests. Specify a unique request ID so that
  41891. // if you must retry your request, the server will know to ignore the
  41892. // request if it has already been completed.
  41893. //
  41894. // For example, consider a situation where you make an initial request
  41895. // and the request times out. If you make the request again with the
  41896. // same request ID, the server can check if original operation with the
  41897. // same request ID was received, and if so, will ignore the second
  41898. // request. This prevents clients from accidentally creating duplicate
  41899. // commitments.
  41900. //
  41901. // The request ID must be a valid UUID with the exception that zero UUID
  41902. // is not supported (00000000-0000-0000-0000-000000000000).
  41903. func (c *HttpsHealthChecksPatchCall) RequestId(requestId string) *HttpsHealthChecksPatchCall {
  41904. c.urlParams_.Set("requestId", requestId)
  41905. return c
  41906. }
  41907. // Fields allows partial responses to be retrieved. See
  41908. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41909. // for more information.
  41910. func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
  41911. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41912. return c
  41913. }
  41914. // Context sets the context to be used in this call's Do method. Any
  41915. // pending HTTP request will be aborted if the provided context is
  41916. // canceled.
  41917. func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
  41918. c.ctx_ = ctx
  41919. return c
  41920. }
  41921. // Header returns an http.Header that can be modified by the caller to
  41922. // add HTTP headers to the request.
  41923. func (c *HttpsHealthChecksPatchCall) Header() http.Header {
  41924. if c.header_ == nil {
  41925. c.header_ = make(http.Header)
  41926. }
  41927. return c.header_
  41928. }
  41929. func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  41930. reqHeaders := make(http.Header)
  41931. for k, v := range c.header_ {
  41932. reqHeaders[k] = v
  41933. }
  41934. reqHeaders.Set("User-Agent", c.s.userAgent())
  41935. var body io.Reader = nil
  41936. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  41937. if err != nil {
  41938. return nil, err
  41939. }
  41940. reqHeaders.Set("Content-Type", "application/json")
  41941. c.urlParams_.Set("alt", alt)
  41942. c.urlParams_.Set("prettyPrint", "false")
  41943. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  41944. urls += "?" + c.urlParams_.Encode()
  41945. req, err := http.NewRequest("PATCH", urls, body)
  41946. if err != nil {
  41947. return nil, err
  41948. }
  41949. req.Header = reqHeaders
  41950. googleapi.Expand(req.URL, map[string]string{
  41951. "project": c.project,
  41952. "httpsHealthCheck": c.httpsHealthCheck,
  41953. })
  41954. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41955. }
  41956. // Do executes the "compute.httpsHealthChecks.patch" call.
  41957. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41958. // status code is an error. Response headers are in either
  41959. // *Operation.ServerResponse.Header or (if a response was returned at
  41960. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41961. // to check whether the returned error was because
  41962. // http.StatusNotModified was returned.
  41963. func (c *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41964. gensupport.SetOptions(c.urlParams_, opts...)
  41965. res, err := c.doRequest("json")
  41966. if res != nil && res.StatusCode == http.StatusNotModified {
  41967. if res.Body != nil {
  41968. res.Body.Close()
  41969. }
  41970. return nil, &googleapi.Error{
  41971. Code: res.StatusCode,
  41972. Header: res.Header,
  41973. }
  41974. }
  41975. if err != nil {
  41976. return nil, err
  41977. }
  41978. defer googleapi.CloseBody(res)
  41979. if err := googleapi.CheckResponse(res); err != nil {
  41980. return nil, err
  41981. }
  41982. ret := &Operation{
  41983. ServerResponse: googleapi.ServerResponse{
  41984. Header: res.Header,
  41985. HTTPStatusCode: res.StatusCode,
  41986. },
  41987. }
  41988. target := &ret
  41989. if err := gensupport.DecodeResponse(target, res); err != nil {
  41990. return nil, err
  41991. }
  41992. return ret, nil
  41993. // {
  41994. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  41995. // "httpMethod": "PATCH",
  41996. // "id": "compute.httpsHealthChecks.patch",
  41997. // "parameterOrder": [
  41998. // "project",
  41999. // "httpsHealthCheck"
  42000. // ],
  42001. // "parameters": {
  42002. // "httpsHealthCheck": {
  42003. // "description": "Name of the HttpsHealthCheck resource to patch.",
  42004. // "location": "path",
  42005. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42006. // "required": true,
  42007. // "type": "string"
  42008. // },
  42009. // "project": {
  42010. // "description": "Project ID for this request.",
  42011. // "location": "path",
  42012. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42013. // "required": true,
  42014. // "type": "string"
  42015. // },
  42016. // "requestId": {
  42017. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42018. // "location": "query",
  42019. // "type": "string"
  42020. // }
  42021. // },
  42022. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  42023. // "request": {
  42024. // "$ref": "HttpsHealthCheck"
  42025. // },
  42026. // "response": {
  42027. // "$ref": "Operation"
  42028. // },
  42029. // "scopes": [
  42030. // "https://www.googleapis.com/auth/cloud-platform",
  42031. // "https://www.googleapis.com/auth/compute"
  42032. // ]
  42033. // }
  42034. }
  42035. // method id "compute.httpsHealthChecks.update":
  42036. type HttpsHealthChecksUpdateCall struct {
  42037. s *Service
  42038. project string
  42039. httpsHealthCheck string
  42040. httpshealthcheck *HttpsHealthCheck
  42041. urlParams_ gensupport.URLParams
  42042. ctx_ context.Context
  42043. header_ http.Header
  42044. }
  42045. // Update: Updates a HttpsHealthCheck resource in the specified project
  42046. // using the data included in the request.
  42047. func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
  42048. c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42049. c.project = project
  42050. c.httpsHealthCheck = httpsHealthCheck
  42051. c.httpshealthcheck = httpshealthcheck
  42052. return c
  42053. }
  42054. // RequestId sets the optional parameter "requestId": An optional
  42055. // request ID to identify requests. Specify a unique request ID so that
  42056. // if you must retry your request, the server will know to ignore the
  42057. // request if it has already been completed.
  42058. //
  42059. // For example, consider a situation where you make an initial request
  42060. // and the request times out. If you make the request again with the
  42061. // same request ID, the server can check if original operation with the
  42062. // same request ID was received, and if so, will ignore the second
  42063. // request. This prevents clients from accidentally creating duplicate
  42064. // commitments.
  42065. //
  42066. // The request ID must be a valid UUID with the exception that zero UUID
  42067. // is not supported (00000000-0000-0000-0000-000000000000).
  42068. func (c *HttpsHealthChecksUpdateCall) RequestId(requestId string) *HttpsHealthChecksUpdateCall {
  42069. c.urlParams_.Set("requestId", requestId)
  42070. return c
  42071. }
  42072. // Fields allows partial responses to be retrieved. See
  42073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42074. // for more information.
  42075. func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
  42076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42077. return c
  42078. }
  42079. // Context sets the context to be used in this call's Do method. Any
  42080. // pending HTTP request will be aborted if the provided context is
  42081. // canceled.
  42082. func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
  42083. c.ctx_ = ctx
  42084. return c
  42085. }
  42086. // Header returns an http.Header that can be modified by the caller to
  42087. // add HTTP headers to the request.
  42088. func (c *HttpsHealthChecksUpdateCall) Header() http.Header {
  42089. if c.header_ == nil {
  42090. c.header_ = make(http.Header)
  42091. }
  42092. return c.header_
  42093. }
  42094. func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  42095. reqHeaders := make(http.Header)
  42096. for k, v := range c.header_ {
  42097. reqHeaders[k] = v
  42098. }
  42099. reqHeaders.Set("User-Agent", c.s.userAgent())
  42100. var body io.Reader = nil
  42101. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  42102. if err != nil {
  42103. return nil, err
  42104. }
  42105. reqHeaders.Set("Content-Type", "application/json")
  42106. c.urlParams_.Set("alt", alt)
  42107. c.urlParams_.Set("prettyPrint", "false")
  42108. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  42109. urls += "?" + c.urlParams_.Encode()
  42110. req, err := http.NewRequest("PUT", urls, body)
  42111. if err != nil {
  42112. return nil, err
  42113. }
  42114. req.Header = reqHeaders
  42115. googleapi.Expand(req.URL, map[string]string{
  42116. "project": c.project,
  42117. "httpsHealthCheck": c.httpsHealthCheck,
  42118. })
  42119. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42120. }
  42121. // Do executes the "compute.httpsHealthChecks.update" call.
  42122. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42123. // status code is an error. Response headers are in either
  42124. // *Operation.ServerResponse.Header or (if a response was returned at
  42125. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42126. // to check whether the returned error was because
  42127. // http.StatusNotModified was returned.
  42128. func (c *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42129. gensupport.SetOptions(c.urlParams_, opts...)
  42130. res, err := c.doRequest("json")
  42131. if res != nil && res.StatusCode == http.StatusNotModified {
  42132. if res.Body != nil {
  42133. res.Body.Close()
  42134. }
  42135. return nil, &googleapi.Error{
  42136. Code: res.StatusCode,
  42137. Header: res.Header,
  42138. }
  42139. }
  42140. if err != nil {
  42141. return nil, err
  42142. }
  42143. defer googleapi.CloseBody(res)
  42144. if err := googleapi.CheckResponse(res); err != nil {
  42145. return nil, err
  42146. }
  42147. ret := &Operation{
  42148. ServerResponse: googleapi.ServerResponse{
  42149. Header: res.Header,
  42150. HTTPStatusCode: res.StatusCode,
  42151. },
  42152. }
  42153. target := &ret
  42154. if err := gensupport.DecodeResponse(target, res); err != nil {
  42155. return nil, err
  42156. }
  42157. return ret, nil
  42158. // {
  42159. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  42160. // "httpMethod": "PUT",
  42161. // "id": "compute.httpsHealthChecks.update",
  42162. // "parameterOrder": [
  42163. // "project",
  42164. // "httpsHealthCheck"
  42165. // ],
  42166. // "parameters": {
  42167. // "httpsHealthCheck": {
  42168. // "description": "Name of the HttpsHealthCheck resource to update.",
  42169. // "location": "path",
  42170. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42171. // "required": true,
  42172. // "type": "string"
  42173. // },
  42174. // "project": {
  42175. // "description": "Project ID for this request.",
  42176. // "location": "path",
  42177. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42178. // "required": true,
  42179. // "type": "string"
  42180. // },
  42181. // "requestId": {
  42182. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42183. // "location": "query",
  42184. // "type": "string"
  42185. // }
  42186. // },
  42187. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  42188. // "request": {
  42189. // "$ref": "HttpsHealthCheck"
  42190. // },
  42191. // "response": {
  42192. // "$ref": "Operation"
  42193. // },
  42194. // "scopes": [
  42195. // "https://www.googleapis.com/auth/cloud-platform",
  42196. // "https://www.googleapis.com/auth/compute"
  42197. // ]
  42198. // }
  42199. }
  42200. // method id "compute.images.delete":
  42201. type ImagesDeleteCall struct {
  42202. s *Service
  42203. project string
  42204. image string
  42205. urlParams_ gensupport.URLParams
  42206. ctx_ context.Context
  42207. header_ http.Header
  42208. }
  42209. // Delete: Deletes the specified image.
  42210. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete
  42211. func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
  42212. c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42213. c.project = project
  42214. c.image = image
  42215. return c
  42216. }
  42217. // RequestId sets the optional parameter "requestId": An optional
  42218. // request ID to identify requests. Specify a unique request ID so that
  42219. // if you must retry your request, the server will know to ignore the
  42220. // request if it has already been completed.
  42221. //
  42222. // For example, consider a situation where you make an initial request
  42223. // and the request times out. If you make the request again with the
  42224. // same request ID, the server can check if original operation with the
  42225. // same request ID was received, and if so, will ignore the second
  42226. // request. This prevents clients from accidentally creating duplicate
  42227. // commitments.
  42228. //
  42229. // The request ID must be a valid UUID with the exception that zero UUID
  42230. // is not supported (00000000-0000-0000-0000-000000000000).
  42231. func (c *ImagesDeleteCall) RequestId(requestId string) *ImagesDeleteCall {
  42232. c.urlParams_.Set("requestId", requestId)
  42233. return c
  42234. }
  42235. // Fields allows partial responses to be retrieved. See
  42236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42237. // for more information.
  42238. func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
  42239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42240. return c
  42241. }
  42242. // Context sets the context to be used in this call's Do method. Any
  42243. // pending HTTP request will be aborted if the provided context is
  42244. // canceled.
  42245. func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
  42246. c.ctx_ = ctx
  42247. return c
  42248. }
  42249. // Header returns an http.Header that can be modified by the caller to
  42250. // add HTTP headers to the request.
  42251. func (c *ImagesDeleteCall) Header() http.Header {
  42252. if c.header_ == nil {
  42253. c.header_ = make(http.Header)
  42254. }
  42255. return c.header_
  42256. }
  42257. func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  42258. reqHeaders := make(http.Header)
  42259. for k, v := range c.header_ {
  42260. reqHeaders[k] = v
  42261. }
  42262. reqHeaders.Set("User-Agent", c.s.userAgent())
  42263. var body io.Reader = nil
  42264. c.urlParams_.Set("alt", alt)
  42265. c.urlParams_.Set("prettyPrint", "false")
  42266. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  42267. urls += "?" + c.urlParams_.Encode()
  42268. req, err := http.NewRequest("DELETE", urls, body)
  42269. if err != nil {
  42270. return nil, err
  42271. }
  42272. req.Header = reqHeaders
  42273. googleapi.Expand(req.URL, map[string]string{
  42274. "project": c.project,
  42275. "image": c.image,
  42276. })
  42277. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42278. }
  42279. // Do executes the "compute.images.delete" call.
  42280. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42281. // status code is an error. Response headers are in either
  42282. // *Operation.ServerResponse.Header or (if a response was returned at
  42283. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42284. // to check whether the returned error was because
  42285. // http.StatusNotModified was returned.
  42286. func (c *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42287. gensupport.SetOptions(c.urlParams_, opts...)
  42288. res, err := c.doRequest("json")
  42289. if res != nil && res.StatusCode == http.StatusNotModified {
  42290. if res.Body != nil {
  42291. res.Body.Close()
  42292. }
  42293. return nil, &googleapi.Error{
  42294. Code: res.StatusCode,
  42295. Header: res.Header,
  42296. }
  42297. }
  42298. if err != nil {
  42299. return nil, err
  42300. }
  42301. defer googleapi.CloseBody(res)
  42302. if err := googleapi.CheckResponse(res); err != nil {
  42303. return nil, err
  42304. }
  42305. ret := &Operation{
  42306. ServerResponse: googleapi.ServerResponse{
  42307. Header: res.Header,
  42308. HTTPStatusCode: res.StatusCode,
  42309. },
  42310. }
  42311. target := &ret
  42312. if err := gensupport.DecodeResponse(target, res); err != nil {
  42313. return nil, err
  42314. }
  42315. return ret, nil
  42316. // {
  42317. // "description": "Deletes the specified image.",
  42318. // "httpMethod": "DELETE",
  42319. // "id": "compute.images.delete",
  42320. // "parameterOrder": [
  42321. // "project",
  42322. // "image"
  42323. // ],
  42324. // "parameters": {
  42325. // "image": {
  42326. // "description": "Name of the image resource to delete.",
  42327. // "location": "path",
  42328. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42329. // "required": true,
  42330. // "type": "string"
  42331. // },
  42332. // "project": {
  42333. // "description": "Project ID for this request.",
  42334. // "location": "path",
  42335. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42336. // "required": true,
  42337. // "type": "string"
  42338. // },
  42339. // "requestId": {
  42340. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42341. // "location": "query",
  42342. // "type": "string"
  42343. // }
  42344. // },
  42345. // "path": "{project}/global/images/{image}",
  42346. // "response": {
  42347. // "$ref": "Operation"
  42348. // },
  42349. // "scopes": [
  42350. // "https://www.googleapis.com/auth/cloud-platform",
  42351. // "https://www.googleapis.com/auth/compute"
  42352. // ]
  42353. // }
  42354. }
  42355. // method id "compute.images.deprecate":
  42356. type ImagesDeprecateCall struct {
  42357. s *Service
  42358. project string
  42359. image string
  42360. deprecationstatus *DeprecationStatus
  42361. urlParams_ gensupport.URLParams
  42362. ctx_ context.Context
  42363. header_ http.Header
  42364. }
  42365. // Deprecate: Sets the deprecation status of an image.
  42366. //
  42367. // If an empty request body is given, clears the deprecation status
  42368. // instead.
  42369. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate
  42370. func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
  42371. c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42372. c.project = project
  42373. c.image = image
  42374. c.deprecationstatus = deprecationstatus
  42375. return c
  42376. }
  42377. // RequestId sets the optional parameter "requestId": An optional
  42378. // request ID to identify requests. Specify a unique request ID so that
  42379. // if you must retry your request, the server will know to ignore the
  42380. // request if it has already been completed.
  42381. //
  42382. // For example, consider a situation where you make an initial request
  42383. // and the request times out. If you make the request again with the
  42384. // same request ID, the server can check if original operation with the
  42385. // same request ID was received, and if so, will ignore the second
  42386. // request. This prevents clients from accidentally creating duplicate
  42387. // commitments.
  42388. //
  42389. // The request ID must be a valid UUID with the exception that zero UUID
  42390. // is not supported (00000000-0000-0000-0000-000000000000).
  42391. func (c *ImagesDeprecateCall) RequestId(requestId string) *ImagesDeprecateCall {
  42392. c.urlParams_.Set("requestId", requestId)
  42393. return c
  42394. }
  42395. // Fields allows partial responses to be retrieved. See
  42396. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42397. // for more information.
  42398. func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
  42399. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42400. return c
  42401. }
  42402. // Context sets the context to be used in this call's Do method. Any
  42403. // pending HTTP request will be aborted if the provided context is
  42404. // canceled.
  42405. func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
  42406. c.ctx_ = ctx
  42407. return c
  42408. }
  42409. // Header returns an http.Header that can be modified by the caller to
  42410. // add HTTP headers to the request.
  42411. func (c *ImagesDeprecateCall) Header() http.Header {
  42412. if c.header_ == nil {
  42413. c.header_ = make(http.Header)
  42414. }
  42415. return c.header_
  42416. }
  42417. func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
  42418. reqHeaders := make(http.Header)
  42419. for k, v := range c.header_ {
  42420. reqHeaders[k] = v
  42421. }
  42422. reqHeaders.Set("User-Agent", c.s.userAgent())
  42423. var body io.Reader = nil
  42424. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
  42425. if err != nil {
  42426. return nil, err
  42427. }
  42428. reqHeaders.Set("Content-Type", "application/json")
  42429. c.urlParams_.Set("alt", alt)
  42430. c.urlParams_.Set("prettyPrint", "false")
  42431. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate")
  42432. urls += "?" + c.urlParams_.Encode()
  42433. req, err := http.NewRequest("POST", urls, body)
  42434. if err != nil {
  42435. return nil, err
  42436. }
  42437. req.Header = reqHeaders
  42438. googleapi.Expand(req.URL, map[string]string{
  42439. "project": c.project,
  42440. "image": c.image,
  42441. })
  42442. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42443. }
  42444. // Do executes the "compute.images.deprecate" call.
  42445. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42446. // status code is an error. Response headers are in either
  42447. // *Operation.ServerResponse.Header or (if a response was returned at
  42448. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42449. // to check whether the returned error was because
  42450. // http.StatusNotModified was returned.
  42451. func (c *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42452. gensupport.SetOptions(c.urlParams_, opts...)
  42453. res, err := c.doRequest("json")
  42454. if res != nil && res.StatusCode == http.StatusNotModified {
  42455. if res.Body != nil {
  42456. res.Body.Close()
  42457. }
  42458. return nil, &googleapi.Error{
  42459. Code: res.StatusCode,
  42460. Header: res.Header,
  42461. }
  42462. }
  42463. if err != nil {
  42464. return nil, err
  42465. }
  42466. defer googleapi.CloseBody(res)
  42467. if err := googleapi.CheckResponse(res); err != nil {
  42468. return nil, err
  42469. }
  42470. ret := &Operation{
  42471. ServerResponse: googleapi.ServerResponse{
  42472. Header: res.Header,
  42473. HTTPStatusCode: res.StatusCode,
  42474. },
  42475. }
  42476. target := &ret
  42477. if err := gensupport.DecodeResponse(target, res); err != nil {
  42478. return nil, err
  42479. }
  42480. return ret, nil
  42481. // {
  42482. // "description": "Sets the deprecation status of an image.\n\nIf an empty request body is given, clears the deprecation status instead.",
  42483. // "httpMethod": "POST",
  42484. // "id": "compute.images.deprecate",
  42485. // "parameterOrder": [
  42486. // "project",
  42487. // "image"
  42488. // ],
  42489. // "parameters": {
  42490. // "image": {
  42491. // "description": "Image name.",
  42492. // "location": "path",
  42493. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42494. // "required": true,
  42495. // "type": "string"
  42496. // },
  42497. // "project": {
  42498. // "description": "Project ID for this request.",
  42499. // "location": "path",
  42500. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42501. // "required": true,
  42502. // "type": "string"
  42503. // },
  42504. // "requestId": {
  42505. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42506. // "location": "query",
  42507. // "type": "string"
  42508. // }
  42509. // },
  42510. // "path": "{project}/global/images/{image}/deprecate",
  42511. // "request": {
  42512. // "$ref": "DeprecationStatus"
  42513. // },
  42514. // "response": {
  42515. // "$ref": "Operation"
  42516. // },
  42517. // "scopes": [
  42518. // "https://www.googleapis.com/auth/cloud-platform",
  42519. // "https://www.googleapis.com/auth/compute"
  42520. // ]
  42521. // }
  42522. }
  42523. // method id "compute.images.get":
  42524. type ImagesGetCall struct {
  42525. s *Service
  42526. project string
  42527. image string
  42528. urlParams_ gensupport.URLParams
  42529. ifNoneMatch_ string
  42530. ctx_ context.Context
  42531. header_ http.Header
  42532. }
  42533. // Get: Returns the specified image. Gets a list of available images by
  42534. // making a list() request.
  42535. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/get
  42536. func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
  42537. c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42538. c.project = project
  42539. c.image = image
  42540. return c
  42541. }
  42542. // Fields allows partial responses to be retrieved. See
  42543. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42544. // for more information.
  42545. func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
  42546. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42547. return c
  42548. }
  42549. // IfNoneMatch sets the optional parameter which makes the operation
  42550. // fail if the object's ETag matches the given value. This is useful for
  42551. // getting updates only after the object has changed since the last
  42552. // request. Use googleapi.IsNotModified to check whether the response
  42553. // error from Do is the result of In-None-Match.
  42554. func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
  42555. c.ifNoneMatch_ = entityTag
  42556. return c
  42557. }
  42558. // Context sets the context to be used in this call's Do method. Any
  42559. // pending HTTP request will be aborted if the provided context is
  42560. // canceled.
  42561. func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
  42562. c.ctx_ = ctx
  42563. return c
  42564. }
  42565. // Header returns an http.Header that can be modified by the caller to
  42566. // add HTTP headers to the request.
  42567. func (c *ImagesGetCall) Header() http.Header {
  42568. if c.header_ == nil {
  42569. c.header_ = make(http.Header)
  42570. }
  42571. return c.header_
  42572. }
  42573. func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
  42574. reqHeaders := make(http.Header)
  42575. for k, v := range c.header_ {
  42576. reqHeaders[k] = v
  42577. }
  42578. reqHeaders.Set("User-Agent", c.s.userAgent())
  42579. if c.ifNoneMatch_ != "" {
  42580. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42581. }
  42582. var body io.Reader = nil
  42583. c.urlParams_.Set("alt", alt)
  42584. c.urlParams_.Set("prettyPrint", "false")
  42585. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  42586. urls += "?" + c.urlParams_.Encode()
  42587. req, err := http.NewRequest("GET", urls, body)
  42588. if err != nil {
  42589. return nil, err
  42590. }
  42591. req.Header = reqHeaders
  42592. googleapi.Expand(req.URL, map[string]string{
  42593. "project": c.project,
  42594. "image": c.image,
  42595. })
  42596. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42597. }
  42598. // Do executes the "compute.images.get" call.
  42599. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  42600. // code is an error. Response headers are in either
  42601. // *Image.ServerResponse.Header or (if a response was returned at all)
  42602. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  42603. // check whether the returned error was because http.StatusNotModified
  42604. // was returned.
  42605. func (c *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  42606. gensupport.SetOptions(c.urlParams_, opts...)
  42607. res, err := c.doRequest("json")
  42608. if res != nil && res.StatusCode == http.StatusNotModified {
  42609. if res.Body != nil {
  42610. res.Body.Close()
  42611. }
  42612. return nil, &googleapi.Error{
  42613. Code: res.StatusCode,
  42614. Header: res.Header,
  42615. }
  42616. }
  42617. if err != nil {
  42618. return nil, err
  42619. }
  42620. defer googleapi.CloseBody(res)
  42621. if err := googleapi.CheckResponse(res); err != nil {
  42622. return nil, err
  42623. }
  42624. ret := &Image{
  42625. ServerResponse: googleapi.ServerResponse{
  42626. Header: res.Header,
  42627. HTTPStatusCode: res.StatusCode,
  42628. },
  42629. }
  42630. target := &ret
  42631. if err := gensupport.DecodeResponse(target, res); err != nil {
  42632. return nil, err
  42633. }
  42634. return ret, nil
  42635. // {
  42636. // "description": "Returns the specified image. Gets a list of available images by making a list() request.",
  42637. // "httpMethod": "GET",
  42638. // "id": "compute.images.get",
  42639. // "parameterOrder": [
  42640. // "project",
  42641. // "image"
  42642. // ],
  42643. // "parameters": {
  42644. // "image": {
  42645. // "description": "Name of the image resource to return.",
  42646. // "location": "path",
  42647. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42648. // "required": true,
  42649. // "type": "string"
  42650. // },
  42651. // "project": {
  42652. // "description": "Project ID for this request.",
  42653. // "location": "path",
  42654. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42655. // "required": true,
  42656. // "type": "string"
  42657. // }
  42658. // },
  42659. // "path": "{project}/global/images/{image}",
  42660. // "response": {
  42661. // "$ref": "Image"
  42662. // },
  42663. // "scopes": [
  42664. // "https://www.googleapis.com/auth/cloud-platform",
  42665. // "https://www.googleapis.com/auth/compute",
  42666. // "https://www.googleapis.com/auth/compute.readonly"
  42667. // ]
  42668. // }
  42669. }
  42670. // method id "compute.images.getFromFamily":
  42671. type ImagesGetFromFamilyCall struct {
  42672. s *Service
  42673. project string
  42674. family string
  42675. urlParams_ gensupport.URLParams
  42676. ifNoneMatch_ string
  42677. ctx_ context.Context
  42678. header_ http.Header
  42679. }
  42680. // GetFromFamily: Returns the latest image that is part of an image
  42681. // family and is not deprecated.
  42682. func (r *ImagesService) GetFromFamily(project string, family string) *ImagesGetFromFamilyCall {
  42683. c := &ImagesGetFromFamilyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42684. c.project = project
  42685. c.family = family
  42686. return c
  42687. }
  42688. // Fields allows partial responses to be retrieved. See
  42689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42690. // for more information.
  42691. func (c *ImagesGetFromFamilyCall) Fields(s ...googleapi.Field) *ImagesGetFromFamilyCall {
  42692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42693. return c
  42694. }
  42695. // IfNoneMatch sets the optional parameter which makes the operation
  42696. // fail if the object's ETag matches the given value. This is useful for
  42697. // getting updates only after the object has changed since the last
  42698. // request. Use googleapi.IsNotModified to check whether the response
  42699. // error from Do is the result of In-None-Match.
  42700. func (c *ImagesGetFromFamilyCall) IfNoneMatch(entityTag string) *ImagesGetFromFamilyCall {
  42701. c.ifNoneMatch_ = entityTag
  42702. return c
  42703. }
  42704. // Context sets the context to be used in this call's Do method. Any
  42705. // pending HTTP request will be aborted if the provided context is
  42706. // canceled.
  42707. func (c *ImagesGetFromFamilyCall) Context(ctx context.Context) *ImagesGetFromFamilyCall {
  42708. c.ctx_ = ctx
  42709. return c
  42710. }
  42711. // Header returns an http.Header that can be modified by the caller to
  42712. // add HTTP headers to the request.
  42713. func (c *ImagesGetFromFamilyCall) Header() http.Header {
  42714. if c.header_ == nil {
  42715. c.header_ = make(http.Header)
  42716. }
  42717. return c.header_
  42718. }
  42719. func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) {
  42720. reqHeaders := make(http.Header)
  42721. for k, v := range c.header_ {
  42722. reqHeaders[k] = v
  42723. }
  42724. reqHeaders.Set("User-Agent", c.s.userAgent())
  42725. if c.ifNoneMatch_ != "" {
  42726. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42727. }
  42728. var body io.Reader = nil
  42729. c.urlParams_.Set("alt", alt)
  42730. c.urlParams_.Set("prettyPrint", "false")
  42731. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/family/{family}")
  42732. urls += "?" + c.urlParams_.Encode()
  42733. req, err := http.NewRequest("GET", urls, body)
  42734. if err != nil {
  42735. return nil, err
  42736. }
  42737. req.Header = reqHeaders
  42738. googleapi.Expand(req.URL, map[string]string{
  42739. "project": c.project,
  42740. "family": c.family,
  42741. })
  42742. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42743. }
  42744. // Do executes the "compute.images.getFromFamily" call.
  42745. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  42746. // code is an error. Response headers are in either
  42747. // *Image.ServerResponse.Header or (if a response was returned at all)
  42748. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  42749. // check whether the returned error was because http.StatusNotModified
  42750. // was returned.
  42751. func (c *ImagesGetFromFamilyCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  42752. gensupport.SetOptions(c.urlParams_, opts...)
  42753. res, err := c.doRequest("json")
  42754. if res != nil && res.StatusCode == http.StatusNotModified {
  42755. if res.Body != nil {
  42756. res.Body.Close()
  42757. }
  42758. return nil, &googleapi.Error{
  42759. Code: res.StatusCode,
  42760. Header: res.Header,
  42761. }
  42762. }
  42763. if err != nil {
  42764. return nil, err
  42765. }
  42766. defer googleapi.CloseBody(res)
  42767. if err := googleapi.CheckResponse(res); err != nil {
  42768. return nil, err
  42769. }
  42770. ret := &Image{
  42771. ServerResponse: googleapi.ServerResponse{
  42772. Header: res.Header,
  42773. HTTPStatusCode: res.StatusCode,
  42774. },
  42775. }
  42776. target := &ret
  42777. if err := gensupport.DecodeResponse(target, res); err != nil {
  42778. return nil, err
  42779. }
  42780. return ret, nil
  42781. // {
  42782. // "description": "Returns the latest image that is part of an image family and is not deprecated.",
  42783. // "httpMethod": "GET",
  42784. // "id": "compute.images.getFromFamily",
  42785. // "parameterOrder": [
  42786. // "project",
  42787. // "family"
  42788. // ],
  42789. // "parameters": {
  42790. // "family": {
  42791. // "description": "Name of the image family to search for.",
  42792. // "location": "path",
  42793. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42794. // "required": true,
  42795. // "type": "string"
  42796. // },
  42797. // "project": {
  42798. // "description": "Project ID for this request.",
  42799. // "location": "path",
  42800. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42801. // "required": true,
  42802. // "type": "string"
  42803. // }
  42804. // },
  42805. // "path": "{project}/global/images/family/{family}",
  42806. // "response": {
  42807. // "$ref": "Image"
  42808. // },
  42809. // "scopes": [
  42810. // "https://www.googleapis.com/auth/cloud-platform",
  42811. // "https://www.googleapis.com/auth/compute",
  42812. // "https://www.googleapis.com/auth/compute.readonly"
  42813. // ]
  42814. // }
  42815. }
  42816. // method id "compute.images.getIamPolicy":
  42817. type ImagesGetIamPolicyCall struct {
  42818. s *Service
  42819. project string
  42820. resource string
  42821. urlParams_ gensupport.URLParams
  42822. ifNoneMatch_ string
  42823. ctx_ context.Context
  42824. header_ http.Header
  42825. }
  42826. // GetIamPolicy: Gets the access control policy for a resource. May be
  42827. // empty if no such policy or resource exists.
  42828. func (r *ImagesService) GetIamPolicy(project string, resource string) *ImagesGetIamPolicyCall {
  42829. c := &ImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42830. c.project = project
  42831. c.resource = resource
  42832. return c
  42833. }
  42834. // Fields allows partial responses to be retrieved. See
  42835. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42836. // for more information.
  42837. func (c *ImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesGetIamPolicyCall {
  42838. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42839. return c
  42840. }
  42841. // IfNoneMatch sets the optional parameter which makes the operation
  42842. // fail if the object's ETag matches the given value. This is useful for
  42843. // getting updates only after the object has changed since the last
  42844. // request. Use googleapi.IsNotModified to check whether the response
  42845. // error from Do is the result of In-None-Match.
  42846. func (c *ImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *ImagesGetIamPolicyCall {
  42847. c.ifNoneMatch_ = entityTag
  42848. return c
  42849. }
  42850. // Context sets the context to be used in this call's Do method. Any
  42851. // pending HTTP request will be aborted if the provided context is
  42852. // canceled.
  42853. func (c *ImagesGetIamPolicyCall) Context(ctx context.Context) *ImagesGetIamPolicyCall {
  42854. c.ctx_ = ctx
  42855. return c
  42856. }
  42857. // Header returns an http.Header that can be modified by the caller to
  42858. // add HTTP headers to the request.
  42859. func (c *ImagesGetIamPolicyCall) Header() http.Header {
  42860. if c.header_ == nil {
  42861. c.header_ = make(http.Header)
  42862. }
  42863. return c.header_
  42864. }
  42865. func (c *ImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  42866. reqHeaders := make(http.Header)
  42867. for k, v := range c.header_ {
  42868. reqHeaders[k] = v
  42869. }
  42870. reqHeaders.Set("User-Agent", c.s.userAgent())
  42871. if c.ifNoneMatch_ != "" {
  42872. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42873. }
  42874. var body io.Reader = nil
  42875. c.urlParams_.Set("alt", alt)
  42876. c.urlParams_.Set("prettyPrint", "false")
  42877. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/getIamPolicy")
  42878. urls += "?" + c.urlParams_.Encode()
  42879. req, err := http.NewRequest("GET", urls, body)
  42880. if err != nil {
  42881. return nil, err
  42882. }
  42883. req.Header = reqHeaders
  42884. googleapi.Expand(req.URL, map[string]string{
  42885. "project": c.project,
  42886. "resource": c.resource,
  42887. })
  42888. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42889. }
  42890. // Do executes the "compute.images.getIamPolicy" call.
  42891. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  42892. // code is an error. Response headers are in either
  42893. // *Policy.ServerResponse.Header or (if a response was returned at all)
  42894. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  42895. // check whether the returned error was because http.StatusNotModified
  42896. // was returned.
  42897. func (c *ImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  42898. gensupport.SetOptions(c.urlParams_, opts...)
  42899. res, err := c.doRequest("json")
  42900. if res != nil && res.StatusCode == http.StatusNotModified {
  42901. if res.Body != nil {
  42902. res.Body.Close()
  42903. }
  42904. return nil, &googleapi.Error{
  42905. Code: res.StatusCode,
  42906. Header: res.Header,
  42907. }
  42908. }
  42909. if err != nil {
  42910. return nil, err
  42911. }
  42912. defer googleapi.CloseBody(res)
  42913. if err := googleapi.CheckResponse(res); err != nil {
  42914. return nil, err
  42915. }
  42916. ret := &Policy{
  42917. ServerResponse: googleapi.ServerResponse{
  42918. Header: res.Header,
  42919. HTTPStatusCode: res.StatusCode,
  42920. },
  42921. }
  42922. target := &ret
  42923. if err := gensupport.DecodeResponse(target, res); err != nil {
  42924. return nil, err
  42925. }
  42926. return ret, nil
  42927. // {
  42928. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  42929. // "httpMethod": "GET",
  42930. // "id": "compute.images.getIamPolicy",
  42931. // "parameterOrder": [
  42932. // "project",
  42933. // "resource"
  42934. // ],
  42935. // "parameters": {
  42936. // "project": {
  42937. // "description": "Project ID for this request.",
  42938. // "location": "path",
  42939. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42940. // "required": true,
  42941. // "type": "string"
  42942. // },
  42943. // "resource": {
  42944. // "description": "Name or id of the resource for this request.",
  42945. // "location": "path",
  42946. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42947. // "required": true,
  42948. // "type": "string"
  42949. // }
  42950. // },
  42951. // "path": "{project}/global/images/{resource}/getIamPolicy",
  42952. // "response": {
  42953. // "$ref": "Policy"
  42954. // },
  42955. // "scopes": [
  42956. // "https://www.googleapis.com/auth/cloud-platform",
  42957. // "https://www.googleapis.com/auth/compute",
  42958. // "https://www.googleapis.com/auth/compute.readonly"
  42959. // ]
  42960. // }
  42961. }
  42962. // method id "compute.images.insert":
  42963. type ImagesInsertCall struct {
  42964. s *Service
  42965. project string
  42966. image *Image
  42967. urlParams_ gensupport.URLParams
  42968. ctx_ context.Context
  42969. header_ http.Header
  42970. }
  42971. // Insert: Creates an image in the specified project using the data
  42972. // included in the request.
  42973. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert
  42974. func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
  42975. c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42976. c.project = project
  42977. c.image = image
  42978. return c
  42979. }
  42980. // ForceCreate sets the optional parameter "forceCreate": Force image
  42981. // creation if true.
  42982. func (c *ImagesInsertCall) ForceCreate(forceCreate bool) *ImagesInsertCall {
  42983. c.urlParams_.Set("forceCreate", fmt.Sprint(forceCreate))
  42984. return c
  42985. }
  42986. // RequestId sets the optional parameter "requestId": An optional
  42987. // request ID to identify requests. Specify a unique request ID so that
  42988. // if you must retry your request, the server will know to ignore the
  42989. // request if it has already been completed.
  42990. //
  42991. // For example, consider a situation where you make an initial request
  42992. // and the request times out. If you make the request again with the
  42993. // same request ID, the server can check if original operation with the
  42994. // same request ID was received, and if so, will ignore the second
  42995. // request. This prevents clients from accidentally creating duplicate
  42996. // commitments.
  42997. //
  42998. // The request ID must be a valid UUID with the exception that zero UUID
  42999. // is not supported (00000000-0000-0000-0000-000000000000).
  43000. func (c *ImagesInsertCall) RequestId(requestId string) *ImagesInsertCall {
  43001. c.urlParams_.Set("requestId", requestId)
  43002. return c
  43003. }
  43004. // Fields allows partial responses to be retrieved. See
  43005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43006. // for more information.
  43007. func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
  43008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43009. return c
  43010. }
  43011. // Context sets the context to be used in this call's Do method. Any
  43012. // pending HTTP request will be aborted if the provided context is
  43013. // canceled.
  43014. func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
  43015. c.ctx_ = ctx
  43016. return c
  43017. }
  43018. // Header returns an http.Header that can be modified by the caller to
  43019. // add HTTP headers to the request.
  43020. func (c *ImagesInsertCall) Header() http.Header {
  43021. if c.header_ == nil {
  43022. c.header_ = make(http.Header)
  43023. }
  43024. return c.header_
  43025. }
  43026. func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  43027. reqHeaders := make(http.Header)
  43028. for k, v := range c.header_ {
  43029. reqHeaders[k] = v
  43030. }
  43031. reqHeaders.Set("User-Agent", c.s.userAgent())
  43032. var body io.Reader = nil
  43033. body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
  43034. if err != nil {
  43035. return nil, err
  43036. }
  43037. reqHeaders.Set("Content-Type", "application/json")
  43038. c.urlParams_.Set("alt", alt)
  43039. c.urlParams_.Set("prettyPrint", "false")
  43040. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  43041. urls += "?" + c.urlParams_.Encode()
  43042. req, err := http.NewRequest("POST", urls, body)
  43043. if err != nil {
  43044. return nil, err
  43045. }
  43046. req.Header = reqHeaders
  43047. googleapi.Expand(req.URL, map[string]string{
  43048. "project": c.project,
  43049. })
  43050. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43051. }
  43052. // Do executes the "compute.images.insert" call.
  43053. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43054. // status code is an error. Response headers are in either
  43055. // *Operation.ServerResponse.Header or (if a response was returned at
  43056. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43057. // to check whether the returned error was because
  43058. // http.StatusNotModified was returned.
  43059. func (c *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43060. gensupport.SetOptions(c.urlParams_, opts...)
  43061. res, err := c.doRequest("json")
  43062. if res != nil && res.StatusCode == http.StatusNotModified {
  43063. if res.Body != nil {
  43064. res.Body.Close()
  43065. }
  43066. return nil, &googleapi.Error{
  43067. Code: res.StatusCode,
  43068. Header: res.Header,
  43069. }
  43070. }
  43071. if err != nil {
  43072. return nil, err
  43073. }
  43074. defer googleapi.CloseBody(res)
  43075. if err := googleapi.CheckResponse(res); err != nil {
  43076. return nil, err
  43077. }
  43078. ret := &Operation{
  43079. ServerResponse: googleapi.ServerResponse{
  43080. Header: res.Header,
  43081. HTTPStatusCode: res.StatusCode,
  43082. },
  43083. }
  43084. target := &ret
  43085. if err := gensupport.DecodeResponse(target, res); err != nil {
  43086. return nil, err
  43087. }
  43088. return ret, nil
  43089. // {
  43090. // "description": "Creates an image in the specified project using the data included in the request.",
  43091. // "httpMethod": "POST",
  43092. // "id": "compute.images.insert",
  43093. // "parameterOrder": [
  43094. // "project"
  43095. // ],
  43096. // "parameters": {
  43097. // "forceCreate": {
  43098. // "description": "Force image creation if true.",
  43099. // "location": "query",
  43100. // "type": "boolean"
  43101. // },
  43102. // "project": {
  43103. // "description": "Project ID for this request.",
  43104. // "location": "path",
  43105. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43106. // "required": true,
  43107. // "type": "string"
  43108. // },
  43109. // "requestId": {
  43110. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43111. // "location": "query",
  43112. // "type": "string"
  43113. // }
  43114. // },
  43115. // "path": "{project}/global/images",
  43116. // "request": {
  43117. // "$ref": "Image"
  43118. // },
  43119. // "response": {
  43120. // "$ref": "Operation"
  43121. // },
  43122. // "scopes": [
  43123. // "https://www.googleapis.com/auth/cloud-platform",
  43124. // "https://www.googleapis.com/auth/compute",
  43125. // "https://www.googleapis.com/auth/devstorage.full_control",
  43126. // "https://www.googleapis.com/auth/devstorage.read_only",
  43127. // "https://www.googleapis.com/auth/devstorage.read_write"
  43128. // ]
  43129. // }
  43130. }
  43131. // method id "compute.images.list":
  43132. type ImagesListCall struct {
  43133. s *Service
  43134. project string
  43135. urlParams_ gensupport.URLParams
  43136. ifNoneMatch_ string
  43137. ctx_ context.Context
  43138. header_ http.Header
  43139. }
  43140. // List: Retrieves the list of custom images available to the specified
  43141. // project. Custom images are images you create that belong to your
  43142. // project. This method does not get any images that belong to other
  43143. // projects, including publicly-available images, like Debian 8. If you
  43144. // want to get a list of publicly-available images, use this method to
  43145. // make a request to the respective image project, such as debian-cloud
  43146. // or windows-cloud.
  43147. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/list
  43148. func (r *ImagesService) List(project string) *ImagesListCall {
  43149. c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43150. c.project = project
  43151. return c
  43152. }
  43153. // Filter sets the optional parameter "filter": A filter expression that
  43154. // filters resources listed in the response. The expression must specify
  43155. // the field name, a comparison operator, and the value that you want to
  43156. // use for filtering. The value must be a string, a number, or a
  43157. // boolean. The comparison operator must be either =, !=, >, or <.
  43158. //
  43159. // For example, if you are filtering Compute Engine instances, you can
  43160. // exclude instances named example-instance by specifying name !=
  43161. // example-instance.
  43162. //
  43163. // You can also filter nested fields. For example, you could specify
  43164. // scheduling.automaticRestart = false to include instances only if they
  43165. // are not scheduled for automatic restarts. You can use filtering on
  43166. // nested fields to filter based on resource labels.
  43167. //
  43168. // To filter on multiple expressions, provide each separate expression
  43169. // within parentheses. For example, (scheduling.automaticRestart = true)
  43170. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  43171. // AND expression. However, you can include AND and OR expressions
  43172. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  43173. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  43174. // true).
  43175. func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
  43176. c.urlParams_.Set("filter", filter)
  43177. return c
  43178. }
  43179. // MaxResults sets the optional parameter "maxResults": The maximum
  43180. // number of results per page that should be returned. If the number of
  43181. // available results is larger than maxResults, Compute Engine returns a
  43182. // nextPageToken that can be used to get the next page of results in
  43183. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  43184. // (Default: 500)
  43185. func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
  43186. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43187. return c
  43188. }
  43189. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  43190. // a certain order. By default, results are returned in alphanumerical
  43191. // order based on the resource name.
  43192. //
  43193. // You can also sort results in descending order based on the creation
  43194. // timestamp using orderBy="creationTimestamp desc". This sorts results
  43195. // based on the creationTimestamp field in reverse chronological order
  43196. // (newest result first). Use this to sort resources like operations so
  43197. // that the newest operation is returned first.
  43198. //
  43199. // Currently, only sorting by name or creationTimestamp desc is
  43200. // supported.
  43201. func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall {
  43202. c.urlParams_.Set("orderBy", orderBy)
  43203. return c
  43204. }
  43205. // PageToken sets the optional parameter "pageToken": Specifies a page
  43206. // token to use. Set pageToken to the nextPageToken returned by a
  43207. // previous list request to get the next page of results.
  43208. func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
  43209. c.urlParams_.Set("pageToken", pageToken)
  43210. return c
  43211. }
  43212. // Fields allows partial responses to be retrieved. See
  43213. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43214. // for more information.
  43215. func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
  43216. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43217. return c
  43218. }
  43219. // IfNoneMatch sets the optional parameter which makes the operation
  43220. // fail if the object's ETag matches the given value. This is useful for
  43221. // getting updates only after the object has changed since the last
  43222. // request. Use googleapi.IsNotModified to check whether the response
  43223. // error from Do is the result of In-None-Match.
  43224. func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
  43225. c.ifNoneMatch_ = entityTag
  43226. return c
  43227. }
  43228. // Context sets the context to be used in this call's Do method. Any
  43229. // pending HTTP request will be aborted if the provided context is
  43230. // canceled.
  43231. func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
  43232. c.ctx_ = ctx
  43233. return c
  43234. }
  43235. // Header returns an http.Header that can be modified by the caller to
  43236. // add HTTP headers to the request.
  43237. func (c *ImagesListCall) Header() http.Header {
  43238. if c.header_ == nil {
  43239. c.header_ = make(http.Header)
  43240. }
  43241. return c.header_
  43242. }
  43243. func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
  43244. reqHeaders := make(http.Header)
  43245. for k, v := range c.header_ {
  43246. reqHeaders[k] = v
  43247. }
  43248. reqHeaders.Set("User-Agent", c.s.userAgent())
  43249. if c.ifNoneMatch_ != "" {
  43250. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43251. }
  43252. var body io.Reader = nil
  43253. c.urlParams_.Set("alt", alt)
  43254. c.urlParams_.Set("prettyPrint", "false")
  43255. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  43256. urls += "?" + c.urlParams_.Encode()
  43257. req, err := http.NewRequest("GET", urls, body)
  43258. if err != nil {
  43259. return nil, err
  43260. }
  43261. req.Header = reqHeaders
  43262. googleapi.Expand(req.URL, map[string]string{
  43263. "project": c.project,
  43264. })
  43265. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43266. }
  43267. // Do executes the "compute.images.list" call.
  43268. // Exactly one of *ImageList or error will be non-nil. Any non-2xx
  43269. // status code is an error. Response headers are in either
  43270. // *ImageList.ServerResponse.Header or (if a response was returned at
  43271. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43272. // to check whether the returned error was because
  43273. // http.StatusNotModified was returned.
  43274. func (c *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, error) {
  43275. gensupport.SetOptions(c.urlParams_, opts...)
  43276. res, err := c.doRequest("json")
  43277. if res != nil && res.StatusCode == http.StatusNotModified {
  43278. if res.Body != nil {
  43279. res.Body.Close()
  43280. }
  43281. return nil, &googleapi.Error{
  43282. Code: res.StatusCode,
  43283. Header: res.Header,
  43284. }
  43285. }
  43286. if err != nil {
  43287. return nil, err
  43288. }
  43289. defer googleapi.CloseBody(res)
  43290. if err := googleapi.CheckResponse(res); err != nil {
  43291. return nil, err
  43292. }
  43293. ret := &ImageList{
  43294. ServerResponse: googleapi.ServerResponse{
  43295. Header: res.Header,
  43296. HTTPStatusCode: res.StatusCode,
  43297. },
  43298. }
  43299. target := &ret
  43300. if err := gensupport.DecodeResponse(target, res); err != nil {
  43301. return nil, err
  43302. }
  43303. return ret, nil
  43304. // {
  43305. // "description": "Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.",
  43306. // "httpMethod": "GET",
  43307. // "id": "compute.images.list",
  43308. // "parameterOrder": [
  43309. // "project"
  43310. // ],
  43311. // "parameters": {
  43312. // "filter": {
  43313. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  43314. // "location": "query",
  43315. // "type": "string"
  43316. // },
  43317. // "maxResults": {
  43318. // "default": "500",
  43319. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  43320. // "format": "uint32",
  43321. // "location": "query",
  43322. // "minimum": "0",
  43323. // "type": "integer"
  43324. // },
  43325. // "orderBy": {
  43326. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  43327. // "location": "query",
  43328. // "type": "string"
  43329. // },
  43330. // "pageToken": {
  43331. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  43332. // "location": "query",
  43333. // "type": "string"
  43334. // },
  43335. // "project": {
  43336. // "description": "Project ID for this request.",
  43337. // "location": "path",
  43338. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43339. // "required": true,
  43340. // "type": "string"
  43341. // }
  43342. // },
  43343. // "path": "{project}/global/images",
  43344. // "response": {
  43345. // "$ref": "ImageList"
  43346. // },
  43347. // "scopes": [
  43348. // "https://www.googleapis.com/auth/cloud-platform",
  43349. // "https://www.googleapis.com/auth/compute",
  43350. // "https://www.googleapis.com/auth/compute.readonly"
  43351. // ]
  43352. // }
  43353. }
  43354. // Pages invokes f for each page of results.
  43355. // A non-nil error returned from f will halt the iteration.
  43356. // The provided context supersedes any context provided to the Context method.
  43357. func (c *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error {
  43358. c.ctx_ = ctx
  43359. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43360. for {
  43361. x, err := c.Do()
  43362. if err != nil {
  43363. return err
  43364. }
  43365. if err := f(x); err != nil {
  43366. return err
  43367. }
  43368. if x.NextPageToken == "" {
  43369. return nil
  43370. }
  43371. c.PageToken(x.NextPageToken)
  43372. }
  43373. }
  43374. // method id "compute.images.setIamPolicy":
  43375. type ImagesSetIamPolicyCall struct {
  43376. s *Service
  43377. project string
  43378. resource string
  43379. globalsetpolicyrequest *GlobalSetPolicyRequest
  43380. urlParams_ gensupport.URLParams
  43381. ctx_ context.Context
  43382. header_ http.Header
  43383. }
  43384. // SetIamPolicy: Sets the access control policy on the specified
  43385. // resource. Replaces any existing policy.
  43386. func (r *ImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *ImagesSetIamPolicyCall {
  43387. c := &ImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43388. c.project = project
  43389. c.resource = resource
  43390. c.globalsetpolicyrequest = globalsetpolicyrequest
  43391. return c
  43392. }
  43393. // Fields allows partial responses to be retrieved. See
  43394. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43395. // for more information.
  43396. func (c *ImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesSetIamPolicyCall {
  43397. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43398. return c
  43399. }
  43400. // Context sets the context to be used in this call's Do method. Any
  43401. // pending HTTP request will be aborted if the provided context is
  43402. // canceled.
  43403. func (c *ImagesSetIamPolicyCall) Context(ctx context.Context) *ImagesSetIamPolicyCall {
  43404. c.ctx_ = ctx
  43405. return c
  43406. }
  43407. // Header returns an http.Header that can be modified by the caller to
  43408. // add HTTP headers to the request.
  43409. func (c *ImagesSetIamPolicyCall) Header() http.Header {
  43410. if c.header_ == nil {
  43411. c.header_ = make(http.Header)
  43412. }
  43413. return c.header_
  43414. }
  43415. func (c *ImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  43416. reqHeaders := make(http.Header)
  43417. for k, v := range c.header_ {
  43418. reqHeaders[k] = v
  43419. }
  43420. reqHeaders.Set("User-Agent", c.s.userAgent())
  43421. var body io.Reader = nil
  43422. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  43423. if err != nil {
  43424. return nil, err
  43425. }
  43426. reqHeaders.Set("Content-Type", "application/json")
  43427. c.urlParams_.Set("alt", alt)
  43428. c.urlParams_.Set("prettyPrint", "false")
  43429. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setIamPolicy")
  43430. urls += "?" + c.urlParams_.Encode()
  43431. req, err := http.NewRequest("POST", urls, body)
  43432. if err != nil {
  43433. return nil, err
  43434. }
  43435. req.Header = reqHeaders
  43436. googleapi.Expand(req.URL, map[string]string{
  43437. "project": c.project,
  43438. "resource": c.resource,
  43439. })
  43440. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43441. }
  43442. // Do executes the "compute.images.setIamPolicy" call.
  43443. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  43444. // code is an error. Response headers are in either
  43445. // *Policy.ServerResponse.Header or (if a response was returned at all)
  43446. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  43447. // check whether the returned error was because http.StatusNotModified
  43448. // was returned.
  43449. func (c *ImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  43450. gensupport.SetOptions(c.urlParams_, opts...)
  43451. res, err := c.doRequest("json")
  43452. if res != nil && res.StatusCode == http.StatusNotModified {
  43453. if res.Body != nil {
  43454. res.Body.Close()
  43455. }
  43456. return nil, &googleapi.Error{
  43457. Code: res.StatusCode,
  43458. Header: res.Header,
  43459. }
  43460. }
  43461. if err != nil {
  43462. return nil, err
  43463. }
  43464. defer googleapi.CloseBody(res)
  43465. if err := googleapi.CheckResponse(res); err != nil {
  43466. return nil, err
  43467. }
  43468. ret := &Policy{
  43469. ServerResponse: googleapi.ServerResponse{
  43470. Header: res.Header,
  43471. HTTPStatusCode: res.StatusCode,
  43472. },
  43473. }
  43474. target := &ret
  43475. if err := gensupport.DecodeResponse(target, res); err != nil {
  43476. return nil, err
  43477. }
  43478. return ret, nil
  43479. // {
  43480. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  43481. // "httpMethod": "POST",
  43482. // "id": "compute.images.setIamPolicy",
  43483. // "parameterOrder": [
  43484. // "project",
  43485. // "resource"
  43486. // ],
  43487. // "parameters": {
  43488. // "project": {
  43489. // "description": "Project ID for this request.",
  43490. // "location": "path",
  43491. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43492. // "required": true,
  43493. // "type": "string"
  43494. // },
  43495. // "resource": {
  43496. // "description": "Name or id of the resource for this request.",
  43497. // "location": "path",
  43498. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43499. // "required": true,
  43500. // "type": "string"
  43501. // }
  43502. // },
  43503. // "path": "{project}/global/images/{resource}/setIamPolicy",
  43504. // "request": {
  43505. // "$ref": "GlobalSetPolicyRequest"
  43506. // },
  43507. // "response": {
  43508. // "$ref": "Policy"
  43509. // },
  43510. // "scopes": [
  43511. // "https://www.googleapis.com/auth/cloud-platform",
  43512. // "https://www.googleapis.com/auth/compute"
  43513. // ]
  43514. // }
  43515. }
  43516. // method id "compute.images.setLabels":
  43517. type ImagesSetLabelsCall struct {
  43518. s *Service
  43519. project string
  43520. resource string
  43521. globalsetlabelsrequest *GlobalSetLabelsRequest
  43522. urlParams_ gensupport.URLParams
  43523. ctx_ context.Context
  43524. header_ http.Header
  43525. }
  43526. // SetLabels: Sets the labels on an image. To learn more about labels,
  43527. // read the Labeling Resources documentation.
  43528. func (r *ImagesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ImagesSetLabelsCall {
  43529. c := &ImagesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43530. c.project = project
  43531. c.resource = resource
  43532. c.globalsetlabelsrequest = globalsetlabelsrequest
  43533. return c
  43534. }
  43535. // Fields allows partial responses to be retrieved. See
  43536. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43537. // for more information.
  43538. func (c *ImagesSetLabelsCall) Fields(s ...googleapi.Field) *ImagesSetLabelsCall {
  43539. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43540. return c
  43541. }
  43542. // Context sets the context to be used in this call's Do method. Any
  43543. // pending HTTP request will be aborted if the provided context is
  43544. // canceled.
  43545. func (c *ImagesSetLabelsCall) Context(ctx context.Context) *ImagesSetLabelsCall {
  43546. c.ctx_ = ctx
  43547. return c
  43548. }
  43549. // Header returns an http.Header that can be modified by the caller to
  43550. // add HTTP headers to the request.
  43551. func (c *ImagesSetLabelsCall) Header() http.Header {
  43552. if c.header_ == nil {
  43553. c.header_ = make(http.Header)
  43554. }
  43555. return c.header_
  43556. }
  43557. func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  43558. reqHeaders := make(http.Header)
  43559. for k, v := range c.header_ {
  43560. reqHeaders[k] = v
  43561. }
  43562. reqHeaders.Set("User-Agent", c.s.userAgent())
  43563. var body io.Reader = nil
  43564. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  43565. if err != nil {
  43566. return nil, err
  43567. }
  43568. reqHeaders.Set("Content-Type", "application/json")
  43569. c.urlParams_.Set("alt", alt)
  43570. c.urlParams_.Set("prettyPrint", "false")
  43571. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setLabels")
  43572. urls += "?" + c.urlParams_.Encode()
  43573. req, err := http.NewRequest("POST", urls, body)
  43574. if err != nil {
  43575. return nil, err
  43576. }
  43577. req.Header = reqHeaders
  43578. googleapi.Expand(req.URL, map[string]string{
  43579. "project": c.project,
  43580. "resource": c.resource,
  43581. })
  43582. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43583. }
  43584. // Do executes the "compute.images.setLabels" call.
  43585. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43586. // status code is an error. Response headers are in either
  43587. // *Operation.ServerResponse.Header or (if a response was returned at
  43588. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43589. // to check whether the returned error was because
  43590. // http.StatusNotModified was returned.
  43591. func (c *ImagesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43592. gensupport.SetOptions(c.urlParams_, opts...)
  43593. res, err := c.doRequest("json")
  43594. if res != nil && res.StatusCode == http.StatusNotModified {
  43595. if res.Body != nil {
  43596. res.Body.Close()
  43597. }
  43598. return nil, &googleapi.Error{
  43599. Code: res.StatusCode,
  43600. Header: res.Header,
  43601. }
  43602. }
  43603. if err != nil {
  43604. return nil, err
  43605. }
  43606. defer googleapi.CloseBody(res)
  43607. if err := googleapi.CheckResponse(res); err != nil {
  43608. return nil, err
  43609. }
  43610. ret := &Operation{
  43611. ServerResponse: googleapi.ServerResponse{
  43612. Header: res.Header,
  43613. HTTPStatusCode: res.StatusCode,
  43614. },
  43615. }
  43616. target := &ret
  43617. if err := gensupport.DecodeResponse(target, res); err != nil {
  43618. return nil, err
  43619. }
  43620. return ret, nil
  43621. // {
  43622. // "description": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.",
  43623. // "httpMethod": "POST",
  43624. // "id": "compute.images.setLabels",
  43625. // "parameterOrder": [
  43626. // "project",
  43627. // "resource"
  43628. // ],
  43629. // "parameters": {
  43630. // "project": {
  43631. // "description": "Project ID for this request.",
  43632. // "location": "path",
  43633. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43634. // "required": true,
  43635. // "type": "string"
  43636. // },
  43637. // "resource": {
  43638. // "description": "Name or id of the resource for this request.",
  43639. // "location": "path",
  43640. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43641. // "required": true,
  43642. // "type": "string"
  43643. // }
  43644. // },
  43645. // "path": "{project}/global/images/{resource}/setLabels",
  43646. // "request": {
  43647. // "$ref": "GlobalSetLabelsRequest"
  43648. // },
  43649. // "response": {
  43650. // "$ref": "Operation"
  43651. // },
  43652. // "scopes": [
  43653. // "https://www.googleapis.com/auth/cloud-platform",
  43654. // "https://www.googleapis.com/auth/compute"
  43655. // ]
  43656. // }
  43657. }
  43658. // method id "compute.images.testIamPermissions":
  43659. type ImagesTestIamPermissionsCall struct {
  43660. s *Service
  43661. project string
  43662. resource string
  43663. testpermissionsrequest *TestPermissionsRequest
  43664. urlParams_ gensupport.URLParams
  43665. ctx_ context.Context
  43666. header_ http.Header
  43667. }
  43668. // TestIamPermissions: Returns permissions that a caller has on the
  43669. // specified resource.
  43670. func (r *ImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ImagesTestIamPermissionsCall {
  43671. c := &ImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43672. c.project = project
  43673. c.resource = resource
  43674. c.testpermissionsrequest = testpermissionsrequest
  43675. return c
  43676. }
  43677. // Fields allows partial responses to be retrieved. See
  43678. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43679. // for more information.
  43680. func (c *ImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ImagesTestIamPermissionsCall {
  43681. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43682. return c
  43683. }
  43684. // Context sets the context to be used in this call's Do method. Any
  43685. // pending HTTP request will be aborted if the provided context is
  43686. // canceled.
  43687. func (c *ImagesTestIamPermissionsCall) Context(ctx context.Context) *ImagesTestIamPermissionsCall {
  43688. c.ctx_ = ctx
  43689. return c
  43690. }
  43691. // Header returns an http.Header that can be modified by the caller to
  43692. // add HTTP headers to the request.
  43693. func (c *ImagesTestIamPermissionsCall) Header() http.Header {
  43694. if c.header_ == nil {
  43695. c.header_ = make(http.Header)
  43696. }
  43697. return c.header_
  43698. }
  43699. func (c *ImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  43700. reqHeaders := make(http.Header)
  43701. for k, v := range c.header_ {
  43702. reqHeaders[k] = v
  43703. }
  43704. reqHeaders.Set("User-Agent", c.s.userAgent())
  43705. var body io.Reader = nil
  43706. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  43707. if err != nil {
  43708. return nil, err
  43709. }
  43710. reqHeaders.Set("Content-Type", "application/json")
  43711. c.urlParams_.Set("alt", alt)
  43712. c.urlParams_.Set("prettyPrint", "false")
  43713. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/testIamPermissions")
  43714. urls += "?" + c.urlParams_.Encode()
  43715. req, err := http.NewRequest("POST", urls, body)
  43716. if err != nil {
  43717. return nil, err
  43718. }
  43719. req.Header = reqHeaders
  43720. googleapi.Expand(req.URL, map[string]string{
  43721. "project": c.project,
  43722. "resource": c.resource,
  43723. })
  43724. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43725. }
  43726. // Do executes the "compute.images.testIamPermissions" call.
  43727. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  43728. // non-2xx status code is an error. Response headers are in either
  43729. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  43730. // returned at all) in error.(*googleapi.Error).Header. Use
  43731. // googleapi.IsNotModified to check whether the returned error was
  43732. // because http.StatusNotModified was returned.
  43733. func (c *ImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  43734. gensupport.SetOptions(c.urlParams_, opts...)
  43735. res, err := c.doRequest("json")
  43736. if res != nil && res.StatusCode == http.StatusNotModified {
  43737. if res.Body != nil {
  43738. res.Body.Close()
  43739. }
  43740. return nil, &googleapi.Error{
  43741. Code: res.StatusCode,
  43742. Header: res.Header,
  43743. }
  43744. }
  43745. if err != nil {
  43746. return nil, err
  43747. }
  43748. defer googleapi.CloseBody(res)
  43749. if err := googleapi.CheckResponse(res); err != nil {
  43750. return nil, err
  43751. }
  43752. ret := &TestPermissionsResponse{
  43753. ServerResponse: googleapi.ServerResponse{
  43754. Header: res.Header,
  43755. HTTPStatusCode: res.StatusCode,
  43756. },
  43757. }
  43758. target := &ret
  43759. if err := gensupport.DecodeResponse(target, res); err != nil {
  43760. return nil, err
  43761. }
  43762. return ret, nil
  43763. // {
  43764. // "description": "Returns permissions that a caller has on the specified resource.",
  43765. // "httpMethod": "POST",
  43766. // "id": "compute.images.testIamPermissions",
  43767. // "parameterOrder": [
  43768. // "project",
  43769. // "resource"
  43770. // ],
  43771. // "parameters": {
  43772. // "project": {
  43773. // "description": "Project ID for this request.",
  43774. // "location": "path",
  43775. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43776. // "required": true,
  43777. // "type": "string"
  43778. // },
  43779. // "resource": {
  43780. // "description": "Name or id of the resource for this request.",
  43781. // "location": "path",
  43782. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43783. // "required": true,
  43784. // "type": "string"
  43785. // }
  43786. // },
  43787. // "path": "{project}/global/images/{resource}/testIamPermissions",
  43788. // "request": {
  43789. // "$ref": "TestPermissionsRequest"
  43790. // },
  43791. // "response": {
  43792. // "$ref": "TestPermissionsResponse"
  43793. // },
  43794. // "scopes": [
  43795. // "https://www.googleapis.com/auth/cloud-platform",
  43796. // "https://www.googleapis.com/auth/compute",
  43797. // "https://www.googleapis.com/auth/compute.readonly"
  43798. // ]
  43799. // }
  43800. }
  43801. // method id "compute.instanceGroupManagers.abandonInstances":
  43802. type InstanceGroupManagersAbandonInstancesCall struct {
  43803. s *Service
  43804. project string
  43805. zone string
  43806. instanceGroupManager string
  43807. instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
  43808. urlParams_ gensupport.URLParams
  43809. ctx_ context.Context
  43810. header_ http.Header
  43811. }
  43812. // AbandonInstances: Flags the specified instances to be removed from
  43813. // the managed instance group. Abandoning an instance does not delete
  43814. // the instance, but it does remove the instance from any target pools
  43815. // that are applied by the managed instance group. This method reduces
  43816. // the targetSize of the managed instance group by the number of
  43817. // instances that you abandon. This operation is marked as DONE when the
  43818. // action is scheduled even if the instances have not yet been removed
  43819. // from the group. You must separately verify the status of the
  43820. // abandoning action with the listmanagedinstances method.
  43821. //
  43822. // If the group is part of a backend service that has enabled connection
  43823. // draining, it can take up to 60 seconds after the connection draining
  43824. // duration has elapsed before the VM instance is removed or
  43825. // deleted.
  43826. //
  43827. // You can specify a maximum of 1000 instances with this method per
  43828. // request.
  43829. func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
  43830. c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43831. c.project = project
  43832. c.zone = zone
  43833. c.instanceGroupManager = instanceGroupManager
  43834. c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
  43835. return c
  43836. }
  43837. // RequestId sets the optional parameter "requestId": An optional
  43838. // request ID to identify requests. Specify a unique request ID so that
  43839. // if you must retry your request, the server will know to ignore the
  43840. // request if it has already been completed.
  43841. //
  43842. // For example, consider a situation where you make an initial request
  43843. // and the request times out. If you make the request again with the
  43844. // same request ID, the server can check if original operation with the
  43845. // same request ID was received, and if so, will ignore the second
  43846. // request. This prevents clients from accidentally creating duplicate
  43847. // commitments.
  43848. //
  43849. // The request ID must be a valid UUID with the exception that zero UUID
  43850. // is not supported (00000000-0000-0000-0000-000000000000).
  43851. func (c *InstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *InstanceGroupManagersAbandonInstancesCall {
  43852. c.urlParams_.Set("requestId", requestId)
  43853. return c
  43854. }
  43855. // Fields allows partial responses to be retrieved. See
  43856. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43857. // for more information.
  43858. func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
  43859. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43860. return c
  43861. }
  43862. // Context sets the context to be used in this call's Do method. Any
  43863. // pending HTTP request will be aborted if the provided context is
  43864. // canceled.
  43865. func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
  43866. c.ctx_ = ctx
  43867. return c
  43868. }
  43869. // Header returns an http.Header that can be modified by the caller to
  43870. // add HTTP headers to the request.
  43871. func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  43872. if c.header_ == nil {
  43873. c.header_ = make(http.Header)
  43874. }
  43875. return c.header_
  43876. }
  43877. func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  43878. reqHeaders := make(http.Header)
  43879. for k, v := range c.header_ {
  43880. reqHeaders[k] = v
  43881. }
  43882. reqHeaders.Set("User-Agent", c.s.userAgent())
  43883. var body io.Reader = nil
  43884. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
  43885. if err != nil {
  43886. return nil, err
  43887. }
  43888. reqHeaders.Set("Content-Type", "application/json")
  43889. c.urlParams_.Set("alt", alt)
  43890. c.urlParams_.Set("prettyPrint", "false")
  43891. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  43892. urls += "?" + c.urlParams_.Encode()
  43893. req, err := http.NewRequest("POST", urls, body)
  43894. if err != nil {
  43895. return nil, err
  43896. }
  43897. req.Header = reqHeaders
  43898. googleapi.Expand(req.URL, map[string]string{
  43899. "project": c.project,
  43900. "zone": c.zone,
  43901. "instanceGroupManager": c.instanceGroupManager,
  43902. })
  43903. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43904. }
  43905. // Do executes the "compute.instanceGroupManagers.abandonInstances" call.
  43906. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43907. // status code is an error. Response headers are in either
  43908. // *Operation.ServerResponse.Header or (if a response was returned at
  43909. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43910. // to check whether the returned error was because
  43911. // http.StatusNotModified was returned.
  43912. func (c *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43913. gensupport.SetOptions(c.urlParams_, opts...)
  43914. res, err := c.doRequest("json")
  43915. if res != nil && res.StatusCode == http.StatusNotModified {
  43916. if res.Body != nil {
  43917. res.Body.Close()
  43918. }
  43919. return nil, &googleapi.Error{
  43920. Code: res.StatusCode,
  43921. Header: res.Header,
  43922. }
  43923. }
  43924. if err != nil {
  43925. return nil, err
  43926. }
  43927. defer googleapi.CloseBody(res)
  43928. if err := googleapi.CheckResponse(res); err != nil {
  43929. return nil, err
  43930. }
  43931. ret := &Operation{
  43932. ServerResponse: googleapi.ServerResponse{
  43933. Header: res.Header,
  43934. HTTPStatusCode: res.StatusCode,
  43935. },
  43936. }
  43937. target := &ret
  43938. if err := gensupport.DecodeResponse(target, res); err != nil {
  43939. return nil, err
  43940. }
  43941. return ret, nil
  43942. // {
  43943. // "description": "Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  43944. // "httpMethod": "POST",
  43945. // "id": "compute.instanceGroupManagers.abandonInstances",
  43946. // "parameterOrder": [
  43947. // "project",
  43948. // "zone",
  43949. // "instanceGroupManager"
  43950. // ],
  43951. // "parameters": {
  43952. // "instanceGroupManager": {
  43953. // "description": "The name of the managed instance group.",
  43954. // "location": "path",
  43955. // "required": true,
  43956. // "type": "string"
  43957. // },
  43958. // "project": {
  43959. // "description": "Project ID for this request.",
  43960. // "location": "path",
  43961. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43962. // "required": true,
  43963. // "type": "string"
  43964. // },
  43965. // "requestId": {
  43966. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43967. // "location": "query",
  43968. // "type": "string"
  43969. // },
  43970. // "zone": {
  43971. // "description": "The name of the zone where the managed instance group is located.",
  43972. // "location": "path",
  43973. // "required": true,
  43974. // "type": "string"
  43975. // }
  43976. // },
  43977. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  43978. // "request": {
  43979. // "$ref": "InstanceGroupManagersAbandonInstancesRequest"
  43980. // },
  43981. // "response": {
  43982. // "$ref": "Operation"
  43983. // },
  43984. // "scopes": [
  43985. // "https://www.googleapis.com/auth/cloud-platform",
  43986. // "https://www.googleapis.com/auth/compute"
  43987. // ]
  43988. // }
  43989. }
  43990. // method id "compute.instanceGroupManagers.aggregatedList":
  43991. type InstanceGroupManagersAggregatedListCall struct {
  43992. s *Service
  43993. project string
  43994. urlParams_ gensupport.URLParams
  43995. ifNoneMatch_ string
  43996. ctx_ context.Context
  43997. header_ http.Header
  43998. }
  43999. // AggregatedList: Retrieves the list of managed instance groups and
  44000. // groups them by zone.
  44001. func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
  44002. c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44003. c.project = project
  44004. return c
  44005. }
  44006. // Filter sets the optional parameter "filter": A filter expression that
  44007. // filters resources listed in the response. The expression must specify
  44008. // the field name, a comparison operator, and the value that you want to
  44009. // use for filtering. The value must be a string, a number, or a
  44010. // boolean. The comparison operator must be either =, !=, >, or <.
  44011. //
  44012. // For example, if you are filtering Compute Engine instances, you can
  44013. // exclude instances named example-instance by specifying name !=
  44014. // example-instance.
  44015. //
  44016. // You can also filter nested fields. For example, you could specify
  44017. // scheduling.automaticRestart = false to include instances only if they
  44018. // are not scheduled for automatic restarts. You can use filtering on
  44019. // nested fields to filter based on resource labels.
  44020. //
  44021. // To filter on multiple expressions, provide each separate expression
  44022. // within parentheses. For example, (scheduling.automaticRestart = true)
  44023. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  44024. // AND expression. However, you can include AND and OR expressions
  44025. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  44026. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  44027. // true).
  44028. func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall {
  44029. c.urlParams_.Set("filter", filter)
  44030. return c
  44031. }
  44032. // MaxResults sets the optional parameter "maxResults": The maximum
  44033. // number of results per page that should be returned. If the number of
  44034. // available results is larger than maxResults, Compute Engine returns a
  44035. // nextPageToken that can be used to get the next page of results in
  44036. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  44037. // (Default: 500)
  44038. func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall {
  44039. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44040. return c
  44041. }
  44042. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  44043. // a certain order. By default, results are returned in alphanumerical
  44044. // order based on the resource name.
  44045. //
  44046. // You can also sort results in descending order based on the creation
  44047. // timestamp using orderBy="creationTimestamp desc". This sorts results
  44048. // based on the creationTimestamp field in reverse chronological order
  44049. // (newest result first). Use this to sort resources like operations so
  44050. // that the newest operation is returned first.
  44051. //
  44052. // Currently, only sorting by name or creationTimestamp desc is
  44053. // supported.
  44054. func (c *InstanceGroupManagersAggregatedListCall) OrderBy(orderBy string) *InstanceGroupManagersAggregatedListCall {
  44055. c.urlParams_.Set("orderBy", orderBy)
  44056. return c
  44057. }
  44058. // PageToken sets the optional parameter "pageToken": Specifies a page
  44059. // token to use. Set pageToken to the nextPageToken returned by a
  44060. // previous list request to get the next page of results.
  44061. func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall {
  44062. c.urlParams_.Set("pageToken", pageToken)
  44063. return c
  44064. }
  44065. // Fields allows partial responses to be retrieved. See
  44066. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44067. // for more information.
  44068. func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall {
  44069. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44070. return c
  44071. }
  44072. // IfNoneMatch sets the optional parameter which makes the operation
  44073. // fail if the object's ETag matches the given value. This is useful for
  44074. // getting updates only after the object has changed since the last
  44075. // request. Use googleapi.IsNotModified to check whether the response
  44076. // error from Do is the result of In-None-Match.
  44077. func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall {
  44078. c.ifNoneMatch_ = entityTag
  44079. return c
  44080. }
  44081. // Context sets the context to be used in this call's Do method. Any
  44082. // pending HTTP request will be aborted if the provided context is
  44083. // canceled.
  44084. func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall {
  44085. c.ctx_ = ctx
  44086. return c
  44087. }
  44088. // Header returns an http.Header that can be modified by the caller to
  44089. // add HTTP headers to the request.
  44090. func (c *InstanceGroupManagersAggregatedListCall) Header() http.Header {
  44091. if c.header_ == nil {
  44092. c.header_ = make(http.Header)
  44093. }
  44094. return c.header_
  44095. }
  44096. func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  44097. reqHeaders := make(http.Header)
  44098. for k, v := range c.header_ {
  44099. reqHeaders[k] = v
  44100. }
  44101. reqHeaders.Set("User-Agent", c.s.userAgent())
  44102. if c.ifNoneMatch_ != "" {
  44103. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44104. }
  44105. var body io.Reader = nil
  44106. c.urlParams_.Set("alt", alt)
  44107. c.urlParams_.Set("prettyPrint", "false")
  44108. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers")
  44109. urls += "?" + c.urlParams_.Encode()
  44110. req, err := http.NewRequest("GET", urls, body)
  44111. if err != nil {
  44112. return nil, err
  44113. }
  44114. req.Header = reqHeaders
  44115. googleapi.Expand(req.URL, map[string]string{
  44116. "project": c.project,
  44117. })
  44118. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44119. }
  44120. // Do executes the "compute.instanceGroupManagers.aggregatedList" call.
  44121. // Exactly one of *InstanceGroupManagerAggregatedList or error will be
  44122. // non-nil. Any non-2xx status code is an error. Response headers are in
  44123. // either *InstanceGroupManagerAggregatedList.ServerResponse.Header or
  44124. // (if a response was returned at all) in
  44125. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  44126. // whether the returned error was because http.StatusNotModified was
  44127. // returned.
  44128. func (c *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerAggregatedList, error) {
  44129. gensupport.SetOptions(c.urlParams_, opts...)
  44130. res, err := c.doRequest("json")
  44131. if res != nil && res.StatusCode == http.StatusNotModified {
  44132. if res.Body != nil {
  44133. res.Body.Close()
  44134. }
  44135. return nil, &googleapi.Error{
  44136. Code: res.StatusCode,
  44137. Header: res.Header,
  44138. }
  44139. }
  44140. if err != nil {
  44141. return nil, err
  44142. }
  44143. defer googleapi.CloseBody(res)
  44144. if err := googleapi.CheckResponse(res); err != nil {
  44145. return nil, err
  44146. }
  44147. ret := &InstanceGroupManagerAggregatedList{
  44148. ServerResponse: googleapi.ServerResponse{
  44149. Header: res.Header,
  44150. HTTPStatusCode: res.StatusCode,
  44151. },
  44152. }
  44153. target := &ret
  44154. if err := gensupport.DecodeResponse(target, res); err != nil {
  44155. return nil, err
  44156. }
  44157. return ret, nil
  44158. // {
  44159. // "description": "Retrieves the list of managed instance groups and groups them by zone.",
  44160. // "httpMethod": "GET",
  44161. // "id": "compute.instanceGroupManagers.aggregatedList",
  44162. // "parameterOrder": [
  44163. // "project"
  44164. // ],
  44165. // "parameters": {
  44166. // "filter": {
  44167. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  44168. // "location": "query",
  44169. // "type": "string"
  44170. // },
  44171. // "maxResults": {
  44172. // "default": "500",
  44173. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  44174. // "format": "uint32",
  44175. // "location": "query",
  44176. // "minimum": "0",
  44177. // "type": "integer"
  44178. // },
  44179. // "orderBy": {
  44180. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  44181. // "location": "query",
  44182. // "type": "string"
  44183. // },
  44184. // "pageToken": {
  44185. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  44186. // "location": "query",
  44187. // "type": "string"
  44188. // },
  44189. // "project": {
  44190. // "description": "Project ID for this request.",
  44191. // "location": "path",
  44192. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44193. // "required": true,
  44194. // "type": "string"
  44195. // }
  44196. // },
  44197. // "path": "{project}/aggregated/instanceGroupManagers",
  44198. // "response": {
  44199. // "$ref": "InstanceGroupManagerAggregatedList"
  44200. // },
  44201. // "scopes": [
  44202. // "https://www.googleapis.com/auth/cloud-platform",
  44203. // "https://www.googleapis.com/auth/compute",
  44204. // "https://www.googleapis.com/auth/compute.readonly"
  44205. // ]
  44206. // }
  44207. }
  44208. // Pages invokes f for each page of results.
  44209. // A non-nil error returned from f will halt the iteration.
  44210. // The provided context supersedes any context provided to the Context method.
  44211. func (c *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) error) error {
  44212. c.ctx_ = ctx
  44213. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44214. for {
  44215. x, err := c.Do()
  44216. if err != nil {
  44217. return err
  44218. }
  44219. if err := f(x); err != nil {
  44220. return err
  44221. }
  44222. if x.NextPageToken == "" {
  44223. return nil
  44224. }
  44225. c.PageToken(x.NextPageToken)
  44226. }
  44227. }
  44228. // method id "compute.instanceGroupManagers.delete":
  44229. type InstanceGroupManagersDeleteCall struct {
  44230. s *Service
  44231. project string
  44232. zone string
  44233. instanceGroupManager string
  44234. urlParams_ gensupport.URLParams
  44235. ctx_ context.Context
  44236. header_ http.Header
  44237. }
  44238. // Delete: Deletes the specified managed instance group and all of the
  44239. // instances in that group. Note that the instance group must not belong
  44240. // to a backend service. Read Deleting an instance group for more
  44241. // information.
  44242. func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
  44243. c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44244. c.project = project
  44245. c.zone = zone
  44246. c.instanceGroupManager = instanceGroupManager
  44247. return c
  44248. }
  44249. // RequestId sets the optional parameter "requestId": An optional
  44250. // request ID to identify requests. Specify a unique request ID so that
  44251. // if you must retry your request, the server will know to ignore the
  44252. // request if it has already been completed.
  44253. //
  44254. // For example, consider a situation where you make an initial request
  44255. // and the request times out. If you make the request again with the
  44256. // same request ID, the server can check if original operation with the
  44257. // same request ID was received, and if so, will ignore the second
  44258. // request. This prevents clients from accidentally creating duplicate
  44259. // commitments.
  44260. //
  44261. // The request ID must be a valid UUID with the exception that zero UUID
  44262. // is not supported (00000000-0000-0000-0000-000000000000).
  44263. func (c *InstanceGroupManagersDeleteCall) RequestId(requestId string) *InstanceGroupManagersDeleteCall {
  44264. c.urlParams_.Set("requestId", requestId)
  44265. return c
  44266. }
  44267. // Fields allows partial responses to be retrieved. See
  44268. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44269. // for more information.
  44270. func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
  44271. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44272. return c
  44273. }
  44274. // Context sets the context to be used in this call's Do method. Any
  44275. // pending HTTP request will be aborted if the provided context is
  44276. // canceled.
  44277. func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall {
  44278. c.ctx_ = ctx
  44279. return c
  44280. }
  44281. // Header returns an http.Header that can be modified by the caller to
  44282. // add HTTP headers to the request.
  44283. func (c *InstanceGroupManagersDeleteCall) Header() http.Header {
  44284. if c.header_ == nil {
  44285. c.header_ = make(http.Header)
  44286. }
  44287. return c.header_
  44288. }
  44289. func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  44290. reqHeaders := make(http.Header)
  44291. for k, v := range c.header_ {
  44292. reqHeaders[k] = v
  44293. }
  44294. reqHeaders.Set("User-Agent", c.s.userAgent())
  44295. var body io.Reader = nil
  44296. c.urlParams_.Set("alt", alt)
  44297. c.urlParams_.Set("prettyPrint", "false")
  44298. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  44299. urls += "?" + c.urlParams_.Encode()
  44300. req, err := http.NewRequest("DELETE", urls, body)
  44301. if err != nil {
  44302. return nil, err
  44303. }
  44304. req.Header = reqHeaders
  44305. googleapi.Expand(req.URL, map[string]string{
  44306. "project": c.project,
  44307. "zone": c.zone,
  44308. "instanceGroupManager": c.instanceGroupManager,
  44309. })
  44310. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44311. }
  44312. // Do executes the "compute.instanceGroupManagers.delete" call.
  44313. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44314. // status code is an error. Response headers are in either
  44315. // *Operation.ServerResponse.Header or (if a response was returned at
  44316. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44317. // to check whether the returned error was because
  44318. // http.StatusNotModified was returned.
  44319. func (c *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44320. gensupport.SetOptions(c.urlParams_, opts...)
  44321. res, err := c.doRequest("json")
  44322. if res != nil && res.StatusCode == http.StatusNotModified {
  44323. if res.Body != nil {
  44324. res.Body.Close()
  44325. }
  44326. return nil, &googleapi.Error{
  44327. Code: res.StatusCode,
  44328. Header: res.Header,
  44329. }
  44330. }
  44331. if err != nil {
  44332. return nil, err
  44333. }
  44334. defer googleapi.CloseBody(res)
  44335. if err := googleapi.CheckResponse(res); err != nil {
  44336. return nil, err
  44337. }
  44338. ret := &Operation{
  44339. ServerResponse: googleapi.ServerResponse{
  44340. Header: res.Header,
  44341. HTTPStatusCode: res.StatusCode,
  44342. },
  44343. }
  44344. target := &ret
  44345. if err := gensupport.DecodeResponse(target, res); err != nil {
  44346. return nil, err
  44347. }
  44348. return ret, nil
  44349. // {
  44350. // "description": "Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information.",
  44351. // "httpMethod": "DELETE",
  44352. // "id": "compute.instanceGroupManagers.delete",
  44353. // "parameterOrder": [
  44354. // "project",
  44355. // "zone",
  44356. // "instanceGroupManager"
  44357. // ],
  44358. // "parameters": {
  44359. // "instanceGroupManager": {
  44360. // "description": "The name of the managed instance group to delete.",
  44361. // "location": "path",
  44362. // "required": true,
  44363. // "type": "string"
  44364. // },
  44365. // "project": {
  44366. // "description": "Project ID for this request.",
  44367. // "location": "path",
  44368. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44369. // "required": true,
  44370. // "type": "string"
  44371. // },
  44372. // "requestId": {
  44373. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44374. // "location": "query",
  44375. // "type": "string"
  44376. // },
  44377. // "zone": {
  44378. // "description": "The name of the zone where the managed instance group is located.",
  44379. // "location": "path",
  44380. // "required": true,
  44381. // "type": "string"
  44382. // }
  44383. // },
  44384. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  44385. // "response": {
  44386. // "$ref": "Operation"
  44387. // },
  44388. // "scopes": [
  44389. // "https://www.googleapis.com/auth/cloud-platform",
  44390. // "https://www.googleapis.com/auth/compute"
  44391. // ]
  44392. // }
  44393. }
  44394. // method id "compute.instanceGroupManagers.deleteInstances":
  44395. type InstanceGroupManagersDeleteInstancesCall struct {
  44396. s *Service
  44397. project string
  44398. zone string
  44399. instanceGroupManager string
  44400. instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
  44401. urlParams_ gensupport.URLParams
  44402. ctx_ context.Context
  44403. header_ http.Header
  44404. }
  44405. // DeleteInstances: Flags the specified instances in the managed
  44406. // instance group for immediate deletion. The instances are also removed
  44407. // from any target pools of which they were a member. This method
  44408. // reduces the targetSize of the managed instance group by the number of
  44409. // instances that you delete. This operation is marked as DONE when the
  44410. // action is scheduled even if the instances are still being deleted.
  44411. // You must separately verify the status of the deleting action with the
  44412. // listmanagedinstances method.
  44413. //
  44414. // If the group is part of a backend service that has enabled connection
  44415. // draining, it can take up to 60 seconds after the connection draining
  44416. // duration has elapsed before the VM instance is removed or
  44417. // deleted.
  44418. //
  44419. // You can specify a maximum of 1000 instances with this method per
  44420. // request.
  44421. func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
  44422. c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44423. c.project = project
  44424. c.zone = zone
  44425. c.instanceGroupManager = instanceGroupManager
  44426. c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
  44427. return c
  44428. }
  44429. // RequestId sets the optional parameter "requestId": An optional
  44430. // request ID to identify requests. Specify a unique request ID so that
  44431. // if you must retry your request, the server will know to ignore the
  44432. // request if it has already been completed.
  44433. //
  44434. // For example, consider a situation where you make an initial request
  44435. // and the request times out. If you make the request again with the
  44436. // same request ID, the server can check if original operation with the
  44437. // same request ID was received, and if so, will ignore the second
  44438. // request. This prevents clients from accidentally creating duplicate
  44439. // commitments.
  44440. //
  44441. // The request ID must be a valid UUID with the exception that zero UUID
  44442. // is not supported (00000000-0000-0000-0000-000000000000).
  44443. func (c *InstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *InstanceGroupManagersDeleteInstancesCall {
  44444. c.urlParams_.Set("requestId", requestId)
  44445. return c
  44446. }
  44447. // Fields allows partial responses to be retrieved. See
  44448. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44449. // for more information.
  44450. func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
  44451. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44452. return c
  44453. }
  44454. // Context sets the context to be used in this call's Do method. Any
  44455. // pending HTTP request will be aborted if the provided context is
  44456. // canceled.
  44457. func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall {
  44458. c.ctx_ = ctx
  44459. return c
  44460. }
  44461. // Header returns an http.Header that can be modified by the caller to
  44462. // add HTTP headers to the request.
  44463. func (c *InstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  44464. if c.header_ == nil {
  44465. c.header_ = make(http.Header)
  44466. }
  44467. return c.header_
  44468. }
  44469. func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  44470. reqHeaders := make(http.Header)
  44471. for k, v := range c.header_ {
  44472. reqHeaders[k] = v
  44473. }
  44474. reqHeaders.Set("User-Agent", c.s.userAgent())
  44475. var body io.Reader = nil
  44476. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
  44477. if err != nil {
  44478. return nil, err
  44479. }
  44480. reqHeaders.Set("Content-Type", "application/json")
  44481. c.urlParams_.Set("alt", alt)
  44482. c.urlParams_.Set("prettyPrint", "false")
  44483. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  44484. urls += "?" + c.urlParams_.Encode()
  44485. req, err := http.NewRequest("POST", urls, body)
  44486. if err != nil {
  44487. return nil, err
  44488. }
  44489. req.Header = reqHeaders
  44490. googleapi.Expand(req.URL, map[string]string{
  44491. "project": c.project,
  44492. "zone": c.zone,
  44493. "instanceGroupManager": c.instanceGroupManager,
  44494. })
  44495. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44496. }
  44497. // Do executes the "compute.instanceGroupManagers.deleteInstances" call.
  44498. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44499. // status code is an error. Response headers are in either
  44500. // *Operation.ServerResponse.Header or (if a response was returned at
  44501. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44502. // to check whether the returned error was because
  44503. // http.StatusNotModified was returned.
  44504. func (c *InstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44505. gensupport.SetOptions(c.urlParams_, opts...)
  44506. res, err := c.doRequest("json")
  44507. if res != nil && res.StatusCode == http.StatusNotModified {
  44508. if res.Body != nil {
  44509. res.Body.Close()
  44510. }
  44511. return nil, &googleapi.Error{
  44512. Code: res.StatusCode,
  44513. Header: res.Header,
  44514. }
  44515. }
  44516. if err != nil {
  44517. return nil, err
  44518. }
  44519. defer googleapi.CloseBody(res)
  44520. if err := googleapi.CheckResponse(res); err != nil {
  44521. return nil, err
  44522. }
  44523. ret := &Operation{
  44524. ServerResponse: googleapi.ServerResponse{
  44525. Header: res.Header,
  44526. HTTPStatusCode: res.StatusCode,
  44527. },
  44528. }
  44529. target := &ret
  44530. if err := gensupport.DecodeResponse(target, res); err != nil {
  44531. return nil, err
  44532. }
  44533. return ret, nil
  44534. // {
  44535. // "description": "Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  44536. // "httpMethod": "POST",
  44537. // "id": "compute.instanceGroupManagers.deleteInstances",
  44538. // "parameterOrder": [
  44539. // "project",
  44540. // "zone",
  44541. // "instanceGroupManager"
  44542. // ],
  44543. // "parameters": {
  44544. // "instanceGroupManager": {
  44545. // "description": "The name of the managed instance group.",
  44546. // "location": "path",
  44547. // "required": true,
  44548. // "type": "string"
  44549. // },
  44550. // "project": {
  44551. // "description": "Project ID for this request.",
  44552. // "location": "path",
  44553. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44554. // "required": true,
  44555. // "type": "string"
  44556. // },
  44557. // "requestId": {
  44558. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44559. // "location": "query",
  44560. // "type": "string"
  44561. // },
  44562. // "zone": {
  44563. // "description": "The name of the zone where the managed instance group is located.",
  44564. // "location": "path",
  44565. // "required": true,
  44566. // "type": "string"
  44567. // }
  44568. // },
  44569. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  44570. // "request": {
  44571. // "$ref": "InstanceGroupManagersDeleteInstancesRequest"
  44572. // },
  44573. // "response": {
  44574. // "$ref": "Operation"
  44575. // },
  44576. // "scopes": [
  44577. // "https://www.googleapis.com/auth/cloud-platform",
  44578. // "https://www.googleapis.com/auth/compute"
  44579. // ]
  44580. // }
  44581. }
  44582. // method id "compute.instanceGroupManagers.get":
  44583. type InstanceGroupManagersGetCall struct {
  44584. s *Service
  44585. project string
  44586. zone string
  44587. instanceGroupManager string
  44588. urlParams_ gensupport.URLParams
  44589. ifNoneMatch_ string
  44590. ctx_ context.Context
  44591. header_ http.Header
  44592. }
  44593. // Get: Returns all of the details about the specified managed instance
  44594. // group. Gets a list of available managed instance groups by making a
  44595. // list() request.
  44596. func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
  44597. c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44598. c.project = project
  44599. c.zone = zone
  44600. c.instanceGroupManager = instanceGroupManager
  44601. return c
  44602. }
  44603. // Fields allows partial responses to be retrieved. See
  44604. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44605. // for more information.
  44606. func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
  44607. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44608. return c
  44609. }
  44610. // IfNoneMatch sets the optional parameter which makes the operation
  44611. // fail if the object's ETag matches the given value. This is useful for
  44612. // getting updates only after the object has changed since the last
  44613. // request. Use googleapi.IsNotModified to check whether the response
  44614. // error from Do is the result of In-None-Match.
  44615. func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall {
  44616. c.ifNoneMatch_ = entityTag
  44617. return c
  44618. }
  44619. // Context sets the context to be used in this call's Do method. Any
  44620. // pending HTTP request will be aborted if the provided context is
  44621. // canceled.
  44622. func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall {
  44623. c.ctx_ = ctx
  44624. return c
  44625. }
  44626. // Header returns an http.Header that can be modified by the caller to
  44627. // add HTTP headers to the request.
  44628. func (c *InstanceGroupManagersGetCall) Header() http.Header {
  44629. if c.header_ == nil {
  44630. c.header_ = make(http.Header)
  44631. }
  44632. return c.header_
  44633. }
  44634. func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  44635. reqHeaders := make(http.Header)
  44636. for k, v := range c.header_ {
  44637. reqHeaders[k] = v
  44638. }
  44639. reqHeaders.Set("User-Agent", c.s.userAgent())
  44640. if c.ifNoneMatch_ != "" {
  44641. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44642. }
  44643. var body io.Reader = nil
  44644. c.urlParams_.Set("alt", alt)
  44645. c.urlParams_.Set("prettyPrint", "false")
  44646. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  44647. urls += "?" + c.urlParams_.Encode()
  44648. req, err := http.NewRequest("GET", urls, body)
  44649. if err != nil {
  44650. return nil, err
  44651. }
  44652. req.Header = reqHeaders
  44653. googleapi.Expand(req.URL, map[string]string{
  44654. "project": c.project,
  44655. "zone": c.zone,
  44656. "instanceGroupManager": c.instanceGroupManager,
  44657. })
  44658. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44659. }
  44660. // Do executes the "compute.instanceGroupManagers.get" call.
  44661. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  44662. // non-2xx status code is an error. Response headers are in either
  44663. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  44664. // returned at all) in error.(*googleapi.Error).Header. Use
  44665. // googleapi.IsNotModified to check whether the returned error was
  44666. // because http.StatusNotModified was returned.
  44667. func (c *InstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  44668. gensupport.SetOptions(c.urlParams_, opts...)
  44669. res, err := c.doRequest("json")
  44670. if res != nil && res.StatusCode == http.StatusNotModified {
  44671. if res.Body != nil {
  44672. res.Body.Close()
  44673. }
  44674. return nil, &googleapi.Error{
  44675. Code: res.StatusCode,
  44676. Header: res.Header,
  44677. }
  44678. }
  44679. if err != nil {
  44680. return nil, err
  44681. }
  44682. defer googleapi.CloseBody(res)
  44683. if err := googleapi.CheckResponse(res); err != nil {
  44684. return nil, err
  44685. }
  44686. ret := &InstanceGroupManager{
  44687. ServerResponse: googleapi.ServerResponse{
  44688. Header: res.Header,
  44689. HTTPStatusCode: res.StatusCode,
  44690. },
  44691. }
  44692. target := &ret
  44693. if err := gensupport.DecodeResponse(target, res); err != nil {
  44694. return nil, err
  44695. }
  44696. return ret, nil
  44697. // {
  44698. // "description": "Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request.",
  44699. // "httpMethod": "GET",
  44700. // "id": "compute.instanceGroupManagers.get",
  44701. // "parameterOrder": [
  44702. // "project",
  44703. // "zone",
  44704. // "instanceGroupManager"
  44705. // ],
  44706. // "parameters": {
  44707. // "instanceGroupManager": {
  44708. // "description": "The name of the managed instance group.",
  44709. // "location": "path",
  44710. // "required": true,
  44711. // "type": "string"
  44712. // },
  44713. // "project": {
  44714. // "description": "Project ID for this request.",
  44715. // "location": "path",
  44716. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44717. // "required": true,
  44718. // "type": "string"
  44719. // },
  44720. // "zone": {
  44721. // "description": "The name of the zone where the managed instance group is located.",
  44722. // "location": "path",
  44723. // "required": true,
  44724. // "type": "string"
  44725. // }
  44726. // },
  44727. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  44728. // "response": {
  44729. // "$ref": "InstanceGroupManager"
  44730. // },
  44731. // "scopes": [
  44732. // "https://www.googleapis.com/auth/cloud-platform",
  44733. // "https://www.googleapis.com/auth/compute",
  44734. // "https://www.googleapis.com/auth/compute.readonly"
  44735. // ]
  44736. // }
  44737. }
  44738. // method id "compute.instanceGroupManagers.insert":
  44739. type InstanceGroupManagersInsertCall struct {
  44740. s *Service
  44741. project string
  44742. zone string
  44743. instancegroupmanager *InstanceGroupManager
  44744. urlParams_ gensupport.URLParams
  44745. ctx_ context.Context
  44746. header_ http.Header
  44747. }
  44748. // Insert: Creates a managed instance group using the information that
  44749. // you specify in the request. After the group is created, instances in
  44750. // the group are created using the specified instance template. This
  44751. // operation is marked as DONE when the group is created even if the
  44752. // instances in the group have not yet been created. You must separately
  44753. // verify the status of the individual instances with the
  44754. // listmanagedinstances method.
  44755. //
  44756. // A managed instance group can have up to 1000 VM instances per group.
  44757. // Please contact Cloud Support if you need an increase in this limit.
  44758. func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
  44759. c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44760. c.project = project
  44761. c.zone = zone
  44762. c.instancegroupmanager = instancegroupmanager
  44763. return c
  44764. }
  44765. // RequestId sets the optional parameter "requestId": An optional
  44766. // request ID to identify requests. Specify a unique request ID so that
  44767. // if you must retry your request, the server will know to ignore the
  44768. // request if it has already been completed.
  44769. //
  44770. // For example, consider a situation where you make an initial request
  44771. // and the request times out. If you make the request again with the
  44772. // same request ID, the server can check if original operation with the
  44773. // same request ID was received, and if so, will ignore the second
  44774. // request. This prevents clients from accidentally creating duplicate
  44775. // commitments.
  44776. //
  44777. // The request ID must be a valid UUID with the exception that zero UUID
  44778. // is not supported (00000000-0000-0000-0000-000000000000).
  44779. func (c *InstanceGroupManagersInsertCall) RequestId(requestId string) *InstanceGroupManagersInsertCall {
  44780. c.urlParams_.Set("requestId", requestId)
  44781. return c
  44782. }
  44783. // Fields allows partial responses to be retrieved. See
  44784. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44785. // for more information.
  44786. func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
  44787. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44788. return c
  44789. }
  44790. // Context sets the context to be used in this call's Do method. Any
  44791. // pending HTTP request will be aborted if the provided context is
  44792. // canceled.
  44793. func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall {
  44794. c.ctx_ = ctx
  44795. return c
  44796. }
  44797. // Header returns an http.Header that can be modified by the caller to
  44798. // add HTTP headers to the request.
  44799. func (c *InstanceGroupManagersInsertCall) Header() http.Header {
  44800. if c.header_ == nil {
  44801. c.header_ = make(http.Header)
  44802. }
  44803. return c.header_
  44804. }
  44805. func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  44806. reqHeaders := make(http.Header)
  44807. for k, v := range c.header_ {
  44808. reqHeaders[k] = v
  44809. }
  44810. reqHeaders.Set("User-Agent", c.s.userAgent())
  44811. var body io.Reader = nil
  44812. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  44813. if err != nil {
  44814. return nil, err
  44815. }
  44816. reqHeaders.Set("Content-Type", "application/json")
  44817. c.urlParams_.Set("alt", alt)
  44818. c.urlParams_.Set("prettyPrint", "false")
  44819. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  44820. urls += "?" + c.urlParams_.Encode()
  44821. req, err := http.NewRequest("POST", urls, body)
  44822. if err != nil {
  44823. return nil, err
  44824. }
  44825. req.Header = reqHeaders
  44826. googleapi.Expand(req.URL, map[string]string{
  44827. "project": c.project,
  44828. "zone": c.zone,
  44829. })
  44830. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44831. }
  44832. // Do executes the "compute.instanceGroupManagers.insert" call.
  44833. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44834. // status code is an error. Response headers are in either
  44835. // *Operation.ServerResponse.Header or (if a response was returned at
  44836. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44837. // to check whether the returned error was because
  44838. // http.StatusNotModified was returned.
  44839. func (c *InstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44840. gensupport.SetOptions(c.urlParams_, opts...)
  44841. res, err := c.doRequest("json")
  44842. if res != nil && res.StatusCode == http.StatusNotModified {
  44843. if res.Body != nil {
  44844. res.Body.Close()
  44845. }
  44846. return nil, &googleapi.Error{
  44847. Code: res.StatusCode,
  44848. Header: res.Header,
  44849. }
  44850. }
  44851. if err != nil {
  44852. return nil, err
  44853. }
  44854. defer googleapi.CloseBody(res)
  44855. if err := googleapi.CheckResponse(res); err != nil {
  44856. return nil, err
  44857. }
  44858. ret := &Operation{
  44859. ServerResponse: googleapi.ServerResponse{
  44860. Header: res.Header,
  44861. HTTPStatusCode: res.StatusCode,
  44862. },
  44863. }
  44864. target := &ret
  44865. if err := gensupport.DecodeResponse(target, res); err != nil {
  44866. return nil, err
  44867. }
  44868. return ret, nil
  44869. // {
  44870. // "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\n\nA managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit.",
  44871. // "httpMethod": "POST",
  44872. // "id": "compute.instanceGroupManagers.insert",
  44873. // "parameterOrder": [
  44874. // "project",
  44875. // "zone"
  44876. // ],
  44877. // "parameters": {
  44878. // "project": {
  44879. // "description": "Project ID for this request.",
  44880. // "location": "path",
  44881. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44882. // "required": true,
  44883. // "type": "string"
  44884. // },
  44885. // "requestId": {
  44886. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44887. // "location": "query",
  44888. // "type": "string"
  44889. // },
  44890. // "zone": {
  44891. // "description": "The name of the zone where you want to create the managed instance group.",
  44892. // "location": "path",
  44893. // "required": true,
  44894. // "type": "string"
  44895. // }
  44896. // },
  44897. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  44898. // "request": {
  44899. // "$ref": "InstanceGroupManager"
  44900. // },
  44901. // "response": {
  44902. // "$ref": "Operation"
  44903. // },
  44904. // "scopes": [
  44905. // "https://www.googleapis.com/auth/cloud-platform",
  44906. // "https://www.googleapis.com/auth/compute"
  44907. // ]
  44908. // }
  44909. }
  44910. // method id "compute.instanceGroupManagers.list":
  44911. type InstanceGroupManagersListCall struct {
  44912. s *Service
  44913. project string
  44914. zone string
  44915. urlParams_ gensupport.URLParams
  44916. ifNoneMatch_ string
  44917. ctx_ context.Context
  44918. header_ http.Header
  44919. }
  44920. // List: Retrieves a list of managed instance groups that are contained
  44921. // within the specified project and zone.
  44922. func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
  44923. c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44924. c.project = project
  44925. c.zone = zone
  44926. return c
  44927. }
  44928. // Filter sets the optional parameter "filter": A filter expression that
  44929. // filters resources listed in the response. The expression must specify
  44930. // the field name, a comparison operator, and the value that you want to
  44931. // use for filtering. The value must be a string, a number, or a
  44932. // boolean. The comparison operator must be either =, !=, >, or <.
  44933. //
  44934. // For example, if you are filtering Compute Engine instances, you can
  44935. // exclude instances named example-instance by specifying name !=
  44936. // example-instance.
  44937. //
  44938. // You can also filter nested fields. For example, you could specify
  44939. // scheduling.automaticRestart = false to include instances only if they
  44940. // are not scheduled for automatic restarts. You can use filtering on
  44941. // nested fields to filter based on resource labels.
  44942. //
  44943. // To filter on multiple expressions, provide each separate expression
  44944. // within parentheses. For example, (scheduling.automaticRestart = true)
  44945. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  44946. // AND expression. However, you can include AND and OR expressions
  44947. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  44948. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  44949. // true).
  44950. func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
  44951. c.urlParams_.Set("filter", filter)
  44952. return c
  44953. }
  44954. // MaxResults sets the optional parameter "maxResults": The maximum
  44955. // number of results per page that should be returned. If the number of
  44956. // available results is larger than maxResults, Compute Engine returns a
  44957. // nextPageToken that can be used to get the next page of results in
  44958. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  44959. // (Default: 500)
  44960. func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
  44961. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44962. return c
  44963. }
  44964. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  44965. // a certain order. By default, results are returned in alphanumerical
  44966. // order based on the resource name.
  44967. //
  44968. // You can also sort results in descending order based on the creation
  44969. // timestamp using orderBy="creationTimestamp desc". This sorts results
  44970. // based on the creationTimestamp field in reverse chronological order
  44971. // (newest result first). Use this to sort resources like operations so
  44972. // that the newest operation is returned first.
  44973. //
  44974. // Currently, only sorting by name or creationTimestamp desc is
  44975. // supported.
  44976. func (c *InstanceGroupManagersListCall) OrderBy(orderBy string) *InstanceGroupManagersListCall {
  44977. c.urlParams_.Set("orderBy", orderBy)
  44978. return c
  44979. }
  44980. // PageToken sets the optional parameter "pageToken": Specifies a page
  44981. // token to use. Set pageToken to the nextPageToken returned by a
  44982. // previous list request to get the next page of results.
  44983. func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
  44984. c.urlParams_.Set("pageToken", pageToken)
  44985. return c
  44986. }
  44987. // Fields allows partial responses to be retrieved. See
  44988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44989. // for more information.
  44990. func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
  44991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44992. return c
  44993. }
  44994. // IfNoneMatch sets the optional parameter which makes the operation
  44995. // fail if the object's ETag matches the given value. This is useful for
  44996. // getting updates only after the object has changed since the last
  44997. // request. Use googleapi.IsNotModified to check whether the response
  44998. // error from Do is the result of In-None-Match.
  44999. func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall {
  45000. c.ifNoneMatch_ = entityTag
  45001. return c
  45002. }
  45003. // Context sets the context to be used in this call's Do method. Any
  45004. // pending HTTP request will be aborted if the provided context is
  45005. // canceled.
  45006. func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall {
  45007. c.ctx_ = ctx
  45008. return c
  45009. }
  45010. // Header returns an http.Header that can be modified by the caller to
  45011. // add HTTP headers to the request.
  45012. func (c *InstanceGroupManagersListCall) Header() http.Header {
  45013. if c.header_ == nil {
  45014. c.header_ = make(http.Header)
  45015. }
  45016. return c.header_
  45017. }
  45018. func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  45019. reqHeaders := make(http.Header)
  45020. for k, v := range c.header_ {
  45021. reqHeaders[k] = v
  45022. }
  45023. reqHeaders.Set("User-Agent", c.s.userAgent())
  45024. if c.ifNoneMatch_ != "" {
  45025. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45026. }
  45027. var body io.Reader = nil
  45028. c.urlParams_.Set("alt", alt)
  45029. c.urlParams_.Set("prettyPrint", "false")
  45030. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  45031. urls += "?" + c.urlParams_.Encode()
  45032. req, err := http.NewRequest("GET", urls, body)
  45033. if err != nil {
  45034. return nil, err
  45035. }
  45036. req.Header = reqHeaders
  45037. googleapi.Expand(req.URL, map[string]string{
  45038. "project": c.project,
  45039. "zone": c.zone,
  45040. })
  45041. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45042. }
  45043. // Do executes the "compute.instanceGroupManagers.list" call.
  45044. // Exactly one of *InstanceGroupManagerList or error will be non-nil.
  45045. // Any non-2xx status code is an error. Response headers are in either
  45046. // *InstanceGroupManagerList.ServerResponse.Header or (if a response was
  45047. // returned at all) in error.(*googleapi.Error).Header. Use
  45048. // googleapi.IsNotModified to check whether the returned error was
  45049. // because http.StatusNotModified was returned.
  45050. func (c *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerList, error) {
  45051. gensupport.SetOptions(c.urlParams_, opts...)
  45052. res, err := c.doRequest("json")
  45053. if res != nil && res.StatusCode == http.StatusNotModified {
  45054. if res.Body != nil {
  45055. res.Body.Close()
  45056. }
  45057. return nil, &googleapi.Error{
  45058. Code: res.StatusCode,
  45059. Header: res.Header,
  45060. }
  45061. }
  45062. if err != nil {
  45063. return nil, err
  45064. }
  45065. defer googleapi.CloseBody(res)
  45066. if err := googleapi.CheckResponse(res); err != nil {
  45067. return nil, err
  45068. }
  45069. ret := &InstanceGroupManagerList{
  45070. ServerResponse: googleapi.ServerResponse{
  45071. Header: res.Header,
  45072. HTTPStatusCode: res.StatusCode,
  45073. },
  45074. }
  45075. target := &ret
  45076. if err := gensupport.DecodeResponse(target, res); err != nil {
  45077. return nil, err
  45078. }
  45079. return ret, nil
  45080. // {
  45081. // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.",
  45082. // "httpMethod": "GET",
  45083. // "id": "compute.instanceGroupManagers.list",
  45084. // "parameterOrder": [
  45085. // "project",
  45086. // "zone"
  45087. // ],
  45088. // "parameters": {
  45089. // "filter": {
  45090. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  45091. // "location": "query",
  45092. // "type": "string"
  45093. // },
  45094. // "maxResults": {
  45095. // "default": "500",
  45096. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  45097. // "format": "uint32",
  45098. // "location": "query",
  45099. // "minimum": "0",
  45100. // "type": "integer"
  45101. // },
  45102. // "orderBy": {
  45103. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  45104. // "location": "query",
  45105. // "type": "string"
  45106. // },
  45107. // "pageToken": {
  45108. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  45109. // "location": "query",
  45110. // "type": "string"
  45111. // },
  45112. // "project": {
  45113. // "description": "Project ID for this request.",
  45114. // "location": "path",
  45115. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45116. // "required": true,
  45117. // "type": "string"
  45118. // },
  45119. // "zone": {
  45120. // "description": "The name of the zone where the managed instance group is located.",
  45121. // "location": "path",
  45122. // "required": true,
  45123. // "type": "string"
  45124. // }
  45125. // },
  45126. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  45127. // "response": {
  45128. // "$ref": "InstanceGroupManagerList"
  45129. // },
  45130. // "scopes": [
  45131. // "https://www.googleapis.com/auth/cloud-platform",
  45132. // "https://www.googleapis.com/auth/compute",
  45133. // "https://www.googleapis.com/auth/compute.readonly"
  45134. // ]
  45135. // }
  45136. }
  45137. // Pages invokes f for each page of results.
  45138. // A non-nil error returned from f will halt the iteration.
  45139. // The provided context supersedes any context provided to the Context method.
  45140. func (c *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) error) error {
  45141. c.ctx_ = ctx
  45142. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  45143. for {
  45144. x, err := c.Do()
  45145. if err != nil {
  45146. return err
  45147. }
  45148. if err := f(x); err != nil {
  45149. return err
  45150. }
  45151. if x.NextPageToken == "" {
  45152. return nil
  45153. }
  45154. c.PageToken(x.NextPageToken)
  45155. }
  45156. }
  45157. // method id "compute.instanceGroupManagers.listManagedInstances":
  45158. type InstanceGroupManagersListManagedInstancesCall struct {
  45159. s *Service
  45160. project string
  45161. zone string
  45162. instanceGroupManager string
  45163. urlParams_ gensupport.URLParams
  45164. ctx_ context.Context
  45165. header_ http.Header
  45166. }
  45167. // ListManagedInstances: Lists all of the instances in the managed
  45168. // instance group. Each instance in the list has a currentAction, which
  45169. // indicates the action that the managed instance group is performing on
  45170. // the instance. For example, if the group is still creating an
  45171. // instance, the currentAction is CREATING. If a previous action failed,
  45172. // the list displays the errors for that failed action.
  45173. func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall {
  45174. c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45175. c.project = project
  45176. c.zone = zone
  45177. c.instanceGroupManager = instanceGroupManager
  45178. return c
  45179. }
  45180. // Filter sets the optional parameter "filter": A filter expression that
  45181. // filters resources listed in the response. The expression must specify
  45182. // the field name, a comparison operator, and the value that you want to
  45183. // use for filtering. The value must be a string, a number, or a
  45184. // boolean. The comparison operator must be either =, !=, >, or <.
  45185. //
  45186. // For example, if you are filtering Compute Engine instances, you can
  45187. // exclude instances named example-instance by specifying name !=
  45188. // example-instance.
  45189. //
  45190. // You can also filter nested fields. For example, you could specify
  45191. // scheduling.automaticRestart = false to include instances only if they
  45192. // are not scheduled for automatic restarts. You can use filtering on
  45193. // nested fields to filter based on resource labels.
  45194. //
  45195. // To filter on multiple expressions, provide each separate expression
  45196. // within parentheses. For example, (scheduling.automaticRestart = true)
  45197. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  45198. // AND expression. However, you can include AND and OR expressions
  45199. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  45200. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  45201. // true).
  45202. func (c *InstanceGroupManagersListManagedInstancesCall) Filter(filter string) *InstanceGroupManagersListManagedInstancesCall {
  45203. c.urlParams_.Set("filter", filter)
  45204. return c
  45205. }
  45206. // MaxResults sets the optional parameter "maxResults": The maximum
  45207. // number of results per page that should be returned. If the number of
  45208. // available results is larger than maxResults, Compute Engine returns a
  45209. // nextPageToken that can be used to get the next page of results in
  45210. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  45211. // (Default: 500)
  45212. func (c *InstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *InstanceGroupManagersListManagedInstancesCall {
  45213. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  45214. return c
  45215. }
  45216. // OrderBy sets the optional parameter "order_by": Sorts list results by
  45217. // a certain order. By default, results are returned in alphanumerical
  45218. // order based on the resource name.
  45219. //
  45220. // You can also sort results in descending order based on the creation
  45221. // timestamp using orderBy="creationTimestamp desc". This sorts results
  45222. // based on the creationTimestamp field in reverse chronological order
  45223. // (newest result first). Use this to sort resources like operations so
  45224. // that the newest operation is returned first.
  45225. //
  45226. // Currently, only sorting by name or creationTimestamp desc is
  45227. // supported.
  45228. func (c *InstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *InstanceGroupManagersListManagedInstancesCall {
  45229. c.urlParams_.Set("order_by", orderBy)
  45230. return c
  45231. }
  45232. // PageToken sets the optional parameter "pageToken": Specifies a page
  45233. // token to use. Set pageToken to the nextPageToken returned by a
  45234. // previous list request to get the next page of results.
  45235. func (c *InstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *InstanceGroupManagersListManagedInstancesCall {
  45236. c.urlParams_.Set("pageToken", pageToken)
  45237. return c
  45238. }
  45239. // Fields allows partial responses to be retrieved. See
  45240. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45241. // for more information.
  45242. func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall {
  45243. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45244. return c
  45245. }
  45246. // Context sets the context to be used in this call's Do method. Any
  45247. // pending HTTP request will be aborted if the provided context is
  45248. // canceled.
  45249. func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall {
  45250. c.ctx_ = ctx
  45251. return c
  45252. }
  45253. // Header returns an http.Header that can be modified by the caller to
  45254. // add HTTP headers to the request.
  45255. func (c *InstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  45256. if c.header_ == nil {
  45257. c.header_ = make(http.Header)
  45258. }
  45259. return c.header_
  45260. }
  45261. func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  45262. reqHeaders := make(http.Header)
  45263. for k, v := range c.header_ {
  45264. reqHeaders[k] = v
  45265. }
  45266. reqHeaders.Set("User-Agent", c.s.userAgent())
  45267. var body io.Reader = nil
  45268. c.urlParams_.Set("alt", alt)
  45269. c.urlParams_.Set("prettyPrint", "false")
  45270. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  45271. urls += "?" + c.urlParams_.Encode()
  45272. req, err := http.NewRequest("POST", urls, body)
  45273. if err != nil {
  45274. return nil, err
  45275. }
  45276. req.Header = reqHeaders
  45277. googleapi.Expand(req.URL, map[string]string{
  45278. "project": c.project,
  45279. "zone": c.zone,
  45280. "instanceGroupManager": c.instanceGroupManager,
  45281. })
  45282. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45283. }
  45284. // Do executes the "compute.instanceGroupManagers.listManagedInstances" call.
  45285. // Exactly one of *InstanceGroupManagersListManagedInstancesResponse or
  45286. // error will be non-nil. Any non-2xx status code is an error. Response
  45287. // headers are in either
  45288. // *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head
  45289. // er or (if a response was returned at all) in
  45290. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  45291. // whether the returned error was because http.StatusNotModified was
  45292. // returned.
  45293. func (c *InstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListManagedInstancesResponse, error) {
  45294. gensupport.SetOptions(c.urlParams_, opts...)
  45295. res, err := c.doRequest("json")
  45296. if res != nil && res.StatusCode == http.StatusNotModified {
  45297. if res.Body != nil {
  45298. res.Body.Close()
  45299. }
  45300. return nil, &googleapi.Error{
  45301. Code: res.StatusCode,
  45302. Header: res.Header,
  45303. }
  45304. }
  45305. if err != nil {
  45306. return nil, err
  45307. }
  45308. defer googleapi.CloseBody(res)
  45309. if err := googleapi.CheckResponse(res); err != nil {
  45310. return nil, err
  45311. }
  45312. ret := &InstanceGroupManagersListManagedInstancesResponse{
  45313. ServerResponse: googleapi.ServerResponse{
  45314. Header: res.Header,
  45315. HTTPStatusCode: res.StatusCode,
  45316. },
  45317. }
  45318. target := &ret
  45319. if err := gensupport.DecodeResponse(target, res); err != nil {
  45320. return nil, err
  45321. }
  45322. return ret, nil
  45323. // {
  45324. // "description": "Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action.",
  45325. // "httpMethod": "POST",
  45326. // "id": "compute.instanceGroupManagers.listManagedInstances",
  45327. // "parameterOrder": [
  45328. // "project",
  45329. // "zone",
  45330. // "instanceGroupManager"
  45331. // ],
  45332. // "parameters": {
  45333. // "filter": {
  45334. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  45335. // "location": "query",
  45336. // "type": "string"
  45337. // },
  45338. // "instanceGroupManager": {
  45339. // "description": "The name of the managed instance group.",
  45340. // "location": "path",
  45341. // "required": true,
  45342. // "type": "string"
  45343. // },
  45344. // "maxResults": {
  45345. // "default": "500",
  45346. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  45347. // "format": "uint32",
  45348. // "location": "query",
  45349. // "minimum": "0",
  45350. // "type": "integer"
  45351. // },
  45352. // "order_by": {
  45353. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  45354. // "location": "query",
  45355. // "type": "string"
  45356. // },
  45357. // "pageToken": {
  45358. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  45359. // "location": "query",
  45360. // "type": "string"
  45361. // },
  45362. // "project": {
  45363. // "description": "Project ID for this request.",
  45364. // "location": "path",
  45365. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45366. // "required": true,
  45367. // "type": "string"
  45368. // },
  45369. // "zone": {
  45370. // "description": "The name of the zone where the managed instance group is located.",
  45371. // "location": "path",
  45372. // "required": true,
  45373. // "type": "string"
  45374. // }
  45375. // },
  45376. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  45377. // "response": {
  45378. // "$ref": "InstanceGroupManagersListManagedInstancesResponse"
  45379. // },
  45380. // "scopes": [
  45381. // "https://www.googleapis.com/auth/cloud-platform",
  45382. // "https://www.googleapis.com/auth/compute",
  45383. // "https://www.googleapis.com/auth/compute.readonly"
  45384. // ]
  45385. // }
  45386. }
  45387. // method id "compute.instanceGroupManagers.patch":
  45388. type InstanceGroupManagersPatchCall struct {
  45389. s *Service
  45390. project string
  45391. zone string
  45392. instanceGroupManager string
  45393. instancegroupmanager *InstanceGroupManager
  45394. urlParams_ gensupport.URLParams
  45395. ctx_ context.Context
  45396. header_ http.Header
  45397. }
  45398. // Patch: Updates a managed instance group using the information that
  45399. // you specify in the request. This operation is marked as DONE when the
  45400. // group is patched even if the instances in the group are still in the
  45401. // process of being patched. You must separately verify the status of
  45402. // the individual instances with the listManagedInstances method. This
  45403. // method supports PATCH semantics and uses the JSON merge patch format
  45404. // and processing rules.
  45405. func (r *InstanceGroupManagersService) Patch(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersPatchCall {
  45406. c := &InstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45407. c.project = project
  45408. c.zone = zone
  45409. c.instanceGroupManager = instanceGroupManager
  45410. c.instancegroupmanager = instancegroupmanager
  45411. return c
  45412. }
  45413. // RequestId sets the optional parameter "requestId": An optional
  45414. // request ID to identify requests. Specify a unique request ID so that
  45415. // if you must retry your request, the server will know to ignore the
  45416. // request if it has already been completed.
  45417. //
  45418. // For example, consider a situation where you make an initial request
  45419. // and the request times out. If you make the request again with the
  45420. // same request ID, the server can check if original operation with the
  45421. // same request ID was received, and if so, will ignore the second
  45422. // request. This prevents clients from accidentally creating duplicate
  45423. // commitments.
  45424. //
  45425. // The request ID must be a valid UUID with the exception that zero UUID
  45426. // is not supported (00000000-0000-0000-0000-000000000000).
  45427. func (c *InstanceGroupManagersPatchCall) RequestId(requestId string) *InstanceGroupManagersPatchCall {
  45428. c.urlParams_.Set("requestId", requestId)
  45429. return c
  45430. }
  45431. // Fields allows partial responses to be retrieved. See
  45432. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45433. // for more information.
  45434. func (c *InstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *InstanceGroupManagersPatchCall {
  45435. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45436. return c
  45437. }
  45438. // Context sets the context to be used in this call's Do method. Any
  45439. // pending HTTP request will be aborted if the provided context is
  45440. // canceled.
  45441. func (c *InstanceGroupManagersPatchCall) Context(ctx context.Context) *InstanceGroupManagersPatchCall {
  45442. c.ctx_ = ctx
  45443. return c
  45444. }
  45445. // Header returns an http.Header that can be modified by the caller to
  45446. // add HTTP headers to the request.
  45447. func (c *InstanceGroupManagersPatchCall) Header() http.Header {
  45448. if c.header_ == nil {
  45449. c.header_ = make(http.Header)
  45450. }
  45451. return c.header_
  45452. }
  45453. func (c *InstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  45454. reqHeaders := make(http.Header)
  45455. for k, v := range c.header_ {
  45456. reqHeaders[k] = v
  45457. }
  45458. reqHeaders.Set("User-Agent", c.s.userAgent())
  45459. var body io.Reader = nil
  45460. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  45461. if err != nil {
  45462. return nil, err
  45463. }
  45464. reqHeaders.Set("Content-Type", "application/json")
  45465. c.urlParams_.Set("alt", alt)
  45466. c.urlParams_.Set("prettyPrint", "false")
  45467. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  45468. urls += "?" + c.urlParams_.Encode()
  45469. req, err := http.NewRequest("PATCH", urls, body)
  45470. if err != nil {
  45471. return nil, err
  45472. }
  45473. req.Header = reqHeaders
  45474. googleapi.Expand(req.URL, map[string]string{
  45475. "project": c.project,
  45476. "zone": c.zone,
  45477. "instanceGroupManager": c.instanceGroupManager,
  45478. })
  45479. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45480. }
  45481. // Do executes the "compute.instanceGroupManagers.patch" call.
  45482. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45483. // status code is an error. Response headers are in either
  45484. // *Operation.ServerResponse.Header or (if a response was returned at
  45485. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45486. // to check whether the returned error was because
  45487. // http.StatusNotModified was returned.
  45488. func (c *InstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45489. gensupport.SetOptions(c.urlParams_, opts...)
  45490. res, err := c.doRequest("json")
  45491. if res != nil && res.StatusCode == http.StatusNotModified {
  45492. if res.Body != nil {
  45493. res.Body.Close()
  45494. }
  45495. return nil, &googleapi.Error{
  45496. Code: res.StatusCode,
  45497. Header: res.Header,
  45498. }
  45499. }
  45500. if err != nil {
  45501. return nil, err
  45502. }
  45503. defer googleapi.CloseBody(res)
  45504. if err := googleapi.CheckResponse(res); err != nil {
  45505. return nil, err
  45506. }
  45507. ret := &Operation{
  45508. ServerResponse: googleapi.ServerResponse{
  45509. Header: res.Header,
  45510. HTTPStatusCode: res.StatusCode,
  45511. },
  45512. }
  45513. target := &ret
  45514. if err := gensupport.DecodeResponse(target, res); err != nil {
  45515. return nil, err
  45516. }
  45517. return ret, nil
  45518. // {
  45519. // "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  45520. // "httpMethod": "PATCH",
  45521. // "id": "compute.instanceGroupManagers.patch",
  45522. // "parameterOrder": [
  45523. // "project",
  45524. // "zone",
  45525. // "instanceGroupManager"
  45526. // ],
  45527. // "parameters": {
  45528. // "instanceGroupManager": {
  45529. // "description": "The name of the instance group manager.",
  45530. // "location": "path",
  45531. // "required": true,
  45532. // "type": "string"
  45533. // },
  45534. // "project": {
  45535. // "description": "Project ID for this request.",
  45536. // "location": "path",
  45537. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45538. // "required": true,
  45539. // "type": "string"
  45540. // },
  45541. // "requestId": {
  45542. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45543. // "location": "query",
  45544. // "type": "string"
  45545. // },
  45546. // "zone": {
  45547. // "description": "The name of the zone where you want to create the managed instance group.",
  45548. // "location": "path",
  45549. // "required": true,
  45550. // "type": "string"
  45551. // }
  45552. // },
  45553. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  45554. // "request": {
  45555. // "$ref": "InstanceGroupManager"
  45556. // },
  45557. // "response": {
  45558. // "$ref": "Operation"
  45559. // },
  45560. // "scopes": [
  45561. // "https://www.googleapis.com/auth/cloud-platform",
  45562. // "https://www.googleapis.com/auth/compute"
  45563. // ]
  45564. // }
  45565. }
  45566. // method id "compute.instanceGroupManagers.recreateInstances":
  45567. type InstanceGroupManagersRecreateInstancesCall struct {
  45568. s *Service
  45569. project string
  45570. zone string
  45571. instanceGroupManager string
  45572. instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
  45573. urlParams_ gensupport.URLParams
  45574. ctx_ context.Context
  45575. header_ http.Header
  45576. }
  45577. // RecreateInstances: Flags the specified instances in the managed
  45578. // instance group to be immediately recreated. The instances are deleted
  45579. // and recreated using the current instance template for the managed
  45580. // instance group. This operation is marked as DONE when the flag is set
  45581. // even if the instances have not yet been recreated. You must
  45582. // separately verify the status of the recreating action with the
  45583. // listmanagedinstances method.
  45584. //
  45585. // If the group is part of a backend service that has enabled connection
  45586. // draining, it can take up to 60 seconds after the connection draining
  45587. // duration has elapsed before the VM instance is removed or
  45588. // deleted.
  45589. //
  45590. // You can specify a maximum of 1000 instances with this method per
  45591. // request.
  45592. func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
  45593. c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45594. c.project = project
  45595. c.zone = zone
  45596. c.instanceGroupManager = instanceGroupManager
  45597. c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
  45598. return c
  45599. }
  45600. // RequestId sets the optional parameter "requestId": An optional
  45601. // request ID to identify requests. Specify a unique request ID so that
  45602. // if you must retry your request, the server will know to ignore the
  45603. // request if it has already been completed.
  45604. //
  45605. // For example, consider a situation where you make an initial request
  45606. // and the request times out. If you make the request again with the
  45607. // same request ID, the server can check if original operation with the
  45608. // same request ID was received, and if so, will ignore the second
  45609. // request. This prevents clients from accidentally creating duplicate
  45610. // commitments.
  45611. //
  45612. // The request ID must be a valid UUID with the exception that zero UUID
  45613. // is not supported (00000000-0000-0000-0000-000000000000).
  45614. func (c *InstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersRecreateInstancesCall {
  45615. c.urlParams_.Set("requestId", requestId)
  45616. return c
  45617. }
  45618. // Fields allows partial responses to be retrieved. See
  45619. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45620. // for more information.
  45621. func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
  45622. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45623. return c
  45624. }
  45625. // Context sets the context to be used in this call's Do method. Any
  45626. // pending HTTP request will be aborted if the provided context is
  45627. // canceled.
  45628. func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall {
  45629. c.ctx_ = ctx
  45630. return c
  45631. }
  45632. // Header returns an http.Header that can be modified by the caller to
  45633. // add HTTP headers to the request.
  45634. func (c *InstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  45635. if c.header_ == nil {
  45636. c.header_ = make(http.Header)
  45637. }
  45638. return c.header_
  45639. }
  45640. func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  45641. reqHeaders := make(http.Header)
  45642. for k, v := range c.header_ {
  45643. reqHeaders[k] = v
  45644. }
  45645. reqHeaders.Set("User-Agent", c.s.userAgent())
  45646. var body io.Reader = nil
  45647. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
  45648. if err != nil {
  45649. return nil, err
  45650. }
  45651. reqHeaders.Set("Content-Type", "application/json")
  45652. c.urlParams_.Set("alt", alt)
  45653. c.urlParams_.Set("prettyPrint", "false")
  45654. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  45655. urls += "?" + c.urlParams_.Encode()
  45656. req, err := http.NewRequest("POST", urls, body)
  45657. if err != nil {
  45658. return nil, err
  45659. }
  45660. req.Header = reqHeaders
  45661. googleapi.Expand(req.URL, map[string]string{
  45662. "project": c.project,
  45663. "zone": c.zone,
  45664. "instanceGroupManager": c.instanceGroupManager,
  45665. })
  45666. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45667. }
  45668. // Do executes the "compute.instanceGroupManagers.recreateInstances" call.
  45669. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45670. // status code is an error. Response headers are in either
  45671. // *Operation.ServerResponse.Header or (if a response was returned at
  45672. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45673. // to check whether the returned error was because
  45674. // http.StatusNotModified was returned.
  45675. func (c *InstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45676. gensupport.SetOptions(c.urlParams_, opts...)
  45677. res, err := c.doRequest("json")
  45678. if res != nil && res.StatusCode == http.StatusNotModified {
  45679. if res.Body != nil {
  45680. res.Body.Close()
  45681. }
  45682. return nil, &googleapi.Error{
  45683. Code: res.StatusCode,
  45684. Header: res.Header,
  45685. }
  45686. }
  45687. if err != nil {
  45688. return nil, err
  45689. }
  45690. defer googleapi.CloseBody(res)
  45691. if err := googleapi.CheckResponse(res); err != nil {
  45692. return nil, err
  45693. }
  45694. ret := &Operation{
  45695. ServerResponse: googleapi.ServerResponse{
  45696. Header: res.Header,
  45697. HTTPStatusCode: res.StatusCode,
  45698. },
  45699. }
  45700. target := &ret
  45701. if err := gensupport.DecodeResponse(target, res); err != nil {
  45702. return nil, err
  45703. }
  45704. return ret, nil
  45705. // {
  45706. // "description": "Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  45707. // "httpMethod": "POST",
  45708. // "id": "compute.instanceGroupManagers.recreateInstances",
  45709. // "parameterOrder": [
  45710. // "project",
  45711. // "zone",
  45712. // "instanceGroupManager"
  45713. // ],
  45714. // "parameters": {
  45715. // "instanceGroupManager": {
  45716. // "description": "The name of the managed instance group.",
  45717. // "location": "path",
  45718. // "required": true,
  45719. // "type": "string"
  45720. // },
  45721. // "project": {
  45722. // "description": "Project ID for this request.",
  45723. // "location": "path",
  45724. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45725. // "required": true,
  45726. // "type": "string"
  45727. // },
  45728. // "requestId": {
  45729. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45730. // "location": "query",
  45731. // "type": "string"
  45732. // },
  45733. // "zone": {
  45734. // "description": "The name of the zone where the managed instance group is located.",
  45735. // "location": "path",
  45736. // "required": true,
  45737. // "type": "string"
  45738. // }
  45739. // },
  45740. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  45741. // "request": {
  45742. // "$ref": "InstanceGroupManagersRecreateInstancesRequest"
  45743. // },
  45744. // "response": {
  45745. // "$ref": "Operation"
  45746. // },
  45747. // "scopes": [
  45748. // "https://www.googleapis.com/auth/cloud-platform",
  45749. // "https://www.googleapis.com/auth/compute"
  45750. // ]
  45751. // }
  45752. }
  45753. // method id "compute.instanceGroupManagers.resize":
  45754. type InstanceGroupManagersResizeCall struct {
  45755. s *Service
  45756. project string
  45757. zone string
  45758. instanceGroupManager string
  45759. urlParams_ gensupport.URLParams
  45760. ctx_ context.Context
  45761. header_ http.Header
  45762. }
  45763. // Resize: Resizes the managed instance group. If you increase the size,
  45764. // the group creates new instances using the current instance template.
  45765. // If you decrease the size, the group deletes instances. The resize
  45766. // operation is marked DONE when the resize actions are scheduled even
  45767. // if the group has not yet added or deleted any instances. You must
  45768. // separately verify the status of the creating or deleting actions with
  45769. // the listmanagedinstances method.
  45770. //
  45771. // When resizing down, the instance group arbitrarily chooses the order
  45772. // in which VMs are deleted. The group takes into account some VM
  45773. // attributes when making the selection including:
  45774. //
  45775. // + The status of the VM instance. + The health of the VM instance. +
  45776. // The instance template version the VM is based on. + For regional
  45777. // managed instance groups, the location of the VM instance.
  45778. //
  45779. // This list is subject to change.
  45780. //
  45781. // If the group is part of a backend service that has enabled connection
  45782. // draining, it can take up to 60 seconds after the connection draining
  45783. // duration has elapsed before the VM instance is removed or deleted.
  45784. func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
  45785. c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45786. c.project = project
  45787. c.zone = zone
  45788. c.instanceGroupManager = instanceGroupManager
  45789. c.urlParams_.Set("size", fmt.Sprint(size))
  45790. return c
  45791. }
  45792. // RequestId sets the optional parameter "requestId": An optional
  45793. // request ID to identify requests. Specify a unique request ID so that
  45794. // if you must retry your request, the server will know to ignore the
  45795. // request if it has already been completed.
  45796. //
  45797. // For example, consider a situation where you make an initial request
  45798. // and the request times out. If you make the request again with the
  45799. // same request ID, the server can check if original operation with the
  45800. // same request ID was received, and if so, will ignore the second
  45801. // request. This prevents clients from accidentally creating duplicate
  45802. // commitments.
  45803. //
  45804. // The request ID must be a valid UUID with the exception that zero UUID
  45805. // is not supported (00000000-0000-0000-0000-000000000000).
  45806. func (c *InstanceGroupManagersResizeCall) RequestId(requestId string) *InstanceGroupManagersResizeCall {
  45807. c.urlParams_.Set("requestId", requestId)
  45808. return c
  45809. }
  45810. // Fields allows partial responses to be retrieved. See
  45811. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45812. // for more information.
  45813. func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
  45814. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45815. return c
  45816. }
  45817. // Context sets the context to be used in this call's Do method. Any
  45818. // pending HTTP request will be aborted if the provided context is
  45819. // canceled.
  45820. func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall {
  45821. c.ctx_ = ctx
  45822. return c
  45823. }
  45824. // Header returns an http.Header that can be modified by the caller to
  45825. // add HTTP headers to the request.
  45826. func (c *InstanceGroupManagersResizeCall) Header() http.Header {
  45827. if c.header_ == nil {
  45828. c.header_ = make(http.Header)
  45829. }
  45830. return c.header_
  45831. }
  45832. func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  45833. reqHeaders := make(http.Header)
  45834. for k, v := range c.header_ {
  45835. reqHeaders[k] = v
  45836. }
  45837. reqHeaders.Set("User-Agent", c.s.userAgent())
  45838. var body io.Reader = nil
  45839. c.urlParams_.Set("alt", alt)
  45840. c.urlParams_.Set("prettyPrint", "false")
  45841. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
  45842. urls += "?" + c.urlParams_.Encode()
  45843. req, err := http.NewRequest("POST", urls, body)
  45844. if err != nil {
  45845. return nil, err
  45846. }
  45847. req.Header = reqHeaders
  45848. googleapi.Expand(req.URL, map[string]string{
  45849. "project": c.project,
  45850. "zone": c.zone,
  45851. "instanceGroupManager": c.instanceGroupManager,
  45852. })
  45853. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45854. }
  45855. // Do executes the "compute.instanceGroupManagers.resize" call.
  45856. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45857. // status code is an error. Response headers are in either
  45858. // *Operation.ServerResponse.Header or (if a response was returned at
  45859. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45860. // to check whether the returned error was because
  45861. // http.StatusNotModified was returned.
  45862. func (c *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45863. gensupport.SetOptions(c.urlParams_, opts...)
  45864. res, err := c.doRequest("json")
  45865. if res != nil && res.StatusCode == http.StatusNotModified {
  45866. if res.Body != nil {
  45867. res.Body.Close()
  45868. }
  45869. return nil, &googleapi.Error{
  45870. Code: res.StatusCode,
  45871. Header: res.Header,
  45872. }
  45873. }
  45874. if err != nil {
  45875. return nil, err
  45876. }
  45877. defer googleapi.CloseBody(res)
  45878. if err := googleapi.CheckResponse(res); err != nil {
  45879. return nil, err
  45880. }
  45881. ret := &Operation{
  45882. ServerResponse: googleapi.ServerResponse{
  45883. Header: res.Header,
  45884. HTTPStatusCode: res.StatusCode,
  45885. },
  45886. }
  45887. target := &ret
  45888. if err := gensupport.DecodeResponse(target, res); err != nil {
  45889. return nil, err
  45890. }
  45891. return ret, nil
  45892. // {
  45893. // "description": "Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.\n\nWhen resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including:\n\n+ The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance.\n\nThis list is subject to change.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.",
  45894. // "httpMethod": "POST",
  45895. // "id": "compute.instanceGroupManagers.resize",
  45896. // "parameterOrder": [
  45897. // "project",
  45898. // "zone",
  45899. // "instanceGroupManager",
  45900. // "size"
  45901. // ],
  45902. // "parameters": {
  45903. // "instanceGroupManager": {
  45904. // "description": "The name of the managed instance group.",
  45905. // "location": "path",
  45906. // "required": true,
  45907. // "type": "string"
  45908. // },
  45909. // "project": {
  45910. // "description": "Project ID for this request.",
  45911. // "location": "path",
  45912. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45913. // "required": true,
  45914. // "type": "string"
  45915. // },
  45916. // "requestId": {
  45917. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45918. // "location": "query",
  45919. // "type": "string"
  45920. // },
  45921. // "size": {
  45922. // "description": "The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.",
  45923. // "format": "int32",
  45924. // "location": "query",
  45925. // "required": true,
  45926. // "type": "integer"
  45927. // },
  45928. // "zone": {
  45929. // "description": "The name of the zone where the managed instance group is located.",
  45930. // "location": "path",
  45931. // "required": true,
  45932. // "type": "string"
  45933. // }
  45934. // },
  45935. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
  45936. // "response": {
  45937. // "$ref": "Operation"
  45938. // },
  45939. // "scopes": [
  45940. // "https://www.googleapis.com/auth/cloud-platform",
  45941. // "https://www.googleapis.com/auth/compute"
  45942. // ]
  45943. // }
  45944. }
  45945. // method id "compute.instanceGroupManagers.setInstanceTemplate":
  45946. type InstanceGroupManagersSetInstanceTemplateCall struct {
  45947. s *Service
  45948. project string
  45949. zone string
  45950. instanceGroupManager string
  45951. instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
  45952. urlParams_ gensupport.URLParams
  45953. ctx_ context.Context
  45954. header_ http.Header
  45955. }
  45956. // SetInstanceTemplate: Specifies the instance template to use when
  45957. // creating new instances in this group. The templates for existing
  45958. // instances in the group do not change unless you recreate them.
  45959. func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
  45960. c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45961. c.project = project
  45962. c.zone = zone
  45963. c.instanceGroupManager = instanceGroupManager
  45964. c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
  45965. return c
  45966. }
  45967. // RequestId sets the optional parameter "requestId": An optional
  45968. // request ID to identify requests. Specify a unique request ID so that
  45969. // if you must retry your request, the server will know to ignore the
  45970. // request if it has already been completed.
  45971. //
  45972. // For example, consider a situation where you make an initial request
  45973. // and the request times out. If you make the request again with the
  45974. // same request ID, the server can check if original operation with the
  45975. // same request ID was received, and if so, will ignore the second
  45976. // request. This prevents clients from accidentally creating duplicate
  45977. // commitments.
  45978. //
  45979. // The request ID must be a valid UUID with the exception that zero UUID
  45980. // is not supported (00000000-0000-0000-0000-000000000000).
  45981. func (c *InstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *InstanceGroupManagersSetInstanceTemplateCall {
  45982. c.urlParams_.Set("requestId", requestId)
  45983. return c
  45984. }
  45985. // Fields allows partial responses to be retrieved. See
  45986. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45987. // for more information.
  45988. func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
  45989. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45990. return c
  45991. }
  45992. // Context sets the context to be used in this call's Do method. Any
  45993. // pending HTTP request will be aborted if the provided context is
  45994. // canceled.
  45995. func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall {
  45996. c.ctx_ = ctx
  45997. return c
  45998. }
  45999. // Header returns an http.Header that can be modified by the caller to
  46000. // add HTTP headers to the request.
  46001. func (c *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  46002. if c.header_ == nil {
  46003. c.header_ = make(http.Header)
  46004. }
  46005. return c.header_
  46006. }
  46007. func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  46008. reqHeaders := make(http.Header)
  46009. for k, v := range c.header_ {
  46010. reqHeaders[k] = v
  46011. }
  46012. reqHeaders.Set("User-Agent", c.s.userAgent())
  46013. var body io.Reader = nil
  46014. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
  46015. if err != nil {
  46016. return nil, err
  46017. }
  46018. reqHeaders.Set("Content-Type", "application/json")
  46019. c.urlParams_.Set("alt", alt)
  46020. c.urlParams_.Set("prettyPrint", "false")
  46021. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  46022. urls += "?" + c.urlParams_.Encode()
  46023. req, err := http.NewRequest("POST", urls, body)
  46024. if err != nil {
  46025. return nil, err
  46026. }
  46027. req.Header = reqHeaders
  46028. googleapi.Expand(req.URL, map[string]string{
  46029. "project": c.project,
  46030. "zone": c.zone,
  46031. "instanceGroupManager": c.instanceGroupManager,
  46032. })
  46033. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46034. }
  46035. // Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call.
  46036. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46037. // status code is an error. Response headers are in either
  46038. // *Operation.ServerResponse.Header or (if a response was returned at
  46039. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46040. // to check whether the returned error was because
  46041. // http.StatusNotModified was returned.
  46042. func (c *InstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46043. gensupport.SetOptions(c.urlParams_, opts...)
  46044. res, err := c.doRequest("json")
  46045. if res != nil && res.StatusCode == http.StatusNotModified {
  46046. if res.Body != nil {
  46047. res.Body.Close()
  46048. }
  46049. return nil, &googleapi.Error{
  46050. Code: res.StatusCode,
  46051. Header: res.Header,
  46052. }
  46053. }
  46054. if err != nil {
  46055. return nil, err
  46056. }
  46057. defer googleapi.CloseBody(res)
  46058. if err := googleapi.CheckResponse(res); err != nil {
  46059. return nil, err
  46060. }
  46061. ret := &Operation{
  46062. ServerResponse: googleapi.ServerResponse{
  46063. Header: res.Header,
  46064. HTTPStatusCode: res.StatusCode,
  46065. },
  46066. }
  46067. target := &ret
  46068. if err := gensupport.DecodeResponse(target, res); err != nil {
  46069. return nil, err
  46070. }
  46071. return ret, nil
  46072. // {
  46073. // "description": "Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them.",
  46074. // "httpMethod": "POST",
  46075. // "id": "compute.instanceGroupManagers.setInstanceTemplate",
  46076. // "parameterOrder": [
  46077. // "project",
  46078. // "zone",
  46079. // "instanceGroupManager"
  46080. // ],
  46081. // "parameters": {
  46082. // "instanceGroupManager": {
  46083. // "description": "The name of the managed instance group.",
  46084. // "location": "path",
  46085. // "required": true,
  46086. // "type": "string"
  46087. // },
  46088. // "project": {
  46089. // "description": "Project ID for this request.",
  46090. // "location": "path",
  46091. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46092. // "required": true,
  46093. // "type": "string"
  46094. // },
  46095. // "requestId": {
  46096. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46097. // "location": "query",
  46098. // "type": "string"
  46099. // },
  46100. // "zone": {
  46101. // "description": "The name of the zone where the managed instance group is located.",
  46102. // "location": "path",
  46103. // "required": true,
  46104. // "type": "string"
  46105. // }
  46106. // },
  46107. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  46108. // "request": {
  46109. // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
  46110. // },
  46111. // "response": {
  46112. // "$ref": "Operation"
  46113. // },
  46114. // "scopes": [
  46115. // "https://www.googleapis.com/auth/cloud-platform",
  46116. // "https://www.googleapis.com/auth/compute"
  46117. // ]
  46118. // }
  46119. }
  46120. // method id "compute.instanceGroupManagers.setTargetPools":
  46121. type InstanceGroupManagersSetTargetPoolsCall struct {
  46122. s *Service
  46123. project string
  46124. zone string
  46125. instanceGroupManager string
  46126. instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
  46127. urlParams_ gensupport.URLParams
  46128. ctx_ context.Context
  46129. header_ http.Header
  46130. }
  46131. // SetTargetPools: Modifies the target pools to which all instances in
  46132. // this managed instance group are assigned. The target pools
  46133. // automatically apply to all of the instances in the managed instance
  46134. // group. This operation is marked DONE when you make the request even
  46135. // if the instances have not yet been added to their target pools. The
  46136. // change might take some time to apply to all of the instances in the
  46137. // group depending on the size of the group.
  46138. func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
  46139. c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46140. c.project = project
  46141. c.zone = zone
  46142. c.instanceGroupManager = instanceGroupManager
  46143. c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
  46144. return c
  46145. }
  46146. // RequestId sets the optional parameter "requestId": An optional
  46147. // request ID to identify requests. Specify a unique request ID so that
  46148. // if you must retry your request, the server will know to ignore the
  46149. // request if it has already been completed.
  46150. //
  46151. // For example, consider a situation where you make an initial request
  46152. // and the request times out. If you make the request again with the
  46153. // same request ID, the server can check if original operation with the
  46154. // same request ID was received, and if so, will ignore the second
  46155. // request. This prevents clients from accidentally creating duplicate
  46156. // commitments.
  46157. //
  46158. // The request ID must be a valid UUID with the exception that zero UUID
  46159. // is not supported (00000000-0000-0000-0000-000000000000).
  46160. func (c *InstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *InstanceGroupManagersSetTargetPoolsCall {
  46161. c.urlParams_.Set("requestId", requestId)
  46162. return c
  46163. }
  46164. // Fields allows partial responses to be retrieved. See
  46165. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46166. // for more information.
  46167. func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
  46168. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46169. return c
  46170. }
  46171. // Context sets the context to be used in this call's Do method. Any
  46172. // pending HTTP request will be aborted if the provided context is
  46173. // canceled.
  46174. func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall {
  46175. c.ctx_ = ctx
  46176. return c
  46177. }
  46178. // Header returns an http.Header that can be modified by the caller to
  46179. // add HTTP headers to the request.
  46180. func (c *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  46181. if c.header_ == nil {
  46182. c.header_ = make(http.Header)
  46183. }
  46184. return c.header_
  46185. }
  46186. func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  46187. reqHeaders := make(http.Header)
  46188. for k, v := range c.header_ {
  46189. reqHeaders[k] = v
  46190. }
  46191. reqHeaders.Set("User-Agent", c.s.userAgent())
  46192. var body io.Reader = nil
  46193. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
  46194. if err != nil {
  46195. return nil, err
  46196. }
  46197. reqHeaders.Set("Content-Type", "application/json")
  46198. c.urlParams_.Set("alt", alt)
  46199. c.urlParams_.Set("prettyPrint", "false")
  46200. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  46201. urls += "?" + c.urlParams_.Encode()
  46202. req, err := http.NewRequest("POST", urls, body)
  46203. if err != nil {
  46204. return nil, err
  46205. }
  46206. req.Header = reqHeaders
  46207. googleapi.Expand(req.URL, map[string]string{
  46208. "project": c.project,
  46209. "zone": c.zone,
  46210. "instanceGroupManager": c.instanceGroupManager,
  46211. })
  46212. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46213. }
  46214. // Do executes the "compute.instanceGroupManagers.setTargetPools" call.
  46215. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46216. // status code is an error. Response headers are in either
  46217. // *Operation.ServerResponse.Header or (if a response was returned at
  46218. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46219. // to check whether the returned error was because
  46220. // http.StatusNotModified was returned.
  46221. func (c *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46222. gensupport.SetOptions(c.urlParams_, opts...)
  46223. res, err := c.doRequest("json")
  46224. if res != nil && res.StatusCode == http.StatusNotModified {
  46225. if res.Body != nil {
  46226. res.Body.Close()
  46227. }
  46228. return nil, &googleapi.Error{
  46229. Code: res.StatusCode,
  46230. Header: res.Header,
  46231. }
  46232. }
  46233. if err != nil {
  46234. return nil, err
  46235. }
  46236. defer googleapi.CloseBody(res)
  46237. if err := googleapi.CheckResponse(res); err != nil {
  46238. return nil, err
  46239. }
  46240. ret := &Operation{
  46241. ServerResponse: googleapi.ServerResponse{
  46242. Header: res.Header,
  46243. HTTPStatusCode: res.StatusCode,
  46244. },
  46245. }
  46246. target := &ret
  46247. if err := gensupport.DecodeResponse(target, res); err != nil {
  46248. return nil, err
  46249. }
  46250. return ret, nil
  46251. // {
  46252. // "description": "Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.",
  46253. // "httpMethod": "POST",
  46254. // "id": "compute.instanceGroupManagers.setTargetPools",
  46255. // "parameterOrder": [
  46256. // "project",
  46257. // "zone",
  46258. // "instanceGroupManager"
  46259. // ],
  46260. // "parameters": {
  46261. // "instanceGroupManager": {
  46262. // "description": "The name of the managed instance group.",
  46263. // "location": "path",
  46264. // "required": true,
  46265. // "type": "string"
  46266. // },
  46267. // "project": {
  46268. // "description": "Project ID for this request.",
  46269. // "location": "path",
  46270. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46271. // "required": true,
  46272. // "type": "string"
  46273. // },
  46274. // "requestId": {
  46275. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46276. // "location": "query",
  46277. // "type": "string"
  46278. // },
  46279. // "zone": {
  46280. // "description": "The name of the zone where the managed instance group is located.",
  46281. // "location": "path",
  46282. // "required": true,
  46283. // "type": "string"
  46284. // }
  46285. // },
  46286. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  46287. // "request": {
  46288. // "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
  46289. // },
  46290. // "response": {
  46291. // "$ref": "Operation"
  46292. // },
  46293. // "scopes": [
  46294. // "https://www.googleapis.com/auth/cloud-platform",
  46295. // "https://www.googleapis.com/auth/compute"
  46296. // ]
  46297. // }
  46298. }
  46299. // method id "compute.instanceGroups.addInstances":
  46300. type InstanceGroupsAddInstancesCall struct {
  46301. s *Service
  46302. project string
  46303. zone string
  46304. instanceGroup string
  46305. instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest
  46306. urlParams_ gensupport.URLParams
  46307. ctx_ context.Context
  46308. header_ http.Header
  46309. }
  46310. // AddInstances: Adds a list of instances to the specified instance
  46311. // group. All of the instances in the instance group must be in the same
  46312. // network/subnetwork. Read Adding instances for more information.
  46313. func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall {
  46314. c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46315. c.project = project
  46316. c.zone = zone
  46317. c.instanceGroup = instanceGroup
  46318. c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest
  46319. return c
  46320. }
  46321. // RequestId sets the optional parameter "requestId": An optional
  46322. // request ID to identify requests. Specify a unique request ID so that
  46323. // if you must retry your request, the server will know to ignore the
  46324. // request if it has already been completed.
  46325. //
  46326. // For example, consider a situation where you make an initial request
  46327. // and the request times out. If you make the request again with the
  46328. // same request ID, the server can check if original operation with the
  46329. // same request ID was received, and if so, will ignore the second
  46330. // request. This prevents clients from accidentally creating duplicate
  46331. // commitments.
  46332. //
  46333. // The request ID must be a valid UUID with the exception that zero UUID
  46334. // is not supported (00000000-0000-0000-0000-000000000000).
  46335. func (c *InstanceGroupsAddInstancesCall) RequestId(requestId string) *InstanceGroupsAddInstancesCall {
  46336. c.urlParams_.Set("requestId", requestId)
  46337. return c
  46338. }
  46339. // Fields allows partial responses to be retrieved. See
  46340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46341. // for more information.
  46342. func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall {
  46343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46344. return c
  46345. }
  46346. // Context sets the context to be used in this call's Do method. Any
  46347. // pending HTTP request will be aborted if the provided context is
  46348. // canceled.
  46349. func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall {
  46350. c.ctx_ = ctx
  46351. return c
  46352. }
  46353. // Header returns an http.Header that can be modified by the caller to
  46354. // add HTTP headers to the request.
  46355. func (c *InstanceGroupsAddInstancesCall) Header() http.Header {
  46356. if c.header_ == nil {
  46357. c.header_ = make(http.Header)
  46358. }
  46359. return c.header_
  46360. }
  46361. func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) {
  46362. reqHeaders := make(http.Header)
  46363. for k, v := range c.header_ {
  46364. reqHeaders[k] = v
  46365. }
  46366. reqHeaders.Set("User-Agent", c.s.userAgent())
  46367. var body io.Reader = nil
  46368. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest)
  46369. if err != nil {
  46370. return nil, err
  46371. }
  46372. reqHeaders.Set("Content-Type", "application/json")
  46373. c.urlParams_.Set("alt", alt)
  46374. c.urlParams_.Set("prettyPrint", "false")
  46375. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")
  46376. urls += "?" + c.urlParams_.Encode()
  46377. req, err := http.NewRequest("POST", urls, body)
  46378. if err != nil {
  46379. return nil, err
  46380. }
  46381. req.Header = reqHeaders
  46382. googleapi.Expand(req.URL, map[string]string{
  46383. "project": c.project,
  46384. "zone": c.zone,
  46385. "instanceGroup": c.instanceGroup,
  46386. })
  46387. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46388. }
  46389. // Do executes the "compute.instanceGroups.addInstances" call.
  46390. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46391. // status code is an error. Response headers are in either
  46392. // *Operation.ServerResponse.Header or (if a response was returned at
  46393. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46394. // to check whether the returned error was because
  46395. // http.StatusNotModified was returned.
  46396. func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46397. gensupport.SetOptions(c.urlParams_, opts...)
  46398. res, err := c.doRequest("json")
  46399. if res != nil && res.StatusCode == http.StatusNotModified {
  46400. if res.Body != nil {
  46401. res.Body.Close()
  46402. }
  46403. return nil, &googleapi.Error{
  46404. Code: res.StatusCode,
  46405. Header: res.Header,
  46406. }
  46407. }
  46408. if err != nil {
  46409. return nil, err
  46410. }
  46411. defer googleapi.CloseBody(res)
  46412. if err := googleapi.CheckResponse(res); err != nil {
  46413. return nil, err
  46414. }
  46415. ret := &Operation{
  46416. ServerResponse: googleapi.ServerResponse{
  46417. Header: res.Header,
  46418. HTTPStatusCode: res.StatusCode,
  46419. },
  46420. }
  46421. target := &ret
  46422. if err := gensupport.DecodeResponse(target, res); err != nil {
  46423. return nil, err
  46424. }
  46425. return ret, nil
  46426. // {
  46427. // "description": "Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information.",
  46428. // "httpMethod": "POST",
  46429. // "id": "compute.instanceGroups.addInstances",
  46430. // "parameterOrder": [
  46431. // "project",
  46432. // "zone",
  46433. // "instanceGroup"
  46434. // ],
  46435. // "parameters": {
  46436. // "instanceGroup": {
  46437. // "description": "The name of the instance group where you are adding instances.",
  46438. // "location": "path",
  46439. // "required": true,
  46440. // "type": "string"
  46441. // },
  46442. // "project": {
  46443. // "description": "Project ID for this request.",
  46444. // "location": "path",
  46445. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46446. // "required": true,
  46447. // "type": "string"
  46448. // },
  46449. // "requestId": {
  46450. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46451. // "location": "query",
  46452. // "type": "string"
  46453. // },
  46454. // "zone": {
  46455. // "description": "The name of the zone where the instance group is located.",
  46456. // "location": "path",
  46457. // "required": true,
  46458. // "type": "string"
  46459. // }
  46460. // },
  46461. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
  46462. // "request": {
  46463. // "$ref": "InstanceGroupsAddInstancesRequest"
  46464. // },
  46465. // "response": {
  46466. // "$ref": "Operation"
  46467. // },
  46468. // "scopes": [
  46469. // "https://www.googleapis.com/auth/cloud-platform",
  46470. // "https://www.googleapis.com/auth/compute"
  46471. // ]
  46472. // }
  46473. }
  46474. // method id "compute.instanceGroups.aggregatedList":
  46475. type InstanceGroupsAggregatedListCall struct {
  46476. s *Service
  46477. project string
  46478. urlParams_ gensupport.URLParams
  46479. ifNoneMatch_ string
  46480. ctx_ context.Context
  46481. header_ http.Header
  46482. }
  46483. // AggregatedList: Retrieves the list of instance groups and sorts them
  46484. // by zone.
  46485. func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {
  46486. c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46487. c.project = project
  46488. return c
  46489. }
  46490. // Filter sets the optional parameter "filter": A filter expression that
  46491. // filters resources listed in the response. The expression must specify
  46492. // the field name, a comparison operator, and the value that you want to
  46493. // use for filtering. The value must be a string, a number, or a
  46494. // boolean. The comparison operator must be either =, !=, >, or <.
  46495. //
  46496. // For example, if you are filtering Compute Engine instances, you can
  46497. // exclude instances named example-instance by specifying name !=
  46498. // example-instance.
  46499. //
  46500. // You can also filter nested fields. For example, you could specify
  46501. // scheduling.automaticRestart = false to include instances only if they
  46502. // are not scheduled for automatic restarts. You can use filtering on
  46503. // nested fields to filter based on resource labels.
  46504. //
  46505. // To filter on multiple expressions, provide each separate expression
  46506. // within parentheses. For example, (scheduling.automaticRestart = true)
  46507. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46508. // AND expression. However, you can include AND and OR expressions
  46509. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46510. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46511. // true).
  46512. func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall {
  46513. c.urlParams_.Set("filter", filter)
  46514. return c
  46515. }
  46516. // MaxResults sets the optional parameter "maxResults": The maximum
  46517. // number of results per page that should be returned. If the number of
  46518. // available results is larger than maxResults, Compute Engine returns a
  46519. // nextPageToken that can be used to get the next page of results in
  46520. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46521. // (Default: 500)
  46522. func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall {
  46523. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46524. return c
  46525. }
  46526. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46527. // a certain order. By default, results are returned in alphanumerical
  46528. // order based on the resource name.
  46529. //
  46530. // You can also sort results in descending order based on the creation
  46531. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46532. // based on the creationTimestamp field in reverse chronological order
  46533. // (newest result first). Use this to sort resources like operations so
  46534. // that the newest operation is returned first.
  46535. //
  46536. // Currently, only sorting by name or creationTimestamp desc is
  46537. // supported.
  46538. func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall {
  46539. c.urlParams_.Set("orderBy", orderBy)
  46540. return c
  46541. }
  46542. // PageToken sets the optional parameter "pageToken": Specifies a page
  46543. // token to use. Set pageToken to the nextPageToken returned by a
  46544. // previous list request to get the next page of results.
  46545. func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall {
  46546. c.urlParams_.Set("pageToken", pageToken)
  46547. return c
  46548. }
  46549. // Fields allows partial responses to be retrieved. See
  46550. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46551. // for more information.
  46552. func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall {
  46553. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46554. return c
  46555. }
  46556. // IfNoneMatch sets the optional parameter which makes the operation
  46557. // fail if the object's ETag matches the given value. This is useful for
  46558. // getting updates only after the object has changed since the last
  46559. // request. Use googleapi.IsNotModified to check whether the response
  46560. // error from Do is the result of In-None-Match.
  46561. func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall {
  46562. c.ifNoneMatch_ = entityTag
  46563. return c
  46564. }
  46565. // Context sets the context to be used in this call's Do method. Any
  46566. // pending HTTP request will be aborted if the provided context is
  46567. // canceled.
  46568. func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall {
  46569. c.ctx_ = ctx
  46570. return c
  46571. }
  46572. // Header returns an http.Header that can be modified by the caller to
  46573. // add HTTP headers to the request.
  46574. func (c *InstanceGroupsAggregatedListCall) Header() http.Header {
  46575. if c.header_ == nil {
  46576. c.header_ = make(http.Header)
  46577. }
  46578. return c.header_
  46579. }
  46580. func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  46581. reqHeaders := make(http.Header)
  46582. for k, v := range c.header_ {
  46583. reqHeaders[k] = v
  46584. }
  46585. reqHeaders.Set("User-Agent", c.s.userAgent())
  46586. if c.ifNoneMatch_ != "" {
  46587. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46588. }
  46589. var body io.Reader = nil
  46590. c.urlParams_.Set("alt", alt)
  46591. c.urlParams_.Set("prettyPrint", "false")
  46592. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups")
  46593. urls += "?" + c.urlParams_.Encode()
  46594. req, err := http.NewRequest("GET", urls, body)
  46595. if err != nil {
  46596. return nil, err
  46597. }
  46598. req.Header = reqHeaders
  46599. googleapi.Expand(req.URL, map[string]string{
  46600. "project": c.project,
  46601. })
  46602. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46603. }
  46604. // Do executes the "compute.instanceGroups.aggregatedList" call.
  46605. // Exactly one of *InstanceGroupAggregatedList or error will be non-nil.
  46606. // Any non-2xx status code is an error. Response headers are in either
  46607. // *InstanceGroupAggregatedList.ServerResponse.Header or (if a response
  46608. // was returned at all) in error.(*googleapi.Error).Header. Use
  46609. // googleapi.IsNotModified to check whether the returned error was
  46610. // because http.StatusNotModified was returned.
  46611. func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) {
  46612. gensupport.SetOptions(c.urlParams_, opts...)
  46613. res, err := c.doRequest("json")
  46614. if res != nil && res.StatusCode == http.StatusNotModified {
  46615. if res.Body != nil {
  46616. res.Body.Close()
  46617. }
  46618. return nil, &googleapi.Error{
  46619. Code: res.StatusCode,
  46620. Header: res.Header,
  46621. }
  46622. }
  46623. if err != nil {
  46624. return nil, err
  46625. }
  46626. defer googleapi.CloseBody(res)
  46627. if err := googleapi.CheckResponse(res); err != nil {
  46628. return nil, err
  46629. }
  46630. ret := &InstanceGroupAggregatedList{
  46631. ServerResponse: googleapi.ServerResponse{
  46632. Header: res.Header,
  46633. HTTPStatusCode: res.StatusCode,
  46634. },
  46635. }
  46636. target := &ret
  46637. if err := gensupport.DecodeResponse(target, res); err != nil {
  46638. return nil, err
  46639. }
  46640. return ret, nil
  46641. // {
  46642. // "description": "Retrieves the list of instance groups and sorts them by zone.",
  46643. // "httpMethod": "GET",
  46644. // "id": "compute.instanceGroups.aggregatedList",
  46645. // "parameterOrder": [
  46646. // "project"
  46647. // ],
  46648. // "parameters": {
  46649. // "filter": {
  46650. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  46651. // "location": "query",
  46652. // "type": "string"
  46653. // },
  46654. // "maxResults": {
  46655. // "default": "500",
  46656. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  46657. // "format": "uint32",
  46658. // "location": "query",
  46659. // "minimum": "0",
  46660. // "type": "integer"
  46661. // },
  46662. // "orderBy": {
  46663. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  46664. // "location": "query",
  46665. // "type": "string"
  46666. // },
  46667. // "pageToken": {
  46668. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  46669. // "location": "query",
  46670. // "type": "string"
  46671. // },
  46672. // "project": {
  46673. // "description": "Project ID for this request.",
  46674. // "location": "path",
  46675. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46676. // "required": true,
  46677. // "type": "string"
  46678. // }
  46679. // },
  46680. // "path": "{project}/aggregated/instanceGroups",
  46681. // "response": {
  46682. // "$ref": "InstanceGroupAggregatedList"
  46683. // },
  46684. // "scopes": [
  46685. // "https://www.googleapis.com/auth/cloud-platform",
  46686. // "https://www.googleapis.com/auth/compute",
  46687. // "https://www.googleapis.com/auth/compute.readonly"
  46688. // ]
  46689. // }
  46690. }
  46691. // Pages invokes f for each page of results.
  46692. // A non-nil error returned from f will halt the iteration.
  46693. // The provided context supersedes any context provided to the Context method.
  46694. func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error {
  46695. c.ctx_ = ctx
  46696. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46697. for {
  46698. x, err := c.Do()
  46699. if err != nil {
  46700. return err
  46701. }
  46702. if err := f(x); err != nil {
  46703. return err
  46704. }
  46705. if x.NextPageToken == "" {
  46706. return nil
  46707. }
  46708. c.PageToken(x.NextPageToken)
  46709. }
  46710. }
  46711. // method id "compute.instanceGroups.delete":
  46712. type InstanceGroupsDeleteCall struct {
  46713. s *Service
  46714. project string
  46715. zone string
  46716. instanceGroup string
  46717. urlParams_ gensupport.URLParams
  46718. ctx_ context.Context
  46719. header_ http.Header
  46720. }
  46721. // Delete: Deletes the specified instance group. The instances in the
  46722. // group are not deleted. Note that instance group must not belong to a
  46723. // backend service. Read Deleting an instance group for more
  46724. // information.
  46725. func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall {
  46726. c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46727. c.project = project
  46728. c.zone = zone
  46729. c.instanceGroup = instanceGroup
  46730. return c
  46731. }
  46732. // RequestId sets the optional parameter "requestId": An optional
  46733. // request ID to identify requests. Specify a unique request ID so that
  46734. // if you must retry your request, the server will know to ignore the
  46735. // request if it has already been completed.
  46736. //
  46737. // For example, consider a situation where you make an initial request
  46738. // and the request times out. If you make the request again with the
  46739. // same request ID, the server can check if original operation with the
  46740. // same request ID was received, and if so, will ignore the second
  46741. // request. This prevents clients from accidentally creating duplicate
  46742. // commitments.
  46743. //
  46744. // The request ID must be a valid UUID with the exception that zero UUID
  46745. // is not supported (00000000-0000-0000-0000-000000000000).
  46746. func (c *InstanceGroupsDeleteCall) RequestId(requestId string) *InstanceGroupsDeleteCall {
  46747. c.urlParams_.Set("requestId", requestId)
  46748. return c
  46749. }
  46750. // Fields allows partial responses to be retrieved. See
  46751. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46752. // for more information.
  46753. func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall {
  46754. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46755. return c
  46756. }
  46757. // Context sets the context to be used in this call's Do method. Any
  46758. // pending HTTP request will be aborted if the provided context is
  46759. // canceled.
  46760. func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall {
  46761. c.ctx_ = ctx
  46762. return c
  46763. }
  46764. // Header returns an http.Header that can be modified by the caller to
  46765. // add HTTP headers to the request.
  46766. func (c *InstanceGroupsDeleteCall) Header() http.Header {
  46767. if c.header_ == nil {
  46768. c.header_ = make(http.Header)
  46769. }
  46770. return c.header_
  46771. }
  46772. func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  46773. reqHeaders := make(http.Header)
  46774. for k, v := range c.header_ {
  46775. reqHeaders[k] = v
  46776. }
  46777. reqHeaders.Set("User-Agent", c.s.userAgent())
  46778. var body io.Reader = nil
  46779. c.urlParams_.Set("alt", alt)
  46780. c.urlParams_.Set("prettyPrint", "false")
  46781. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  46782. urls += "?" + c.urlParams_.Encode()
  46783. req, err := http.NewRequest("DELETE", urls, body)
  46784. if err != nil {
  46785. return nil, err
  46786. }
  46787. req.Header = reqHeaders
  46788. googleapi.Expand(req.URL, map[string]string{
  46789. "project": c.project,
  46790. "zone": c.zone,
  46791. "instanceGroup": c.instanceGroup,
  46792. })
  46793. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46794. }
  46795. // Do executes the "compute.instanceGroups.delete" call.
  46796. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46797. // status code is an error. Response headers are in either
  46798. // *Operation.ServerResponse.Header or (if a response was returned at
  46799. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46800. // to check whether the returned error was because
  46801. // http.StatusNotModified was returned.
  46802. func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46803. gensupport.SetOptions(c.urlParams_, opts...)
  46804. res, err := c.doRequest("json")
  46805. if res != nil && res.StatusCode == http.StatusNotModified {
  46806. if res.Body != nil {
  46807. res.Body.Close()
  46808. }
  46809. return nil, &googleapi.Error{
  46810. Code: res.StatusCode,
  46811. Header: res.Header,
  46812. }
  46813. }
  46814. if err != nil {
  46815. return nil, err
  46816. }
  46817. defer googleapi.CloseBody(res)
  46818. if err := googleapi.CheckResponse(res); err != nil {
  46819. return nil, err
  46820. }
  46821. ret := &Operation{
  46822. ServerResponse: googleapi.ServerResponse{
  46823. Header: res.Header,
  46824. HTTPStatusCode: res.StatusCode,
  46825. },
  46826. }
  46827. target := &ret
  46828. if err := gensupport.DecodeResponse(target, res); err != nil {
  46829. return nil, err
  46830. }
  46831. return ret, nil
  46832. // {
  46833. // "description": "Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information.",
  46834. // "httpMethod": "DELETE",
  46835. // "id": "compute.instanceGroups.delete",
  46836. // "parameterOrder": [
  46837. // "project",
  46838. // "zone",
  46839. // "instanceGroup"
  46840. // ],
  46841. // "parameters": {
  46842. // "instanceGroup": {
  46843. // "description": "The name of the instance group to delete.",
  46844. // "location": "path",
  46845. // "required": true,
  46846. // "type": "string"
  46847. // },
  46848. // "project": {
  46849. // "description": "Project ID for this request.",
  46850. // "location": "path",
  46851. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46852. // "required": true,
  46853. // "type": "string"
  46854. // },
  46855. // "requestId": {
  46856. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46857. // "location": "query",
  46858. // "type": "string"
  46859. // },
  46860. // "zone": {
  46861. // "description": "The name of the zone where the instance group is located.",
  46862. // "location": "path",
  46863. // "required": true,
  46864. // "type": "string"
  46865. // }
  46866. // },
  46867. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  46868. // "response": {
  46869. // "$ref": "Operation"
  46870. // },
  46871. // "scopes": [
  46872. // "https://www.googleapis.com/auth/cloud-platform",
  46873. // "https://www.googleapis.com/auth/compute"
  46874. // ]
  46875. // }
  46876. }
  46877. // method id "compute.instanceGroups.get":
  46878. type InstanceGroupsGetCall struct {
  46879. s *Service
  46880. project string
  46881. zone string
  46882. instanceGroup string
  46883. urlParams_ gensupport.URLParams
  46884. ifNoneMatch_ string
  46885. ctx_ context.Context
  46886. header_ http.Header
  46887. }
  46888. // Get: Returns the specified instance group. Gets a list of available
  46889. // instance groups by making a list() request.
  46890. func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall {
  46891. c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46892. c.project = project
  46893. c.zone = zone
  46894. c.instanceGroup = instanceGroup
  46895. return c
  46896. }
  46897. // Fields allows partial responses to be retrieved. See
  46898. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46899. // for more information.
  46900. func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall {
  46901. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46902. return c
  46903. }
  46904. // IfNoneMatch sets the optional parameter which makes the operation
  46905. // fail if the object's ETag matches the given value. This is useful for
  46906. // getting updates only after the object has changed since the last
  46907. // request. Use googleapi.IsNotModified to check whether the response
  46908. // error from Do is the result of In-None-Match.
  46909. func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall {
  46910. c.ifNoneMatch_ = entityTag
  46911. return c
  46912. }
  46913. // Context sets the context to be used in this call's Do method. Any
  46914. // pending HTTP request will be aborted if the provided context is
  46915. // canceled.
  46916. func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall {
  46917. c.ctx_ = ctx
  46918. return c
  46919. }
  46920. // Header returns an http.Header that can be modified by the caller to
  46921. // add HTTP headers to the request.
  46922. func (c *InstanceGroupsGetCall) Header() http.Header {
  46923. if c.header_ == nil {
  46924. c.header_ = make(http.Header)
  46925. }
  46926. return c.header_
  46927. }
  46928. func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  46929. reqHeaders := make(http.Header)
  46930. for k, v := range c.header_ {
  46931. reqHeaders[k] = v
  46932. }
  46933. reqHeaders.Set("User-Agent", c.s.userAgent())
  46934. if c.ifNoneMatch_ != "" {
  46935. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46936. }
  46937. var body io.Reader = nil
  46938. c.urlParams_.Set("alt", alt)
  46939. c.urlParams_.Set("prettyPrint", "false")
  46940. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  46941. urls += "?" + c.urlParams_.Encode()
  46942. req, err := http.NewRequest("GET", urls, body)
  46943. if err != nil {
  46944. return nil, err
  46945. }
  46946. req.Header = reqHeaders
  46947. googleapi.Expand(req.URL, map[string]string{
  46948. "project": c.project,
  46949. "zone": c.zone,
  46950. "instanceGroup": c.instanceGroup,
  46951. })
  46952. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46953. }
  46954. // Do executes the "compute.instanceGroups.get" call.
  46955. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  46956. // status code is an error. Response headers are in either
  46957. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  46958. // at all) in error.(*googleapi.Error).Header. Use
  46959. // googleapi.IsNotModified to check whether the returned error was
  46960. // because http.StatusNotModified was returned.
  46961. func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  46962. gensupport.SetOptions(c.urlParams_, opts...)
  46963. res, err := c.doRequest("json")
  46964. if res != nil && res.StatusCode == http.StatusNotModified {
  46965. if res.Body != nil {
  46966. res.Body.Close()
  46967. }
  46968. return nil, &googleapi.Error{
  46969. Code: res.StatusCode,
  46970. Header: res.Header,
  46971. }
  46972. }
  46973. if err != nil {
  46974. return nil, err
  46975. }
  46976. defer googleapi.CloseBody(res)
  46977. if err := googleapi.CheckResponse(res); err != nil {
  46978. return nil, err
  46979. }
  46980. ret := &InstanceGroup{
  46981. ServerResponse: googleapi.ServerResponse{
  46982. Header: res.Header,
  46983. HTTPStatusCode: res.StatusCode,
  46984. },
  46985. }
  46986. target := &ret
  46987. if err := gensupport.DecodeResponse(target, res); err != nil {
  46988. return nil, err
  46989. }
  46990. return ret, nil
  46991. // {
  46992. // "description": "Returns the specified instance group. Gets a list of available instance groups by making a list() request.",
  46993. // "httpMethod": "GET",
  46994. // "id": "compute.instanceGroups.get",
  46995. // "parameterOrder": [
  46996. // "project",
  46997. // "zone",
  46998. // "instanceGroup"
  46999. // ],
  47000. // "parameters": {
  47001. // "instanceGroup": {
  47002. // "description": "The name of the instance group.",
  47003. // "location": "path",
  47004. // "required": true,
  47005. // "type": "string"
  47006. // },
  47007. // "project": {
  47008. // "description": "Project ID for this request.",
  47009. // "location": "path",
  47010. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47011. // "required": true,
  47012. // "type": "string"
  47013. // },
  47014. // "zone": {
  47015. // "description": "The name of the zone where the instance group is located.",
  47016. // "location": "path",
  47017. // "required": true,
  47018. // "type": "string"
  47019. // }
  47020. // },
  47021. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  47022. // "response": {
  47023. // "$ref": "InstanceGroup"
  47024. // },
  47025. // "scopes": [
  47026. // "https://www.googleapis.com/auth/cloud-platform",
  47027. // "https://www.googleapis.com/auth/compute",
  47028. // "https://www.googleapis.com/auth/compute.readonly"
  47029. // ]
  47030. // }
  47031. }
  47032. // method id "compute.instanceGroups.insert":
  47033. type InstanceGroupsInsertCall struct {
  47034. s *Service
  47035. project string
  47036. zone string
  47037. instancegroup *InstanceGroup
  47038. urlParams_ gensupport.URLParams
  47039. ctx_ context.Context
  47040. header_ http.Header
  47041. }
  47042. // Insert: Creates an instance group in the specified project using the
  47043. // parameters that are included in the request.
  47044. func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall {
  47045. c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47046. c.project = project
  47047. c.zone = zone
  47048. c.instancegroup = instancegroup
  47049. return c
  47050. }
  47051. // RequestId sets the optional parameter "requestId": An optional
  47052. // request ID to identify requests. Specify a unique request ID so that
  47053. // if you must retry your request, the server will know to ignore the
  47054. // request if it has already been completed.
  47055. //
  47056. // For example, consider a situation where you make an initial request
  47057. // and the request times out. If you make the request again with the
  47058. // same request ID, the server can check if original operation with the
  47059. // same request ID was received, and if so, will ignore the second
  47060. // request. This prevents clients from accidentally creating duplicate
  47061. // commitments.
  47062. //
  47063. // The request ID must be a valid UUID with the exception that zero UUID
  47064. // is not supported (00000000-0000-0000-0000-000000000000).
  47065. func (c *InstanceGroupsInsertCall) RequestId(requestId string) *InstanceGroupsInsertCall {
  47066. c.urlParams_.Set("requestId", requestId)
  47067. return c
  47068. }
  47069. // Fields allows partial responses to be retrieved. See
  47070. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47071. // for more information.
  47072. func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall {
  47073. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47074. return c
  47075. }
  47076. // Context sets the context to be used in this call's Do method. Any
  47077. // pending HTTP request will be aborted if the provided context is
  47078. // canceled.
  47079. func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall {
  47080. c.ctx_ = ctx
  47081. return c
  47082. }
  47083. // Header returns an http.Header that can be modified by the caller to
  47084. // add HTTP headers to the request.
  47085. func (c *InstanceGroupsInsertCall) Header() http.Header {
  47086. if c.header_ == nil {
  47087. c.header_ = make(http.Header)
  47088. }
  47089. return c.header_
  47090. }
  47091. func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  47092. reqHeaders := make(http.Header)
  47093. for k, v := range c.header_ {
  47094. reqHeaders[k] = v
  47095. }
  47096. reqHeaders.Set("User-Agent", c.s.userAgent())
  47097. var body io.Reader = nil
  47098. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup)
  47099. if err != nil {
  47100. return nil, err
  47101. }
  47102. reqHeaders.Set("Content-Type", "application/json")
  47103. c.urlParams_.Set("alt", alt)
  47104. c.urlParams_.Set("prettyPrint", "false")
  47105. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  47106. urls += "?" + c.urlParams_.Encode()
  47107. req, err := http.NewRequest("POST", urls, body)
  47108. if err != nil {
  47109. return nil, err
  47110. }
  47111. req.Header = reqHeaders
  47112. googleapi.Expand(req.URL, map[string]string{
  47113. "project": c.project,
  47114. "zone": c.zone,
  47115. })
  47116. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47117. }
  47118. // Do executes the "compute.instanceGroups.insert" call.
  47119. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47120. // status code is an error. Response headers are in either
  47121. // *Operation.ServerResponse.Header or (if a response was returned at
  47122. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47123. // to check whether the returned error was because
  47124. // http.StatusNotModified was returned.
  47125. func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47126. gensupport.SetOptions(c.urlParams_, opts...)
  47127. res, err := c.doRequest("json")
  47128. if res != nil && res.StatusCode == http.StatusNotModified {
  47129. if res.Body != nil {
  47130. res.Body.Close()
  47131. }
  47132. return nil, &googleapi.Error{
  47133. Code: res.StatusCode,
  47134. Header: res.Header,
  47135. }
  47136. }
  47137. if err != nil {
  47138. return nil, err
  47139. }
  47140. defer googleapi.CloseBody(res)
  47141. if err := googleapi.CheckResponse(res); err != nil {
  47142. return nil, err
  47143. }
  47144. ret := &Operation{
  47145. ServerResponse: googleapi.ServerResponse{
  47146. Header: res.Header,
  47147. HTTPStatusCode: res.StatusCode,
  47148. },
  47149. }
  47150. target := &ret
  47151. if err := gensupport.DecodeResponse(target, res); err != nil {
  47152. return nil, err
  47153. }
  47154. return ret, nil
  47155. // {
  47156. // "description": "Creates an instance group in the specified project using the parameters that are included in the request.",
  47157. // "httpMethod": "POST",
  47158. // "id": "compute.instanceGroups.insert",
  47159. // "parameterOrder": [
  47160. // "project",
  47161. // "zone"
  47162. // ],
  47163. // "parameters": {
  47164. // "project": {
  47165. // "description": "Project ID for this request.",
  47166. // "location": "path",
  47167. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47168. // "required": true,
  47169. // "type": "string"
  47170. // },
  47171. // "requestId": {
  47172. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47173. // "location": "query",
  47174. // "type": "string"
  47175. // },
  47176. // "zone": {
  47177. // "description": "The name of the zone where you want to create the instance group.",
  47178. // "location": "path",
  47179. // "required": true,
  47180. // "type": "string"
  47181. // }
  47182. // },
  47183. // "path": "{project}/zones/{zone}/instanceGroups",
  47184. // "request": {
  47185. // "$ref": "InstanceGroup"
  47186. // },
  47187. // "response": {
  47188. // "$ref": "Operation"
  47189. // },
  47190. // "scopes": [
  47191. // "https://www.googleapis.com/auth/cloud-platform",
  47192. // "https://www.googleapis.com/auth/compute"
  47193. // ]
  47194. // }
  47195. }
  47196. // method id "compute.instanceGroups.list":
  47197. type InstanceGroupsListCall struct {
  47198. s *Service
  47199. project string
  47200. zone string
  47201. urlParams_ gensupport.URLParams
  47202. ifNoneMatch_ string
  47203. ctx_ context.Context
  47204. header_ http.Header
  47205. }
  47206. // List: Retrieves the list of instance groups that are located in the
  47207. // specified project and zone.
  47208. func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall {
  47209. c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47210. c.project = project
  47211. c.zone = zone
  47212. return c
  47213. }
  47214. // Filter sets the optional parameter "filter": A filter expression that
  47215. // filters resources listed in the response. The expression must specify
  47216. // the field name, a comparison operator, and the value that you want to
  47217. // use for filtering. The value must be a string, a number, or a
  47218. // boolean. The comparison operator must be either =, !=, >, or <.
  47219. //
  47220. // For example, if you are filtering Compute Engine instances, you can
  47221. // exclude instances named example-instance by specifying name !=
  47222. // example-instance.
  47223. //
  47224. // You can also filter nested fields. For example, you could specify
  47225. // scheduling.automaticRestart = false to include instances only if they
  47226. // are not scheduled for automatic restarts. You can use filtering on
  47227. // nested fields to filter based on resource labels.
  47228. //
  47229. // To filter on multiple expressions, provide each separate expression
  47230. // within parentheses. For example, (scheduling.automaticRestart = true)
  47231. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  47232. // AND expression. However, you can include AND and OR expressions
  47233. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  47234. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  47235. // true).
  47236. func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall {
  47237. c.urlParams_.Set("filter", filter)
  47238. return c
  47239. }
  47240. // MaxResults sets the optional parameter "maxResults": The maximum
  47241. // number of results per page that should be returned. If the number of
  47242. // available results is larger than maxResults, Compute Engine returns a
  47243. // nextPageToken that can be used to get the next page of results in
  47244. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  47245. // (Default: 500)
  47246. func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall {
  47247. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  47248. return c
  47249. }
  47250. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  47251. // a certain order. By default, results are returned in alphanumerical
  47252. // order based on the resource name.
  47253. //
  47254. // You can also sort results in descending order based on the creation
  47255. // timestamp using orderBy="creationTimestamp desc". This sorts results
  47256. // based on the creationTimestamp field in reverse chronological order
  47257. // (newest result first). Use this to sort resources like operations so
  47258. // that the newest operation is returned first.
  47259. //
  47260. // Currently, only sorting by name or creationTimestamp desc is
  47261. // supported.
  47262. func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall {
  47263. c.urlParams_.Set("orderBy", orderBy)
  47264. return c
  47265. }
  47266. // PageToken sets the optional parameter "pageToken": Specifies a page
  47267. // token to use. Set pageToken to the nextPageToken returned by a
  47268. // previous list request to get the next page of results.
  47269. func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall {
  47270. c.urlParams_.Set("pageToken", pageToken)
  47271. return c
  47272. }
  47273. // Fields allows partial responses to be retrieved. See
  47274. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47275. // for more information.
  47276. func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall {
  47277. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47278. return c
  47279. }
  47280. // IfNoneMatch sets the optional parameter which makes the operation
  47281. // fail if the object's ETag matches the given value. This is useful for
  47282. // getting updates only after the object has changed since the last
  47283. // request. Use googleapi.IsNotModified to check whether the response
  47284. // error from Do is the result of In-None-Match.
  47285. func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall {
  47286. c.ifNoneMatch_ = entityTag
  47287. return c
  47288. }
  47289. // Context sets the context to be used in this call's Do method. Any
  47290. // pending HTTP request will be aborted if the provided context is
  47291. // canceled.
  47292. func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall {
  47293. c.ctx_ = ctx
  47294. return c
  47295. }
  47296. // Header returns an http.Header that can be modified by the caller to
  47297. // add HTTP headers to the request.
  47298. func (c *InstanceGroupsListCall) Header() http.Header {
  47299. if c.header_ == nil {
  47300. c.header_ = make(http.Header)
  47301. }
  47302. return c.header_
  47303. }
  47304. func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  47305. reqHeaders := make(http.Header)
  47306. for k, v := range c.header_ {
  47307. reqHeaders[k] = v
  47308. }
  47309. reqHeaders.Set("User-Agent", c.s.userAgent())
  47310. if c.ifNoneMatch_ != "" {
  47311. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47312. }
  47313. var body io.Reader = nil
  47314. c.urlParams_.Set("alt", alt)
  47315. c.urlParams_.Set("prettyPrint", "false")
  47316. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  47317. urls += "?" + c.urlParams_.Encode()
  47318. req, err := http.NewRequest("GET", urls, body)
  47319. if err != nil {
  47320. return nil, err
  47321. }
  47322. req.Header = reqHeaders
  47323. googleapi.Expand(req.URL, map[string]string{
  47324. "project": c.project,
  47325. "zone": c.zone,
  47326. })
  47327. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47328. }
  47329. // Do executes the "compute.instanceGroups.list" call.
  47330. // Exactly one of *InstanceGroupList or error will be non-nil. Any
  47331. // non-2xx status code is an error. Response headers are in either
  47332. // *InstanceGroupList.ServerResponse.Header or (if a response was
  47333. // returned at all) in error.(*googleapi.Error).Header. Use
  47334. // googleapi.IsNotModified to check whether the returned error was
  47335. // because http.StatusNotModified was returned.
  47336. func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) {
  47337. gensupport.SetOptions(c.urlParams_, opts...)
  47338. res, err := c.doRequest("json")
  47339. if res != nil && res.StatusCode == http.StatusNotModified {
  47340. if res.Body != nil {
  47341. res.Body.Close()
  47342. }
  47343. return nil, &googleapi.Error{
  47344. Code: res.StatusCode,
  47345. Header: res.Header,
  47346. }
  47347. }
  47348. if err != nil {
  47349. return nil, err
  47350. }
  47351. defer googleapi.CloseBody(res)
  47352. if err := googleapi.CheckResponse(res); err != nil {
  47353. return nil, err
  47354. }
  47355. ret := &InstanceGroupList{
  47356. ServerResponse: googleapi.ServerResponse{
  47357. Header: res.Header,
  47358. HTTPStatusCode: res.StatusCode,
  47359. },
  47360. }
  47361. target := &ret
  47362. if err := gensupport.DecodeResponse(target, res); err != nil {
  47363. return nil, err
  47364. }
  47365. return ret, nil
  47366. // {
  47367. // "description": "Retrieves the list of instance groups that are located in the specified project and zone.",
  47368. // "httpMethod": "GET",
  47369. // "id": "compute.instanceGroups.list",
  47370. // "parameterOrder": [
  47371. // "project",
  47372. // "zone"
  47373. // ],
  47374. // "parameters": {
  47375. // "filter": {
  47376. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  47377. // "location": "query",
  47378. // "type": "string"
  47379. // },
  47380. // "maxResults": {
  47381. // "default": "500",
  47382. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  47383. // "format": "uint32",
  47384. // "location": "query",
  47385. // "minimum": "0",
  47386. // "type": "integer"
  47387. // },
  47388. // "orderBy": {
  47389. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  47390. // "location": "query",
  47391. // "type": "string"
  47392. // },
  47393. // "pageToken": {
  47394. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  47395. // "location": "query",
  47396. // "type": "string"
  47397. // },
  47398. // "project": {
  47399. // "description": "Project ID for this request.",
  47400. // "location": "path",
  47401. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47402. // "required": true,
  47403. // "type": "string"
  47404. // },
  47405. // "zone": {
  47406. // "description": "The name of the zone where the instance group is located.",
  47407. // "location": "path",
  47408. // "required": true,
  47409. // "type": "string"
  47410. // }
  47411. // },
  47412. // "path": "{project}/zones/{zone}/instanceGroups",
  47413. // "response": {
  47414. // "$ref": "InstanceGroupList"
  47415. // },
  47416. // "scopes": [
  47417. // "https://www.googleapis.com/auth/cloud-platform",
  47418. // "https://www.googleapis.com/auth/compute",
  47419. // "https://www.googleapis.com/auth/compute.readonly"
  47420. // ]
  47421. // }
  47422. }
  47423. // Pages invokes f for each page of results.
  47424. // A non-nil error returned from f will halt the iteration.
  47425. // The provided context supersedes any context provided to the Context method.
  47426. func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error {
  47427. c.ctx_ = ctx
  47428. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  47429. for {
  47430. x, err := c.Do()
  47431. if err != nil {
  47432. return err
  47433. }
  47434. if err := f(x); err != nil {
  47435. return err
  47436. }
  47437. if x.NextPageToken == "" {
  47438. return nil
  47439. }
  47440. c.PageToken(x.NextPageToken)
  47441. }
  47442. }
  47443. // method id "compute.instanceGroups.listInstances":
  47444. type InstanceGroupsListInstancesCall struct {
  47445. s *Service
  47446. project string
  47447. zone string
  47448. instanceGroup string
  47449. instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest
  47450. urlParams_ gensupport.URLParams
  47451. ctx_ context.Context
  47452. header_ http.Header
  47453. }
  47454. // ListInstances: Lists the instances in the specified instance group.
  47455. func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall {
  47456. c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47457. c.project = project
  47458. c.zone = zone
  47459. c.instanceGroup = instanceGroup
  47460. c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest
  47461. return c
  47462. }
  47463. // Filter sets the optional parameter "filter": A filter expression that
  47464. // filters resources listed in the response. The expression must specify
  47465. // the field name, a comparison operator, and the value that you want to
  47466. // use for filtering. The value must be a string, a number, or a
  47467. // boolean. The comparison operator must be either =, !=, >, or <.
  47468. //
  47469. // For example, if you are filtering Compute Engine instances, you can
  47470. // exclude instances named example-instance by specifying name !=
  47471. // example-instance.
  47472. //
  47473. // You can also filter nested fields. For example, you could specify
  47474. // scheduling.automaticRestart = false to include instances only if they
  47475. // are not scheduled for automatic restarts. You can use filtering on
  47476. // nested fields to filter based on resource labels.
  47477. //
  47478. // To filter on multiple expressions, provide each separate expression
  47479. // within parentheses. For example, (scheduling.automaticRestart = true)
  47480. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  47481. // AND expression. However, you can include AND and OR expressions
  47482. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  47483. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  47484. // true).
  47485. func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall {
  47486. c.urlParams_.Set("filter", filter)
  47487. return c
  47488. }
  47489. // MaxResults sets the optional parameter "maxResults": The maximum
  47490. // number of results per page that should be returned. If the number of
  47491. // available results is larger than maxResults, Compute Engine returns a
  47492. // nextPageToken that can be used to get the next page of results in
  47493. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  47494. // (Default: 500)
  47495. func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall {
  47496. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  47497. return c
  47498. }
  47499. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  47500. // a certain order. By default, results are returned in alphanumerical
  47501. // order based on the resource name.
  47502. //
  47503. // You can also sort results in descending order based on the creation
  47504. // timestamp using orderBy="creationTimestamp desc". This sorts results
  47505. // based on the creationTimestamp field in reverse chronological order
  47506. // (newest result first). Use this to sort resources like operations so
  47507. // that the newest operation is returned first.
  47508. //
  47509. // Currently, only sorting by name or creationTimestamp desc is
  47510. // supported.
  47511. func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall {
  47512. c.urlParams_.Set("orderBy", orderBy)
  47513. return c
  47514. }
  47515. // PageToken sets the optional parameter "pageToken": Specifies a page
  47516. // token to use. Set pageToken to the nextPageToken returned by a
  47517. // previous list request to get the next page of results.
  47518. func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall {
  47519. c.urlParams_.Set("pageToken", pageToken)
  47520. return c
  47521. }
  47522. // Fields allows partial responses to be retrieved. See
  47523. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47524. // for more information.
  47525. func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall {
  47526. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47527. return c
  47528. }
  47529. // Context sets the context to be used in this call's Do method. Any
  47530. // pending HTTP request will be aborted if the provided context is
  47531. // canceled.
  47532. func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall {
  47533. c.ctx_ = ctx
  47534. return c
  47535. }
  47536. // Header returns an http.Header that can be modified by the caller to
  47537. // add HTTP headers to the request.
  47538. func (c *InstanceGroupsListInstancesCall) Header() http.Header {
  47539. if c.header_ == nil {
  47540. c.header_ = make(http.Header)
  47541. }
  47542. return c.header_
  47543. }
  47544. func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  47545. reqHeaders := make(http.Header)
  47546. for k, v := range c.header_ {
  47547. reqHeaders[k] = v
  47548. }
  47549. reqHeaders.Set("User-Agent", c.s.userAgent())
  47550. var body io.Reader = nil
  47551. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest)
  47552. if err != nil {
  47553. return nil, err
  47554. }
  47555. reqHeaders.Set("Content-Type", "application/json")
  47556. c.urlParams_.Set("alt", alt)
  47557. c.urlParams_.Set("prettyPrint", "false")
  47558. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")
  47559. urls += "?" + c.urlParams_.Encode()
  47560. req, err := http.NewRequest("POST", urls, body)
  47561. if err != nil {
  47562. return nil, err
  47563. }
  47564. req.Header = reqHeaders
  47565. googleapi.Expand(req.URL, map[string]string{
  47566. "project": c.project,
  47567. "zone": c.zone,
  47568. "instanceGroup": c.instanceGroup,
  47569. })
  47570. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47571. }
  47572. // Do executes the "compute.instanceGroups.listInstances" call.
  47573. // Exactly one of *InstanceGroupsListInstances or error will be non-nil.
  47574. // Any non-2xx status code is an error. Response headers are in either
  47575. // *InstanceGroupsListInstances.ServerResponse.Header or (if a response
  47576. // was returned at all) in error.(*googleapi.Error).Header. Use
  47577. // googleapi.IsNotModified to check whether the returned error was
  47578. // because http.StatusNotModified was returned.
  47579. func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) {
  47580. gensupport.SetOptions(c.urlParams_, opts...)
  47581. res, err := c.doRequest("json")
  47582. if res != nil && res.StatusCode == http.StatusNotModified {
  47583. if res.Body != nil {
  47584. res.Body.Close()
  47585. }
  47586. return nil, &googleapi.Error{
  47587. Code: res.StatusCode,
  47588. Header: res.Header,
  47589. }
  47590. }
  47591. if err != nil {
  47592. return nil, err
  47593. }
  47594. defer googleapi.CloseBody(res)
  47595. if err := googleapi.CheckResponse(res); err != nil {
  47596. return nil, err
  47597. }
  47598. ret := &InstanceGroupsListInstances{
  47599. ServerResponse: googleapi.ServerResponse{
  47600. Header: res.Header,
  47601. HTTPStatusCode: res.StatusCode,
  47602. },
  47603. }
  47604. target := &ret
  47605. if err := gensupport.DecodeResponse(target, res); err != nil {
  47606. return nil, err
  47607. }
  47608. return ret, nil
  47609. // {
  47610. // "description": "Lists the instances in the specified instance group.",
  47611. // "httpMethod": "POST",
  47612. // "id": "compute.instanceGroups.listInstances",
  47613. // "parameterOrder": [
  47614. // "project",
  47615. // "zone",
  47616. // "instanceGroup"
  47617. // ],
  47618. // "parameters": {
  47619. // "filter": {
  47620. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  47621. // "location": "query",
  47622. // "type": "string"
  47623. // },
  47624. // "instanceGroup": {
  47625. // "description": "The name of the instance group from which you want to generate a list of included instances.",
  47626. // "location": "path",
  47627. // "required": true,
  47628. // "type": "string"
  47629. // },
  47630. // "maxResults": {
  47631. // "default": "500",
  47632. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  47633. // "format": "uint32",
  47634. // "location": "query",
  47635. // "minimum": "0",
  47636. // "type": "integer"
  47637. // },
  47638. // "orderBy": {
  47639. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  47640. // "location": "query",
  47641. // "type": "string"
  47642. // },
  47643. // "pageToken": {
  47644. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  47645. // "location": "query",
  47646. // "type": "string"
  47647. // },
  47648. // "project": {
  47649. // "description": "Project ID for this request.",
  47650. // "location": "path",
  47651. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47652. // "required": true,
  47653. // "type": "string"
  47654. // },
  47655. // "zone": {
  47656. // "description": "The name of the zone where the instance group is located.",
  47657. // "location": "path",
  47658. // "required": true,
  47659. // "type": "string"
  47660. // }
  47661. // },
  47662. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
  47663. // "request": {
  47664. // "$ref": "InstanceGroupsListInstancesRequest"
  47665. // },
  47666. // "response": {
  47667. // "$ref": "InstanceGroupsListInstances"
  47668. // },
  47669. // "scopes": [
  47670. // "https://www.googleapis.com/auth/cloud-platform",
  47671. // "https://www.googleapis.com/auth/compute",
  47672. // "https://www.googleapis.com/auth/compute.readonly"
  47673. // ]
  47674. // }
  47675. }
  47676. // Pages invokes f for each page of results.
  47677. // A non-nil error returned from f will halt the iteration.
  47678. // The provided context supersedes any context provided to the Context method.
  47679. func (c *InstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupsListInstances) error) error {
  47680. c.ctx_ = ctx
  47681. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  47682. for {
  47683. x, err := c.Do()
  47684. if err != nil {
  47685. return err
  47686. }
  47687. if err := f(x); err != nil {
  47688. return err
  47689. }
  47690. if x.NextPageToken == "" {
  47691. return nil
  47692. }
  47693. c.PageToken(x.NextPageToken)
  47694. }
  47695. }
  47696. // method id "compute.instanceGroups.removeInstances":
  47697. type InstanceGroupsRemoveInstancesCall struct {
  47698. s *Service
  47699. project string
  47700. zone string
  47701. instanceGroup string
  47702. instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest
  47703. urlParams_ gensupport.URLParams
  47704. ctx_ context.Context
  47705. header_ http.Header
  47706. }
  47707. // RemoveInstances: Removes one or more instances from the specified
  47708. // instance group, but does not delete those instances.
  47709. //
  47710. // If the group is part of a backend service that has enabled connection
  47711. // draining, it can take up to 60 seconds after the connection draining
  47712. // duration before the VM instance is removed or deleted.
  47713. func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall {
  47714. c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47715. c.project = project
  47716. c.zone = zone
  47717. c.instanceGroup = instanceGroup
  47718. c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest
  47719. return c
  47720. }
  47721. // RequestId sets the optional parameter "requestId": An optional
  47722. // request ID to identify requests. Specify a unique request ID so that
  47723. // if you must retry your request, the server will know to ignore the
  47724. // request if it has already been completed.
  47725. //
  47726. // For example, consider a situation where you make an initial request
  47727. // and the request times out. If you make the request again with the
  47728. // same request ID, the server can check if original operation with the
  47729. // same request ID was received, and if so, will ignore the second
  47730. // request. This prevents clients from accidentally creating duplicate
  47731. // commitments.
  47732. //
  47733. // The request ID must be a valid UUID with the exception that zero UUID
  47734. // is not supported (00000000-0000-0000-0000-000000000000).
  47735. func (c *InstanceGroupsRemoveInstancesCall) RequestId(requestId string) *InstanceGroupsRemoveInstancesCall {
  47736. c.urlParams_.Set("requestId", requestId)
  47737. return c
  47738. }
  47739. // Fields allows partial responses to be retrieved. See
  47740. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47741. // for more information.
  47742. func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall {
  47743. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47744. return c
  47745. }
  47746. // Context sets the context to be used in this call's Do method. Any
  47747. // pending HTTP request will be aborted if the provided context is
  47748. // canceled.
  47749. func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall {
  47750. c.ctx_ = ctx
  47751. return c
  47752. }
  47753. // Header returns an http.Header that can be modified by the caller to
  47754. // add HTTP headers to the request.
  47755. func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header {
  47756. if c.header_ == nil {
  47757. c.header_ = make(http.Header)
  47758. }
  47759. return c.header_
  47760. }
  47761. func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) {
  47762. reqHeaders := make(http.Header)
  47763. for k, v := range c.header_ {
  47764. reqHeaders[k] = v
  47765. }
  47766. reqHeaders.Set("User-Agent", c.s.userAgent())
  47767. var body io.Reader = nil
  47768. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest)
  47769. if err != nil {
  47770. return nil, err
  47771. }
  47772. reqHeaders.Set("Content-Type", "application/json")
  47773. c.urlParams_.Set("alt", alt)
  47774. c.urlParams_.Set("prettyPrint", "false")
  47775. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")
  47776. urls += "?" + c.urlParams_.Encode()
  47777. req, err := http.NewRequest("POST", urls, body)
  47778. if err != nil {
  47779. return nil, err
  47780. }
  47781. req.Header = reqHeaders
  47782. googleapi.Expand(req.URL, map[string]string{
  47783. "project": c.project,
  47784. "zone": c.zone,
  47785. "instanceGroup": c.instanceGroup,
  47786. })
  47787. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47788. }
  47789. // Do executes the "compute.instanceGroups.removeInstances" call.
  47790. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47791. // status code is an error. Response headers are in either
  47792. // *Operation.ServerResponse.Header or (if a response was returned at
  47793. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47794. // to check whether the returned error was because
  47795. // http.StatusNotModified was returned.
  47796. func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47797. gensupport.SetOptions(c.urlParams_, opts...)
  47798. res, err := c.doRequest("json")
  47799. if res != nil && res.StatusCode == http.StatusNotModified {
  47800. if res.Body != nil {
  47801. res.Body.Close()
  47802. }
  47803. return nil, &googleapi.Error{
  47804. Code: res.StatusCode,
  47805. Header: res.Header,
  47806. }
  47807. }
  47808. if err != nil {
  47809. return nil, err
  47810. }
  47811. defer googleapi.CloseBody(res)
  47812. if err := googleapi.CheckResponse(res); err != nil {
  47813. return nil, err
  47814. }
  47815. ret := &Operation{
  47816. ServerResponse: googleapi.ServerResponse{
  47817. Header: res.Header,
  47818. HTTPStatusCode: res.StatusCode,
  47819. },
  47820. }
  47821. target := &ret
  47822. if err := gensupport.DecodeResponse(target, res); err != nil {
  47823. return nil, err
  47824. }
  47825. return ret, nil
  47826. // {
  47827. // "description": "Removes one or more instances from the specified instance group, but does not delete those instances.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted.",
  47828. // "httpMethod": "POST",
  47829. // "id": "compute.instanceGroups.removeInstances",
  47830. // "parameterOrder": [
  47831. // "project",
  47832. // "zone",
  47833. // "instanceGroup"
  47834. // ],
  47835. // "parameters": {
  47836. // "instanceGroup": {
  47837. // "description": "The name of the instance group where the specified instances will be removed.",
  47838. // "location": "path",
  47839. // "required": true,
  47840. // "type": "string"
  47841. // },
  47842. // "project": {
  47843. // "description": "Project ID for this request.",
  47844. // "location": "path",
  47845. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47846. // "required": true,
  47847. // "type": "string"
  47848. // },
  47849. // "requestId": {
  47850. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47851. // "location": "query",
  47852. // "type": "string"
  47853. // },
  47854. // "zone": {
  47855. // "description": "The name of the zone where the instance group is located.",
  47856. // "location": "path",
  47857. // "required": true,
  47858. // "type": "string"
  47859. // }
  47860. // },
  47861. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
  47862. // "request": {
  47863. // "$ref": "InstanceGroupsRemoveInstancesRequest"
  47864. // },
  47865. // "response": {
  47866. // "$ref": "Operation"
  47867. // },
  47868. // "scopes": [
  47869. // "https://www.googleapis.com/auth/cloud-platform",
  47870. // "https://www.googleapis.com/auth/compute"
  47871. // ]
  47872. // }
  47873. }
  47874. // method id "compute.instanceGroups.setNamedPorts":
  47875. type InstanceGroupsSetNamedPortsCall struct {
  47876. s *Service
  47877. project string
  47878. zone string
  47879. instanceGroup string
  47880. instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest
  47881. urlParams_ gensupport.URLParams
  47882. ctx_ context.Context
  47883. header_ http.Header
  47884. }
  47885. // SetNamedPorts: Sets the named ports for the specified instance group.
  47886. func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall {
  47887. c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47888. c.project = project
  47889. c.zone = zone
  47890. c.instanceGroup = instanceGroup
  47891. c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest
  47892. return c
  47893. }
  47894. // RequestId sets the optional parameter "requestId": An optional
  47895. // request ID to identify requests. Specify a unique request ID so that
  47896. // if you must retry your request, the server will know to ignore the
  47897. // request if it has already been completed.
  47898. //
  47899. // For example, consider a situation where you make an initial request
  47900. // and the request times out. If you make the request again with the
  47901. // same request ID, the server can check if original operation with the
  47902. // same request ID was received, and if so, will ignore the second
  47903. // request. This prevents clients from accidentally creating duplicate
  47904. // commitments.
  47905. //
  47906. // The request ID must be a valid UUID with the exception that zero UUID
  47907. // is not supported (00000000-0000-0000-0000-000000000000).
  47908. func (c *InstanceGroupsSetNamedPortsCall) RequestId(requestId string) *InstanceGroupsSetNamedPortsCall {
  47909. c.urlParams_.Set("requestId", requestId)
  47910. return c
  47911. }
  47912. // Fields allows partial responses to be retrieved. See
  47913. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47914. // for more information.
  47915. func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall {
  47916. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47917. return c
  47918. }
  47919. // Context sets the context to be used in this call's Do method. Any
  47920. // pending HTTP request will be aborted if the provided context is
  47921. // canceled.
  47922. func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall {
  47923. c.ctx_ = ctx
  47924. return c
  47925. }
  47926. // Header returns an http.Header that can be modified by the caller to
  47927. // add HTTP headers to the request.
  47928. func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header {
  47929. if c.header_ == nil {
  47930. c.header_ = make(http.Header)
  47931. }
  47932. return c.header_
  47933. }
  47934. func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  47935. reqHeaders := make(http.Header)
  47936. for k, v := range c.header_ {
  47937. reqHeaders[k] = v
  47938. }
  47939. reqHeaders.Set("User-Agent", c.s.userAgent())
  47940. var body io.Reader = nil
  47941. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest)
  47942. if err != nil {
  47943. return nil, err
  47944. }
  47945. reqHeaders.Set("Content-Type", "application/json")
  47946. c.urlParams_.Set("alt", alt)
  47947. c.urlParams_.Set("prettyPrint", "false")
  47948. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")
  47949. urls += "?" + c.urlParams_.Encode()
  47950. req, err := http.NewRequest("POST", urls, body)
  47951. if err != nil {
  47952. return nil, err
  47953. }
  47954. req.Header = reqHeaders
  47955. googleapi.Expand(req.URL, map[string]string{
  47956. "project": c.project,
  47957. "zone": c.zone,
  47958. "instanceGroup": c.instanceGroup,
  47959. })
  47960. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47961. }
  47962. // Do executes the "compute.instanceGroups.setNamedPorts" call.
  47963. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47964. // status code is an error. Response headers are in either
  47965. // *Operation.ServerResponse.Header or (if a response was returned at
  47966. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47967. // to check whether the returned error was because
  47968. // http.StatusNotModified was returned.
  47969. func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47970. gensupport.SetOptions(c.urlParams_, opts...)
  47971. res, err := c.doRequest("json")
  47972. if res != nil && res.StatusCode == http.StatusNotModified {
  47973. if res.Body != nil {
  47974. res.Body.Close()
  47975. }
  47976. return nil, &googleapi.Error{
  47977. Code: res.StatusCode,
  47978. Header: res.Header,
  47979. }
  47980. }
  47981. if err != nil {
  47982. return nil, err
  47983. }
  47984. defer googleapi.CloseBody(res)
  47985. if err := googleapi.CheckResponse(res); err != nil {
  47986. return nil, err
  47987. }
  47988. ret := &Operation{
  47989. ServerResponse: googleapi.ServerResponse{
  47990. Header: res.Header,
  47991. HTTPStatusCode: res.StatusCode,
  47992. },
  47993. }
  47994. target := &ret
  47995. if err := gensupport.DecodeResponse(target, res); err != nil {
  47996. return nil, err
  47997. }
  47998. return ret, nil
  47999. // {
  48000. // "description": "Sets the named ports for the specified instance group.",
  48001. // "httpMethod": "POST",
  48002. // "id": "compute.instanceGroups.setNamedPorts",
  48003. // "parameterOrder": [
  48004. // "project",
  48005. // "zone",
  48006. // "instanceGroup"
  48007. // ],
  48008. // "parameters": {
  48009. // "instanceGroup": {
  48010. // "description": "The name of the instance group where the named ports are updated.",
  48011. // "location": "path",
  48012. // "required": true,
  48013. // "type": "string"
  48014. // },
  48015. // "project": {
  48016. // "description": "Project ID for this request.",
  48017. // "location": "path",
  48018. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48019. // "required": true,
  48020. // "type": "string"
  48021. // },
  48022. // "requestId": {
  48023. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48024. // "location": "query",
  48025. // "type": "string"
  48026. // },
  48027. // "zone": {
  48028. // "description": "The name of the zone where the instance group is located.",
  48029. // "location": "path",
  48030. // "required": true,
  48031. // "type": "string"
  48032. // }
  48033. // },
  48034. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
  48035. // "request": {
  48036. // "$ref": "InstanceGroupsSetNamedPortsRequest"
  48037. // },
  48038. // "response": {
  48039. // "$ref": "Operation"
  48040. // },
  48041. // "scopes": [
  48042. // "https://www.googleapis.com/auth/cloud-platform",
  48043. // "https://www.googleapis.com/auth/compute"
  48044. // ]
  48045. // }
  48046. }
  48047. // method id "compute.instanceTemplates.delete":
  48048. type InstanceTemplatesDeleteCall struct {
  48049. s *Service
  48050. project string
  48051. instanceTemplate string
  48052. urlParams_ gensupport.URLParams
  48053. ctx_ context.Context
  48054. header_ http.Header
  48055. }
  48056. // Delete: Deletes the specified instance template. Deleting an instance
  48057. // template is permanent and cannot be undone. It is not possible to
  48058. // delete templates that are already in use by a managed instance group.
  48059. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete
  48060. func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall {
  48061. c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48062. c.project = project
  48063. c.instanceTemplate = instanceTemplate
  48064. return c
  48065. }
  48066. // RequestId sets the optional parameter "requestId": An optional
  48067. // request ID to identify requests. Specify a unique request ID so that
  48068. // if you must retry your request, the server will know to ignore the
  48069. // request if it has already been completed.
  48070. //
  48071. // For example, consider a situation where you make an initial request
  48072. // and the request times out. If you make the request again with the
  48073. // same request ID, the server can check if original operation with the
  48074. // same request ID was received, and if so, will ignore the second
  48075. // request. This prevents clients from accidentally creating duplicate
  48076. // commitments.
  48077. //
  48078. // The request ID must be a valid UUID with the exception that zero UUID
  48079. // is not supported (00000000-0000-0000-0000-000000000000).
  48080. func (c *InstanceTemplatesDeleteCall) RequestId(requestId string) *InstanceTemplatesDeleteCall {
  48081. c.urlParams_.Set("requestId", requestId)
  48082. return c
  48083. }
  48084. // Fields allows partial responses to be retrieved. See
  48085. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48086. // for more information.
  48087. func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall {
  48088. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48089. return c
  48090. }
  48091. // Context sets the context to be used in this call's Do method. Any
  48092. // pending HTTP request will be aborted if the provided context is
  48093. // canceled.
  48094. func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall {
  48095. c.ctx_ = ctx
  48096. return c
  48097. }
  48098. // Header returns an http.Header that can be modified by the caller to
  48099. // add HTTP headers to the request.
  48100. func (c *InstanceTemplatesDeleteCall) Header() http.Header {
  48101. if c.header_ == nil {
  48102. c.header_ = make(http.Header)
  48103. }
  48104. return c.header_
  48105. }
  48106. func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  48107. reqHeaders := make(http.Header)
  48108. for k, v := range c.header_ {
  48109. reqHeaders[k] = v
  48110. }
  48111. reqHeaders.Set("User-Agent", c.s.userAgent())
  48112. var body io.Reader = nil
  48113. c.urlParams_.Set("alt", alt)
  48114. c.urlParams_.Set("prettyPrint", "false")
  48115. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  48116. urls += "?" + c.urlParams_.Encode()
  48117. req, err := http.NewRequest("DELETE", urls, body)
  48118. if err != nil {
  48119. return nil, err
  48120. }
  48121. req.Header = reqHeaders
  48122. googleapi.Expand(req.URL, map[string]string{
  48123. "project": c.project,
  48124. "instanceTemplate": c.instanceTemplate,
  48125. })
  48126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48127. }
  48128. // Do executes the "compute.instanceTemplates.delete" call.
  48129. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48130. // status code is an error. Response headers are in either
  48131. // *Operation.ServerResponse.Header or (if a response was returned at
  48132. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48133. // to check whether the returned error was because
  48134. // http.StatusNotModified was returned.
  48135. func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48136. gensupport.SetOptions(c.urlParams_, opts...)
  48137. res, err := c.doRequest("json")
  48138. if res != nil && res.StatusCode == http.StatusNotModified {
  48139. if res.Body != nil {
  48140. res.Body.Close()
  48141. }
  48142. return nil, &googleapi.Error{
  48143. Code: res.StatusCode,
  48144. Header: res.Header,
  48145. }
  48146. }
  48147. if err != nil {
  48148. return nil, err
  48149. }
  48150. defer googleapi.CloseBody(res)
  48151. if err := googleapi.CheckResponse(res); err != nil {
  48152. return nil, err
  48153. }
  48154. ret := &Operation{
  48155. ServerResponse: googleapi.ServerResponse{
  48156. Header: res.Header,
  48157. HTTPStatusCode: res.StatusCode,
  48158. },
  48159. }
  48160. target := &ret
  48161. if err := gensupport.DecodeResponse(target, res); err != nil {
  48162. return nil, err
  48163. }
  48164. return ret, nil
  48165. // {
  48166. // "description": "Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group.",
  48167. // "httpMethod": "DELETE",
  48168. // "id": "compute.instanceTemplates.delete",
  48169. // "parameterOrder": [
  48170. // "project",
  48171. // "instanceTemplate"
  48172. // ],
  48173. // "parameters": {
  48174. // "instanceTemplate": {
  48175. // "description": "The name of the instance template to delete.",
  48176. // "location": "path",
  48177. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48178. // "required": true,
  48179. // "type": "string"
  48180. // },
  48181. // "project": {
  48182. // "description": "Project ID for this request.",
  48183. // "location": "path",
  48184. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48185. // "required": true,
  48186. // "type": "string"
  48187. // },
  48188. // "requestId": {
  48189. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48190. // "location": "query",
  48191. // "type": "string"
  48192. // }
  48193. // },
  48194. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  48195. // "response": {
  48196. // "$ref": "Operation"
  48197. // },
  48198. // "scopes": [
  48199. // "https://www.googleapis.com/auth/cloud-platform",
  48200. // "https://www.googleapis.com/auth/compute"
  48201. // ]
  48202. // }
  48203. }
  48204. // method id "compute.instanceTemplates.get":
  48205. type InstanceTemplatesGetCall struct {
  48206. s *Service
  48207. project string
  48208. instanceTemplate string
  48209. urlParams_ gensupport.URLParams
  48210. ifNoneMatch_ string
  48211. ctx_ context.Context
  48212. header_ http.Header
  48213. }
  48214. // Get: Returns the specified instance template. Gets a list of
  48215. // available instance templates by making a list() request.
  48216. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get
  48217. func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall {
  48218. c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48219. c.project = project
  48220. c.instanceTemplate = instanceTemplate
  48221. return c
  48222. }
  48223. // Fields allows partial responses to be retrieved. See
  48224. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48225. // for more information.
  48226. func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall {
  48227. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48228. return c
  48229. }
  48230. // IfNoneMatch sets the optional parameter which makes the operation
  48231. // fail if the object's ETag matches the given value. This is useful for
  48232. // getting updates only after the object has changed since the last
  48233. // request. Use googleapi.IsNotModified to check whether the response
  48234. // error from Do is the result of In-None-Match.
  48235. func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall {
  48236. c.ifNoneMatch_ = entityTag
  48237. return c
  48238. }
  48239. // Context sets the context to be used in this call's Do method. Any
  48240. // pending HTTP request will be aborted if the provided context is
  48241. // canceled.
  48242. func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall {
  48243. c.ctx_ = ctx
  48244. return c
  48245. }
  48246. // Header returns an http.Header that can be modified by the caller to
  48247. // add HTTP headers to the request.
  48248. func (c *InstanceTemplatesGetCall) Header() http.Header {
  48249. if c.header_ == nil {
  48250. c.header_ = make(http.Header)
  48251. }
  48252. return c.header_
  48253. }
  48254. func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  48255. reqHeaders := make(http.Header)
  48256. for k, v := range c.header_ {
  48257. reqHeaders[k] = v
  48258. }
  48259. reqHeaders.Set("User-Agent", c.s.userAgent())
  48260. if c.ifNoneMatch_ != "" {
  48261. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48262. }
  48263. var body io.Reader = nil
  48264. c.urlParams_.Set("alt", alt)
  48265. c.urlParams_.Set("prettyPrint", "false")
  48266. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  48267. urls += "?" + c.urlParams_.Encode()
  48268. req, err := http.NewRequest("GET", urls, body)
  48269. if err != nil {
  48270. return nil, err
  48271. }
  48272. req.Header = reqHeaders
  48273. googleapi.Expand(req.URL, map[string]string{
  48274. "project": c.project,
  48275. "instanceTemplate": c.instanceTemplate,
  48276. })
  48277. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48278. }
  48279. // Do executes the "compute.instanceTemplates.get" call.
  48280. // Exactly one of *InstanceTemplate or error will be non-nil. Any
  48281. // non-2xx status code is an error. Response headers are in either
  48282. // *InstanceTemplate.ServerResponse.Header or (if a response was
  48283. // returned at all) in error.(*googleapi.Error).Header. Use
  48284. // googleapi.IsNotModified to check whether the returned error was
  48285. // because http.StatusNotModified was returned.
  48286. func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) {
  48287. gensupport.SetOptions(c.urlParams_, opts...)
  48288. res, err := c.doRequest("json")
  48289. if res != nil && res.StatusCode == http.StatusNotModified {
  48290. if res.Body != nil {
  48291. res.Body.Close()
  48292. }
  48293. return nil, &googleapi.Error{
  48294. Code: res.StatusCode,
  48295. Header: res.Header,
  48296. }
  48297. }
  48298. if err != nil {
  48299. return nil, err
  48300. }
  48301. defer googleapi.CloseBody(res)
  48302. if err := googleapi.CheckResponse(res); err != nil {
  48303. return nil, err
  48304. }
  48305. ret := &InstanceTemplate{
  48306. ServerResponse: googleapi.ServerResponse{
  48307. Header: res.Header,
  48308. HTTPStatusCode: res.StatusCode,
  48309. },
  48310. }
  48311. target := &ret
  48312. if err := gensupport.DecodeResponse(target, res); err != nil {
  48313. return nil, err
  48314. }
  48315. return ret, nil
  48316. // {
  48317. // "description": "Returns the specified instance template. Gets a list of available instance templates by making a list() request.",
  48318. // "httpMethod": "GET",
  48319. // "id": "compute.instanceTemplates.get",
  48320. // "parameterOrder": [
  48321. // "project",
  48322. // "instanceTemplate"
  48323. // ],
  48324. // "parameters": {
  48325. // "instanceTemplate": {
  48326. // "description": "The name of the instance template.",
  48327. // "location": "path",
  48328. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48329. // "required": true,
  48330. // "type": "string"
  48331. // },
  48332. // "project": {
  48333. // "description": "Project ID for this request.",
  48334. // "location": "path",
  48335. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48336. // "required": true,
  48337. // "type": "string"
  48338. // }
  48339. // },
  48340. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  48341. // "response": {
  48342. // "$ref": "InstanceTemplate"
  48343. // },
  48344. // "scopes": [
  48345. // "https://www.googleapis.com/auth/cloud-platform",
  48346. // "https://www.googleapis.com/auth/compute",
  48347. // "https://www.googleapis.com/auth/compute.readonly"
  48348. // ]
  48349. // }
  48350. }
  48351. // method id "compute.instanceTemplates.getIamPolicy":
  48352. type InstanceTemplatesGetIamPolicyCall struct {
  48353. s *Service
  48354. project string
  48355. resource string
  48356. urlParams_ gensupport.URLParams
  48357. ifNoneMatch_ string
  48358. ctx_ context.Context
  48359. header_ http.Header
  48360. }
  48361. // GetIamPolicy: Gets the access control policy for a resource. May be
  48362. // empty if no such policy or resource exists.
  48363. func (r *InstanceTemplatesService) GetIamPolicy(project string, resource string) *InstanceTemplatesGetIamPolicyCall {
  48364. c := &InstanceTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48365. c.project = project
  48366. c.resource = resource
  48367. return c
  48368. }
  48369. // Fields allows partial responses to be retrieved. See
  48370. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48371. // for more information.
  48372. func (c *InstanceTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetIamPolicyCall {
  48373. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48374. return c
  48375. }
  48376. // IfNoneMatch sets the optional parameter which makes the operation
  48377. // fail if the object's ETag matches the given value. This is useful for
  48378. // getting updates only after the object has changed since the last
  48379. // request. Use googleapi.IsNotModified to check whether the response
  48380. // error from Do is the result of In-None-Match.
  48381. func (c *InstanceTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetIamPolicyCall {
  48382. c.ifNoneMatch_ = entityTag
  48383. return c
  48384. }
  48385. // Context sets the context to be used in this call's Do method. Any
  48386. // pending HTTP request will be aborted if the provided context is
  48387. // canceled.
  48388. func (c *InstanceTemplatesGetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesGetIamPolicyCall {
  48389. c.ctx_ = ctx
  48390. return c
  48391. }
  48392. // Header returns an http.Header that can be modified by the caller to
  48393. // add HTTP headers to the request.
  48394. func (c *InstanceTemplatesGetIamPolicyCall) Header() http.Header {
  48395. if c.header_ == nil {
  48396. c.header_ = make(http.Header)
  48397. }
  48398. return c.header_
  48399. }
  48400. func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  48401. reqHeaders := make(http.Header)
  48402. for k, v := range c.header_ {
  48403. reqHeaders[k] = v
  48404. }
  48405. reqHeaders.Set("User-Agent", c.s.userAgent())
  48406. if c.ifNoneMatch_ != "" {
  48407. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48408. }
  48409. var body io.Reader = nil
  48410. c.urlParams_.Set("alt", alt)
  48411. c.urlParams_.Set("prettyPrint", "false")
  48412. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/getIamPolicy")
  48413. urls += "?" + c.urlParams_.Encode()
  48414. req, err := http.NewRequest("GET", urls, body)
  48415. if err != nil {
  48416. return nil, err
  48417. }
  48418. req.Header = reqHeaders
  48419. googleapi.Expand(req.URL, map[string]string{
  48420. "project": c.project,
  48421. "resource": c.resource,
  48422. })
  48423. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48424. }
  48425. // Do executes the "compute.instanceTemplates.getIamPolicy" call.
  48426. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  48427. // code is an error. Response headers are in either
  48428. // *Policy.ServerResponse.Header or (if a response was returned at all)
  48429. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  48430. // check whether the returned error was because http.StatusNotModified
  48431. // was returned.
  48432. func (c *InstanceTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  48433. gensupport.SetOptions(c.urlParams_, opts...)
  48434. res, err := c.doRequest("json")
  48435. if res != nil && res.StatusCode == http.StatusNotModified {
  48436. if res.Body != nil {
  48437. res.Body.Close()
  48438. }
  48439. return nil, &googleapi.Error{
  48440. Code: res.StatusCode,
  48441. Header: res.Header,
  48442. }
  48443. }
  48444. if err != nil {
  48445. return nil, err
  48446. }
  48447. defer googleapi.CloseBody(res)
  48448. if err := googleapi.CheckResponse(res); err != nil {
  48449. return nil, err
  48450. }
  48451. ret := &Policy{
  48452. ServerResponse: googleapi.ServerResponse{
  48453. Header: res.Header,
  48454. HTTPStatusCode: res.StatusCode,
  48455. },
  48456. }
  48457. target := &ret
  48458. if err := gensupport.DecodeResponse(target, res); err != nil {
  48459. return nil, err
  48460. }
  48461. return ret, nil
  48462. // {
  48463. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  48464. // "httpMethod": "GET",
  48465. // "id": "compute.instanceTemplates.getIamPolicy",
  48466. // "parameterOrder": [
  48467. // "project",
  48468. // "resource"
  48469. // ],
  48470. // "parameters": {
  48471. // "project": {
  48472. // "description": "Project ID for this request.",
  48473. // "location": "path",
  48474. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48475. // "required": true,
  48476. // "type": "string"
  48477. // },
  48478. // "resource": {
  48479. // "description": "Name or id of the resource for this request.",
  48480. // "location": "path",
  48481. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48482. // "required": true,
  48483. // "type": "string"
  48484. // }
  48485. // },
  48486. // "path": "{project}/global/instanceTemplates/{resource}/getIamPolicy",
  48487. // "response": {
  48488. // "$ref": "Policy"
  48489. // },
  48490. // "scopes": [
  48491. // "https://www.googleapis.com/auth/cloud-platform",
  48492. // "https://www.googleapis.com/auth/compute",
  48493. // "https://www.googleapis.com/auth/compute.readonly"
  48494. // ]
  48495. // }
  48496. }
  48497. // method id "compute.instanceTemplates.insert":
  48498. type InstanceTemplatesInsertCall struct {
  48499. s *Service
  48500. project string
  48501. instancetemplate *InstanceTemplate
  48502. urlParams_ gensupport.URLParams
  48503. ctx_ context.Context
  48504. header_ http.Header
  48505. }
  48506. // Insert: Creates an instance template in the specified project using
  48507. // the data that is included in the request. If you are creating a new
  48508. // template to update an existing instance group, your new instance
  48509. // template must use the same network or, if applicable, the same
  48510. // subnetwork as the original template.
  48511. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert
  48512. func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall {
  48513. c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48514. c.project = project
  48515. c.instancetemplate = instancetemplate
  48516. return c
  48517. }
  48518. // RequestId sets the optional parameter "requestId": An optional
  48519. // request ID to identify requests. Specify a unique request ID so that
  48520. // if you must retry your request, the server will know to ignore the
  48521. // request if it has already been completed.
  48522. //
  48523. // For example, consider a situation where you make an initial request
  48524. // and the request times out. If you make the request again with the
  48525. // same request ID, the server can check if original operation with the
  48526. // same request ID was received, and if so, will ignore the second
  48527. // request. This prevents clients from accidentally creating duplicate
  48528. // commitments.
  48529. //
  48530. // The request ID must be a valid UUID with the exception that zero UUID
  48531. // is not supported (00000000-0000-0000-0000-000000000000).
  48532. func (c *InstanceTemplatesInsertCall) RequestId(requestId string) *InstanceTemplatesInsertCall {
  48533. c.urlParams_.Set("requestId", requestId)
  48534. return c
  48535. }
  48536. // Fields allows partial responses to be retrieved. See
  48537. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48538. // for more information.
  48539. func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall {
  48540. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48541. return c
  48542. }
  48543. // Context sets the context to be used in this call's Do method. Any
  48544. // pending HTTP request will be aborted if the provided context is
  48545. // canceled.
  48546. func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall {
  48547. c.ctx_ = ctx
  48548. return c
  48549. }
  48550. // Header returns an http.Header that can be modified by the caller to
  48551. // add HTTP headers to the request.
  48552. func (c *InstanceTemplatesInsertCall) Header() http.Header {
  48553. if c.header_ == nil {
  48554. c.header_ = make(http.Header)
  48555. }
  48556. return c.header_
  48557. }
  48558. func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  48559. reqHeaders := make(http.Header)
  48560. for k, v := range c.header_ {
  48561. reqHeaders[k] = v
  48562. }
  48563. reqHeaders.Set("User-Agent", c.s.userAgent())
  48564. var body io.Reader = nil
  48565. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
  48566. if err != nil {
  48567. return nil, err
  48568. }
  48569. reqHeaders.Set("Content-Type", "application/json")
  48570. c.urlParams_.Set("alt", alt)
  48571. c.urlParams_.Set("prettyPrint", "false")
  48572. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  48573. urls += "?" + c.urlParams_.Encode()
  48574. req, err := http.NewRequest("POST", urls, body)
  48575. if err != nil {
  48576. return nil, err
  48577. }
  48578. req.Header = reqHeaders
  48579. googleapi.Expand(req.URL, map[string]string{
  48580. "project": c.project,
  48581. })
  48582. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48583. }
  48584. // Do executes the "compute.instanceTemplates.insert" call.
  48585. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48586. // status code is an error. Response headers are in either
  48587. // *Operation.ServerResponse.Header or (if a response was returned at
  48588. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48589. // to check whether the returned error was because
  48590. // http.StatusNotModified was returned.
  48591. func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48592. gensupport.SetOptions(c.urlParams_, opts...)
  48593. res, err := c.doRequest("json")
  48594. if res != nil && res.StatusCode == http.StatusNotModified {
  48595. if res.Body != nil {
  48596. res.Body.Close()
  48597. }
  48598. return nil, &googleapi.Error{
  48599. Code: res.StatusCode,
  48600. Header: res.Header,
  48601. }
  48602. }
  48603. if err != nil {
  48604. return nil, err
  48605. }
  48606. defer googleapi.CloseBody(res)
  48607. if err := googleapi.CheckResponse(res); err != nil {
  48608. return nil, err
  48609. }
  48610. ret := &Operation{
  48611. ServerResponse: googleapi.ServerResponse{
  48612. Header: res.Header,
  48613. HTTPStatusCode: res.StatusCode,
  48614. },
  48615. }
  48616. target := &ret
  48617. if err := gensupport.DecodeResponse(target, res); err != nil {
  48618. return nil, err
  48619. }
  48620. return ret, nil
  48621. // {
  48622. // "description": "Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.",
  48623. // "httpMethod": "POST",
  48624. // "id": "compute.instanceTemplates.insert",
  48625. // "parameterOrder": [
  48626. // "project"
  48627. // ],
  48628. // "parameters": {
  48629. // "project": {
  48630. // "description": "Project ID for this request.",
  48631. // "location": "path",
  48632. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48633. // "required": true,
  48634. // "type": "string"
  48635. // },
  48636. // "requestId": {
  48637. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48638. // "location": "query",
  48639. // "type": "string"
  48640. // }
  48641. // },
  48642. // "path": "{project}/global/instanceTemplates",
  48643. // "request": {
  48644. // "$ref": "InstanceTemplate"
  48645. // },
  48646. // "response": {
  48647. // "$ref": "Operation"
  48648. // },
  48649. // "scopes": [
  48650. // "https://www.googleapis.com/auth/cloud-platform",
  48651. // "https://www.googleapis.com/auth/compute"
  48652. // ]
  48653. // }
  48654. }
  48655. // method id "compute.instanceTemplates.list":
  48656. type InstanceTemplatesListCall struct {
  48657. s *Service
  48658. project string
  48659. urlParams_ gensupport.URLParams
  48660. ifNoneMatch_ string
  48661. ctx_ context.Context
  48662. header_ http.Header
  48663. }
  48664. // List: Retrieves a list of instance templates that are contained
  48665. // within the specified project.
  48666. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list
  48667. func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall {
  48668. c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48669. c.project = project
  48670. return c
  48671. }
  48672. // Filter sets the optional parameter "filter": A filter expression that
  48673. // filters resources listed in the response. The expression must specify
  48674. // the field name, a comparison operator, and the value that you want to
  48675. // use for filtering. The value must be a string, a number, or a
  48676. // boolean. The comparison operator must be either =, !=, >, or <.
  48677. //
  48678. // For example, if you are filtering Compute Engine instances, you can
  48679. // exclude instances named example-instance by specifying name !=
  48680. // example-instance.
  48681. //
  48682. // You can also filter nested fields. For example, you could specify
  48683. // scheduling.automaticRestart = false to include instances only if they
  48684. // are not scheduled for automatic restarts. You can use filtering on
  48685. // nested fields to filter based on resource labels.
  48686. //
  48687. // To filter on multiple expressions, provide each separate expression
  48688. // within parentheses. For example, (scheduling.automaticRestart = true)
  48689. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48690. // AND expression. However, you can include AND and OR expressions
  48691. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48692. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48693. // true).
  48694. func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall {
  48695. c.urlParams_.Set("filter", filter)
  48696. return c
  48697. }
  48698. // MaxResults sets the optional parameter "maxResults": The maximum
  48699. // number of results per page that should be returned. If the number of
  48700. // available results is larger than maxResults, Compute Engine returns a
  48701. // nextPageToken that can be used to get the next page of results in
  48702. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48703. // (Default: 500)
  48704. func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall {
  48705. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48706. return c
  48707. }
  48708. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48709. // a certain order. By default, results are returned in alphanumerical
  48710. // order based on the resource name.
  48711. //
  48712. // You can also sort results in descending order based on the creation
  48713. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48714. // based on the creationTimestamp field in reverse chronological order
  48715. // (newest result first). Use this to sort resources like operations so
  48716. // that the newest operation is returned first.
  48717. //
  48718. // Currently, only sorting by name or creationTimestamp desc is
  48719. // supported.
  48720. func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall {
  48721. c.urlParams_.Set("orderBy", orderBy)
  48722. return c
  48723. }
  48724. // PageToken sets the optional parameter "pageToken": Specifies a page
  48725. // token to use. Set pageToken to the nextPageToken returned by a
  48726. // previous list request to get the next page of results.
  48727. func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall {
  48728. c.urlParams_.Set("pageToken", pageToken)
  48729. return c
  48730. }
  48731. // Fields allows partial responses to be retrieved. See
  48732. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48733. // for more information.
  48734. func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall {
  48735. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48736. return c
  48737. }
  48738. // IfNoneMatch sets the optional parameter which makes the operation
  48739. // fail if the object's ETag matches the given value. This is useful for
  48740. // getting updates only after the object has changed since the last
  48741. // request. Use googleapi.IsNotModified to check whether the response
  48742. // error from Do is the result of In-None-Match.
  48743. func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall {
  48744. c.ifNoneMatch_ = entityTag
  48745. return c
  48746. }
  48747. // Context sets the context to be used in this call's Do method. Any
  48748. // pending HTTP request will be aborted if the provided context is
  48749. // canceled.
  48750. func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall {
  48751. c.ctx_ = ctx
  48752. return c
  48753. }
  48754. // Header returns an http.Header that can be modified by the caller to
  48755. // add HTTP headers to the request.
  48756. func (c *InstanceTemplatesListCall) Header() http.Header {
  48757. if c.header_ == nil {
  48758. c.header_ = make(http.Header)
  48759. }
  48760. return c.header_
  48761. }
  48762. func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  48763. reqHeaders := make(http.Header)
  48764. for k, v := range c.header_ {
  48765. reqHeaders[k] = v
  48766. }
  48767. reqHeaders.Set("User-Agent", c.s.userAgent())
  48768. if c.ifNoneMatch_ != "" {
  48769. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48770. }
  48771. var body io.Reader = nil
  48772. c.urlParams_.Set("alt", alt)
  48773. c.urlParams_.Set("prettyPrint", "false")
  48774. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  48775. urls += "?" + c.urlParams_.Encode()
  48776. req, err := http.NewRequest("GET", urls, body)
  48777. if err != nil {
  48778. return nil, err
  48779. }
  48780. req.Header = reqHeaders
  48781. googleapi.Expand(req.URL, map[string]string{
  48782. "project": c.project,
  48783. })
  48784. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48785. }
  48786. // Do executes the "compute.instanceTemplates.list" call.
  48787. // Exactly one of *InstanceTemplateList or error will be non-nil. Any
  48788. // non-2xx status code is an error. Response headers are in either
  48789. // *InstanceTemplateList.ServerResponse.Header or (if a response was
  48790. // returned at all) in error.(*googleapi.Error).Header. Use
  48791. // googleapi.IsNotModified to check whether the returned error was
  48792. // because http.StatusNotModified was returned.
  48793. func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) {
  48794. gensupport.SetOptions(c.urlParams_, opts...)
  48795. res, err := c.doRequest("json")
  48796. if res != nil && res.StatusCode == http.StatusNotModified {
  48797. if res.Body != nil {
  48798. res.Body.Close()
  48799. }
  48800. return nil, &googleapi.Error{
  48801. Code: res.StatusCode,
  48802. Header: res.Header,
  48803. }
  48804. }
  48805. if err != nil {
  48806. return nil, err
  48807. }
  48808. defer googleapi.CloseBody(res)
  48809. if err := googleapi.CheckResponse(res); err != nil {
  48810. return nil, err
  48811. }
  48812. ret := &InstanceTemplateList{
  48813. ServerResponse: googleapi.ServerResponse{
  48814. Header: res.Header,
  48815. HTTPStatusCode: res.StatusCode,
  48816. },
  48817. }
  48818. target := &ret
  48819. if err := gensupport.DecodeResponse(target, res); err != nil {
  48820. return nil, err
  48821. }
  48822. return ret, nil
  48823. // {
  48824. // "description": "Retrieves a list of instance templates that are contained within the specified project.",
  48825. // "httpMethod": "GET",
  48826. // "id": "compute.instanceTemplates.list",
  48827. // "parameterOrder": [
  48828. // "project"
  48829. // ],
  48830. // "parameters": {
  48831. // "filter": {
  48832. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  48833. // "location": "query",
  48834. // "type": "string"
  48835. // },
  48836. // "maxResults": {
  48837. // "default": "500",
  48838. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  48839. // "format": "uint32",
  48840. // "location": "query",
  48841. // "minimum": "0",
  48842. // "type": "integer"
  48843. // },
  48844. // "orderBy": {
  48845. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  48846. // "location": "query",
  48847. // "type": "string"
  48848. // },
  48849. // "pageToken": {
  48850. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  48851. // "location": "query",
  48852. // "type": "string"
  48853. // },
  48854. // "project": {
  48855. // "description": "Project ID for this request.",
  48856. // "location": "path",
  48857. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48858. // "required": true,
  48859. // "type": "string"
  48860. // }
  48861. // },
  48862. // "path": "{project}/global/instanceTemplates",
  48863. // "response": {
  48864. // "$ref": "InstanceTemplateList"
  48865. // },
  48866. // "scopes": [
  48867. // "https://www.googleapis.com/auth/cloud-platform",
  48868. // "https://www.googleapis.com/auth/compute",
  48869. // "https://www.googleapis.com/auth/compute.readonly"
  48870. // ]
  48871. // }
  48872. }
  48873. // Pages invokes f for each page of results.
  48874. // A non-nil error returned from f will halt the iteration.
  48875. // The provided context supersedes any context provided to the Context method.
  48876. func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error {
  48877. c.ctx_ = ctx
  48878. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  48879. for {
  48880. x, err := c.Do()
  48881. if err != nil {
  48882. return err
  48883. }
  48884. if err := f(x); err != nil {
  48885. return err
  48886. }
  48887. if x.NextPageToken == "" {
  48888. return nil
  48889. }
  48890. c.PageToken(x.NextPageToken)
  48891. }
  48892. }
  48893. // method id "compute.instanceTemplates.setIamPolicy":
  48894. type InstanceTemplatesSetIamPolicyCall struct {
  48895. s *Service
  48896. project string
  48897. resource string
  48898. globalsetpolicyrequest *GlobalSetPolicyRequest
  48899. urlParams_ gensupport.URLParams
  48900. ctx_ context.Context
  48901. header_ http.Header
  48902. }
  48903. // SetIamPolicy: Sets the access control policy on the specified
  48904. // resource. Replaces any existing policy.
  48905. func (r *InstanceTemplatesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *InstanceTemplatesSetIamPolicyCall {
  48906. c := &InstanceTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48907. c.project = project
  48908. c.resource = resource
  48909. c.globalsetpolicyrequest = globalsetpolicyrequest
  48910. return c
  48911. }
  48912. // Fields allows partial responses to be retrieved. See
  48913. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48914. // for more information.
  48915. func (c *InstanceTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesSetIamPolicyCall {
  48916. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48917. return c
  48918. }
  48919. // Context sets the context to be used in this call's Do method. Any
  48920. // pending HTTP request will be aborted if the provided context is
  48921. // canceled.
  48922. func (c *InstanceTemplatesSetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesSetIamPolicyCall {
  48923. c.ctx_ = ctx
  48924. return c
  48925. }
  48926. // Header returns an http.Header that can be modified by the caller to
  48927. // add HTTP headers to the request.
  48928. func (c *InstanceTemplatesSetIamPolicyCall) Header() http.Header {
  48929. if c.header_ == nil {
  48930. c.header_ = make(http.Header)
  48931. }
  48932. return c.header_
  48933. }
  48934. func (c *InstanceTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  48935. reqHeaders := make(http.Header)
  48936. for k, v := range c.header_ {
  48937. reqHeaders[k] = v
  48938. }
  48939. reqHeaders.Set("User-Agent", c.s.userAgent())
  48940. var body io.Reader = nil
  48941. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  48942. if err != nil {
  48943. return nil, err
  48944. }
  48945. reqHeaders.Set("Content-Type", "application/json")
  48946. c.urlParams_.Set("alt", alt)
  48947. c.urlParams_.Set("prettyPrint", "false")
  48948. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/setIamPolicy")
  48949. urls += "?" + c.urlParams_.Encode()
  48950. req, err := http.NewRequest("POST", urls, body)
  48951. if err != nil {
  48952. return nil, err
  48953. }
  48954. req.Header = reqHeaders
  48955. googleapi.Expand(req.URL, map[string]string{
  48956. "project": c.project,
  48957. "resource": c.resource,
  48958. })
  48959. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48960. }
  48961. // Do executes the "compute.instanceTemplates.setIamPolicy" call.
  48962. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  48963. // code is an error. Response headers are in either
  48964. // *Policy.ServerResponse.Header or (if a response was returned at all)
  48965. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  48966. // check whether the returned error was because http.StatusNotModified
  48967. // was returned.
  48968. func (c *InstanceTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  48969. gensupport.SetOptions(c.urlParams_, opts...)
  48970. res, err := c.doRequest("json")
  48971. if res != nil && res.StatusCode == http.StatusNotModified {
  48972. if res.Body != nil {
  48973. res.Body.Close()
  48974. }
  48975. return nil, &googleapi.Error{
  48976. Code: res.StatusCode,
  48977. Header: res.Header,
  48978. }
  48979. }
  48980. if err != nil {
  48981. return nil, err
  48982. }
  48983. defer googleapi.CloseBody(res)
  48984. if err := googleapi.CheckResponse(res); err != nil {
  48985. return nil, err
  48986. }
  48987. ret := &Policy{
  48988. ServerResponse: googleapi.ServerResponse{
  48989. Header: res.Header,
  48990. HTTPStatusCode: res.StatusCode,
  48991. },
  48992. }
  48993. target := &ret
  48994. if err := gensupport.DecodeResponse(target, res); err != nil {
  48995. return nil, err
  48996. }
  48997. return ret, nil
  48998. // {
  48999. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  49000. // "httpMethod": "POST",
  49001. // "id": "compute.instanceTemplates.setIamPolicy",
  49002. // "parameterOrder": [
  49003. // "project",
  49004. // "resource"
  49005. // ],
  49006. // "parameters": {
  49007. // "project": {
  49008. // "description": "Project ID for this request.",
  49009. // "location": "path",
  49010. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49011. // "required": true,
  49012. // "type": "string"
  49013. // },
  49014. // "resource": {
  49015. // "description": "Name or id of the resource for this request.",
  49016. // "location": "path",
  49017. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49018. // "required": true,
  49019. // "type": "string"
  49020. // }
  49021. // },
  49022. // "path": "{project}/global/instanceTemplates/{resource}/setIamPolicy",
  49023. // "request": {
  49024. // "$ref": "GlobalSetPolicyRequest"
  49025. // },
  49026. // "response": {
  49027. // "$ref": "Policy"
  49028. // },
  49029. // "scopes": [
  49030. // "https://www.googleapis.com/auth/cloud-platform",
  49031. // "https://www.googleapis.com/auth/compute"
  49032. // ]
  49033. // }
  49034. }
  49035. // method id "compute.instanceTemplates.testIamPermissions":
  49036. type InstanceTemplatesTestIamPermissionsCall struct {
  49037. s *Service
  49038. project string
  49039. resource string
  49040. testpermissionsrequest *TestPermissionsRequest
  49041. urlParams_ gensupport.URLParams
  49042. ctx_ context.Context
  49043. header_ http.Header
  49044. }
  49045. // TestIamPermissions: Returns permissions that a caller has on the
  49046. // specified resource.
  49047. func (r *InstanceTemplatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceTemplatesTestIamPermissionsCall {
  49048. c := &InstanceTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49049. c.project = project
  49050. c.resource = resource
  49051. c.testpermissionsrequest = testpermissionsrequest
  49052. return c
  49053. }
  49054. // Fields allows partial responses to be retrieved. See
  49055. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49056. // for more information.
  49057. func (c *InstanceTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceTemplatesTestIamPermissionsCall {
  49058. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49059. return c
  49060. }
  49061. // Context sets the context to be used in this call's Do method. Any
  49062. // pending HTTP request will be aborted if the provided context is
  49063. // canceled.
  49064. func (c *InstanceTemplatesTestIamPermissionsCall) Context(ctx context.Context) *InstanceTemplatesTestIamPermissionsCall {
  49065. c.ctx_ = ctx
  49066. return c
  49067. }
  49068. // Header returns an http.Header that can be modified by the caller to
  49069. // add HTTP headers to the request.
  49070. func (c *InstanceTemplatesTestIamPermissionsCall) Header() http.Header {
  49071. if c.header_ == nil {
  49072. c.header_ = make(http.Header)
  49073. }
  49074. return c.header_
  49075. }
  49076. func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  49077. reqHeaders := make(http.Header)
  49078. for k, v := range c.header_ {
  49079. reqHeaders[k] = v
  49080. }
  49081. reqHeaders.Set("User-Agent", c.s.userAgent())
  49082. var body io.Reader = nil
  49083. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  49084. if err != nil {
  49085. return nil, err
  49086. }
  49087. reqHeaders.Set("Content-Type", "application/json")
  49088. c.urlParams_.Set("alt", alt)
  49089. c.urlParams_.Set("prettyPrint", "false")
  49090. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/testIamPermissions")
  49091. urls += "?" + c.urlParams_.Encode()
  49092. req, err := http.NewRequest("POST", urls, body)
  49093. if err != nil {
  49094. return nil, err
  49095. }
  49096. req.Header = reqHeaders
  49097. googleapi.Expand(req.URL, map[string]string{
  49098. "project": c.project,
  49099. "resource": c.resource,
  49100. })
  49101. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49102. }
  49103. // Do executes the "compute.instanceTemplates.testIamPermissions" call.
  49104. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  49105. // non-2xx status code is an error. Response headers are in either
  49106. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  49107. // returned at all) in error.(*googleapi.Error).Header. Use
  49108. // googleapi.IsNotModified to check whether the returned error was
  49109. // because http.StatusNotModified was returned.
  49110. func (c *InstanceTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  49111. gensupport.SetOptions(c.urlParams_, opts...)
  49112. res, err := c.doRequest("json")
  49113. if res != nil && res.StatusCode == http.StatusNotModified {
  49114. if res.Body != nil {
  49115. res.Body.Close()
  49116. }
  49117. return nil, &googleapi.Error{
  49118. Code: res.StatusCode,
  49119. Header: res.Header,
  49120. }
  49121. }
  49122. if err != nil {
  49123. return nil, err
  49124. }
  49125. defer googleapi.CloseBody(res)
  49126. if err := googleapi.CheckResponse(res); err != nil {
  49127. return nil, err
  49128. }
  49129. ret := &TestPermissionsResponse{
  49130. ServerResponse: googleapi.ServerResponse{
  49131. Header: res.Header,
  49132. HTTPStatusCode: res.StatusCode,
  49133. },
  49134. }
  49135. target := &ret
  49136. if err := gensupport.DecodeResponse(target, res); err != nil {
  49137. return nil, err
  49138. }
  49139. return ret, nil
  49140. // {
  49141. // "description": "Returns permissions that a caller has on the specified resource.",
  49142. // "httpMethod": "POST",
  49143. // "id": "compute.instanceTemplates.testIamPermissions",
  49144. // "parameterOrder": [
  49145. // "project",
  49146. // "resource"
  49147. // ],
  49148. // "parameters": {
  49149. // "project": {
  49150. // "description": "Project ID for this request.",
  49151. // "location": "path",
  49152. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49153. // "required": true,
  49154. // "type": "string"
  49155. // },
  49156. // "resource": {
  49157. // "description": "Name or id of the resource for this request.",
  49158. // "location": "path",
  49159. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49160. // "required": true,
  49161. // "type": "string"
  49162. // }
  49163. // },
  49164. // "path": "{project}/global/instanceTemplates/{resource}/testIamPermissions",
  49165. // "request": {
  49166. // "$ref": "TestPermissionsRequest"
  49167. // },
  49168. // "response": {
  49169. // "$ref": "TestPermissionsResponse"
  49170. // },
  49171. // "scopes": [
  49172. // "https://www.googleapis.com/auth/cloud-platform",
  49173. // "https://www.googleapis.com/auth/compute",
  49174. // "https://www.googleapis.com/auth/compute.readonly"
  49175. // ]
  49176. // }
  49177. }
  49178. // method id "compute.instances.addAccessConfig":
  49179. type InstancesAddAccessConfigCall struct {
  49180. s *Service
  49181. project string
  49182. zone string
  49183. instance string
  49184. accessconfig *AccessConfig
  49185. urlParams_ gensupport.URLParams
  49186. ctx_ context.Context
  49187. header_ http.Header
  49188. }
  49189. // AddAccessConfig: Adds an access config to an instance's network
  49190. // interface.
  49191. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig
  49192. func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall {
  49193. c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49194. c.project = project
  49195. c.zone = zone
  49196. c.instance = instance
  49197. c.urlParams_.Set("networkInterface", networkInterface)
  49198. c.accessconfig = accessconfig
  49199. return c
  49200. }
  49201. // RequestId sets the optional parameter "requestId": An optional
  49202. // request ID to identify requests. Specify a unique request ID so that
  49203. // if you must retry your request, the server will know to ignore the
  49204. // request if it has already been completed.
  49205. //
  49206. // For example, consider a situation where you make an initial request
  49207. // and the request times out. If you make the request again with the
  49208. // same request ID, the server can check if original operation with the
  49209. // same request ID was received, and if so, will ignore the second
  49210. // request. This prevents clients from accidentally creating duplicate
  49211. // commitments.
  49212. //
  49213. // The request ID must be a valid UUID with the exception that zero UUID
  49214. // is not supported (00000000-0000-0000-0000-000000000000).
  49215. func (c *InstancesAddAccessConfigCall) RequestId(requestId string) *InstancesAddAccessConfigCall {
  49216. c.urlParams_.Set("requestId", requestId)
  49217. return c
  49218. }
  49219. // Fields allows partial responses to be retrieved. See
  49220. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49221. // for more information.
  49222. func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall {
  49223. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49224. return c
  49225. }
  49226. // Context sets the context to be used in this call's Do method. Any
  49227. // pending HTTP request will be aborted if the provided context is
  49228. // canceled.
  49229. func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall {
  49230. c.ctx_ = ctx
  49231. return c
  49232. }
  49233. // Header returns an http.Header that can be modified by the caller to
  49234. // add HTTP headers to the request.
  49235. func (c *InstancesAddAccessConfigCall) Header() http.Header {
  49236. if c.header_ == nil {
  49237. c.header_ = make(http.Header)
  49238. }
  49239. return c.header_
  49240. }
  49241. func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  49242. reqHeaders := make(http.Header)
  49243. for k, v := range c.header_ {
  49244. reqHeaders[k] = v
  49245. }
  49246. reqHeaders.Set("User-Agent", c.s.userAgent())
  49247. var body io.Reader = nil
  49248. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  49249. if err != nil {
  49250. return nil, err
  49251. }
  49252. reqHeaders.Set("Content-Type", "application/json")
  49253. c.urlParams_.Set("alt", alt)
  49254. c.urlParams_.Set("prettyPrint", "false")
  49255. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig")
  49256. urls += "?" + c.urlParams_.Encode()
  49257. req, err := http.NewRequest("POST", urls, body)
  49258. if err != nil {
  49259. return nil, err
  49260. }
  49261. req.Header = reqHeaders
  49262. googleapi.Expand(req.URL, map[string]string{
  49263. "project": c.project,
  49264. "zone": c.zone,
  49265. "instance": c.instance,
  49266. })
  49267. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49268. }
  49269. // Do executes the "compute.instances.addAccessConfig" call.
  49270. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49271. // status code is an error. Response headers are in either
  49272. // *Operation.ServerResponse.Header or (if a response was returned at
  49273. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49274. // to check whether the returned error was because
  49275. // http.StatusNotModified was returned.
  49276. func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49277. gensupport.SetOptions(c.urlParams_, opts...)
  49278. res, err := c.doRequest("json")
  49279. if res != nil && res.StatusCode == http.StatusNotModified {
  49280. if res.Body != nil {
  49281. res.Body.Close()
  49282. }
  49283. return nil, &googleapi.Error{
  49284. Code: res.StatusCode,
  49285. Header: res.Header,
  49286. }
  49287. }
  49288. if err != nil {
  49289. return nil, err
  49290. }
  49291. defer googleapi.CloseBody(res)
  49292. if err := googleapi.CheckResponse(res); err != nil {
  49293. return nil, err
  49294. }
  49295. ret := &Operation{
  49296. ServerResponse: googleapi.ServerResponse{
  49297. Header: res.Header,
  49298. HTTPStatusCode: res.StatusCode,
  49299. },
  49300. }
  49301. target := &ret
  49302. if err := gensupport.DecodeResponse(target, res); err != nil {
  49303. return nil, err
  49304. }
  49305. return ret, nil
  49306. // {
  49307. // "description": "Adds an access config to an instance's network interface.",
  49308. // "httpMethod": "POST",
  49309. // "id": "compute.instances.addAccessConfig",
  49310. // "parameterOrder": [
  49311. // "project",
  49312. // "zone",
  49313. // "instance",
  49314. // "networkInterface"
  49315. // ],
  49316. // "parameters": {
  49317. // "instance": {
  49318. // "description": "The instance name for this request.",
  49319. // "location": "path",
  49320. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49321. // "required": true,
  49322. // "type": "string"
  49323. // },
  49324. // "networkInterface": {
  49325. // "description": "The name of the network interface to add to this instance.",
  49326. // "location": "query",
  49327. // "required": true,
  49328. // "type": "string"
  49329. // },
  49330. // "project": {
  49331. // "description": "Project ID for this request.",
  49332. // "location": "path",
  49333. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49334. // "required": true,
  49335. // "type": "string"
  49336. // },
  49337. // "requestId": {
  49338. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49339. // "location": "query",
  49340. // "type": "string"
  49341. // },
  49342. // "zone": {
  49343. // "description": "The name of the zone for this request.",
  49344. // "location": "path",
  49345. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49346. // "required": true,
  49347. // "type": "string"
  49348. // }
  49349. // },
  49350. // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig",
  49351. // "request": {
  49352. // "$ref": "AccessConfig"
  49353. // },
  49354. // "response": {
  49355. // "$ref": "Operation"
  49356. // },
  49357. // "scopes": [
  49358. // "https://www.googleapis.com/auth/cloud-platform",
  49359. // "https://www.googleapis.com/auth/compute"
  49360. // ]
  49361. // }
  49362. }
  49363. // method id "compute.instances.aggregatedList":
  49364. type InstancesAggregatedListCall struct {
  49365. s *Service
  49366. project string
  49367. urlParams_ gensupport.URLParams
  49368. ifNoneMatch_ string
  49369. ctx_ context.Context
  49370. header_ http.Header
  49371. }
  49372. // AggregatedList: Retrieves aggregated list of all of the instances in
  49373. // your project across all regions and zones.
  49374. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList
  49375. func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {
  49376. c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49377. c.project = project
  49378. return c
  49379. }
  49380. // Filter sets the optional parameter "filter": A filter expression that
  49381. // filters resources listed in the response. The expression must specify
  49382. // the field name, a comparison operator, and the value that you want to
  49383. // use for filtering. The value must be a string, a number, or a
  49384. // boolean. The comparison operator must be either =, !=, >, or <.
  49385. //
  49386. // For example, if you are filtering Compute Engine instances, you can
  49387. // exclude instances named example-instance by specifying name !=
  49388. // example-instance.
  49389. //
  49390. // You can also filter nested fields. For example, you could specify
  49391. // scheduling.automaticRestart = false to include instances only if they
  49392. // are not scheduled for automatic restarts. You can use filtering on
  49393. // nested fields to filter based on resource labels.
  49394. //
  49395. // To filter on multiple expressions, provide each separate expression
  49396. // within parentheses. For example, (scheduling.automaticRestart = true)
  49397. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  49398. // AND expression. However, you can include AND and OR expressions
  49399. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  49400. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  49401. // true).
  49402. func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall {
  49403. c.urlParams_.Set("filter", filter)
  49404. return c
  49405. }
  49406. // MaxResults sets the optional parameter "maxResults": The maximum
  49407. // number of results per page that should be returned. If the number of
  49408. // available results is larger than maxResults, Compute Engine returns a
  49409. // nextPageToken that can be used to get the next page of results in
  49410. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  49411. // (Default: 500)
  49412. func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall {
  49413. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  49414. return c
  49415. }
  49416. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  49417. // a certain order. By default, results are returned in alphanumerical
  49418. // order based on the resource name.
  49419. //
  49420. // You can also sort results in descending order based on the creation
  49421. // timestamp using orderBy="creationTimestamp desc". This sorts results
  49422. // based on the creationTimestamp field in reverse chronological order
  49423. // (newest result first). Use this to sort resources like operations so
  49424. // that the newest operation is returned first.
  49425. //
  49426. // Currently, only sorting by name or creationTimestamp desc is
  49427. // supported.
  49428. func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall {
  49429. c.urlParams_.Set("orderBy", orderBy)
  49430. return c
  49431. }
  49432. // PageToken sets the optional parameter "pageToken": Specifies a page
  49433. // token to use. Set pageToken to the nextPageToken returned by a
  49434. // previous list request to get the next page of results.
  49435. func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall {
  49436. c.urlParams_.Set("pageToken", pageToken)
  49437. return c
  49438. }
  49439. // Fields allows partial responses to be retrieved. See
  49440. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49441. // for more information.
  49442. func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall {
  49443. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49444. return c
  49445. }
  49446. // IfNoneMatch sets the optional parameter which makes the operation
  49447. // fail if the object's ETag matches the given value. This is useful for
  49448. // getting updates only after the object has changed since the last
  49449. // request. Use googleapi.IsNotModified to check whether the response
  49450. // error from Do is the result of In-None-Match.
  49451. func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall {
  49452. c.ifNoneMatch_ = entityTag
  49453. return c
  49454. }
  49455. // Context sets the context to be used in this call's Do method. Any
  49456. // pending HTTP request will be aborted if the provided context is
  49457. // canceled.
  49458. func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall {
  49459. c.ctx_ = ctx
  49460. return c
  49461. }
  49462. // Header returns an http.Header that can be modified by the caller to
  49463. // add HTTP headers to the request.
  49464. func (c *InstancesAggregatedListCall) Header() http.Header {
  49465. if c.header_ == nil {
  49466. c.header_ = make(http.Header)
  49467. }
  49468. return c.header_
  49469. }
  49470. func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  49471. reqHeaders := make(http.Header)
  49472. for k, v := range c.header_ {
  49473. reqHeaders[k] = v
  49474. }
  49475. reqHeaders.Set("User-Agent", c.s.userAgent())
  49476. if c.ifNoneMatch_ != "" {
  49477. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49478. }
  49479. var body io.Reader = nil
  49480. c.urlParams_.Set("alt", alt)
  49481. c.urlParams_.Set("prettyPrint", "false")
  49482. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances")
  49483. urls += "?" + c.urlParams_.Encode()
  49484. req, err := http.NewRequest("GET", urls, body)
  49485. if err != nil {
  49486. return nil, err
  49487. }
  49488. req.Header = reqHeaders
  49489. googleapi.Expand(req.URL, map[string]string{
  49490. "project": c.project,
  49491. })
  49492. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49493. }
  49494. // Do executes the "compute.instances.aggregatedList" call.
  49495. // Exactly one of *InstanceAggregatedList or error will be non-nil. Any
  49496. // non-2xx status code is an error. Response headers are in either
  49497. // *InstanceAggregatedList.ServerResponse.Header or (if a response was
  49498. // returned at all) in error.(*googleapi.Error).Header. Use
  49499. // googleapi.IsNotModified to check whether the returned error was
  49500. // because http.StatusNotModified was returned.
  49501. func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) {
  49502. gensupport.SetOptions(c.urlParams_, opts...)
  49503. res, err := c.doRequest("json")
  49504. if res != nil && res.StatusCode == http.StatusNotModified {
  49505. if res.Body != nil {
  49506. res.Body.Close()
  49507. }
  49508. return nil, &googleapi.Error{
  49509. Code: res.StatusCode,
  49510. Header: res.Header,
  49511. }
  49512. }
  49513. if err != nil {
  49514. return nil, err
  49515. }
  49516. defer googleapi.CloseBody(res)
  49517. if err := googleapi.CheckResponse(res); err != nil {
  49518. return nil, err
  49519. }
  49520. ret := &InstanceAggregatedList{
  49521. ServerResponse: googleapi.ServerResponse{
  49522. Header: res.Header,
  49523. HTTPStatusCode: res.StatusCode,
  49524. },
  49525. }
  49526. target := &ret
  49527. if err := gensupport.DecodeResponse(target, res); err != nil {
  49528. return nil, err
  49529. }
  49530. return ret, nil
  49531. // {
  49532. // "description": "Retrieves aggregated list of all of the instances in your project across all regions and zones.",
  49533. // "httpMethod": "GET",
  49534. // "id": "compute.instances.aggregatedList",
  49535. // "parameterOrder": [
  49536. // "project"
  49537. // ],
  49538. // "parameters": {
  49539. // "filter": {
  49540. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  49541. // "location": "query",
  49542. // "type": "string"
  49543. // },
  49544. // "maxResults": {
  49545. // "default": "500",
  49546. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  49547. // "format": "uint32",
  49548. // "location": "query",
  49549. // "minimum": "0",
  49550. // "type": "integer"
  49551. // },
  49552. // "orderBy": {
  49553. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  49554. // "location": "query",
  49555. // "type": "string"
  49556. // },
  49557. // "pageToken": {
  49558. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  49559. // "location": "query",
  49560. // "type": "string"
  49561. // },
  49562. // "project": {
  49563. // "description": "Project ID for this request.",
  49564. // "location": "path",
  49565. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49566. // "required": true,
  49567. // "type": "string"
  49568. // }
  49569. // },
  49570. // "path": "{project}/aggregated/instances",
  49571. // "response": {
  49572. // "$ref": "InstanceAggregatedList"
  49573. // },
  49574. // "scopes": [
  49575. // "https://www.googleapis.com/auth/cloud-platform",
  49576. // "https://www.googleapis.com/auth/compute",
  49577. // "https://www.googleapis.com/auth/compute.readonly"
  49578. // ]
  49579. // }
  49580. }
  49581. // Pages invokes f for each page of results.
  49582. // A non-nil error returned from f will halt the iteration.
  49583. // The provided context supersedes any context provided to the Context method.
  49584. func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error {
  49585. c.ctx_ = ctx
  49586. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  49587. for {
  49588. x, err := c.Do()
  49589. if err != nil {
  49590. return err
  49591. }
  49592. if err := f(x); err != nil {
  49593. return err
  49594. }
  49595. if x.NextPageToken == "" {
  49596. return nil
  49597. }
  49598. c.PageToken(x.NextPageToken)
  49599. }
  49600. }
  49601. // method id "compute.instances.attachDisk":
  49602. type InstancesAttachDiskCall struct {
  49603. s *Service
  49604. project string
  49605. zone string
  49606. instance string
  49607. attacheddisk *AttachedDisk
  49608. urlParams_ gensupport.URLParams
  49609. ctx_ context.Context
  49610. header_ http.Header
  49611. }
  49612. // AttachDisk: Attaches an existing Disk resource to an instance. You
  49613. // must first create the disk before you can attach it. It is not
  49614. // possible to create and attach a disk at the same time. For more
  49615. // information, read Adding a persistent disk to your instance.
  49616. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk
  49617. func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall {
  49618. c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49619. c.project = project
  49620. c.zone = zone
  49621. c.instance = instance
  49622. c.attacheddisk = attacheddisk
  49623. return c
  49624. }
  49625. // ForceAttach sets the optional parameter "forceAttach": Whether to
  49626. // force attach the disk even if it's currently attached to another
  49627. // instance.
  49628. func (c *InstancesAttachDiskCall) ForceAttach(forceAttach bool) *InstancesAttachDiskCall {
  49629. c.urlParams_.Set("forceAttach", fmt.Sprint(forceAttach))
  49630. return c
  49631. }
  49632. // RequestId sets the optional parameter "requestId": An optional
  49633. // request ID to identify requests. Specify a unique request ID so that
  49634. // if you must retry your request, the server will know to ignore the
  49635. // request if it has already been completed.
  49636. //
  49637. // For example, consider a situation where you make an initial request
  49638. // and the request times out. If you make the request again with the
  49639. // same request ID, the server can check if original operation with the
  49640. // same request ID was received, and if so, will ignore the second
  49641. // request. This prevents clients from accidentally creating duplicate
  49642. // commitments.
  49643. //
  49644. // The request ID must be a valid UUID with the exception that zero UUID
  49645. // is not supported (00000000-0000-0000-0000-000000000000).
  49646. func (c *InstancesAttachDiskCall) RequestId(requestId string) *InstancesAttachDiskCall {
  49647. c.urlParams_.Set("requestId", requestId)
  49648. return c
  49649. }
  49650. // Fields allows partial responses to be retrieved. See
  49651. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49652. // for more information.
  49653. func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall {
  49654. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49655. return c
  49656. }
  49657. // Context sets the context to be used in this call's Do method. Any
  49658. // pending HTTP request will be aborted if the provided context is
  49659. // canceled.
  49660. func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall {
  49661. c.ctx_ = ctx
  49662. return c
  49663. }
  49664. // Header returns an http.Header that can be modified by the caller to
  49665. // add HTTP headers to the request.
  49666. func (c *InstancesAttachDiskCall) Header() http.Header {
  49667. if c.header_ == nil {
  49668. c.header_ = make(http.Header)
  49669. }
  49670. return c.header_
  49671. }
  49672. func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) {
  49673. reqHeaders := make(http.Header)
  49674. for k, v := range c.header_ {
  49675. reqHeaders[k] = v
  49676. }
  49677. reqHeaders.Set("User-Agent", c.s.userAgent())
  49678. var body io.Reader = nil
  49679. body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk)
  49680. if err != nil {
  49681. return nil, err
  49682. }
  49683. reqHeaders.Set("Content-Type", "application/json")
  49684. c.urlParams_.Set("alt", alt)
  49685. c.urlParams_.Set("prettyPrint", "false")
  49686. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk")
  49687. urls += "?" + c.urlParams_.Encode()
  49688. req, err := http.NewRequest("POST", urls, body)
  49689. if err != nil {
  49690. return nil, err
  49691. }
  49692. req.Header = reqHeaders
  49693. googleapi.Expand(req.URL, map[string]string{
  49694. "project": c.project,
  49695. "zone": c.zone,
  49696. "instance": c.instance,
  49697. })
  49698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49699. }
  49700. // Do executes the "compute.instances.attachDisk" call.
  49701. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49702. // status code is an error. Response headers are in either
  49703. // *Operation.ServerResponse.Header or (if a response was returned at
  49704. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49705. // to check whether the returned error was because
  49706. // http.StatusNotModified was returned.
  49707. func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49708. gensupport.SetOptions(c.urlParams_, opts...)
  49709. res, err := c.doRequest("json")
  49710. if res != nil && res.StatusCode == http.StatusNotModified {
  49711. if res.Body != nil {
  49712. res.Body.Close()
  49713. }
  49714. return nil, &googleapi.Error{
  49715. Code: res.StatusCode,
  49716. Header: res.Header,
  49717. }
  49718. }
  49719. if err != nil {
  49720. return nil, err
  49721. }
  49722. defer googleapi.CloseBody(res)
  49723. if err := googleapi.CheckResponse(res); err != nil {
  49724. return nil, err
  49725. }
  49726. ret := &Operation{
  49727. ServerResponse: googleapi.ServerResponse{
  49728. Header: res.Header,
  49729. HTTPStatusCode: res.StatusCode,
  49730. },
  49731. }
  49732. target := &ret
  49733. if err := gensupport.DecodeResponse(target, res); err != nil {
  49734. return nil, err
  49735. }
  49736. return ret, nil
  49737. // {
  49738. // "description": "Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance.",
  49739. // "httpMethod": "POST",
  49740. // "id": "compute.instances.attachDisk",
  49741. // "parameterOrder": [
  49742. // "project",
  49743. // "zone",
  49744. // "instance"
  49745. // ],
  49746. // "parameters": {
  49747. // "forceAttach": {
  49748. // "description": "Whether to force attach the disk even if it's currently attached to another instance.",
  49749. // "location": "query",
  49750. // "type": "boolean"
  49751. // },
  49752. // "instance": {
  49753. // "description": "The instance name for this request.",
  49754. // "location": "path",
  49755. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49756. // "required": true,
  49757. // "type": "string"
  49758. // },
  49759. // "project": {
  49760. // "description": "Project ID for this request.",
  49761. // "location": "path",
  49762. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49763. // "required": true,
  49764. // "type": "string"
  49765. // },
  49766. // "requestId": {
  49767. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49768. // "location": "query",
  49769. // "type": "string"
  49770. // },
  49771. // "zone": {
  49772. // "description": "The name of the zone for this request.",
  49773. // "location": "path",
  49774. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49775. // "required": true,
  49776. // "type": "string"
  49777. // }
  49778. // },
  49779. // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk",
  49780. // "request": {
  49781. // "$ref": "AttachedDisk"
  49782. // },
  49783. // "response": {
  49784. // "$ref": "Operation"
  49785. // },
  49786. // "scopes": [
  49787. // "https://www.googleapis.com/auth/cloud-platform",
  49788. // "https://www.googleapis.com/auth/compute"
  49789. // ]
  49790. // }
  49791. }
  49792. // method id "compute.instances.delete":
  49793. type InstancesDeleteCall struct {
  49794. s *Service
  49795. project string
  49796. zone string
  49797. instance string
  49798. urlParams_ gensupport.URLParams
  49799. ctx_ context.Context
  49800. header_ http.Header
  49801. }
  49802. // Delete: Deletes the specified Instance resource. For more
  49803. // information, see Stopping or Deleting an Instance.
  49804. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete
  49805. func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall {
  49806. c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49807. c.project = project
  49808. c.zone = zone
  49809. c.instance = instance
  49810. return c
  49811. }
  49812. // RequestId sets the optional parameter "requestId": An optional
  49813. // request ID to identify requests. Specify a unique request ID so that
  49814. // if you must retry your request, the server will know to ignore the
  49815. // request if it has already been completed.
  49816. //
  49817. // For example, consider a situation where you make an initial request
  49818. // and the request times out. If you make the request again with the
  49819. // same request ID, the server can check if original operation with the
  49820. // same request ID was received, and if so, will ignore the second
  49821. // request. This prevents clients from accidentally creating duplicate
  49822. // commitments.
  49823. //
  49824. // The request ID must be a valid UUID with the exception that zero UUID
  49825. // is not supported (00000000-0000-0000-0000-000000000000).
  49826. func (c *InstancesDeleteCall) RequestId(requestId string) *InstancesDeleteCall {
  49827. c.urlParams_.Set("requestId", requestId)
  49828. return c
  49829. }
  49830. // Fields allows partial responses to be retrieved. See
  49831. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49832. // for more information.
  49833. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
  49834. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49835. return c
  49836. }
  49837. // Context sets the context to be used in this call's Do method. Any
  49838. // pending HTTP request will be aborted if the provided context is
  49839. // canceled.
  49840. func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
  49841. c.ctx_ = ctx
  49842. return c
  49843. }
  49844. // Header returns an http.Header that can be modified by the caller to
  49845. // add HTTP headers to the request.
  49846. func (c *InstancesDeleteCall) Header() http.Header {
  49847. if c.header_ == nil {
  49848. c.header_ = make(http.Header)
  49849. }
  49850. return c.header_
  49851. }
  49852. func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  49853. reqHeaders := make(http.Header)
  49854. for k, v := range c.header_ {
  49855. reqHeaders[k] = v
  49856. }
  49857. reqHeaders.Set("User-Agent", c.s.userAgent())
  49858. var body io.Reader = nil
  49859. c.urlParams_.Set("alt", alt)
  49860. c.urlParams_.Set("prettyPrint", "false")
  49861. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  49862. urls += "?" + c.urlParams_.Encode()
  49863. req, err := http.NewRequest("DELETE", urls, body)
  49864. if err != nil {
  49865. return nil, err
  49866. }
  49867. req.Header = reqHeaders
  49868. googleapi.Expand(req.URL, map[string]string{
  49869. "project": c.project,
  49870. "zone": c.zone,
  49871. "instance": c.instance,
  49872. })
  49873. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49874. }
  49875. // Do executes the "compute.instances.delete" call.
  49876. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49877. // status code is an error. Response headers are in either
  49878. // *Operation.ServerResponse.Header or (if a response was returned at
  49879. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49880. // to check whether the returned error was because
  49881. // http.StatusNotModified was returned.
  49882. func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49883. gensupport.SetOptions(c.urlParams_, opts...)
  49884. res, err := c.doRequest("json")
  49885. if res != nil && res.StatusCode == http.StatusNotModified {
  49886. if res.Body != nil {
  49887. res.Body.Close()
  49888. }
  49889. return nil, &googleapi.Error{
  49890. Code: res.StatusCode,
  49891. Header: res.Header,
  49892. }
  49893. }
  49894. if err != nil {
  49895. return nil, err
  49896. }
  49897. defer googleapi.CloseBody(res)
  49898. if err := googleapi.CheckResponse(res); err != nil {
  49899. return nil, err
  49900. }
  49901. ret := &Operation{
  49902. ServerResponse: googleapi.ServerResponse{
  49903. Header: res.Header,
  49904. HTTPStatusCode: res.StatusCode,
  49905. },
  49906. }
  49907. target := &ret
  49908. if err := gensupport.DecodeResponse(target, res); err != nil {
  49909. return nil, err
  49910. }
  49911. return ret, nil
  49912. // {
  49913. // "description": "Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.",
  49914. // "httpMethod": "DELETE",
  49915. // "id": "compute.instances.delete",
  49916. // "parameterOrder": [
  49917. // "project",
  49918. // "zone",
  49919. // "instance"
  49920. // ],
  49921. // "parameters": {
  49922. // "instance": {
  49923. // "description": "Name of the instance resource to delete.",
  49924. // "location": "path",
  49925. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49926. // "required": true,
  49927. // "type": "string"
  49928. // },
  49929. // "project": {
  49930. // "description": "Project ID for this request.",
  49931. // "location": "path",
  49932. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49933. // "required": true,
  49934. // "type": "string"
  49935. // },
  49936. // "requestId": {
  49937. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49938. // "location": "query",
  49939. // "type": "string"
  49940. // },
  49941. // "zone": {
  49942. // "description": "The name of the zone for this request.",
  49943. // "location": "path",
  49944. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49945. // "required": true,
  49946. // "type": "string"
  49947. // }
  49948. // },
  49949. // "path": "{project}/zones/{zone}/instances/{instance}",
  49950. // "response": {
  49951. // "$ref": "Operation"
  49952. // },
  49953. // "scopes": [
  49954. // "https://www.googleapis.com/auth/cloud-platform",
  49955. // "https://www.googleapis.com/auth/compute"
  49956. // ]
  49957. // }
  49958. }
  49959. // method id "compute.instances.deleteAccessConfig":
  49960. type InstancesDeleteAccessConfigCall struct {
  49961. s *Service
  49962. project string
  49963. zone string
  49964. instance string
  49965. urlParams_ gensupport.URLParams
  49966. ctx_ context.Context
  49967. header_ http.Header
  49968. }
  49969. // DeleteAccessConfig: Deletes an access config from an instance's
  49970. // network interface.
  49971. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig
  49972. func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall {
  49973. c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49974. c.project = project
  49975. c.zone = zone
  49976. c.instance = instance
  49977. c.urlParams_.Set("accessConfig", accessConfig)
  49978. c.urlParams_.Set("networkInterface", networkInterface)
  49979. return c
  49980. }
  49981. // RequestId sets the optional parameter "requestId": An optional
  49982. // request ID to identify requests. Specify a unique request ID so that
  49983. // if you must retry your request, the server will know to ignore the
  49984. // request if it has already been completed.
  49985. //
  49986. // For example, consider a situation where you make an initial request
  49987. // and the request times out. If you make the request again with the
  49988. // same request ID, the server can check if original operation with the
  49989. // same request ID was received, and if so, will ignore the second
  49990. // request. This prevents clients from accidentally creating duplicate
  49991. // commitments.
  49992. //
  49993. // The request ID must be a valid UUID with the exception that zero UUID
  49994. // is not supported (00000000-0000-0000-0000-000000000000).
  49995. func (c *InstancesDeleteAccessConfigCall) RequestId(requestId string) *InstancesDeleteAccessConfigCall {
  49996. c.urlParams_.Set("requestId", requestId)
  49997. return c
  49998. }
  49999. // Fields allows partial responses to be retrieved. See
  50000. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50001. // for more information.
  50002. func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall {
  50003. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50004. return c
  50005. }
  50006. // Context sets the context to be used in this call's Do method. Any
  50007. // pending HTTP request will be aborted if the provided context is
  50008. // canceled.
  50009. func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall {
  50010. c.ctx_ = ctx
  50011. return c
  50012. }
  50013. // Header returns an http.Header that can be modified by the caller to
  50014. // add HTTP headers to the request.
  50015. func (c *InstancesDeleteAccessConfigCall) Header() http.Header {
  50016. if c.header_ == nil {
  50017. c.header_ = make(http.Header)
  50018. }
  50019. return c.header_
  50020. }
  50021. func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  50022. reqHeaders := make(http.Header)
  50023. for k, v := range c.header_ {
  50024. reqHeaders[k] = v
  50025. }
  50026. reqHeaders.Set("User-Agent", c.s.userAgent())
  50027. var body io.Reader = nil
  50028. c.urlParams_.Set("alt", alt)
  50029. c.urlParams_.Set("prettyPrint", "false")
  50030. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")
  50031. urls += "?" + c.urlParams_.Encode()
  50032. req, err := http.NewRequest("POST", urls, body)
  50033. if err != nil {
  50034. return nil, err
  50035. }
  50036. req.Header = reqHeaders
  50037. googleapi.Expand(req.URL, map[string]string{
  50038. "project": c.project,
  50039. "zone": c.zone,
  50040. "instance": c.instance,
  50041. })
  50042. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50043. }
  50044. // Do executes the "compute.instances.deleteAccessConfig" call.
  50045. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50046. // status code is an error. Response headers are in either
  50047. // *Operation.ServerResponse.Header or (if a response was returned at
  50048. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50049. // to check whether the returned error was because
  50050. // http.StatusNotModified was returned.
  50051. func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50052. gensupport.SetOptions(c.urlParams_, opts...)
  50053. res, err := c.doRequest("json")
  50054. if res != nil && res.StatusCode == http.StatusNotModified {
  50055. if res.Body != nil {
  50056. res.Body.Close()
  50057. }
  50058. return nil, &googleapi.Error{
  50059. Code: res.StatusCode,
  50060. Header: res.Header,
  50061. }
  50062. }
  50063. if err != nil {
  50064. return nil, err
  50065. }
  50066. defer googleapi.CloseBody(res)
  50067. if err := googleapi.CheckResponse(res); err != nil {
  50068. return nil, err
  50069. }
  50070. ret := &Operation{
  50071. ServerResponse: googleapi.ServerResponse{
  50072. Header: res.Header,
  50073. HTTPStatusCode: res.StatusCode,
  50074. },
  50075. }
  50076. target := &ret
  50077. if err := gensupport.DecodeResponse(target, res); err != nil {
  50078. return nil, err
  50079. }
  50080. return ret, nil
  50081. // {
  50082. // "description": "Deletes an access config from an instance's network interface.",
  50083. // "httpMethod": "POST",
  50084. // "id": "compute.instances.deleteAccessConfig",
  50085. // "parameterOrder": [
  50086. // "project",
  50087. // "zone",
  50088. // "instance",
  50089. // "accessConfig",
  50090. // "networkInterface"
  50091. // ],
  50092. // "parameters": {
  50093. // "accessConfig": {
  50094. // "description": "The name of the access config to delete.",
  50095. // "location": "query",
  50096. // "required": true,
  50097. // "type": "string"
  50098. // },
  50099. // "instance": {
  50100. // "description": "The instance name for this request.",
  50101. // "location": "path",
  50102. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50103. // "required": true,
  50104. // "type": "string"
  50105. // },
  50106. // "networkInterface": {
  50107. // "description": "The name of the network interface.",
  50108. // "location": "query",
  50109. // "required": true,
  50110. // "type": "string"
  50111. // },
  50112. // "project": {
  50113. // "description": "Project ID for this request.",
  50114. // "location": "path",
  50115. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50116. // "required": true,
  50117. // "type": "string"
  50118. // },
  50119. // "requestId": {
  50120. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50121. // "location": "query",
  50122. // "type": "string"
  50123. // },
  50124. // "zone": {
  50125. // "description": "The name of the zone for this request.",
  50126. // "location": "path",
  50127. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50128. // "required": true,
  50129. // "type": "string"
  50130. // }
  50131. // },
  50132. // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
  50133. // "response": {
  50134. // "$ref": "Operation"
  50135. // },
  50136. // "scopes": [
  50137. // "https://www.googleapis.com/auth/cloud-platform",
  50138. // "https://www.googleapis.com/auth/compute"
  50139. // ]
  50140. // }
  50141. }
  50142. // method id "compute.instances.detachDisk":
  50143. type InstancesDetachDiskCall struct {
  50144. s *Service
  50145. project string
  50146. zone string
  50147. instance string
  50148. urlParams_ gensupport.URLParams
  50149. ctx_ context.Context
  50150. header_ http.Header
  50151. }
  50152. // DetachDisk: Detaches a disk from an instance.
  50153. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk
  50154. func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall {
  50155. c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50156. c.project = project
  50157. c.zone = zone
  50158. c.instance = instance
  50159. c.urlParams_.Set("deviceName", deviceName)
  50160. return c
  50161. }
  50162. // RequestId sets the optional parameter "requestId": An optional
  50163. // request ID to identify requests. Specify a unique request ID so that
  50164. // if you must retry your request, the server will know to ignore the
  50165. // request if it has already been completed.
  50166. //
  50167. // For example, consider a situation where you make an initial request
  50168. // and the request times out. If you make the request again with the
  50169. // same request ID, the server can check if original operation with the
  50170. // same request ID was received, and if so, will ignore the second
  50171. // request. This prevents clients from accidentally creating duplicate
  50172. // commitments.
  50173. //
  50174. // The request ID must be a valid UUID with the exception that zero UUID
  50175. // is not supported (00000000-0000-0000-0000-000000000000).
  50176. func (c *InstancesDetachDiskCall) RequestId(requestId string) *InstancesDetachDiskCall {
  50177. c.urlParams_.Set("requestId", requestId)
  50178. return c
  50179. }
  50180. // Fields allows partial responses to be retrieved. See
  50181. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50182. // for more information.
  50183. func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall {
  50184. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50185. return c
  50186. }
  50187. // Context sets the context to be used in this call's Do method. Any
  50188. // pending HTTP request will be aborted if the provided context is
  50189. // canceled.
  50190. func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall {
  50191. c.ctx_ = ctx
  50192. return c
  50193. }
  50194. // Header returns an http.Header that can be modified by the caller to
  50195. // add HTTP headers to the request.
  50196. func (c *InstancesDetachDiskCall) Header() http.Header {
  50197. if c.header_ == nil {
  50198. c.header_ = make(http.Header)
  50199. }
  50200. return c.header_
  50201. }
  50202. func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) {
  50203. reqHeaders := make(http.Header)
  50204. for k, v := range c.header_ {
  50205. reqHeaders[k] = v
  50206. }
  50207. reqHeaders.Set("User-Agent", c.s.userAgent())
  50208. var body io.Reader = nil
  50209. c.urlParams_.Set("alt", alt)
  50210. c.urlParams_.Set("prettyPrint", "false")
  50211. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk")
  50212. urls += "?" + c.urlParams_.Encode()
  50213. req, err := http.NewRequest("POST", urls, body)
  50214. if err != nil {
  50215. return nil, err
  50216. }
  50217. req.Header = reqHeaders
  50218. googleapi.Expand(req.URL, map[string]string{
  50219. "project": c.project,
  50220. "zone": c.zone,
  50221. "instance": c.instance,
  50222. })
  50223. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50224. }
  50225. // Do executes the "compute.instances.detachDisk" call.
  50226. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50227. // status code is an error. Response headers are in either
  50228. // *Operation.ServerResponse.Header or (if a response was returned at
  50229. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50230. // to check whether the returned error was because
  50231. // http.StatusNotModified was returned.
  50232. func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50233. gensupport.SetOptions(c.urlParams_, opts...)
  50234. res, err := c.doRequest("json")
  50235. if res != nil && res.StatusCode == http.StatusNotModified {
  50236. if res.Body != nil {
  50237. res.Body.Close()
  50238. }
  50239. return nil, &googleapi.Error{
  50240. Code: res.StatusCode,
  50241. Header: res.Header,
  50242. }
  50243. }
  50244. if err != nil {
  50245. return nil, err
  50246. }
  50247. defer googleapi.CloseBody(res)
  50248. if err := googleapi.CheckResponse(res); err != nil {
  50249. return nil, err
  50250. }
  50251. ret := &Operation{
  50252. ServerResponse: googleapi.ServerResponse{
  50253. Header: res.Header,
  50254. HTTPStatusCode: res.StatusCode,
  50255. },
  50256. }
  50257. target := &ret
  50258. if err := gensupport.DecodeResponse(target, res); err != nil {
  50259. return nil, err
  50260. }
  50261. return ret, nil
  50262. // {
  50263. // "description": "Detaches a disk from an instance.",
  50264. // "httpMethod": "POST",
  50265. // "id": "compute.instances.detachDisk",
  50266. // "parameterOrder": [
  50267. // "project",
  50268. // "zone",
  50269. // "instance",
  50270. // "deviceName"
  50271. // ],
  50272. // "parameters": {
  50273. // "deviceName": {
  50274. // "description": "The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names.",
  50275. // "location": "query",
  50276. // "required": true,
  50277. // "type": "string"
  50278. // },
  50279. // "instance": {
  50280. // "description": "Instance name for this request.",
  50281. // "location": "path",
  50282. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50283. // "required": true,
  50284. // "type": "string"
  50285. // },
  50286. // "project": {
  50287. // "description": "Project ID for this request.",
  50288. // "location": "path",
  50289. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50290. // "required": true,
  50291. // "type": "string"
  50292. // },
  50293. // "requestId": {
  50294. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50295. // "location": "query",
  50296. // "type": "string"
  50297. // },
  50298. // "zone": {
  50299. // "description": "The name of the zone for this request.",
  50300. // "location": "path",
  50301. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50302. // "required": true,
  50303. // "type": "string"
  50304. // }
  50305. // },
  50306. // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk",
  50307. // "response": {
  50308. // "$ref": "Operation"
  50309. // },
  50310. // "scopes": [
  50311. // "https://www.googleapis.com/auth/cloud-platform",
  50312. // "https://www.googleapis.com/auth/compute"
  50313. // ]
  50314. // }
  50315. }
  50316. // method id "compute.instances.get":
  50317. type InstancesGetCall struct {
  50318. s *Service
  50319. project string
  50320. zone string
  50321. instance string
  50322. urlParams_ gensupport.URLParams
  50323. ifNoneMatch_ string
  50324. ctx_ context.Context
  50325. header_ http.Header
  50326. }
  50327. // Get: Returns the specified Instance resource. Gets a list of
  50328. // available instances by making a list() request.
  50329. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get
  50330. func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall {
  50331. c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50332. c.project = project
  50333. c.zone = zone
  50334. c.instance = instance
  50335. return c
  50336. }
  50337. // Fields allows partial responses to be retrieved. See
  50338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50339. // for more information.
  50340. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
  50341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50342. return c
  50343. }
  50344. // IfNoneMatch sets the optional parameter which makes the operation
  50345. // fail if the object's ETag matches the given value. This is useful for
  50346. // getting updates only after the object has changed since the last
  50347. // request. Use googleapi.IsNotModified to check whether the response
  50348. // error from Do is the result of In-None-Match.
  50349. func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
  50350. c.ifNoneMatch_ = entityTag
  50351. return c
  50352. }
  50353. // Context sets the context to be used in this call's Do method. Any
  50354. // pending HTTP request will be aborted if the provided context is
  50355. // canceled.
  50356. func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
  50357. c.ctx_ = ctx
  50358. return c
  50359. }
  50360. // Header returns an http.Header that can be modified by the caller to
  50361. // add HTTP headers to the request.
  50362. func (c *InstancesGetCall) Header() http.Header {
  50363. if c.header_ == nil {
  50364. c.header_ = make(http.Header)
  50365. }
  50366. return c.header_
  50367. }
  50368. func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
  50369. reqHeaders := make(http.Header)
  50370. for k, v := range c.header_ {
  50371. reqHeaders[k] = v
  50372. }
  50373. reqHeaders.Set("User-Agent", c.s.userAgent())
  50374. if c.ifNoneMatch_ != "" {
  50375. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50376. }
  50377. var body io.Reader = nil
  50378. c.urlParams_.Set("alt", alt)
  50379. c.urlParams_.Set("prettyPrint", "false")
  50380. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  50381. urls += "?" + c.urlParams_.Encode()
  50382. req, err := http.NewRequest("GET", urls, body)
  50383. if err != nil {
  50384. return nil, err
  50385. }
  50386. req.Header = reqHeaders
  50387. googleapi.Expand(req.URL, map[string]string{
  50388. "project": c.project,
  50389. "zone": c.zone,
  50390. "instance": c.instance,
  50391. })
  50392. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50393. }
  50394. // Do executes the "compute.instances.get" call.
  50395. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  50396. // code is an error. Response headers are in either
  50397. // *Instance.ServerResponse.Header or (if a response was returned at
  50398. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50399. // to check whether the returned error was because
  50400. // http.StatusNotModified was returned.
  50401. func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  50402. gensupport.SetOptions(c.urlParams_, opts...)
  50403. res, err := c.doRequest("json")
  50404. if res != nil && res.StatusCode == http.StatusNotModified {
  50405. if res.Body != nil {
  50406. res.Body.Close()
  50407. }
  50408. return nil, &googleapi.Error{
  50409. Code: res.StatusCode,
  50410. Header: res.Header,
  50411. }
  50412. }
  50413. if err != nil {
  50414. return nil, err
  50415. }
  50416. defer googleapi.CloseBody(res)
  50417. if err := googleapi.CheckResponse(res); err != nil {
  50418. return nil, err
  50419. }
  50420. ret := &Instance{
  50421. ServerResponse: googleapi.ServerResponse{
  50422. Header: res.Header,
  50423. HTTPStatusCode: res.StatusCode,
  50424. },
  50425. }
  50426. target := &ret
  50427. if err := gensupport.DecodeResponse(target, res); err != nil {
  50428. return nil, err
  50429. }
  50430. return ret, nil
  50431. // {
  50432. // "description": "Returns the specified Instance resource. Gets a list of available instances by making a list() request.",
  50433. // "httpMethod": "GET",
  50434. // "id": "compute.instances.get",
  50435. // "parameterOrder": [
  50436. // "project",
  50437. // "zone",
  50438. // "instance"
  50439. // ],
  50440. // "parameters": {
  50441. // "instance": {
  50442. // "description": "Name of the instance resource to return.",
  50443. // "location": "path",
  50444. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50445. // "required": true,
  50446. // "type": "string"
  50447. // },
  50448. // "project": {
  50449. // "description": "Project ID for this request.",
  50450. // "location": "path",
  50451. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50452. // "required": true,
  50453. // "type": "string"
  50454. // },
  50455. // "zone": {
  50456. // "description": "The name of the zone for this request.",
  50457. // "location": "path",
  50458. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50459. // "required": true,
  50460. // "type": "string"
  50461. // }
  50462. // },
  50463. // "path": "{project}/zones/{zone}/instances/{instance}",
  50464. // "response": {
  50465. // "$ref": "Instance"
  50466. // },
  50467. // "scopes": [
  50468. // "https://www.googleapis.com/auth/cloud-platform",
  50469. // "https://www.googleapis.com/auth/compute",
  50470. // "https://www.googleapis.com/auth/compute.readonly"
  50471. // ]
  50472. // }
  50473. }
  50474. // method id "compute.instances.getIamPolicy":
  50475. type InstancesGetIamPolicyCall struct {
  50476. s *Service
  50477. project string
  50478. zone string
  50479. resource string
  50480. urlParams_ gensupport.URLParams
  50481. ifNoneMatch_ string
  50482. ctx_ context.Context
  50483. header_ http.Header
  50484. }
  50485. // GetIamPolicy: Gets the access control policy for a resource. May be
  50486. // empty if no such policy or resource exists.
  50487. func (r *InstancesService) GetIamPolicy(project string, zone string, resource string) *InstancesGetIamPolicyCall {
  50488. c := &InstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50489. c.project = project
  50490. c.zone = zone
  50491. c.resource = resource
  50492. return c
  50493. }
  50494. // Fields allows partial responses to be retrieved. See
  50495. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50496. // for more information.
  50497. func (c *InstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesGetIamPolicyCall {
  50498. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50499. return c
  50500. }
  50501. // IfNoneMatch sets the optional parameter which makes the operation
  50502. // fail if the object's ETag matches the given value. This is useful for
  50503. // getting updates only after the object has changed since the last
  50504. // request. Use googleapi.IsNotModified to check whether the response
  50505. // error from Do is the result of In-None-Match.
  50506. func (c *InstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstancesGetIamPolicyCall {
  50507. c.ifNoneMatch_ = entityTag
  50508. return c
  50509. }
  50510. // Context sets the context to be used in this call's Do method. Any
  50511. // pending HTTP request will be aborted if the provided context is
  50512. // canceled.
  50513. func (c *InstancesGetIamPolicyCall) Context(ctx context.Context) *InstancesGetIamPolicyCall {
  50514. c.ctx_ = ctx
  50515. return c
  50516. }
  50517. // Header returns an http.Header that can be modified by the caller to
  50518. // add HTTP headers to the request.
  50519. func (c *InstancesGetIamPolicyCall) Header() http.Header {
  50520. if c.header_ == nil {
  50521. c.header_ = make(http.Header)
  50522. }
  50523. return c.header_
  50524. }
  50525. func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  50526. reqHeaders := make(http.Header)
  50527. for k, v := range c.header_ {
  50528. reqHeaders[k] = v
  50529. }
  50530. reqHeaders.Set("User-Agent", c.s.userAgent())
  50531. if c.ifNoneMatch_ != "" {
  50532. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50533. }
  50534. var body io.Reader = nil
  50535. c.urlParams_.Set("alt", alt)
  50536. c.urlParams_.Set("prettyPrint", "false")
  50537. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/getIamPolicy")
  50538. urls += "?" + c.urlParams_.Encode()
  50539. req, err := http.NewRequest("GET", urls, body)
  50540. if err != nil {
  50541. return nil, err
  50542. }
  50543. req.Header = reqHeaders
  50544. googleapi.Expand(req.URL, map[string]string{
  50545. "project": c.project,
  50546. "zone": c.zone,
  50547. "resource": c.resource,
  50548. })
  50549. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50550. }
  50551. // Do executes the "compute.instances.getIamPolicy" call.
  50552. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  50553. // code is an error. Response headers are in either
  50554. // *Policy.ServerResponse.Header or (if a response was returned at all)
  50555. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  50556. // check whether the returned error was because http.StatusNotModified
  50557. // was returned.
  50558. func (c *InstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  50559. gensupport.SetOptions(c.urlParams_, opts...)
  50560. res, err := c.doRequest("json")
  50561. if res != nil && res.StatusCode == http.StatusNotModified {
  50562. if res.Body != nil {
  50563. res.Body.Close()
  50564. }
  50565. return nil, &googleapi.Error{
  50566. Code: res.StatusCode,
  50567. Header: res.Header,
  50568. }
  50569. }
  50570. if err != nil {
  50571. return nil, err
  50572. }
  50573. defer googleapi.CloseBody(res)
  50574. if err := googleapi.CheckResponse(res); err != nil {
  50575. return nil, err
  50576. }
  50577. ret := &Policy{
  50578. ServerResponse: googleapi.ServerResponse{
  50579. Header: res.Header,
  50580. HTTPStatusCode: res.StatusCode,
  50581. },
  50582. }
  50583. target := &ret
  50584. if err := gensupport.DecodeResponse(target, res); err != nil {
  50585. return nil, err
  50586. }
  50587. return ret, nil
  50588. // {
  50589. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  50590. // "httpMethod": "GET",
  50591. // "id": "compute.instances.getIamPolicy",
  50592. // "parameterOrder": [
  50593. // "project",
  50594. // "zone",
  50595. // "resource"
  50596. // ],
  50597. // "parameters": {
  50598. // "project": {
  50599. // "description": "Project ID for this request.",
  50600. // "location": "path",
  50601. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50602. // "required": true,
  50603. // "type": "string"
  50604. // },
  50605. // "resource": {
  50606. // "description": "Name or id of the resource for this request.",
  50607. // "location": "path",
  50608. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50609. // "required": true,
  50610. // "type": "string"
  50611. // },
  50612. // "zone": {
  50613. // "description": "The name of the zone for this request.",
  50614. // "location": "path",
  50615. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50616. // "required": true,
  50617. // "type": "string"
  50618. // }
  50619. // },
  50620. // "path": "{project}/zones/{zone}/instances/{resource}/getIamPolicy",
  50621. // "response": {
  50622. // "$ref": "Policy"
  50623. // },
  50624. // "scopes": [
  50625. // "https://www.googleapis.com/auth/cloud-platform",
  50626. // "https://www.googleapis.com/auth/compute",
  50627. // "https://www.googleapis.com/auth/compute.readonly"
  50628. // ]
  50629. // }
  50630. }
  50631. // method id "compute.instances.getSerialPortOutput":
  50632. type InstancesGetSerialPortOutputCall struct {
  50633. s *Service
  50634. project string
  50635. zone string
  50636. instance string
  50637. urlParams_ gensupport.URLParams
  50638. ifNoneMatch_ string
  50639. ctx_ context.Context
  50640. header_ http.Header
  50641. }
  50642. // GetSerialPortOutput: Returns the last 1 MB of serial port output from
  50643. // the specified instance.
  50644. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput
  50645. func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall {
  50646. c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50647. c.project = project
  50648. c.zone = zone
  50649. c.instance = instance
  50650. return c
  50651. }
  50652. // Port sets the optional parameter "port": Specifies which COM or
  50653. // serial port to retrieve data from.
  50654. func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall {
  50655. c.urlParams_.Set("port", fmt.Sprint(port))
  50656. return c
  50657. }
  50658. // Start sets the optional parameter "start": Returns output starting
  50659. // from a specific byte position. Use this to page through output when
  50660. // the output is too large to return in a single request. For the
  50661. // initial request, leave this field unspecified. For subsequent calls,
  50662. // this field should be set to the next value returned in the previous
  50663. // call.
  50664. func (c *InstancesGetSerialPortOutputCall) Start(start int64) *InstancesGetSerialPortOutputCall {
  50665. c.urlParams_.Set("start", fmt.Sprint(start))
  50666. return c
  50667. }
  50668. // Fields allows partial responses to be retrieved. See
  50669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50670. // for more information.
  50671. func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall {
  50672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50673. return c
  50674. }
  50675. // IfNoneMatch sets the optional parameter which makes the operation
  50676. // fail if the object's ETag matches the given value. This is useful for
  50677. // getting updates only after the object has changed since the last
  50678. // request. Use googleapi.IsNotModified to check whether the response
  50679. // error from Do is the result of In-None-Match.
  50680. func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall {
  50681. c.ifNoneMatch_ = entityTag
  50682. return c
  50683. }
  50684. // Context sets the context to be used in this call's Do method. Any
  50685. // pending HTTP request will be aborted if the provided context is
  50686. // canceled.
  50687. func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall {
  50688. c.ctx_ = ctx
  50689. return c
  50690. }
  50691. // Header returns an http.Header that can be modified by the caller to
  50692. // add HTTP headers to the request.
  50693. func (c *InstancesGetSerialPortOutputCall) Header() http.Header {
  50694. if c.header_ == nil {
  50695. c.header_ = make(http.Header)
  50696. }
  50697. return c.header_
  50698. }
  50699. func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) {
  50700. reqHeaders := make(http.Header)
  50701. for k, v := range c.header_ {
  50702. reqHeaders[k] = v
  50703. }
  50704. reqHeaders.Set("User-Agent", c.s.userAgent())
  50705. if c.ifNoneMatch_ != "" {
  50706. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50707. }
  50708. var body io.Reader = nil
  50709. c.urlParams_.Set("alt", alt)
  50710. c.urlParams_.Set("prettyPrint", "false")
  50711. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort")
  50712. urls += "?" + c.urlParams_.Encode()
  50713. req, err := http.NewRequest("GET", urls, body)
  50714. if err != nil {
  50715. return nil, err
  50716. }
  50717. req.Header = reqHeaders
  50718. googleapi.Expand(req.URL, map[string]string{
  50719. "project": c.project,
  50720. "zone": c.zone,
  50721. "instance": c.instance,
  50722. })
  50723. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50724. }
  50725. // Do executes the "compute.instances.getSerialPortOutput" call.
  50726. // Exactly one of *SerialPortOutput or error will be non-nil. Any
  50727. // non-2xx status code is an error. Response headers are in either
  50728. // *SerialPortOutput.ServerResponse.Header or (if a response was
  50729. // returned at all) in error.(*googleapi.Error).Header. Use
  50730. // googleapi.IsNotModified to check whether the returned error was
  50731. // because http.StatusNotModified was returned.
  50732. func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) {
  50733. gensupport.SetOptions(c.urlParams_, opts...)
  50734. res, err := c.doRequest("json")
  50735. if res != nil && res.StatusCode == http.StatusNotModified {
  50736. if res.Body != nil {
  50737. res.Body.Close()
  50738. }
  50739. return nil, &googleapi.Error{
  50740. Code: res.StatusCode,
  50741. Header: res.Header,
  50742. }
  50743. }
  50744. if err != nil {
  50745. return nil, err
  50746. }
  50747. defer googleapi.CloseBody(res)
  50748. if err := googleapi.CheckResponse(res); err != nil {
  50749. return nil, err
  50750. }
  50751. ret := &SerialPortOutput{
  50752. ServerResponse: googleapi.ServerResponse{
  50753. Header: res.Header,
  50754. HTTPStatusCode: res.StatusCode,
  50755. },
  50756. }
  50757. target := &ret
  50758. if err := gensupport.DecodeResponse(target, res); err != nil {
  50759. return nil, err
  50760. }
  50761. return ret, nil
  50762. // {
  50763. // "description": "Returns the last 1 MB of serial port output from the specified instance.",
  50764. // "httpMethod": "GET",
  50765. // "id": "compute.instances.getSerialPortOutput",
  50766. // "parameterOrder": [
  50767. // "project",
  50768. // "zone",
  50769. // "instance"
  50770. // ],
  50771. // "parameters": {
  50772. // "instance": {
  50773. // "description": "Name of the instance scoping this request.",
  50774. // "location": "path",
  50775. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50776. // "required": true,
  50777. // "type": "string"
  50778. // },
  50779. // "port": {
  50780. // "default": "1",
  50781. // "description": "Specifies which COM or serial port to retrieve data from.",
  50782. // "format": "int32",
  50783. // "location": "query",
  50784. // "maximum": "4",
  50785. // "minimum": "1",
  50786. // "type": "integer"
  50787. // },
  50788. // "project": {
  50789. // "description": "Project ID for this request.",
  50790. // "location": "path",
  50791. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50792. // "required": true,
  50793. // "type": "string"
  50794. // },
  50795. // "start": {
  50796. // "description": "Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call.",
  50797. // "format": "int64",
  50798. // "location": "query",
  50799. // "type": "string"
  50800. // },
  50801. // "zone": {
  50802. // "description": "The name of the zone for this request.",
  50803. // "location": "path",
  50804. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50805. // "required": true,
  50806. // "type": "string"
  50807. // }
  50808. // },
  50809. // "path": "{project}/zones/{zone}/instances/{instance}/serialPort",
  50810. // "response": {
  50811. // "$ref": "SerialPortOutput"
  50812. // },
  50813. // "scopes": [
  50814. // "https://www.googleapis.com/auth/cloud-platform",
  50815. // "https://www.googleapis.com/auth/compute",
  50816. // "https://www.googleapis.com/auth/compute.readonly"
  50817. // ]
  50818. // }
  50819. }
  50820. // method id "compute.instances.insert":
  50821. type InstancesInsertCall struct {
  50822. s *Service
  50823. project string
  50824. zone string
  50825. instance *Instance
  50826. urlParams_ gensupport.URLParams
  50827. ctx_ context.Context
  50828. header_ http.Header
  50829. }
  50830. // Insert: Creates an instance resource in the specified project using
  50831. // the data included in the request.
  50832. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert
  50833. func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall {
  50834. c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50835. c.project = project
  50836. c.zone = zone
  50837. c.instance = instance
  50838. return c
  50839. }
  50840. // RequestId sets the optional parameter "requestId": An optional
  50841. // request ID to identify requests. Specify a unique request ID so that
  50842. // if you must retry your request, the server will know to ignore the
  50843. // request if it has already been completed.
  50844. //
  50845. // For example, consider a situation where you make an initial request
  50846. // and the request times out. If you make the request again with the
  50847. // same request ID, the server can check if original operation with the
  50848. // same request ID was received, and if so, will ignore the second
  50849. // request. This prevents clients from accidentally creating duplicate
  50850. // commitments.
  50851. //
  50852. // The request ID must be a valid UUID with the exception that zero UUID
  50853. // is not supported (00000000-0000-0000-0000-000000000000).
  50854. func (c *InstancesInsertCall) RequestId(requestId string) *InstancesInsertCall {
  50855. c.urlParams_.Set("requestId", requestId)
  50856. return c
  50857. }
  50858. // SourceInstanceTemplate sets the optional parameter
  50859. // "sourceInstanceTemplate": Specifies instance template to create the
  50860. // instance.
  50861. //
  50862. // This field is optional. It can be a full or partial URL. For example,
  50863. // the following are all valid URLs to an instance template:
  50864. // -
  50865. // https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate
  50866. // - projects/project/global/instanceTemplates/instanceTemplate
  50867. // - global/instanceTemplates/instanceTemplate
  50868. func (c *InstancesInsertCall) SourceInstanceTemplate(sourceInstanceTemplate string) *InstancesInsertCall {
  50869. c.urlParams_.Set("sourceInstanceTemplate", sourceInstanceTemplate)
  50870. return c
  50871. }
  50872. // Fields allows partial responses to be retrieved. See
  50873. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50874. // for more information.
  50875. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
  50876. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50877. return c
  50878. }
  50879. // Context sets the context to be used in this call's Do method. Any
  50880. // pending HTTP request will be aborted if the provided context is
  50881. // canceled.
  50882. func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
  50883. c.ctx_ = ctx
  50884. return c
  50885. }
  50886. // Header returns an http.Header that can be modified by the caller to
  50887. // add HTTP headers to the request.
  50888. func (c *InstancesInsertCall) Header() http.Header {
  50889. if c.header_ == nil {
  50890. c.header_ = make(http.Header)
  50891. }
  50892. return c.header_
  50893. }
  50894. func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  50895. reqHeaders := make(http.Header)
  50896. for k, v := range c.header_ {
  50897. reqHeaders[k] = v
  50898. }
  50899. reqHeaders.Set("User-Agent", c.s.userAgent())
  50900. var body io.Reader = nil
  50901. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  50902. if err != nil {
  50903. return nil, err
  50904. }
  50905. reqHeaders.Set("Content-Type", "application/json")
  50906. c.urlParams_.Set("alt", alt)
  50907. c.urlParams_.Set("prettyPrint", "false")
  50908. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  50909. urls += "?" + c.urlParams_.Encode()
  50910. req, err := http.NewRequest("POST", urls, body)
  50911. if err != nil {
  50912. return nil, err
  50913. }
  50914. req.Header = reqHeaders
  50915. googleapi.Expand(req.URL, map[string]string{
  50916. "project": c.project,
  50917. "zone": c.zone,
  50918. })
  50919. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50920. }
  50921. // Do executes the "compute.instances.insert" call.
  50922. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50923. // status code is an error. Response headers are in either
  50924. // *Operation.ServerResponse.Header or (if a response was returned at
  50925. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50926. // to check whether the returned error was because
  50927. // http.StatusNotModified was returned.
  50928. func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50929. gensupport.SetOptions(c.urlParams_, opts...)
  50930. res, err := c.doRequest("json")
  50931. if res != nil && res.StatusCode == http.StatusNotModified {
  50932. if res.Body != nil {
  50933. res.Body.Close()
  50934. }
  50935. return nil, &googleapi.Error{
  50936. Code: res.StatusCode,
  50937. Header: res.Header,
  50938. }
  50939. }
  50940. if err != nil {
  50941. return nil, err
  50942. }
  50943. defer googleapi.CloseBody(res)
  50944. if err := googleapi.CheckResponse(res); err != nil {
  50945. return nil, err
  50946. }
  50947. ret := &Operation{
  50948. ServerResponse: googleapi.ServerResponse{
  50949. Header: res.Header,
  50950. HTTPStatusCode: res.StatusCode,
  50951. },
  50952. }
  50953. target := &ret
  50954. if err := gensupport.DecodeResponse(target, res); err != nil {
  50955. return nil, err
  50956. }
  50957. return ret, nil
  50958. // {
  50959. // "description": "Creates an instance resource in the specified project using the data included in the request.",
  50960. // "httpMethod": "POST",
  50961. // "id": "compute.instances.insert",
  50962. // "parameterOrder": [
  50963. // "project",
  50964. // "zone"
  50965. // ],
  50966. // "parameters": {
  50967. // "project": {
  50968. // "description": "Project ID for this request.",
  50969. // "location": "path",
  50970. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50971. // "required": true,
  50972. // "type": "string"
  50973. // },
  50974. // "requestId": {
  50975. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50976. // "location": "query",
  50977. // "type": "string"
  50978. // },
  50979. // "sourceInstanceTemplate": {
  50980. // "description": "Specifies instance template to create the instance.\n\nThis field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: \n- https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate \n- projects/project/global/instanceTemplates/instanceTemplate \n- global/instanceTemplates/instanceTemplate",
  50981. // "location": "query",
  50982. // "type": "string"
  50983. // },
  50984. // "zone": {
  50985. // "description": "The name of the zone for this request.",
  50986. // "location": "path",
  50987. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50988. // "required": true,
  50989. // "type": "string"
  50990. // }
  50991. // },
  50992. // "path": "{project}/zones/{zone}/instances",
  50993. // "request": {
  50994. // "$ref": "Instance"
  50995. // },
  50996. // "response": {
  50997. // "$ref": "Operation"
  50998. // },
  50999. // "scopes": [
  51000. // "https://www.googleapis.com/auth/cloud-platform",
  51001. // "https://www.googleapis.com/auth/compute"
  51002. // ]
  51003. // }
  51004. }
  51005. // method id "compute.instances.list":
  51006. type InstancesListCall struct {
  51007. s *Service
  51008. project string
  51009. zone string
  51010. urlParams_ gensupport.URLParams
  51011. ifNoneMatch_ string
  51012. ctx_ context.Context
  51013. header_ http.Header
  51014. }
  51015. // List: Retrieves the list of instances contained within the specified
  51016. // zone.
  51017. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list
  51018. func (r *InstancesService) List(project string, zone string) *InstancesListCall {
  51019. c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51020. c.project = project
  51021. c.zone = zone
  51022. return c
  51023. }
  51024. // Filter sets the optional parameter "filter": A filter expression that
  51025. // filters resources listed in the response. The expression must specify
  51026. // the field name, a comparison operator, and the value that you want to
  51027. // use for filtering. The value must be a string, a number, or a
  51028. // boolean. The comparison operator must be either =, !=, >, or <.
  51029. //
  51030. // For example, if you are filtering Compute Engine instances, you can
  51031. // exclude instances named example-instance by specifying name !=
  51032. // example-instance.
  51033. //
  51034. // You can also filter nested fields. For example, you could specify
  51035. // scheduling.automaticRestart = false to include instances only if they
  51036. // are not scheduled for automatic restarts. You can use filtering on
  51037. // nested fields to filter based on resource labels.
  51038. //
  51039. // To filter on multiple expressions, provide each separate expression
  51040. // within parentheses. For example, (scheduling.automaticRestart = true)
  51041. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  51042. // AND expression. However, you can include AND and OR expressions
  51043. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  51044. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  51045. // true).
  51046. func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
  51047. c.urlParams_.Set("filter", filter)
  51048. return c
  51049. }
  51050. // MaxResults sets the optional parameter "maxResults": The maximum
  51051. // number of results per page that should be returned. If the number of
  51052. // available results is larger than maxResults, Compute Engine returns a
  51053. // nextPageToken that can be used to get the next page of results in
  51054. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  51055. // (Default: 500)
  51056. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
  51057. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  51058. return c
  51059. }
  51060. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  51061. // a certain order. By default, results are returned in alphanumerical
  51062. // order based on the resource name.
  51063. //
  51064. // You can also sort results in descending order based on the creation
  51065. // timestamp using orderBy="creationTimestamp desc". This sorts results
  51066. // based on the creationTimestamp field in reverse chronological order
  51067. // (newest result first). Use this to sort resources like operations so
  51068. // that the newest operation is returned first.
  51069. //
  51070. // Currently, only sorting by name or creationTimestamp desc is
  51071. // supported.
  51072. func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall {
  51073. c.urlParams_.Set("orderBy", orderBy)
  51074. return c
  51075. }
  51076. // PageToken sets the optional parameter "pageToken": Specifies a page
  51077. // token to use. Set pageToken to the nextPageToken returned by a
  51078. // previous list request to get the next page of results.
  51079. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
  51080. c.urlParams_.Set("pageToken", pageToken)
  51081. return c
  51082. }
  51083. // Fields allows partial responses to be retrieved. See
  51084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51085. // for more information.
  51086. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
  51087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51088. return c
  51089. }
  51090. // IfNoneMatch sets the optional parameter which makes the operation
  51091. // fail if the object's ETag matches the given value. This is useful for
  51092. // getting updates only after the object has changed since the last
  51093. // request. Use googleapi.IsNotModified to check whether the response
  51094. // error from Do is the result of In-None-Match.
  51095. func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
  51096. c.ifNoneMatch_ = entityTag
  51097. return c
  51098. }
  51099. // Context sets the context to be used in this call's Do method. Any
  51100. // pending HTTP request will be aborted if the provided context is
  51101. // canceled.
  51102. func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
  51103. c.ctx_ = ctx
  51104. return c
  51105. }
  51106. // Header returns an http.Header that can be modified by the caller to
  51107. // add HTTP headers to the request.
  51108. func (c *InstancesListCall) Header() http.Header {
  51109. if c.header_ == nil {
  51110. c.header_ = make(http.Header)
  51111. }
  51112. return c.header_
  51113. }
  51114. func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
  51115. reqHeaders := make(http.Header)
  51116. for k, v := range c.header_ {
  51117. reqHeaders[k] = v
  51118. }
  51119. reqHeaders.Set("User-Agent", c.s.userAgent())
  51120. if c.ifNoneMatch_ != "" {
  51121. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51122. }
  51123. var body io.Reader = nil
  51124. c.urlParams_.Set("alt", alt)
  51125. c.urlParams_.Set("prettyPrint", "false")
  51126. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  51127. urls += "?" + c.urlParams_.Encode()
  51128. req, err := http.NewRequest("GET", urls, body)
  51129. if err != nil {
  51130. return nil, err
  51131. }
  51132. req.Header = reqHeaders
  51133. googleapi.Expand(req.URL, map[string]string{
  51134. "project": c.project,
  51135. "zone": c.zone,
  51136. })
  51137. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51138. }
  51139. // Do executes the "compute.instances.list" call.
  51140. // Exactly one of *InstanceList or error will be non-nil. Any non-2xx
  51141. // status code is an error. Response headers are in either
  51142. // *InstanceList.ServerResponse.Header or (if a response was returned at
  51143. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51144. // to check whether the returned error was because
  51145. // http.StatusNotModified was returned.
  51146. func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) {
  51147. gensupport.SetOptions(c.urlParams_, opts...)
  51148. res, err := c.doRequest("json")
  51149. if res != nil && res.StatusCode == http.StatusNotModified {
  51150. if res.Body != nil {
  51151. res.Body.Close()
  51152. }
  51153. return nil, &googleapi.Error{
  51154. Code: res.StatusCode,
  51155. Header: res.Header,
  51156. }
  51157. }
  51158. if err != nil {
  51159. return nil, err
  51160. }
  51161. defer googleapi.CloseBody(res)
  51162. if err := googleapi.CheckResponse(res); err != nil {
  51163. return nil, err
  51164. }
  51165. ret := &InstanceList{
  51166. ServerResponse: googleapi.ServerResponse{
  51167. Header: res.Header,
  51168. HTTPStatusCode: res.StatusCode,
  51169. },
  51170. }
  51171. target := &ret
  51172. if err := gensupport.DecodeResponse(target, res); err != nil {
  51173. return nil, err
  51174. }
  51175. return ret, nil
  51176. // {
  51177. // "description": "Retrieves the list of instances contained within the specified zone.",
  51178. // "httpMethod": "GET",
  51179. // "id": "compute.instances.list",
  51180. // "parameterOrder": [
  51181. // "project",
  51182. // "zone"
  51183. // ],
  51184. // "parameters": {
  51185. // "filter": {
  51186. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  51187. // "location": "query",
  51188. // "type": "string"
  51189. // },
  51190. // "maxResults": {
  51191. // "default": "500",
  51192. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  51193. // "format": "uint32",
  51194. // "location": "query",
  51195. // "minimum": "0",
  51196. // "type": "integer"
  51197. // },
  51198. // "orderBy": {
  51199. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  51200. // "location": "query",
  51201. // "type": "string"
  51202. // },
  51203. // "pageToken": {
  51204. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  51205. // "location": "query",
  51206. // "type": "string"
  51207. // },
  51208. // "project": {
  51209. // "description": "Project ID for this request.",
  51210. // "location": "path",
  51211. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51212. // "required": true,
  51213. // "type": "string"
  51214. // },
  51215. // "zone": {
  51216. // "description": "The name of the zone for this request.",
  51217. // "location": "path",
  51218. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51219. // "required": true,
  51220. // "type": "string"
  51221. // }
  51222. // },
  51223. // "path": "{project}/zones/{zone}/instances",
  51224. // "response": {
  51225. // "$ref": "InstanceList"
  51226. // },
  51227. // "scopes": [
  51228. // "https://www.googleapis.com/auth/cloud-platform",
  51229. // "https://www.googleapis.com/auth/compute",
  51230. // "https://www.googleapis.com/auth/compute.readonly"
  51231. // ]
  51232. // }
  51233. }
  51234. // Pages invokes f for each page of results.
  51235. // A non-nil error returned from f will halt the iteration.
  51236. // The provided context supersedes any context provided to the Context method.
  51237. func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error {
  51238. c.ctx_ = ctx
  51239. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  51240. for {
  51241. x, err := c.Do()
  51242. if err != nil {
  51243. return err
  51244. }
  51245. if err := f(x); err != nil {
  51246. return err
  51247. }
  51248. if x.NextPageToken == "" {
  51249. return nil
  51250. }
  51251. c.PageToken(x.NextPageToken)
  51252. }
  51253. }
  51254. // method id "compute.instances.listReferrers":
  51255. type InstancesListReferrersCall struct {
  51256. s *Service
  51257. project string
  51258. zone string
  51259. instance string
  51260. urlParams_ gensupport.URLParams
  51261. ifNoneMatch_ string
  51262. ctx_ context.Context
  51263. header_ http.Header
  51264. }
  51265. // ListReferrers: Retrieves the list of referrers to instances contained
  51266. // within the specified zone. For more information, read Viewing
  51267. // Referrers to VM Instances.
  51268. func (r *InstancesService) ListReferrers(project string, zone string, instance string) *InstancesListReferrersCall {
  51269. c := &InstancesListReferrersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51270. c.project = project
  51271. c.zone = zone
  51272. c.instance = instance
  51273. return c
  51274. }
  51275. // Filter sets the optional parameter "filter": A filter expression that
  51276. // filters resources listed in the response. The expression must specify
  51277. // the field name, a comparison operator, and the value that you want to
  51278. // use for filtering. The value must be a string, a number, or a
  51279. // boolean. The comparison operator must be either =, !=, >, or <.
  51280. //
  51281. // For example, if you are filtering Compute Engine instances, you can
  51282. // exclude instances named example-instance by specifying name !=
  51283. // example-instance.
  51284. //
  51285. // You can also filter nested fields. For example, you could specify
  51286. // scheduling.automaticRestart = false to include instances only if they
  51287. // are not scheduled for automatic restarts. You can use filtering on
  51288. // nested fields to filter based on resource labels.
  51289. //
  51290. // To filter on multiple expressions, provide each separate expression
  51291. // within parentheses. For example, (scheduling.automaticRestart = true)
  51292. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  51293. // AND expression. However, you can include AND and OR expressions
  51294. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  51295. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  51296. // true).
  51297. func (c *InstancesListReferrersCall) Filter(filter string) *InstancesListReferrersCall {
  51298. c.urlParams_.Set("filter", filter)
  51299. return c
  51300. }
  51301. // MaxResults sets the optional parameter "maxResults": The maximum
  51302. // number of results per page that should be returned. If the number of
  51303. // available results is larger than maxResults, Compute Engine returns a
  51304. // nextPageToken that can be used to get the next page of results in
  51305. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  51306. // (Default: 500)
  51307. func (c *InstancesListReferrersCall) MaxResults(maxResults int64) *InstancesListReferrersCall {
  51308. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  51309. return c
  51310. }
  51311. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  51312. // a certain order. By default, results are returned in alphanumerical
  51313. // order based on the resource name.
  51314. //
  51315. // You can also sort results in descending order based on the creation
  51316. // timestamp using orderBy="creationTimestamp desc". This sorts results
  51317. // based on the creationTimestamp field in reverse chronological order
  51318. // (newest result first). Use this to sort resources like operations so
  51319. // that the newest operation is returned first.
  51320. //
  51321. // Currently, only sorting by name or creationTimestamp desc is
  51322. // supported.
  51323. func (c *InstancesListReferrersCall) OrderBy(orderBy string) *InstancesListReferrersCall {
  51324. c.urlParams_.Set("orderBy", orderBy)
  51325. return c
  51326. }
  51327. // PageToken sets the optional parameter "pageToken": Specifies a page
  51328. // token to use. Set pageToken to the nextPageToken returned by a
  51329. // previous list request to get the next page of results.
  51330. func (c *InstancesListReferrersCall) PageToken(pageToken string) *InstancesListReferrersCall {
  51331. c.urlParams_.Set("pageToken", pageToken)
  51332. return c
  51333. }
  51334. // Fields allows partial responses to be retrieved. See
  51335. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51336. // for more information.
  51337. func (c *InstancesListReferrersCall) Fields(s ...googleapi.Field) *InstancesListReferrersCall {
  51338. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51339. return c
  51340. }
  51341. // IfNoneMatch sets the optional parameter which makes the operation
  51342. // fail if the object's ETag matches the given value. This is useful for
  51343. // getting updates only after the object has changed since the last
  51344. // request. Use googleapi.IsNotModified to check whether the response
  51345. // error from Do is the result of In-None-Match.
  51346. func (c *InstancesListReferrersCall) IfNoneMatch(entityTag string) *InstancesListReferrersCall {
  51347. c.ifNoneMatch_ = entityTag
  51348. return c
  51349. }
  51350. // Context sets the context to be used in this call's Do method. Any
  51351. // pending HTTP request will be aborted if the provided context is
  51352. // canceled.
  51353. func (c *InstancesListReferrersCall) Context(ctx context.Context) *InstancesListReferrersCall {
  51354. c.ctx_ = ctx
  51355. return c
  51356. }
  51357. // Header returns an http.Header that can be modified by the caller to
  51358. // add HTTP headers to the request.
  51359. func (c *InstancesListReferrersCall) Header() http.Header {
  51360. if c.header_ == nil {
  51361. c.header_ = make(http.Header)
  51362. }
  51363. return c.header_
  51364. }
  51365. func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, error) {
  51366. reqHeaders := make(http.Header)
  51367. for k, v := range c.header_ {
  51368. reqHeaders[k] = v
  51369. }
  51370. reqHeaders.Set("User-Agent", c.s.userAgent())
  51371. if c.ifNoneMatch_ != "" {
  51372. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51373. }
  51374. var body io.Reader = nil
  51375. c.urlParams_.Set("alt", alt)
  51376. c.urlParams_.Set("prettyPrint", "false")
  51377. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/referrers")
  51378. urls += "?" + c.urlParams_.Encode()
  51379. req, err := http.NewRequest("GET", urls, body)
  51380. if err != nil {
  51381. return nil, err
  51382. }
  51383. req.Header = reqHeaders
  51384. googleapi.Expand(req.URL, map[string]string{
  51385. "project": c.project,
  51386. "zone": c.zone,
  51387. "instance": c.instance,
  51388. })
  51389. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51390. }
  51391. // Do executes the "compute.instances.listReferrers" call.
  51392. // Exactly one of *InstanceListReferrers or error will be non-nil. Any
  51393. // non-2xx status code is an error. Response headers are in either
  51394. // *InstanceListReferrers.ServerResponse.Header or (if a response was
  51395. // returned at all) in error.(*googleapi.Error).Header. Use
  51396. // googleapi.IsNotModified to check whether the returned error was
  51397. // because http.StatusNotModified was returned.
  51398. func (c *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*InstanceListReferrers, error) {
  51399. gensupport.SetOptions(c.urlParams_, opts...)
  51400. res, err := c.doRequest("json")
  51401. if res != nil && res.StatusCode == http.StatusNotModified {
  51402. if res.Body != nil {
  51403. res.Body.Close()
  51404. }
  51405. return nil, &googleapi.Error{
  51406. Code: res.StatusCode,
  51407. Header: res.Header,
  51408. }
  51409. }
  51410. if err != nil {
  51411. return nil, err
  51412. }
  51413. defer googleapi.CloseBody(res)
  51414. if err := googleapi.CheckResponse(res); err != nil {
  51415. return nil, err
  51416. }
  51417. ret := &InstanceListReferrers{
  51418. ServerResponse: googleapi.ServerResponse{
  51419. Header: res.Header,
  51420. HTTPStatusCode: res.StatusCode,
  51421. },
  51422. }
  51423. target := &ret
  51424. if err := gensupport.DecodeResponse(target, res); err != nil {
  51425. return nil, err
  51426. }
  51427. return ret, nil
  51428. // {
  51429. // "description": "Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances.",
  51430. // "httpMethod": "GET",
  51431. // "id": "compute.instances.listReferrers",
  51432. // "parameterOrder": [
  51433. // "project",
  51434. // "zone",
  51435. // "instance"
  51436. // ],
  51437. // "parameters": {
  51438. // "filter": {
  51439. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  51440. // "location": "query",
  51441. // "type": "string"
  51442. // },
  51443. // "instance": {
  51444. // "description": "Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.",
  51445. // "location": "path",
  51446. // "pattern": "-|[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51447. // "required": true,
  51448. // "type": "string"
  51449. // },
  51450. // "maxResults": {
  51451. // "default": "500",
  51452. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  51453. // "format": "uint32",
  51454. // "location": "query",
  51455. // "minimum": "0",
  51456. // "type": "integer"
  51457. // },
  51458. // "orderBy": {
  51459. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  51460. // "location": "query",
  51461. // "type": "string"
  51462. // },
  51463. // "pageToken": {
  51464. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  51465. // "location": "query",
  51466. // "type": "string"
  51467. // },
  51468. // "project": {
  51469. // "description": "Project ID for this request.",
  51470. // "location": "path",
  51471. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51472. // "required": true,
  51473. // "type": "string"
  51474. // },
  51475. // "zone": {
  51476. // "description": "The name of the zone for this request.",
  51477. // "location": "path",
  51478. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51479. // "required": true,
  51480. // "type": "string"
  51481. // }
  51482. // },
  51483. // "path": "{project}/zones/{zone}/instances/{instance}/referrers",
  51484. // "response": {
  51485. // "$ref": "InstanceListReferrers"
  51486. // },
  51487. // "scopes": [
  51488. // "https://www.googleapis.com/auth/cloud-platform",
  51489. // "https://www.googleapis.com/auth/compute",
  51490. // "https://www.googleapis.com/auth/compute.readonly"
  51491. // ]
  51492. // }
  51493. }
  51494. // Pages invokes f for each page of results.
  51495. // A non-nil error returned from f will halt the iteration.
  51496. // The provided context supersedes any context provided to the Context method.
  51497. func (c *InstancesListReferrersCall) Pages(ctx context.Context, f func(*InstanceListReferrers) error) error {
  51498. c.ctx_ = ctx
  51499. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  51500. for {
  51501. x, err := c.Do()
  51502. if err != nil {
  51503. return err
  51504. }
  51505. if err := f(x); err != nil {
  51506. return err
  51507. }
  51508. if x.NextPageToken == "" {
  51509. return nil
  51510. }
  51511. c.PageToken(x.NextPageToken)
  51512. }
  51513. }
  51514. // method id "compute.instances.reset":
  51515. type InstancesResetCall struct {
  51516. s *Service
  51517. project string
  51518. zone string
  51519. instance string
  51520. urlParams_ gensupport.URLParams
  51521. ctx_ context.Context
  51522. header_ http.Header
  51523. }
  51524. // Reset: Performs a reset on the instance. This is a hard reset the VM
  51525. // does not do a graceful shutdown. For more information, see Resetting
  51526. // an instance.
  51527. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset
  51528. func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall {
  51529. c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51530. c.project = project
  51531. c.zone = zone
  51532. c.instance = instance
  51533. return c
  51534. }
  51535. // RequestId sets the optional parameter "requestId": An optional
  51536. // request ID to identify requests. Specify a unique request ID so that
  51537. // if you must retry your request, the server will know to ignore the
  51538. // request if it has already been completed.
  51539. //
  51540. // For example, consider a situation where you make an initial request
  51541. // and the request times out. If you make the request again with the
  51542. // same request ID, the server can check if original operation with the
  51543. // same request ID was received, and if so, will ignore the second
  51544. // request. This prevents clients from accidentally creating duplicate
  51545. // commitments.
  51546. //
  51547. // The request ID must be a valid UUID with the exception that zero UUID
  51548. // is not supported (00000000-0000-0000-0000-000000000000).
  51549. func (c *InstancesResetCall) RequestId(requestId string) *InstancesResetCall {
  51550. c.urlParams_.Set("requestId", requestId)
  51551. return c
  51552. }
  51553. // Fields allows partial responses to be retrieved. See
  51554. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51555. // for more information.
  51556. func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall {
  51557. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51558. return c
  51559. }
  51560. // Context sets the context to be used in this call's Do method. Any
  51561. // pending HTTP request will be aborted if the provided context is
  51562. // canceled.
  51563. func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall {
  51564. c.ctx_ = ctx
  51565. return c
  51566. }
  51567. // Header returns an http.Header that can be modified by the caller to
  51568. // add HTTP headers to the request.
  51569. func (c *InstancesResetCall) Header() http.Header {
  51570. if c.header_ == nil {
  51571. c.header_ = make(http.Header)
  51572. }
  51573. return c.header_
  51574. }
  51575. func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) {
  51576. reqHeaders := make(http.Header)
  51577. for k, v := range c.header_ {
  51578. reqHeaders[k] = v
  51579. }
  51580. reqHeaders.Set("User-Agent", c.s.userAgent())
  51581. var body io.Reader = nil
  51582. c.urlParams_.Set("alt", alt)
  51583. c.urlParams_.Set("prettyPrint", "false")
  51584. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset")
  51585. urls += "?" + c.urlParams_.Encode()
  51586. req, err := http.NewRequest("POST", urls, body)
  51587. if err != nil {
  51588. return nil, err
  51589. }
  51590. req.Header = reqHeaders
  51591. googleapi.Expand(req.URL, map[string]string{
  51592. "project": c.project,
  51593. "zone": c.zone,
  51594. "instance": c.instance,
  51595. })
  51596. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51597. }
  51598. // Do executes the "compute.instances.reset" call.
  51599. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51600. // status code is an error. Response headers are in either
  51601. // *Operation.ServerResponse.Header or (if a response was returned at
  51602. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51603. // to check whether the returned error was because
  51604. // http.StatusNotModified was returned.
  51605. func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51606. gensupport.SetOptions(c.urlParams_, opts...)
  51607. res, err := c.doRequest("json")
  51608. if res != nil && res.StatusCode == http.StatusNotModified {
  51609. if res.Body != nil {
  51610. res.Body.Close()
  51611. }
  51612. return nil, &googleapi.Error{
  51613. Code: res.StatusCode,
  51614. Header: res.Header,
  51615. }
  51616. }
  51617. if err != nil {
  51618. return nil, err
  51619. }
  51620. defer googleapi.CloseBody(res)
  51621. if err := googleapi.CheckResponse(res); err != nil {
  51622. return nil, err
  51623. }
  51624. ret := &Operation{
  51625. ServerResponse: googleapi.ServerResponse{
  51626. Header: res.Header,
  51627. HTTPStatusCode: res.StatusCode,
  51628. },
  51629. }
  51630. target := &ret
  51631. if err := gensupport.DecodeResponse(target, res); err != nil {
  51632. return nil, err
  51633. }
  51634. return ret, nil
  51635. // {
  51636. // "description": "Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance.",
  51637. // "httpMethod": "POST",
  51638. // "id": "compute.instances.reset",
  51639. // "parameterOrder": [
  51640. // "project",
  51641. // "zone",
  51642. // "instance"
  51643. // ],
  51644. // "parameters": {
  51645. // "instance": {
  51646. // "description": "Name of the instance scoping this request.",
  51647. // "location": "path",
  51648. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51649. // "required": true,
  51650. // "type": "string"
  51651. // },
  51652. // "project": {
  51653. // "description": "Project ID for this request.",
  51654. // "location": "path",
  51655. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51656. // "required": true,
  51657. // "type": "string"
  51658. // },
  51659. // "requestId": {
  51660. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51661. // "location": "query",
  51662. // "type": "string"
  51663. // },
  51664. // "zone": {
  51665. // "description": "The name of the zone for this request.",
  51666. // "location": "path",
  51667. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51668. // "required": true,
  51669. // "type": "string"
  51670. // }
  51671. // },
  51672. // "path": "{project}/zones/{zone}/instances/{instance}/reset",
  51673. // "response": {
  51674. // "$ref": "Operation"
  51675. // },
  51676. // "scopes": [
  51677. // "https://www.googleapis.com/auth/cloud-platform",
  51678. // "https://www.googleapis.com/auth/compute"
  51679. // ]
  51680. // }
  51681. }
  51682. // method id "compute.instances.setDeletionProtection":
  51683. type InstancesSetDeletionProtectionCall struct {
  51684. s *Service
  51685. project string
  51686. zone string
  51687. resource string
  51688. urlParams_ gensupport.URLParams
  51689. ctx_ context.Context
  51690. header_ http.Header
  51691. }
  51692. // SetDeletionProtection: Sets deletion protection on the instance.
  51693. func (r *InstancesService) SetDeletionProtection(project string, zone string, resource string) *InstancesSetDeletionProtectionCall {
  51694. c := &InstancesSetDeletionProtectionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51695. c.project = project
  51696. c.zone = zone
  51697. c.resource = resource
  51698. return c
  51699. }
  51700. // DeletionProtection sets the optional parameter "deletionProtection":
  51701. // Whether the resource should be protected against deletion.
  51702. func (c *InstancesSetDeletionProtectionCall) DeletionProtection(deletionProtection bool) *InstancesSetDeletionProtectionCall {
  51703. c.urlParams_.Set("deletionProtection", fmt.Sprint(deletionProtection))
  51704. return c
  51705. }
  51706. // RequestId sets the optional parameter "requestId": An optional
  51707. // request ID to identify requests. Specify a unique request ID so that
  51708. // if you must retry your request, the server will know to ignore the
  51709. // request if it has already been completed.
  51710. //
  51711. // For example, consider a situation where you make an initial request
  51712. // and the request times out. If you make the request again with the
  51713. // same request ID, the server can check if original operation with the
  51714. // same request ID was received, and if so, will ignore the second
  51715. // request. This prevents clients from accidentally creating duplicate
  51716. // commitments.
  51717. //
  51718. // The request ID must be a valid UUID with the exception that zero UUID
  51719. // is not supported (00000000-0000-0000-0000-000000000000).
  51720. func (c *InstancesSetDeletionProtectionCall) RequestId(requestId string) *InstancesSetDeletionProtectionCall {
  51721. c.urlParams_.Set("requestId", requestId)
  51722. return c
  51723. }
  51724. // Fields allows partial responses to be retrieved. See
  51725. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51726. // for more information.
  51727. func (c *InstancesSetDeletionProtectionCall) Fields(s ...googleapi.Field) *InstancesSetDeletionProtectionCall {
  51728. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51729. return c
  51730. }
  51731. // Context sets the context to be used in this call's Do method. Any
  51732. // pending HTTP request will be aborted if the provided context is
  51733. // canceled.
  51734. func (c *InstancesSetDeletionProtectionCall) Context(ctx context.Context) *InstancesSetDeletionProtectionCall {
  51735. c.ctx_ = ctx
  51736. return c
  51737. }
  51738. // Header returns an http.Header that can be modified by the caller to
  51739. // add HTTP headers to the request.
  51740. func (c *InstancesSetDeletionProtectionCall) Header() http.Header {
  51741. if c.header_ == nil {
  51742. c.header_ = make(http.Header)
  51743. }
  51744. return c.header_
  51745. }
  51746. func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) {
  51747. reqHeaders := make(http.Header)
  51748. for k, v := range c.header_ {
  51749. reqHeaders[k] = v
  51750. }
  51751. reqHeaders.Set("User-Agent", c.s.userAgent())
  51752. var body io.Reader = nil
  51753. c.urlParams_.Set("alt", alt)
  51754. c.urlParams_.Set("prettyPrint", "false")
  51755. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setDeletionProtection")
  51756. urls += "?" + c.urlParams_.Encode()
  51757. req, err := http.NewRequest("POST", urls, body)
  51758. if err != nil {
  51759. return nil, err
  51760. }
  51761. req.Header = reqHeaders
  51762. googleapi.Expand(req.URL, map[string]string{
  51763. "project": c.project,
  51764. "zone": c.zone,
  51765. "resource": c.resource,
  51766. })
  51767. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51768. }
  51769. // Do executes the "compute.instances.setDeletionProtection" call.
  51770. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51771. // status code is an error. Response headers are in either
  51772. // *Operation.ServerResponse.Header or (if a response was returned at
  51773. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51774. // to check whether the returned error was because
  51775. // http.StatusNotModified was returned.
  51776. func (c *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51777. gensupport.SetOptions(c.urlParams_, opts...)
  51778. res, err := c.doRequest("json")
  51779. if res != nil && res.StatusCode == http.StatusNotModified {
  51780. if res.Body != nil {
  51781. res.Body.Close()
  51782. }
  51783. return nil, &googleapi.Error{
  51784. Code: res.StatusCode,
  51785. Header: res.Header,
  51786. }
  51787. }
  51788. if err != nil {
  51789. return nil, err
  51790. }
  51791. defer googleapi.CloseBody(res)
  51792. if err := googleapi.CheckResponse(res); err != nil {
  51793. return nil, err
  51794. }
  51795. ret := &Operation{
  51796. ServerResponse: googleapi.ServerResponse{
  51797. Header: res.Header,
  51798. HTTPStatusCode: res.StatusCode,
  51799. },
  51800. }
  51801. target := &ret
  51802. if err := gensupport.DecodeResponse(target, res); err != nil {
  51803. return nil, err
  51804. }
  51805. return ret, nil
  51806. // {
  51807. // "description": "Sets deletion protection on the instance.",
  51808. // "httpMethod": "POST",
  51809. // "id": "compute.instances.setDeletionProtection",
  51810. // "parameterOrder": [
  51811. // "project",
  51812. // "zone",
  51813. // "resource"
  51814. // ],
  51815. // "parameters": {
  51816. // "deletionProtection": {
  51817. // "default": "true",
  51818. // "description": "Whether the resource should be protected against deletion.",
  51819. // "location": "query",
  51820. // "type": "boolean"
  51821. // },
  51822. // "project": {
  51823. // "description": "Project ID for this request.",
  51824. // "location": "path",
  51825. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51826. // "required": true,
  51827. // "type": "string"
  51828. // },
  51829. // "requestId": {
  51830. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51831. // "location": "query",
  51832. // "type": "string"
  51833. // },
  51834. // "resource": {
  51835. // "description": "Name or id of the resource for this request.",
  51836. // "location": "path",
  51837. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51838. // "required": true,
  51839. // "type": "string"
  51840. // },
  51841. // "zone": {
  51842. // "description": "The name of the zone for this request.",
  51843. // "location": "path",
  51844. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51845. // "required": true,
  51846. // "type": "string"
  51847. // }
  51848. // },
  51849. // "path": "{project}/zones/{zone}/instances/{resource}/setDeletionProtection",
  51850. // "response": {
  51851. // "$ref": "Operation"
  51852. // },
  51853. // "scopes": [
  51854. // "https://www.googleapis.com/auth/cloud-platform",
  51855. // "https://www.googleapis.com/auth/compute"
  51856. // ]
  51857. // }
  51858. }
  51859. // method id "compute.instances.setDiskAutoDelete":
  51860. type InstancesSetDiskAutoDeleteCall struct {
  51861. s *Service
  51862. project string
  51863. zone string
  51864. instance string
  51865. urlParams_ gensupport.URLParams
  51866. ctx_ context.Context
  51867. header_ http.Header
  51868. }
  51869. // SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to
  51870. // an instance.
  51871. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete
  51872. func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall {
  51873. c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51874. c.project = project
  51875. c.zone = zone
  51876. c.instance = instance
  51877. c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete))
  51878. c.urlParams_.Set("deviceName", deviceName)
  51879. return c
  51880. }
  51881. // RequestId sets the optional parameter "requestId": An optional
  51882. // request ID to identify requests. Specify a unique request ID so that
  51883. // if you must retry your request, the server will know to ignore the
  51884. // request if it has already been completed.
  51885. //
  51886. // For example, consider a situation where you make an initial request
  51887. // and the request times out. If you make the request again with the
  51888. // same request ID, the server can check if original operation with the
  51889. // same request ID was received, and if so, will ignore the second
  51890. // request. This prevents clients from accidentally creating duplicate
  51891. // commitments.
  51892. //
  51893. // The request ID must be a valid UUID with the exception that zero UUID
  51894. // is not supported (00000000-0000-0000-0000-000000000000).
  51895. func (c *InstancesSetDiskAutoDeleteCall) RequestId(requestId string) *InstancesSetDiskAutoDeleteCall {
  51896. c.urlParams_.Set("requestId", requestId)
  51897. return c
  51898. }
  51899. // Fields allows partial responses to be retrieved. See
  51900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51901. // for more information.
  51902. func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall {
  51903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51904. return c
  51905. }
  51906. // Context sets the context to be used in this call's Do method. Any
  51907. // pending HTTP request will be aborted if the provided context is
  51908. // canceled.
  51909. func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall {
  51910. c.ctx_ = ctx
  51911. return c
  51912. }
  51913. // Header returns an http.Header that can be modified by the caller to
  51914. // add HTTP headers to the request.
  51915. func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header {
  51916. if c.header_ == nil {
  51917. c.header_ = make(http.Header)
  51918. }
  51919. return c.header_
  51920. }
  51921. func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) {
  51922. reqHeaders := make(http.Header)
  51923. for k, v := range c.header_ {
  51924. reqHeaders[k] = v
  51925. }
  51926. reqHeaders.Set("User-Agent", c.s.userAgent())
  51927. var body io.Reader = nil
  51928. c.urlParams_.Set("alt", alt)
  51929. c.urlParams_.Set("prettyPrint", "false")
  51930. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")
  51931. urls += "?" + c.urlParams_.Encode()
  51932. req, err := http.NewRequest("POST", urls, body)
  51933. if err != nil {
  51934. return nil, err
  51935. }
  51936. req.Header = reqHeaders
  51937. googleapi.Expand(req.URL, map[string]string{
  51938. "project": c.project,
  51939. "zone": c.zone,
  51940. "instance": c.instance,
  51941. })
  51942. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51943. }
  51944. // Do executes the "compute.instances.setDiskAutoDelete" call.
  51945. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51946. // status code is an error. Response headers are in either
  51947. // *Operation.ServerResponse.Header or (if a response was returned at
  51948. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51949. // to check whether the returned error was because
  51950. // http.StatusNotModified was returned.
  51951. func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51952. gensupport.SetOptions(c.urlParams_, opts...)
  51953. res, err := c.doRequest("json")
  51954. if res != nil && res.StatusCode == http.StatusNotModified {
  51955. if res.Body != nil {
  51956. res.Body.Close()
  51957. }
  51958. return nil, &googleapi.Error{
  51959. Code: res.StatusCode,
  51960. Header: res.Header,
  51961. }
  51962. }
  51963. if err != nil {
  51964. return nil, err
  51965. }
  51966. defer googleapi.CloseBody(res)
  51967. if err := googleapi.CheckResponse(res); err != nil {
  51968. return nil, err
  51969. }
  51970. ret := &Operation{
  51971. ServerResponse: googleapi.ServerResponse{
  51972. Header: res.Header,
  51973. HTTPStatusCode: res.StatusCode,
  51974. },
  51975. }
  51976. target := &ret
  51977. if err := gensupport.DecodeResponse(target, res); err != nil {
  51978. return nil, err
  51979. }
  51980. return ret, nil
  51981. // {
  51982. // "description": "Sets the auto-delete flag for a disk attached to an instance.",
  51983. // "httpMethod": "POST",
  51984. // "id": "compute.instances.setDiskAutoDelete",
  51985. // "parameterOrder": [
  51986. // "project",
  51987. // "zone",
  51988. // "instance",
  51989. // "autoDelete",
  51990. // "deviceName"
  51991. // ],
  51992. // "parameters": {
  51993. // "autoDelete": {
  51994. // "description": "Whether to auto-delete the disk when the instance is deleted.",
  51995. // "location": "query",
  51996. // "required": true,
  51997. // "type": "boolean"
  51998. // },
  51999. // "deviceName": {
  52000. // "description": "The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names.",
  52001. // "location": "query",
  52002. // "pattern": "\\w[\\w.-]{0,254}",
  52003. // "required": true,
  52004. // "type": "string"
  52005. // },
  52006. // "instance": {
  52007. // "description": "The instance name for this request.",
  52008. // "location": "path",
  52009. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52010. // "required": true,
  52011. // "type": "string"
  52012. // },
  52013. // "project": {
  52014. // "description": "Project ID for this request.",
  52015. // "location": "path",
  52016. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52017. // "required": true,
  52018. // "type": "string"
  52019. // },
  52020. // "requestId": {
  52021. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52022. // "location": "query",
  52023. // "type": "string"
  52024. // },
  52025. // "zone": {
  52026. // "description": "The name of the zone for this request.",
  52027. // "location": "path",
  52028. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52029. // "required": true,
  52030. // "type": "string"
  52031. // }
  52032. // },
  52033. // "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
  52034. // "response": {
  52035. // "$ref": "Operation"
  52036. // },
  52037. // "scopes": [
  52038. // "https://www.googleapis.com/auth/cloud-platform",
  52039. // "https://www.googleapis.com/auth/compute"
  52040. // ]
  52041. // }
  52042. }
  52043. // method id "compute.instances.setIamPolicy":
  52044. type InstancesSetIamPolicyCall struct {
  52045. s *Service
  52046. project string
  52047. zone string
  52048. resource string
  52049. zonesetpolicyrequest *ZoneSetPolicyRequest
  52050. urlParams_ gensupport.URLParams
  52051. ctx_ context.Context
  52052. header_ http.Header
  52053. }
  52054. // SetIamPolicy: Sets the access control policy on the specified
  52055. // resource. Replaces any existing policy.
  52056. func (r *InstancesService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *InstancesSetIamPolicyCall {
  52057. c := &InstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52058. c.project = project
  52059. c.zone = zone
  52060. c.resource = resource
  52061. c.zonesetpolicyrequest = zonesetpolicyrequest
  52062. return c
  52063. }
  52064. // Fields allows partial responses to be retrieved. See
  52065. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52066. // for more information.
  52067. func (c *InstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesSetIamPolicyCall {
  52068. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52069. return c
  52070. }
  52071. // Context sets the context to be used in this call's Do method. Any
  52072. // pending HTTP request will be aborted if the provided context is
  52073. // canceled.
  52074. func (c *InstancesSetIamPolicyCall) Context(ctx context.Context) *InstancesSetIamPolicyCall {
  52075. c.ctx_ = ctx
  52076. return c
  52077. }
  52078. // Header returns an http.Header that can be modified by the caller to
  52079. // add HTTP headers to the request.
  52080. func (c *InstancesSetIamPolicyCall) Header() http.Header {
  52081. if c.header_ == nil {
  52082. c.header_ = make(http.Header)
  52083. }
  52084. return c.header_
  52085. }
  52086. func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  52087. reqHeaders := make(http.Header)
  52088. for k, v := range c.header_ {
  52089. reqHeaders[k] = v
  52090. }
  52091. reqHeaders.Set("User-Agent", c.s.userAgent())
  52092. var body io.Reader = nil
  52093. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  52094. if err != nil {
  52095. return nil, err
  52096. }
  52097. reqHeaders.Set("Content-Type", "application/json")
  52098. c.urlParams_.Set("alt", alt)
  52099. c.urlParams_.Set("prettyPrint", "false")
  52100. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setIamPolicy")
  52101. urls += "?" + c.urlParams_.Encode()
  52102. req, err := http.NewRequest("POST", urls, body)
  52103. if err != nil {
  52104. return nil, err
  52105. }
  52106. req.Header = reqHeaders
  52107. googleapi.Expand(req.URL, map[string]string{
  52108. "project": c.project,
  52109. "zone": c.zone,
  52110. "resource": c.resource,
  52111. })
  52112. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52113. }
  52114. // Do executes the "compute.instances.setIamPolicy" call.
  52115. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  52116. // code is an error. Response headers are in either
  52117. // *Policy.ServerResponse.Header or (if a response was returned at all)
  52118. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  52119. // check whether the returned error was because http.StatusNotModified
  52120. // was returned.
  52121. func (c *InstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  52122. gensupport.SetOptions(c.urlParams_, opts...)
  52123. res, err := c.doRequest("json")
  52124. if res != nil && res.StatusCode == http.StatusNotModified {
  52125. if res.Body != nil {
  52126. res.Body.Close()
  52127. }
  52128. return nil, &googleapi.Error{
  52129. Code: res.StatusCode,
  52130. Header: res.Header,
  52131. }
  52132. }
  52133. if err != nil {
  52134. return nil, err
  52135. }
  52136. defer googleapi.CloseBody(res)
  52137. if err := googleapi.CheckResponse(res); err != nil {
  52138. return nil, err
  52139. }
  52140. ret := &Policy{
  52141. ServerResponse: googleapi.ServerResponse{
  52142. Header: res.Header,
  52143. HTTPStatusCode: res.StatusCode,
  52144. },
  52145. }
  52146. target := &ret
  52147. if err := gensupport.DecodeResponse(target, res); err != nil {
  52148. return nil, err
  52149. }
  52150. return ret, nil
  52151. // {
  52152. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  52153. // "httpMethod": "POST",
  52154. // "id": "compute.instances.setIamPolicy",
  52155. // "parameterOrder": [
  52156. // "project",
  52157. // "zone",
  52158. // "resource"
  52159. // ],
  52160. // "parameters": {
  52161. // "project": {
  52162. // "description": "Project ID for this request.",
  52163. // "location": "path",
  52164. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52165. // "required": true,
  52166. // "type": "string"
  52167. // },
  52168. // "resource": {
  52169. // "description": "Name or id of the resource for this request.",
  52170. // "location": "path",
  52171. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52172. // "required": true,
  52173. // "type": "string"
  52174. // },
  52175. // "zone": {
  52176. // "description": "The name of the zone for this request.",
  52177. // "location": "path",
  52178. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52179. // "required": true,
  52180. // "type": "string"
  52181. // }
  52182. // },
  52183. // "path": "{project}/zones/{zone}/instances/{resource}/setIamPolicy",
  52184. // "request": {
  52185. // "$ref": "ZoneSetPolicyRequest"
  52186. // },
  52187. // "response": {
  52188. // "$ref": "Policy"
  52189. // },
  52190. // "scopes": [
  52191. // "https://www.googleapis.com/auth/cloud-platform",
  52192. // "https://www.googleapis.com/auth/compute"
  52193. // ]
  52194. // }
  52195. }
  52196. // method id "compute.instances.setLabels":
  52197. type InstancesSetLabelsCall struct {
  52198. s *Service
  52199. project string
  52200. zone string
  52201. instance string
  52202. instancessetlabelsrequest *InstancesSetLabelsRequest
  52203. urlParams_ gensupport.URLParams
  52204. ctx_ context.Context
  52205. header_ http.Header
  52206. }
  52207. // SetLabels: Sets labels on an instance. To learn more about labels,
  52208. // read the Labeling Resources documentation.
  52209. func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall {
  52210. c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52211. c.project = project
  52212. c.zone = zone
  52213. c.instance = instance
  52214. c.instancessetlabelsrequest = instancessetlabelsrequest
  52215. return c
  52216. }
  52217. // RequestId sets the optional parameter "requestId": An optional
  52218. // request ID to identify requests. Specify a unique request ID so that
  52219. // if you must retry your request, the server will know to ignore the
  52220. // request if it has already been completed.
  52221. //
  52222. // For example, consider a situation where you make an initial request
  52223. // and the request times out. If you make the request again with the
  52224. // same request ID, the server can check if original operation with the
  52225. // same request ID was received, and if so, will ignore the second
  52226. // request. This prevents clients from accidentally creating duplicate
  52227. // commitments.
  52228. //
  52229. // The request ID must be a valid UUID with the exception that zero UUID
  52230. // is not supported (00000000-0000-0000-0000-000000000000).
  52231. func (c *InstancesSetLabelsCall) RequestId(requestId string) *InstancesSetLabelsCall {
  52232. c.urlParams_.Set("requestId", requestId)
  52233. return c
  52234. }
  52235. // Fields allows partial responses to be retrieved. See
  52236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52237. // for more information.
  52238. func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall {
  52239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52240. return c
  52241. }
  52242. // Context sets the context to be used in this call's Do method. Any
  52243. // pending HTTP request will be aborted if the provided context is
  52244. // canceled.
  52245. func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall {
  52246. c.ctx_ = ctx
  52247. return c
  52248. }
  52249. // Header returns an http.Header that can be modified by the caller to
  52250. // add HTTP headers to the request.
  52251. func (c *InstancesSetLabelsCall) Header() http.Header {
  52252. if c.header_ == nil {
  52253. c.header_ = make(http.Header)
  52254. }
  52255. return c.header_
  52256. }
  52257. func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  52258. reqHeaders := make(http.Header)
  52259. for k, v := range c.header_ {
  52260. reqHeaders[k] = v
  52261. }
  52262. reqHeaders.Set("User-Agent", c.s.userAgent())
  52263. var body io.Reader = nil
  52264. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest)
  52265. if err != nil {
  52266. return nil, err
  52267. }
  52268. reqHeaders.Set("Content-Type", "application/json")
  52269. c.urlParams_.Set("alt", alt)
  52270. c.urlParams_.Set("prettyPrint", "false")
  52271. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setLabels")
  52272. urls += "?" + c.urlParams_.Encode()
  52273. req, err := http.NewRequest("POST", urls, body)
  52274. if err != nil {
  52275. return nil, err
  52276. }
  52277. req.Header = reqHeaders
  52278. googleapi.Expand(req.URL, map[string]string{
  52279. "project": c.project,
  52280. "zone": c.zone,
  52281. "instance": c.instance,
  52282. })
  52283. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52284. }
  52285. // Do executes the "compute.instances.setLabels" call.
  52286. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52287. // status code is an error. Response headers are in either
  52288. // *Operation.ServerResponse.Header or (if a response was returned at
  52289. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52290. // to check whether the returned error was because
  52291. // http.StatusNotModified was returned.
  52292. func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52293. gensupport.SetOptions(c.urlParams_, opts...)
  52294. res, err := c.doRequest("json")
  52295. if res != nil && res.StatusCode == http.StatusNotModified {
  52296. if res.Body != nil {
  52297. res.Body.Close()
  52298. }
  52299. return nil, &googleapi.Error{
  52300. Code: res.StatusCode,
  52301. Header: res.Header,
  52302. }
  52303. }
  52304. if err != nil {
  52305. return nil, err
  52306. }
  52307. defer googleapi.CloseBody(res)
  52308. if err := googleapi.CheckResponse(res); err != nil {
  52309. return nil, err
  52310. }
  52311. ret := &Operation{
  52312. ServerResponse: googleapi.ServerResponse{
  52313. Header: res.Header,
  52314. HTTPStatusCode: res.StatusCode,
  52315. },
  52316. }
  52317. target := &ret
  52318. if err := gensupport.DecodeResponse(target, res); err != nil {
  52319. return nil, err
  52320. }
  52321. return ret, nil
  52322. // {
  52323. // "description": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.",
  52324. // "httpMethod": "POST",
  52325. // "id": "compute.instances.setLabels",
  52326. // "parameterOrder": [
  52327. // "project",
  52328. // "zone",
  52329. // "instance"
  52330. // ],
  52331. // "parameters": {
  52332. // "instance": {
  52333. // "description": "Name of the instance scoping this request.",
  52334. // "location": "path",
  52335. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52336. // "required": true,
  52337. // "type": "string"
  52338. // },
  52339. // "project": {
  52340. // "description": "Project ID for this request.",
  52341. // "location": "path",
  52342. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52343. // "required": true,
  52344. // "type": "string"
  52345. // },
  52346. // "requestId": {
  52347. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52348. // "location": "query",
  52349. // "type": "string"
  52350. // },
  52351. // "zone": {
  52352. // "description": "The name of the zone for this request.",
  52353. // "location": "path",
  52354. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52355. // "required": true,
  52356. // "type": "string"
  52357. // }
  52358. // },
  52359. // "path": "{project}/zones/{zone}/instances/{instance}/setLabels",
  52360. // "request": {
  52361. // "$ref": "InstancesSetLabelsRequest"
  52362. // },
  52363. // "response": {
  52364. // "$ref": "Operation"
  52365. // },
  52366. // "scopes": [
  52367. // "https://www.googleapis.com/auth/cloud-platform",
  52368. // "https://www.googleapis.com/auth/compute"
  52369. // ]
  52370. // }
  52371. }
  52372. // method id "compute.instances.setMachineResources":
  52373. type InstancesSetMachineResourcesCall struct {
  52374. s *Service
  52375. project string
  52376. zone string
  52377. instance string
  52378. instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest
  52379. urlParams_ gensupport.URLParams
  52380. ctx_ context.Context
  52381. header_ http.Header
  52382. }
  52383. // SetMachineResources: Changes the number and/or type of accelerator
  52384. // for a stopped instance to the values specified in the request.
  52385. func (r *InstancesService) SetMachineResources(project string, zone string, instance string, instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest) *InstancesSetMachineResourcesCall {
  52386. c := &InstancesSetMachineResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52387. c.project = project
  52388. c.zone = zone
  52389. c.instance = instance
  52390. c.instancessetmachineresourcesrequest = instancessetmachineresourcesrequest
  52391. return c
  52392. }
  52393. // RequestId sets the optional parameter "requestId": An optional
  52394. // request ID to identify requests. Specify a unique request ID so that
  52395. // if you must retry your request, the server will know to ignore the
  52396. // request if it has already been completed.
  52397. //
  52398. // For example, consider a situation where you make an initial request
  52399. // and the request times out. If you make the request again with the
  52400. // same request ID, the server can check if original operation with the
  52401. // same request ID was received, and if so, will ignore the second
  52402. // request. This prevents clients from accidentally creating duplicate
  52403. // commitments.
  52404. //
  52405. // The request ID must be a valid UUID with the exception that zero UUID
  52406. // is not supported (00000000-0000-0000-0000-000000000000).
  52407. func (c *InstancesSetMachineResourcesCall) RequestId(requestId string) *InstancesSetMachineResourcesCall {
  52408. c.urlParams_.Set("requestId", requestId)
  52409. return c
  52410. }
  52411. // Fields allows partial responses to be retrieved. See
  52412. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52413. // for more information.
  52414. func (c *InstancesSetMachineResourcesCall) Fields(s ...googleapi.Field) *InstancesSetMachineResourcesCall {
  52415. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52416. return c
  52417. }
  52418. // Context sets the context to be used in this call's Do method. Any
  52419. // pending HTTP request will be aborted if the provided context is
  52420. // canceled.
  52421. func (c *InstancesSetMachineResourcesCall) Context(ctx context.Context) *InstancesSetMachineResourcesCall {
  52422. c.ctx_ = ctx
  52423. return c
  52424. }
  52425. // Header returns an http.Header that can be modified by the caller to
  52426. // add HTTP headers to the request.
  52427. func (c *InstancesSetMachineResourcesCall) Header() http.Header {
  52428. if c.header_ == nil {
  52429. c.header_ = make(http.Header)
  52430. }
  52431. return c.header_
  52432. }
  52433. func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) {
  52434. reqHeaders := make(http.Header)
  52435. for k, v := range c.header_ {
  52436. reqHeaders[k] = v
  52437. }
  52438. reqHeaders.Set("User-Agent", c.s.userAgent())
  52439. var body io.Reader = nil
  52440. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest)
  52441. if err != nil {
  52442. return nil, err
  52443. }
  52444. reqHeaders.Set("Content-Type", "application/json")
  52445. c.urlParams_.Set("alt", alt)
  52446. c.urlParams_.Set("prettyPrint", "false")
  52447. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineResources")
  52448. urls += "?" + c.urlParams_.Encode()
  52449. req, err := http.NewRequest("POST", urls, body)
  52450. if err != nil {
  52451. return nil, err
  52452. }
  52453. req.Header = reqHeaders
  52454. googleapi.Expand(req.URL, map[string]string{
  52455. "project": c.project,
  52456. "zone": c.zone,
  52457. "instance": c.instance,
  52458. })
  52459. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52460. }
  52461. // Do executes the "compute.instances.setMachineResources" call.
  52462. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52463. // status code is an error. Response headers are in either
  52464. // *Operation.ServerResponse.Header or (if a response was returned at
  52465. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52466. // to check whether the returned error was because
  52467. // http.StatusNotModified was returned.
  52468. func (c *InstancesSetMachineResourcesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52469. gensupport.SetOptions(c.urlParams_, opts...)
  52470. res, err := c.doRequest("json")
  52471. if res != nil && res.StatusCode == http.StatusNotModified {
  52472. if res.Body != nil {
  52473. res.Body.Close()
  52474. }
  52475. return nil, &googleapi.Error{
  52476. Code: res.StatusCode,
  52477. Header: res.Header,
  52478. }
  52479. }
  52480. if err != nil {
  52481. return nil, err
  52482. }
  52483. defer googleapi.CloseBody(res)
  52484. if err := googleapi.CheckResponse(res); err != nil {
  52485. return nil, err
  52486. }
  52487. ret := &Operation{
  52488. ServerResponse: googleapi.ServerResponse{
  52489. Header: res.Header,
  52490. HTTPStatusCode: res.StatusCode,
  52491. },
  52492. }
  52493. target := &ret
  52494. if err := gensupport.DecodeResponse(target, res); err != nil {
  52495. return nil, err
  52496. }
  52497. return ret, nil
  52498. // {
  52499. // "description": "Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.",
  52500. // "httpMethod": "POST",
  52501. // "id": "compute.instances.setMachineResources",
  52502. // "parameterOrder": [
  52503. // "project",
  52504. // "zone",
  52505. // "instance"
  52506. // ],
  52507. // "parameters": {
  52508. // "instance": {
  52509. // "description": "Name of the instance scoping this request.",
  52510. // "location": "path",
  52511. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52512. // "required": true,
  52513. // "type": "string"
  52514. // },
  52515. // "project": {
  52516. // "description": "Project ID for this request.",
  52517. // "location": "path",
  52518. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52519. // "required": true,
  52520. // "type": "string"
  52521. // },
  52522. // "requestId": {
  52523. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52524. // "location": "query",
  52525. // "type": "string"
  52526. // },
  52527. // "zone": {
  52528. // "description": "The name of the zone for this request.",
  52529. // "location": "path",
  52530. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52531. // "required": true,
  52532. // "type": "string"
  52533. // }
  52534. // },
  52535. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineResources",
  52536. // "request": {
  52537. // "$ref": "InstancesSetMachineResourcesRequest"
  52538. // },
  52539. // "response": {
  52540. // "$ref": "Operation"
  52541. // },
  52542. // "scopes": [
  52543. // "https://www.googleapis.com/auth/cloud-platform",
  52544. // "https://www.googleapis.com/auth/compute"
  52545. // ]
  52546. // }
  52547. }
  52548. // method id "compute.instances.setMachineType":
  52549. type InstancesSetMachineTypeCall struct {
  52550. s *Service
  52551. project string
  52552. zone string
  52553. instance string
  52554. instancessetmachinetyperequest *InstancesSetMachineTypeRequest
  52555. urlParams_ gensupport.URLParams
  52556. ctx_ context.Context
  52557. header_ http.Header
  52558. }
  52559. // SetMachineType: Changes the machine type for a stopped instance to
  52560. // the machine type specified in the request.
  52561. func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall {
  52562. c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52563. c.project = project
  52564. c.zone = zone
  52565. c.instance = instance
  52566. c.instancessetmachinetyperequest = instancessetmachinetyperequest
  52567. return c
  52568. }
  52569. // RequestId sets the optional parameter "requestId": An optional
  52570. // request ID to identify requests. Specify a unique request ID so that
  52571. // if you must retry your request, the server will know to ignore the
  52572. // request if it has already been completed.
  52573. //
  52574. // For example, consider a situation where you make an initial request
  52575. // and the request times out. If you make the request again with the
  52576. // same request ID, the server can check if original operation with the
  52577. // same request ID was received, and if so, will ignore the second
  52578. // request. This prevents clients from accidentally creating duplicate
  52579. // commitments.
  52580. //
  52581. // The request ID must be a valid UUID with the exception that zero UUID
  52582. // is not supported (00000000-0000-0000-0000-000000000000).
  52583. func (c *InstancesSetMachineTypeCall) RequestId(requestId string) *InstancesSetMachineTypeCall {
  52584. c.urlParams_.Set("requestId", requestId)
  52585. return c
  52586. }
  52587. // Fields allows partial responses to be retrieved. See
  52588. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52589. // for more information.
  52590. func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall {
  52591. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52592. return c
  52593. }
  52594. // Context sets the context to be used in this call's Do method. Any
  52595. // pending HTTP request will be aborted if the provided context is
  52596. // canceled.
  52597. func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall {
  52598. c.ctx_ = ctx
  52599. return c
  52600. }
  52601. // Header returns an http.Header that can be modified by the caller to
  52602. // add HTTP headers to the request.
  52603. func (c *InstancesSetMachineTypeCall) Header() http.Header {
  52604. if c.header_ == nil {
  52605. c.header_ = make(http.Header)
  52606. }
  52607. return c.header_
  52608. }
  52609. func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) {
  52610. reqHeaders := make(http.Header)
  52611. for k, v := range c.header_ {
  52612. reqHeaders[k] = v
  52613. }
  52614. reqHeaders.Set("User-Agent", c.s.userAgent())
  52615. var body io.Reader = nil
  52616. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest)
  52617. if err != nil {
  52618. return nil, err
  52619. }
  52620. reqHeaders.Set("Content-Type", "application/json")
  52621. c.urlParams_.Set("alt", alt)
  52622. c.urlParams_.Set("prettyPrint", "false")
  52623. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType")
  52624. urls += "?" + c.urlParams_.Encode()
  52625. req, err := http.NewRequest("POST", urls, body)
  52626. if err != nil {
  52627. return nil, err
  52628. }
  52629. req.Header = reqHeaders
  52630. googleapi.Expand(req.URL, map[string]string{
  52631. "project": c.project,
  52632. "zone": c.zone,
  52633. "instance": c.instance,
  52634. })
  52635. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52636. }
  52637. // Do executes the "compute.instances.setMachineType" call.
  52638. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52639. // status code is an error. Response headers are in either
  52640. // *Operation.ServerResponse.Header or (if a response was returned at
  52641. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52642. // to check whether the returned error was because
  52643. // http.StatusNotModified was returned.
  52644. func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52645. gensupport.SetOptions(c.urlParams_, opts...)
  52646. res, err := c.doRequest("json")
  52647. if res != nil && res.StatusCode == http.StatusNotModified {
  52648. if res.Body != nil {
  52649. res.Body.Close()
  52650. }
  52651. return nil, &googleapi.Error{
  52652. Code: res.StatusCode,
  52653. Header: res.Header,
  52654. }
  52655. }
  52656. if err != nil {
  52657. return nil, err
  52658. }
  52659. defer googleapi.CloseBody(res)
  52660. if err := googleapi.CheckResponse(res); err != nil {
  52661. return nil, err
  52662. }
  52663. ret := &Operation{
  52664. ServerResponse: googleapi.ServerResponse{
  52665. Header: res.Header,
  52666. HTTPStatusCode: res.StatusCode,
  52667. },
  52668. }
  52669. target := &ret
  52670. if err := gensupport.DecodeResponse(target, res); err != nil {
  52671. return nil, err
  52672. }
  52673. return ret, nil
  52674. // {
  52675. // "description": "Changes the machine type for a stopped instance to the machine type specified in the request.",
  52676. // "httpMethod": "POST",
  52677. // "id": "compute.instances.setMachineType",
  52678. // "parameterOrder": [
  52679. // "project",
  52680. // "zone",
  52681. // "instance"
  52682. // ],
  52683. // "parameters": {
  52684. // "instance": {
  52685. // "description": "Name of the instance scoping this request.",
  52686. // "location": "path",
  52687. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52688. // "required": true,
  52689. // "type": "string"
  52690. // },
  52691. // "project": {
  52692. // "description": "Project ID for this request.",
  52693. // "location": "path",
  52694. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52695. // "required": true,
  52696. // "type": "string"
  52697. // },
  52698. // "requestId": {
  52699. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52700. // "location": "query",
  52701. // "type": "string"
  52702. // },
  52703. // "zone": {
  52704. // "description": "The name of the zone for this request.",
  52705. // "location": "path",
  52706. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52707. // "required": true,
  52708. // "type": "string"
  52709. // }
  52710. // },
  52711. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineType",
  52712. // "request": {
  52713. // "$ref": "InstancesSetMachineTypeRequest"
  52714. // },
  52715. // "response": {
  52716. // "$ref": "Operation"
  52717. // },
  52718. // "scopes": [
  52719. // "https://www.googleapis.com/auth/cloud-platform",
  52720. // "https://www.googleapis.com/auth/compute"
  52721. // ]
  52722. // }
  52723. }
  52724. // method id "compute.instances.setMetadata":
  52725. type InstancesSetMetadataCall struct {
  52726. s *Service
  52727. project string
  52728. zone string
  52729. instance string
  52730. metadata *Metadata
  52731. urlParams_ gensupport.URLParams
  52732. ctx_ context.Context
  52733. header_ http.Header
  52734. }
  52735. // SetMetadata: Sets metadata for the specified instance to the data
  52736. // included in the request.
  52737. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata
  52738. func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall {
  52739. c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52740. c.project = project
  52741. c.zone = zone
  52742. c.instance = instance
  52743. c.metadata = metadata
  52744. return c
  52745. }
  52746. // RequestId sets the optional parameter "requestId": An optional
  52747. // request ID to identify requests. Specify a unique request ID so that
  52748. // if you must retry your request, the server will know to ignore the
  52749. // request if it has already been completed.
  52750. //
  52751. // For example, consider a situation where you make an initial request
  52752. // and the request times out. If you make the request again with the
  52753. // same request ID, the server can check if original operation with the
  52754. // same request ID was received, and if so, will ignore the second
  52755. // request. This prevents clients from accidentally creating duplicate
  52756. // commitments.
  52757. //
  52758. // The request ID must be a valid UUID with the exception that zero UUID
  52759. // is not supported (00000000-0000-0000-0000-000000000000).
  52760. func (c *InstancesSetMetadataCall) RequestId(requestId string) *InstancesSetMetadataCall {
  52761. c.urlParams_.Set("requestId", requestId)
  52762. return c
  52763. }
  52764. // Fields allows partial responses to be retrieved. See
  52765. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52766. // for more information.
  52767. func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall {
  52768. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52769. return c
  52770. }
  52771. // Context sets the context to be used in this call's Do method. Any
  52772. // pending HTTP request will be aborted if the provided context is
  52773. // canceled.
  52774. func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall {
  52775. c.ctx_ = ctx
  52776. return c
  52777. }
  52778. // Header returns an http.Header that can be modified by the caller to
  52779. // add HTTP headers to the request.
  52780. func (c *InstancesSetMetadataCall) Header() http.Header {
  52781. if c.header_ == nil {
  52782. c.header_ = make(http.Header)
  52783. }
  52784. return c.header_
  52785. }
  52786. func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) {
  52787. reqHeaders := make(http.Header)
  52788. for k, v := range c.header_ {
  52789. reqHeaders[k] = v
  52790. }
  52791. reqHeaders.Set("User-Agent", c.s.userAgent())
  52792. var body io.Reader = nil
  52793. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  52794. if err != nil {
  52795. return nil, err
  52796. }
  52797. reqHeaders.Set("Content-Type", "application/json")
  52798. c.urlParams_.Set("alt", alt)
  52799. c.urlParams_.Set("prettyPrint", "false")
  52800. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata")
  52801. urls += "?" + c.urlParams_.Encode()
  52802. req, err := http.NewRequest("POST", urls, body)
  52803. if err != nil {
  52804. return nil, err
  52805. }
  52806. req.Header = reqHeaders
  52807. googleapi.Expand(req.URL, map[string]string{
  52808. "project": c.project,
  52809. "zone": c.zone,
  52810. "instance": c.instance,
  52811. })
  52812. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52813. }
  52814. // Do executes the "compute.instances.setMetadata" call.
  52815. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52816. // status code is an error. Response headers are in either
  52817. // *Operation.ServerResponse.Header or (if a response was returned at
  52818. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52819. // to check whether the returned error was because
  52820. // http.StatusNotModified was returned.
  52821. func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52822. gensupport.SetOptions(c.urlParams_, opts...)
  52823. res, err := c.doRequest("json")
  52824. if res != nil && res.StatusCode == http.StatusNotModified {
  52825. if res.Body != nil {
  52826. res.Body.Close()
  52827. }
  52828. return nil, &googleapi.Error{
  52829. Code: res.StatusCode,
  52830. Header: res.Header,
  52831. }
  52832. }
  52833. if err != nil {
  52834. return nil, err
  52835. }
  52836. defer googleapi.CloseBody(res)
  52837. if err := googleapi.CheckResponse(res); err != nil {
  52838. return nil, err
  52839. }
  52840. ret := &Operation{
  52841. ServerResponse: googleapi.ServerResponse{
  52842. Header: res.Header,
  52843. HTTPStatusCode: res.StatusCode,
  52844. },
  52845. }
  52846. target := &ret
  52847. if err := gensupport.DecodeResponse(target, res); err != nil {
  52848. return nil, err
  52849. }
  52850. return ret, nil
  52851. // {
  52852. // "description": "Sets metadata for the specified instance to the data included in the request.",
  52853. // "httpMethod": "POST",
  52854. // "id": "compute.instances.setMetadata",
  52855. // "parameterOrder": [
  52856. // "project",
  52857. // "zone",
  52858. // "instance"
  52859. // ],
  52860. // "parameters": {
  52861. // "instance": {
  52862. // "description": "Name of the instance scoping this request.",
  52863. // "location": "path",
  52864. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52865. // "required": true,
  52866. // "type": "string"
  52867. // },
  52868. // "project": {
  52869. // "description": "Project ID for this request.",
  52870. // "location": "path",
  52871. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52872. // "required": true,
  52873. // "type": "string"
  52874. // },
  52875. // "requestId": {
  52876. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52877. // "location": "query",
  52878. // "type": "string"
  52879. // },
  52880. // "zone": {
  52881. // "description": "The name of the zone for this request.",
  52882. // "location": "path",
  52883. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52884. // "required": true,
  52885. // "type": "string"
  52886. // }
  52887. // },
  52888. // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata",
  52889. // "request": {
  52890. // "$ref": "Metadata"
  52891. // },
  52892. // "response": {
  52893. // "$ref": "Operation"
  52894. // },
  52895. // "scopes": [
  52896. // "https://www.googleapis.com/auth/cloud-platform",
  52897. // "https://www.googleapis.com/auth/compute"
  52898. // ]
  52899. // }
  52900. }
  52901. // method id "compute.instances.setMinCpuPlatform":
  52902. type InstancesSetMinCpuPlatformCall struct {
  52903. s *Service
  52904. project string
  52905. zone string
  52906. instance string
  52907. instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest
  52908. urlParams_ gensupport.URLParams
  52909. ctx_ context.Context
  52910. header_ http.Header
  52911. }
  52912. // SetMinCpuPlatform: Changes the minimum CPU platform that this
  52913. // instance should use. This method can only be called on a stopped
  52914. // instance. For more information, read Specifying a Minimum CPU
  52915. // Platform.
  52916. func (r *InstancesService) SetMinCpuPlatform(project string, zone string, instance string, instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest) *InstancesSetMinCpuPlatformCall {
  52917. c := &InstancesSetMinCpuPlatformCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52918. c.project = project
  52919. c.zone = zone
  52920. c.instance = instance
  52921. c.instancessetmincpuplatformrequest = instancessetmincpuplatformrequest
  52922. return c
  52923. }
  52924. // RequestId sets the optional parameter "requestId": An optional
  52925. // request ID to identify requests. Specify a unique request ID so that
  52926. // if you must retry your request, the server will know to ignore the
  52927. // request if it has already been completed.
  52928. //
  52929. // For example, consider a situation where you make an initial request
  52930. // and the request times out. If you make the request again with the
  52931. // same request ID, the server can check if original operation with the
  52932. // same request ID was received, and if so, will ignore the second
  52933. // request. This prevents clients from accidentally creating duplicate
  52934. // commitments.
  52935. //
  52936. // The request ID must be a valid UUID with the exception that zero UUID
  52937. // is not supported (00000000-0000-0000-0000-000000000000).
  52938. func (c *InstancesSetMinCpuPlatformCall) RequestId(requestId string) *InstancesSetMinCpuPlatformCall {
  52939. c.urlParams_.Set("requestId", requestId)
  52940. return c
  52941. }
  52942. // Fields allows partial responses to be retrieved. See
  52943. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52944. // for more information.
  52945. func (c *InstancesSetMinCpuPlatformCall) Fields(s ...googleapi.Field) *InstancesSetMinCpuPlatformCall {
  52946. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52947. return c
  52948. }
  52949. // Context sets the context to be used in this call's Do method. Any
  52950. // pending HTTP request will be aborted if the provided context is
  52951. // canceled.
  52952. func (c *InstancesSetMinCpuPlatformCall) Context(ctx context.Context) *InstancesSetMinCpuPlatformCall {
  52953. c.ctx_ = ctx
  52954. return c
  52955. }
  52956. // Header returns an http.Header that can be modified by the caller to
  52957. // add HTTP headers to the request.
  52958. func (c *InstancesSetMinCpuPlatformCall) Header() http.Header {
  52959. if c.header_ == nil {
  52960. c.header_ = make(http.Header)
  52961. }
  52962. return c.header_
  52963. }
  52964. func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) {
  52965. reqHeaders := make(http.Header)
  52966. for k, v := range c.header_ {
  52967. reqHeaders[k] = v
  52968. }
  52969. reqHeaders.Set("User-Agent", c.s.userAgent())
  52970. var body io.Reader = nil
  52971. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest)
  52972. if err != nil {
  52973. return nil, err
  52974. }
  52975. reqHeaders.Set("Content-Type", "application/json")
  52976. c.urlParams_.Set("alt", alt)
  52977. c.urlParams_.Set("prettyPrint", "false")
  52978. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")
  52979. urls += "?" + c.urlParams_.Encode()
  52980. req, err := http.NewRequest("POST", urls, body)
  52981. if err != nil {
  52982. return nil, err
  52983. }
  52984. req.Header = reqHeaders
  52985. googleapi.Expand(req.URL, map[string]string{
  52986. "project": c.project,
  52987. "zone": c.zone,
  52988. "instance": c.instance,
  52989. })
  52990. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52991. }
  52992. // Do executes the "compute.instances.setMinCpuPlatform" call.
  52993. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52994. // status code is an error. Response headers are in either
  52995. // *Operation.ServerResponse.Header or (if a response was returned at
  52996. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52997. // to check whether the returned error was because
  52998. // http.StatusNotModified was returned.
  52999. func (c *InstancesSetMinCpuPlatformCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53000. gensupport.SetOptions(c.urlParams_, opts...)
  53001. res, err := c.doRequest("json")
  53002. if res != nil && res.StatusCode == http.StatusNotModified {
  53003. if res.Body != nil {
  53004. res.Body.Close()
  53005. }
  53006. return nil, &googleapi.Error{
  53007. Code: res.StatusCode,
  53008. Header: res.Header,
  53009. }
  53010. }
  53011. if err != nil {
  53012. return nil, err
  53013. }
  53014. defer googleapi.CloseBody(res)
  53015. if err := googleapi.CheckResponse(res); err != nil {
  53016. return nil, err
  53017. }
  53018. ret := &Operation{
  53019. ServerResponse: googleapi.ServerResponse{
  53020. Header: res.Header,
  53021. HTTPStatusCode: res.StatusCode,
  53022. },
  53023. }
  53024. target := &ret
  53025. if err := gensupport.DecodeResponse(target, res); err != nil {
  53026. return nil, err
  53027. }
  53028. return ret, nil
  53029. // {
  53030. // "description": "Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform.",
  53031. // "httpMethod": "POST",
  53032. // "id": "compute.instances.setMinCpuPlatform",
  53033. // "parameterOrder": [
  53034. // "project",
  53035. // "zone",
  53036. // "instance"
  53037. // ],
  53038. // "parameters": {
  53039. // "instance": {
  53040. // "description": "Name of the instance scoping this request.",
  53041. // "location": "path",
  53042. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53043. // "required": true,
  53044. // "type": "string"
  53045. // },
  53046. // "project": {
  53047. // "description": "Project ID for this request.",
  53048. // "location": "path",
  53049. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53050. // "required": true,
  53051. // "type": "string"
  53052. // },
  53053. // "requestId": {
  53054. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53055. // "location": "query",
  53056. // "type": "string"
  53057. // },
  53058. // "zone": {
  53059. // "description": "The name of the zone for this request.",
  53060. // "location": "path",
  53061. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53062. // "required": true,
  53063. // "type": "string"
  53064. // }
  53065. // },
  53066. // "path": "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform",
  53067. // "request": {
  53068. // "$ref": "InstancesSetMinCpuPlatformRequest"
  53069. // },
  53070. // "response": {
  53071. // "$ref": "Operation"
  53072. // },
  53073. // "scopes": [
  53074. // "https://www.googleapis.com/auth/cloud-platform",
  53075. // "https://www.googleapis.com/auth/compute"
  53076. // ]
  53077. // }
  53078. }
  53079. // method id "compute.instances.setScheduling":
  53080. type InstancesSetSchedulingCall struct {
  53081. s *Service
  53082. project string
  53083. zone string
  53084. instance string
  53085. scheduling *Scheduling
  53086. urlParams_ gensupport.URLParams
  53087. ctx_ context.Context
  53088. header_ http.Header
  53089. }
  53090. // SetScheduling: Sets an instance's scheduling options.
  53091. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling
  53092. func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall {
  53093. c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53094. c.project = project
  53095. c.zone = zone
  53096. c.instance = instance
  53097. c.scheduling = scheduling
  53098. return c
  53099. }
  53100. // RequestId sets the optional parameter "requestId": An optional
  53101. // request ID to identify requests. Specify a unique request ID so that
  53102. // if you must retry your request, the server will know to ignore the
  53103. // request if it has already been completed.
  53104. //
  53105. // For example, consider a situation where you make an initial request
  53106. // and the request times out. If you make the request again with the
  53107. // same request ID, the server can check if original operation with the
  53108. // same request ID was received, and if so, will ignore the second
  53109. // request. This prevents clients from accidentally creating duplicate
  53110. // commitments.
  53111. //
  53112. // The request ID must be a valid UUID with the exception that zero UUID
  53113. // is not supported (00000000-0000-0000-0000-000000000000).
  53114. func (c *InstancesSetSchedulingCall) RequestId(requestId string) *InstancesSetSchedulingCall {
  53115. c.urlParams_.Set("requestId", requestId)
  53116. return c
  53117. }
  53118. // Fields allows partial responses to be retrieved. See
  53119. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53120. // for more information.
  53121. func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall {
  53122. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53123. return c
  53124. }
  53125. // Context sets the context to be used in this call's Do method. Any
  53126. // pending HTTP request will be aborted if the provided context is
  53127. // canceled.
  53128. func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall {
  53129. c.ctx_ = ctx
  53130. return c
  53131. }
  53132. // Header returns an http.Header that can be modified by the caller to
  53133. // add HTTP headers to the request.
  53134. func (c *InstancesSetSchedulingCall) Header() http.Header {
  53135. if c.header_ == nil {
  53136. c.header_ = make(http.Header)
  53137. }
  53138. return c.header_
  53139. }
  53140. func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) {
  53141. reqHeaders := make(http.Header)
  53142. for k, v := range c.header_ {
  53143. reqHeaders[k] = v
  53144. }
  53145. reqHeaders.Set("User-Agent", c.s.userAgent())
  53146. var body io.Reader = nil
  53147. body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling)
  53148. if err != nil {
  53149. return nil, err
  53150. }
  53151. reqHeaders.Set("Content-Type", "application/json")
  53152. c.urlParams_.Set("alt", alt)
  53153. c.urlParams_.Set("prettyPrint", "false")
  53154. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling")
  53155. urls += "?" + c.urlParams_.Encode()
  53156. req, err := http.NewRequest("POST", urls, body)
  53157. if err != nil {
  53158. return nil, err
  53159. }
  53160. req.Header = reqHeaders
  53161. googleapi.Expand(req.URL, map[string]string{
  53162. "project": c.project,
  53163. "zone": c.zone,
  53164. "instance": c.instance,
  53165. })
  53166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53167. }
  53168. // Do executes the "compute.instances.setScheduling" call.
  53169. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53170. // status code is an error. Response headers are in either
  53171. // *Operation.ServerResponse.Header or (if a response was returned at
  53172. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53173. // to check whether the returned error was because
  53174. // http.StatusNotModified was returned.
  53175. func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53176. gensupport.SetOptions(c.urlParams_, opts...)
  53177. res, err := c.doRequest("json")
  53178. if res != nil && res.StatusCode == http.StatusNotModified {
  53179. if res.Body != nil {
  53180. res.Body.Close()
  53181. }
  53182. return nil, &googleapi.Error{
  53183. Code: res.StatusCode,
  53184. Header: res.Header,
  53185. }
  53186. }
  53187. if err != nil {
  53188. return nil, err
  53189. }
  53190. defer googleapi.CloseBody(res)
  53191. if err := googleapi.CheckResponse(res); err != nil {
  53192. return nil, err
  53193. }
  53194. ret := &Operation{
  53195. ServerResponse: googleapi.ServerResponse{
  53196. Header: res.Header,
  53197. HTTPStatusCode: res.StatusCode,
  53198. },
  53199. }
  53200. target := &ret
  53201. if err := gensupport.DecodeResponse(target, res); err != nil {
  53202. return nil, err
  53203. }
  53204. return ret, nil
  53205. // {
  53206. // "description": "Sets an instance's scheduling options.",
  53207. // "httpMethod": "POST",
  53208. // "id": "compute.instances.setScheduling",
  53209. // "parameterOrder": [
  53210. // "project",
  53211. // "zone",
  53212. // "instance"
  53213. // ],
  53214. // "parameters": {
  53215. // "instance": {
  53216. // "description": "Instance name for this request.",
  53217. // "location": "path",
  53218. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53219. // "required": true,
  53220. // "type": "string"
  53221. // },
  53222. // "project": {
  53223. // "description": "Project ID for this request.",
  53224. // "location": "path",
  53225. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53226. // "required": true,
  53227. // "type": "string"
  53228. // },
  53229. // "requestId": {
  53230. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53231. // "location": "query",
  53232. // "type": "string"
  53233. // },
  53234. // "zone": {
  53235. // "description": "The name of the zone for this request.",
  53236. // "location": "path",
  53237. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53238. // "required": true,
  53239. // "type": "string"
  53240. // }
  53241. // },
  53242. // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling",
  53243. // "request": {
  53244. // "$ref": "Scheduling"
  53245. // },
  53246. // "response": {
  53247. // "$ref": "Operation"
  53248. // },
  53249. // "scopes": [
  53250. // "https://www.googleapis.com/auth/cloud-platform",
  53251. // "https://www.googleapis.com/auth/compute"
  53252. // ]
  53253. // }
  53254. }
  53255. // method id "compute.instances.setServiceAccount":
  53256. type InstancesSetServiceAccountCall struct {
  53257. s *Service
  53258. project string
  53259. zone string
  53260. instance string
  53261. instancessetserviceaccountrequest *InstancesSetServiceAccountRequest
  53262. urlParams_ gensupport.URLParams
  53263. ctx_ context.Context
  53264. header_ http.Header
  53265. }
  53266. // SetServiceAccount: Sets the service account on the instance. For more
  53267. // information, read Changing the service account and access scopes for
  53268. // an instance.
  53269. func (r *InstancesService) SetServiceAccount(project string, zone string, instance string, instancessetserviceaccountrequest *InstancesSetServiceAccountRequest) *InstancesSetServiceAccountCall {
  53270. c := &InstancesSetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53271. c.project = project
  53272. c.zone = zone
  53273. c.instance = instance
  53274. c.instancessetserviceaccountrequest = instancessetserviceaccountrequest
  53275. return c
  53276. }
  53277. // RequestId sets the optional parameter "requestId": An optional
  53278. // request ID to identify requests. Specify a unique request ID so that
  53279. // if you must retry your request, the server will know to ignore the
  53280. // request if it has already been completed.
  53281. //
  53282. // For example, consider a situation where you make an initial request
  53283. // and the request times out. If you make the request again with the
  53284. // same request ID, the server can check if original operation with the
  53285. // same request ID was received, and if so, will ignore the second
  53286. // request. This prevents clients from accidentally creating duplicate
  53287. // commitments.
  53288. //
  53289. // The request ID must be a valid UUID with the exception that zero UUID
  53290. // is not supported (00000000-0000-0000-0000-000000000000).
  53291. func (c *InstancesSetServiceAccountCall) RequestId(requestId string) *InstancesSetServiceAccountCall {
  53292. c.urlParams_.Set("requestId", requestId)
  53293. return c
  53294. }
  53295. // Fields allows partial responses to be retrieved. See
  53296. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53297. // for more information.
  53298. func (c *InstancesSetServiceAccountCall) Fields(s ...googleapi.Field) *InstancesSetServiceAccountCall {
  53299. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53300. return c
  53301. }
  53302. // Context sets the context to be used in this call's Do method. Any
  53303. // pending HTTP request will be aborted if the provided context is
  53304. // canceled.
  53305. func (c *InstancesSetServiceAccountCall) Context(ctx context.Context) *InstancesSetServiceAccountCall {
  53306. c.ctx_ = ctx
  53307. return c
  53308. }
  53309. // Header returns an http.Header that can be modified by the caller to
  53310. // add HTTP headers to the request.
  53311. func (c *InstancesSetServiceAccountCall) Header() http.Header {
  53312. if c.header_ == nil {
  53313. c.header_ = make(http.Header)
  53314. }
  53315. return c.header_
  53316. }
  53317. func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  53318. reqHeaders := make(http.Header)
  53319. for k, v := range c.header_ {
  53320. reqHeaders[k] = v
  53321. }
  53322. reqHeaders.Set("User-Agent", c.s.userAgent())
  53323. var body io.Reader = nil
  53324. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest)
  53325. if err != nil {
  53326. return nil, err
  53327. }
  53328. reqHeaders.Set("Content-Type", "application/json")
  53329. c.urlParams_.Set("alt", alt)
  53330. c.urlParams_.Set("prettyPrint", "false")
  53331. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setServiceAccount")
  53332. urls += "?" + c.urlParams_.Encode()
  53333. req, err := http.NewRequest("POST", urls, body)
  53334. if err != nil {
  53335. return nil, err
  53336. }
  53337. req.Header = reqHeaders
  53338. googleapi.Expand(req.URL, map[string]string{
  53339. "project": c.project,
  53340. "zone": c.zone,
  53341. "instance": c.instance,
  53342. })
  53343. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53344. }
  53345. // Do executes the "compute.instances.setServiceAccount" call.
  53346. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53347. // status code is an error. Response headers are in either
  53348. // *Operation.ServerResponse.Header or (if a response was returned at
  53349. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53350. // to check whether the returned error was because
  53351. // http.StatusNotModified was returned.
  53352. func (c *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53353. gensupport.SetOptions(c.urlParams_, opts...)
  53354. res, err := c.doRequest("json")
  53355. if res != nil && res.StatusCode == http.StatusNotModified {
  53356. if res.Body != nil {
  53357. res.Body.Close()
  53358. }
  53359. return nil, &googleapi.Error{
  53360. Code: res.StatusCode,
  53361. Header: res.Header,
  53362. }
  53363. }
  53364. if err != nil {
  53365. return nil, err
  53366. }
  53367. defer googleapi.CloseBody(res)
  53368. if err := googleapi.CheckResponse(res); err != nil {
  53369. return nil, err
  53370. }
  53371. ret := &Operation{
  53372. ServerResponse: googleapi.ServerResponse{
  53373. Header: res.Header,
  53374. HTTPStatusCode: res.StatusCode,
  53375. },
  53376. }
  53377. target := &ret
  53378. if err := gensupport.DecodeResponse(target, res); err != nil {
  53379. return nil, err
  53380. }
  53381. return ret, nil
  53382. // {
  53383. // "description": "Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.",
  53384. // "httpMethod": "POST",
  53385. // "id": "compute.instances.setServiceAccount",
  53386. // "parameterOrder": [
  53387. // "project",
  53388. // "zone",
  53389. // "instance"
  53390. // ],
  53391. // "parameters": {
  53392. // "instance": {
  53393. // "description": "Name of the instance resource to start.",
  53394. // "location": "path",
  53395. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53396. // "required": true,
  53397. // "type": "string"
  53398. // },
  53399. // "project": {
  53400. // "description": "Project ID for this request.",
  53401. // "location": "path",
  53402. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53403. // "required": true,
  53404. // "type": "string"
  53405. // },
  53406. // "requestId": {
  53407. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53408. // "location": "query",
  53409. // "type": "string"
  53410. // },
  53411. // "zone": {
  53412. // "description": "The name of the zone for this request.",
  53413. // "location": "path",
  53414. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53415. // "required": true,
  53416. // "type": "string"
  53417. // }
  53418. // },
  53419. // "path": "{project}/zones/{zone}/instances/{instance}/setServiceAccount",
  53420. // "request": {
  53421. // "$ref": "InstancesSetServiceAccountRequest"
  53422. // },
  53423. // "response": {
  53424. // "$ref": "Operation"
  53425. // },
  53426. // "scopes": [
  53427. // "https://www.googleapis.com/auth/cloud-platform",
  53428. // "https://www.googleapis.com/auth/compute"
  53429. // ]
  53430. // }
  53431. }
  53432. // method id "compute.instances.setTags":
  53433. type InstancesSetTagsCall struct {
  53434. s *Service
  53435. project string
  53436. zone string
  53437. instance string
  53438. tags *Tags
  53439. urlParams_ gensupport.URLParams
  53440. ctx_ context.Context
  53441. header_ http.Header
  53442. }
  53443. // SetTags: Sets network tags for the specified instance to the data
  53444. // included in the request.
  53445. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags
  53446. func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall {
  53447. c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53448. c.project = project
  53449. c.zone = zone
  53450. c.instance = instance
  53451. c.tags = tags
  53452. return c
  53453. }
  53454. // RequestId sets the optional parameter "requestId": An optional
  53455. // request ID to identify requests. Specify a unique request ID so that
  53456. // if you must retry your request, the server will know to ignore the
  53457. // request if it has already been completed.
  53458. //
  53459. // For example, consider a situation where you make an initial request
  53460. // and the request times out. If you make the request again with the
  53461. // same request ID, the server can check if original operation with the
  53462. // same request ID was received, and if so, will ignore the second
  53463. // request. This prevents clients from accidentally creating duplicate
  53464. // commitments.
  53465. //
  53466. // The request ID must be a valid UUID with the exception that zero UUID
  53467. // is not supported (00000000-0000-0000-0000-000000000000).
  53468. func (c *InstancesSetTagsCall) RequestId(requestId string) *InstancesSetTagsCall {
  53469. c.urlParams_.Set("requestId", requestId)
  53470. return c
  53471. }
  53472. // Fields allows partial responses to be retrieved. See
  53473. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53474. // for more information.
  53475. func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall {
  53476. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53477. return c
  53478. }
  53479. // Context sets the context to be used in this call's Do method. Any
  53480. // pending HTTP request will be aborted if the provided context is
  53481. // canceled.
  53482. func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall {
  53483. c.ctx_ = ctx
  53484. return c
  53485. }
  53486. // Header returns an http.Header that can be modified by the caller to
  53487. // add HTTP headers to the request.
  53488. func (c *InstancesSetTagsCall) Header() http.Header {
  53489. if c.header_ == nil {
  53490. c.header_ = make(http.Header)
  53491. }
  53492. return c.header_
  53493. }
  53494. func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) {
  53495. reqHeaders := make(http.Header)
  53496. for k, v := range c.header_ {
  53497. reqHeaders[k] = v
  53498. }
  53499. reqHeaders.Set("User-Agent", c.s.userAgent())
  53500. var body io.Reader = nil
  53501. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags)
  53502. if err != nil {
  53503. return nil, err
  53504. }
  53505. reqHeaders.Set("Content-Type", "application/json")
  53506. c.urlParams_.Set("alt", alt)
  53507. c.urlParams_.Set("prettyPrint", "false")
  53508. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags")
  53509. urls += "?" + c.urlParams_.Encode()
  53510. req, err := http.NewRequest("POST", urls, body)
  53511. if err != nil {
  53512. return nil, err
  53513. }
  53514. req.Header = reqHeaders
  53515. googleapi.Expand(req.URL, map[string]string{
  53516. "project": c.project,
  53517. "zone": c.zone,
  53518. "instance": c.instance,
  53519. })
  53520. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53521. }
  53522. // Do executes the "compute.instances.setTags" call.
  53523. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53524. // status code is an error. Response headers are in either
  53525. // *Operation.ServerResponse.Header or (if a response was returned at
  53526. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53527. // to check whether the returned error was because
  53528. // http.StatusNotModified was returned.
  53529. func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53530. gensupport.SetOptions(c.urlParams_, opts...)
  53531. res, err := c.doRequest("json")
  53532. if res != nil && res.StatusCode == http.StatusNotModified {
  53533. if res.Body != nil {
  53534. res.Body.Close()
  53535. }
  53536. return nil, &googleapi.Error{
  53537. Code: res.StatusCode,
  53538. Header: res.Header,
  53539. }
  53540. }
  53541. if err != nil {
  53542. return nil, err
  53543. }
  53544. defer googleapi.CloseBody(res)
  53545. if err := googleapi.CheckResponse(res); err != nil {
  53546. return nil, err
  53547. }
  53548. ret := &Operation{
  53549. ServerResponse: googleapi.ServerResponse{
  53550. Header: res.Header,
  53551. HTTPStatusCode: res.StatusCode,
  53552. },
  53553. }
  53554. target := &ret
  53555. if err := gensupport.DecodeResponse(target, res); err != nil {
  53556. return nil, err
  53557. }
  53558. return ret, nil
  53559. // {
  53560. // "description": "Sets network tags for the specified instance to the data included in the request.",
  53561. // "httpMethod": "POST",
  53562. // "id": "compute.instances.setTags",
  53563. // "parameterOrder": [
  53564. // "project",
  53565. // "zone",
  53566. // "instance"
  53567. // ],
  53568. // "parameters": {
  53569. // "instance": {
  53570. // "description": "Name of the instance scoping this request.",
  53571. // "location": "path",
  53572. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53573. // "required": true,
  53574. // "type": "string"
  53575. // },
  53576. // "project": {
  53577. // "description": "Project ID for this request.",
  53578. // "location": "path",
  53579. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53580. // "required": true,
  53581. // "type": "string"
  53582. // },
  53583. // "requestId": {
  53584. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53585. // "location": "query",
  53586. // "type": "string"
  53587. // },
  53588. // "zone": {
  53589. // "description": "The name of the zone for this request.",
  53590. // "location": "path",
  53591. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53592. // "required": true,
  53593. // "type": "string"
  53594. // }
  53595. // },
  53596. // "path": "{project}/zones/{zone}/instances/{instance}/setTags",
  53597. // "request": {
  53598. // "$ref": "Tags"
  53599. // },
  53600. // "response": {
  53601. // "$ref": "Operation"
  53602. // },
  53603. // "scopes": [
  53604. // "https://www.googleapis.com/auth/cloud-platform",
  53605. // "https://www.googleapis.com/auth/compute"
  53606. // ]
  53607. // }
  53608. }
  53609. // method id "compute.instances.simulateMaintenanceEvent":
  53610. type InstancesSimulateMaintenanceEventCall struct {
  53611. s *Service
  53612. project string
  53613. zone string
  53614. instance string
  53615. urlParams_ gensupport.URLParams
  53616. ctx_ context.Context
  53617. header_ http.Header
  53618. }
  53619. // SimulateMaintenanceEvent: Simulates a maintenance event on the
  53620. // instance.
  53621. func (r *InstancesService) SimulateMaintenanceEvent(project string, zone string, instance string) *InstancesSimulateMaintenanceEventCall {
  53622. c := &InstancesSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53623. c.project = project
  53624. c.zone = zone
  53625. c.instance = instance
  53626. return c
  53627. }
  53628. // Fields allows partial responses to be retrieved. See
  53629. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53630. // for more information.
  53631. func (c *InstancesSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *InstancesSimulateMaintenanceEventCall {
  53632. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53633. return c
  53634. }
  53635. // Context sets the context to be used in this call's Do method. Any
  53636. // pending HTTP request will be aborted if the provided context is
  53637. // canceled.
  53638. func (c *InstancesSimulateMaintenanceEventCall) Context(ctx context.Context) *InstancesSimulateMaintenanceEventCall {
  53639. c.ctx_ = ctx
  53640. return c
  53641. }
  53642. // Header returns an http.Header that can be modified by the caller to
  53643. // add HTTP headers to the request.
  53644. func (c *InstancesSimulateMaintenanceEventCall) Header() http.Header {
  53645. if c.header_ == nil {
  53646. c.header_ = make(http.Header)
  53647. }
  53648. return c.header_
  53649. }
  53650. func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) {
  53651. reqHeaders := make(http.Header)
  53652. for k, v := range c.header_ {
  53653. reqHeaders[k] = v
  53654. }
  53655. reqHeaders.Set("User-Agent", c.s.userAgent())
  53656. var body io.Reader = nil
  53657. c.urlParams_.Set("alt", alt)
  53658. c.urlParams_.Set("prettyPrint", "false")
  53659. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent")
  53660. urls += "?" + c.urlParams_.Encode()
  53661. req, err := http.NewRequest("POST", urls, body)
  53662. if err != nil {
  53663. return nil, err
  53664. }
  53665. req.Header = reqHeaders
  53666. googleapi.Expand(req.URL, map[string]string{
  53667. "project": c.project,
  53668. "zone": c.zone,
  53669. "instance": c.instance,
  53670. })
  53671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53672. }
  53673. // Do executes the "compute.instances.simulateMaintenanceEvent" call.
  53674. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53675. // status code is an error. Response headers are in either
  53676. // *Operation.ServerResponse.Header or (if a response was returned at
  53677. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53678. // to check whether the returned error was because
  53679. // http.StatusNotModified was returned.
  53680. func (c *InstancesSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53681. gensupport.SetOptions(c.urlParams_, opts...)
  53682. res, err := c.doRequest("json")
  53683. if res != nil && res.StatusCode == http.StatusNotModified {
  53684. if res.Body != nil {
  53685. res.Body.Close()
  53686. }
  53687. return nil, &googleapi.Error{
  53688. Code: res.StatusCode,
  53689. Header: res.Header,
  53690. }
  53691. }
  53692. if err != nil {
  53693. return nil, err
  53694. }
  53695. defer googleapi.CloseBody(res)
  53696. if err := googleapi.CheckResponse(res); err != nil {
  53697. return nil, err
  53698. }
  53699. ret := &Operation{
  53700. ServerResponse: googleapi.ServerResponse{
  53701. Header: res.Header,
  53702. HTTPStatusCode: res.StatusCode,
  53703. },
  53704. }
  53705. target := &ret
  53706. if err := gensupport.DecodeResponse(target, res); err != nil {
  53707. return nil, err
  53708. }
  53709. return ret, nil
  53710. // {
  53711. // "description": "Simulates a maintenance event on the instance.",
  53712. // "httpMethod": "POST",
  53713. // "id": "compute.instances.simulateMaintenanceEvent",
  53714. // "parameterOrder": [
  53715. // "project",
  53716. // "zone",
  53717. // "instance"
  53718. // ],
  53719. // "parameters": {
  53720. // "instance": {
  53721. // "description": "Name of the instance scoping this request.",
  53722. // "location": "path",
  53723. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53724. // "required": true,
  53725. // "type": "string"
  53726. // },
  53727. // "project": {
  53728. // "description": "Project ID for this request.",
  53729. // "location": "path",
  53730. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53731. // "required": true,
  53732. // "type": "string"
  53733. // },
  53734. // "zone": {
  53735. // "description": "The name of the zone for this request.",
  53736. // "location": "path",
  53737. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53738. // "required": true,
  53739. // "type": "string"
  53740. // }
  53741. // },
  53742. // "path": "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent",
  53743. // "response": {
  53744. // "$ref": "Operation"
  53745. // },
  53746. // "scopes": [
  53747. // "https://www.googleapis.com/auth/cloud-platform",
  53748. // "https://www.googleapis.com/auth/compute"
  53749. // ]
  53750. // }
  53751. }
  53752. // method id "compute.instances.start":
  53753. type InstancesStartCall struct {
  53754. s *Service
  53755. project string
  53756. zone string
  53757. instance string
  53758. urlParams_ gensupport.URLParams
  53759. ctx_ context.Context
  53760. header_ http.Header
  53761. }
  53762. // Start: Starts an instance that was stopped using the instances().stop
  53763. // method. For more information, see Restart an instance.
  53764. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start
  53765. func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall {
  53766. c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53767. c.project = project
  53768. c.zone = zone
  53769. c.instance = instance
  53770. return c
  53771. }
  53772. // RequestId sets the optional parameter "requestId": An optional
  53773. // request ID to identify requests. Specify a unique request ID so that
  53774. // if you must retry your request, the server will know to ignore the
  53775. // request if it has already been completed.
  53776. //
  53777. // For example, consider a situation where you make an initial request
  53778. // and the request times out. If you make the request again with the
  53779. // same request ID, the server can check if original operation with the
  53780. // same request ID was received, and if so, will ignore the second
  53781. // request. This prevents clients from accidentally creating duplicate
  53782. // commitments.
  53783. //
  53784. // The request ID must be a valid UUID with the exception that zero UUID
  53785. // is not supported (00000000-0000-0000-0000-000000000000).
  53786. func (c *InstancesStartCall) RequestId(requestId string) *InstancesStartCall {
  53787. c.urlParams_.Set("requestId", requestId)
  53788. return c
  53789. }
  53790. // Fields allows partial responses to be retrieved. See
  53791. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53792. // for more information.
  53793. func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall {
  53794. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53795. return c
  53796. }
  53797. // Context sets the context to be used in this call's Do method. Any
  53798. // pending HTTP request will be aborted if the provided context is
  53799. // canceled.
  53800. func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall {
  53801. c.ctx_ = ctx
  53802. return c
  53803. }
  53804. // Header returns an http.Header that can be modified by the caller to
  53805. // add HTTP headers to the request.
  53806. func (c *InstancesStartCall) Header() http.Header {
  53807. if c.header_ == nil {
  53808. c.header_ = make(http.Header)
  53809. }
  53810. return c.header_
  53811. }
  53812. func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) {
  53813. reqHeaders := make(http.Header)
  53814. for k, v := range c.header_ {
  53815. reqHeaders[k] = v
  53816. }
  53817. reqHeaders.Set("User-Agent", c.s.userAgent())
  53818. var body io.Reader = nil
  53819. c.urlParams_.Set("alt", alt)
  53820. c.urlParams_.Set("prettyPrint", "false")
  53821. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start")
  53822. urls += "?" + c.urlParams_.Encode()
  53823. req, err := http.NewRequest("POST", urls, body)
  53824. if err != nil {
  53825. return nil, err
  53826. }
  53827. req.Header = reqHeaders
  53828. googleapi.Expand(req.URL, map[string]string{
  53829. "project": c.project,
  53830. "zone": c.zone,
  53831. "instance": c.instance,
  53832. })
  53833. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53834. }
  53835. // Do executes the "compute.instances.start" call.
  53836. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53837. // status code is an error. Response headers are in either
  53838. // *Operation.ServerResponse.Header or (if a response was returned at
  53839. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53840. // to check whether the returned error was because
  53841. // http.StatusNotModified was returned.
  53842. func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53843. gensupport.SetOptions(c.urlParams_, opts...)
  53844. res, err := c.doRequest("json")
  53845. if res != nil && res.StatusCode == http.StatusNotModified {
  53846. if res.Body != nil {
  53847. res.Body.Close()
  53848. }
  53849. return nil, &googleapi.Error{
  53850. Code: res.StatusCode,
  53851. Header: res.Header,
  53852. }
  53853. }
  53854. if err != nil {
  53855. return nil, err
  53856. }
  53857. defer googleapi.CloseBody(res)
  53858. if err := googleapi.CheckResponse(res); err != nil {
  53859. return nil, err
  53860. }
  53861. ret := &Operation{
  53862. ServerResponse: googleapi.ServerResponse{
  53863. Header: res.Header,
  53864. HTTPStatusCode: res.StatusCode,
  53865. },
  53866. }
  53867. target := &ret
  53868. if err := gensupport.DecodeResponse(target, res); err != nil {
  53869. return nil, err
  53870. }
  53871. return ret, nil
  53872. // {
  53873. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  53874. // "httpMethod": "POST",
  53875. // "id": "compute.instances.start",
  53876. // "parameterOrder": [
  53877. // "project",
  53878. // "zone",
  53879. // "instance"
  53880. // ],
  53881. // "parameters": {
  53882. // "instance": {
  53883. // "description": "Name of the instance resource to start.",
  53884. // "location": "path",
  53885. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53886. // "required": true,
  53887. // "type": "string"
  53888. // },
  53889. // "project": {
  53890. // "description": "Project ID for this request.",
  53891. // "location": "path",
  53892. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53893. // "required": true,
  53894. // "type": "string"
  53895. // },
  53896. // "requestId": {
  53897. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53898. // "location": "query",
  53899. // "type": "string"
  53900. // },
  53901. // "zone": {
  53902. // "description": "The name of the zone for this request.",
  53903. // "location": "path",
  53904. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53905. // "required": true,
  53906. // "type": "string"
  53907. // }
  53908. // },
  53909. // "path": "{project}/zones/{zone}/instances/{instance}/start",
  53910. // "response": {
  53911. // "$ref": "Operation"
  53912. // },
  53913. // "scopes": [
  53914. // "https://www.googleapis.com/auth/cloud-platform",
  53915. // "https://www.googleapis.com/auth/compute"
  53916. // ]
  53917. // }
  53918. }
  53919. // method id "compute.instances.startWithEncryptionKey":
  53920. type InstancesStartWithEncryptionKeyCall struct {
  53921. s *Service
  53922. project string
  53923. zone string
  53924. instance string
  53925. instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest
  53926. urlParams_ gensupport.URLParams
  53927. ctx_ context.Context
  53928. header_ http.Header
  53929. }
  53930. // StartWithEncryptionKey: Starts an instance that was stopped using the
  53931. // instances().stop method. For more information, see Restart an
  53932. // instance.
  53933. func (r *InstancesService) StartWithEncryptionKey(project string, zone string, instance string, instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest) *InstancesStartWithEncryptionKeyCall {
  53934. c := &InstancesStartWithEncryptionKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53935. c.project = project
  53936. c.zone = zone
  53937. c.instance = instance
  53938. c.instancesstartwithencryptionkeyrequest = instancesstartwithencryptionkeyrequest
  53939. return c
  53940. }
  53941. // RequestId sets the optional parameter "requestId": An optional
  53942. // request ID to identify requests. Specify a unique request ID so that
  53943. // if you must retry your request, the server will know to ignore the
  53944. // request if it has already been completed.
  53945. //
  53946. // For example, consider a situation where you make an initial request
  53947. // and the request times out. If you make the request again with the
  53948. // same request ID, the server can check if original operation with the
  53949. // same request ID was received, and if so, will ignore the second
  53950. // request. This prevents clients from accidentally creating duplicate
  53951. // commitments.
  53952. //
  53953. // The request ID must be a valid UUID with the exception that zero UUID
  53954. // is not supported (00000000-0000-0000-0000-000000000000).
  53955. func (c *InstancesStartWithEncryptionKeyCall) RequestId(requestId string) *InstancesStartWithEncryptionKeyCall {
  53956. c.urlParams_.Set("requestId", requestId)
  53957. return c
  53958. }
  53959. // Fields allows partial responses to be retrieved. See
  53960. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53961. // for more information.
  53962. func (c *InstancesStartWithEncryptionKeyCall) Fields(s ...googleapi.Field) *InstancesStartWithEncryptionKeyCall {
  53963. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53964. return c
  53965. }
  53966. // Context sets the context to be used in this call's Do method. Any
  53967. // pending HTTP request will be aborted if the provided context is
  53968. // canceled.
  53969. func (c *InstancesStartWithEncryptionKeyCall) Context(ctx context.Context) *InstancesStartWithEncryptionKeyCall {
  53970. c.ctx_ = ctx
  53971. return c
  53972. }
  53973. // Header returns an http.Header that can be modified by the caller to
  53974. // add HTTP headers to the request.
  53975. func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header {
  53976. if c.header_ == nil {
  53977. c.header_ = make(http.Header)
  53978. }
  53979. return c.header_
  53980. }
  53981. func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) {
  53982. reqHeaders := make(http.Header)
  53983. for k, v := range c.header_ {
  53984. reqHeaders[k] = v
  53985. }
  53986. reqHeaders.Set("User-Agent", c.s.userAgent())
  53987. var body io.Reader = nil
  53988. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest)
  53989. if err != nil {
  53990. return nil, err
  53991. }
  53992. reqHeaders.Set("Content-Type", "application/json")
  53993. c.urlParams_.Set("alt", alt)
  53994. c.urlParams_.Set("prettyPrint", "false")
  53995. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")
  53996. urls += "?" + c.urlParams_.Encode()
  53997. req, err := http.NewRequest("POST", urls, body)
  53998. if err != nil {
  53999. return nil, err
  54000. }
  54001. req.Header = reqHeaders
  54002. googleapi.Expand(req.URL, map[string]string{
  54003. "project": c.project,
  54004. "zone": c.zone,
  54005. "instance": c.instance,
  54006. })
  54007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54008. }
  54009. // Do executes the "compute.instances.startWithEncryptionKey" call.
  54010. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54011. // status code is an error. Response headers are in either
  54012. // *Operation.ServerResponse.Header or (if a response was returned at
  54013. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54014. // to check whether the returned error was because
  54015. // http.StatusNotModified was returned.
  54016. func (c *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54017. gensupport.SetOptions(c.urlParams_, opts...)
  54018. res, err := c.doRequest("json")
  54019. if res != nil && res.StatusCode == http.StatusNotModified {
  54020. if res.Body != nil {
  54021. res.Body.Close()
  54022. }
  54023. return nil, &googleapi.Error{
  54024. Code: res.StatusCode,
  54025. Header: res.Header,
  54026. }
  54027. }
  54028. if err != nil {
  54029. return nil, err
  54030. }
  54031. defer googleapi.CloseBody(res)
  54032. if err := googleapi.CheckResponse(res); err != nil {
  54033. return nil, err
  54034. }
  54035. ret := &Operation{
  54036. ServerResponse: googleapi.ServerResponse{
  54037. Header: res.Header,
  54038. HTTPStatusCode: res.StatusCode,
  54039. },
  54040. }
  54041. target := &ret
  54042. if err := gensupport.DecodeResponse(target, res); err != nil {
  54043. return nil, err
  54044. }
  54045. return ret, nil
  54046. // {
  54047. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  54048. // "httpMethod": "POST",
  54049. // "id": "compute.instances.startWithEncryptionKey",
  54050. // "parameterOrder": [
  54051. // "project",
  54052. // "zone",
  54053. // "instance"
  54054. // ],
  54055. // "parameters": {
  54056. // "instance": {
  54057. // "description": "Name of the instance resource to start.",
  54058. // "location": "path",
  54059. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54060. // "required": true,
  54061. // "type": "string"
  54062. // },
  54063. // "project": {
  54064. // "description": "Project ID for this request.",
  54065. // "location": "path",
  54066. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54067. // "required": true,
  54068. // "type": "string"
  54069. // },
  54070. // "requestId": {
  54071. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54072. // "location": "query",
  54073. // "type": "string"
  54074. // },
  54075. // "zone": {
  54076. // "description": "The name of the zone for this request.",
  54077. // "location": "path",
  54078. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54079. // "required": true,
  54080. // "type": "string"
  54081. // }
  54082. // },
  54083. // "path": "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey",
  54084. // "request": {
  54085. // "$ref": "InstancesStartWithEncryptionKeyRequest"
  54086. // },
  54087. // "response": {
  54088. // "$ref": "Operation"
  54089. // },
  54090. // "scopes": [
  54091. // "https://www.googleapis.com/auth/cloud-platform",
  54092. // "https://www.googleapis.com/auth/compute"
  54093. // ]
  54094. // }
  54095. }
  54096. // method id "compute.instances.stop":
  54097. type InstancesStopCall struct {
  54098. s *Service
  54099. project string
  54100. zone string
  54101. instance string
  54102. urlParams_ gensupport.URLParams
  54103. ctx_ context.Context
  54104. header_ http.Header
  54105. }
  54106. // Stop: Stops a running instance, shutting it down cleanly, and allows
  54107. // you to restart the instance at a later time. Stopped instances do not
  54108. // incur VM usage charges while they are stopped. However, resources
  54109. // that the VM is using, such as persistent disks and static IP
  54110. // addresses, will continue to be charged until they are deleted. For
  54111. // more information, see Stopping an instance.
  54112. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop
  54113. func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall {
  54114. c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54115. c.project = project
  54116. c.zone = zone
  54117. c.instance = instance
  54118. return c
  54119. }
  54120. // RequestId sets the optional parameter "requestId": An optional
  54121. // request ID to identify requests. Specify a unique request ID so that
  54122. // if you must retry your request, the server will know to ignore the
  54123. // request if it has already been completed.
  54124. //
  54125. // For example, consider a situation where you make an initial request
  54126. // and the request times out. If you make the request again with the
  54127. // same request ID, the server can check if original operation with the
  54128. // same request ID was received, and if so, will ignore the second
  54129. // request. This prevents clients from accidentally creating duplicate
  54130. // commitments.
  54131. //
  54132. // The request ID must be a valid UUID with the exception that zero UUID
  54133. // is not supported (00000000-0000-0000-0000-000000000000).
  54134. func (c *InstancesStopCall) RequestId(requestId string) *InstancesStopCall {
  54135. c.urlParams_.Set("requestId", requestId)
  54136. return c
  54137. }
  54138. // Fields allows partial responses to be retrieved. See
  54139. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54140. // for more information.
  54141. func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall {
  54142. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54143. return c
  54144. }
  54145. // Context sets the context to be used in this call's Do method. Any
  54146. // pending HTTP request will be aborted if the provided context is
  54147. // canceled.
  54148. func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall {
  54149. c.ctx_ = ctx
  54150. return c
  54151. }
  54152. // Header returns an http.Header that can be modified by the caller to
  54153. // add HTTP headers to the request.
  54154. func (c *InstancesStopCall) Header() http.Header {
  54155. if c.header_ == nil {
  54156. c.header_ = make(http.Header)
  54157. }
  54158. return c.header_
  54159. }
  54160. func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) {
  54161. reqHeaders := make(http.Header)
  54162. for k, v := range c.header_ {
  54163. reqHeaders[k] = v
  54164. }
  54165. reqHeaders.Set("User-Agent", c.s.userAgent())
  54166. var body io.Reader = nil
  54167. c.urlParams_.Set("alt", alt)
  54168. c.urlParams_.Set("prettyPrint", "false")
  54169. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop")
  54170. urls += "?" + c.urlParams_.Encode()
  54171. req, err := http.NewRequest("POST", urls, body)
  54172. if err != nil {
  54173. return nil, err
  54174. }
  54175. req.Header = reqHeaders
  54176. googleapi.Expand(req.URL, map[string]string{
  54177. "project": c.project,
  54178. "zone": c.zone,
  54179. "instance": c.instance,
  54180. })
  54181. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54182. }
  54183. // Do executes the "compute.instances.stop" call.
  54184. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54185. // status code is an error. Response headers are in either
  54186. // *Operation.ServerResponse.Header or (if a response was returned at
  54187. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54188. // to check whether the returned error was because
  54189. // http.StatusNotModified was returned.
  54190. func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54191. gensupport.SetOptions(c.urlParams_, opts...)
  54192. res, err := c.doRequest("json")
  54193. if res != nil && res.StatusCode == http.StatusNotModified {
  54194. if res.Body != nil {
  54195. res.Body.Close()
  54196. }
  54197. return nil, &googleapi.Error{
  54198. Code: res.StatusCode,
  54199. Header: res.Header,
  54200. }
  54201. }
  54202. if err != nil {
  54203. return nil, err
  54204. }
  54205. defer googleapi.CloseBody(res)
  54206. if err := googleapi.CheckResponse(res); err != nil {
  54207. return nil, err
  54208. }
  54209. ret := &Operation{
  54210. ServerResponse: googleapi.ServerResponse{
  54211. Header: res.Header,
  54212. HTTPStatusCode: res.StatusCode,
  54213. },
  54214. }
  54215. target := &ret
  54216. if err := gensupport.DecodeResponse(target, res); err != nil {
  54217. return nil, err
  54218. }
  54219. return ret, nil
  54220. // {
  54221. // "description": "Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.",
  54222. // "httpMethod": "POST",
  54223. // "id": "compute.instances.stop",
  54224. // "parameterOrder": [
  54225. // "project",
  54226. // "zone",
  54227. // "instance"
  54228. // ],
  54229. // "parameters": {
  54230. // "instance": {
  54231. // "description": "Name of the instance resource to stop.",
  54232. // "location": "path",
  54233. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54234. // "required": true,
  54235. // "type": "string"
  54236. // },
  54237. // "project": {
  54238. // "description": "Project ID for this request.",
  54239. // "location": "path",
  54240. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54241. // "required": true,
  54242. // "type": "string"
  54243. // },
  54244. // "requestId": {
  54245. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54246. // "location": "query",
  54247. // "type": "string"
  54248. // },
  54249. // "zone": {
  54250. // "description": "The name of the zone for this request.",
  54251. // "location": "path",
  54252. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54253. // "required": true,
  54254. // "type": "string"
  54255. // }
  54256. // },
  54257. // "path": "{project}/zones/{zone}/instances/{instance}/stop",
  54258. // "response": {
  54259. // "$ref": "Operation"
  54260. // },
  54261. // "scopes": [
  54262. // "https://www.googleapis.com/auth/cloud-platform",
  54263. // "https://www.googleapis.com/auth/compute"
  54264. // ]
  54265. // }
  54266. }
  54267. // method id "compute.instances.testIamPermissions":
  54268. type InstancesTestIamPermissionsCall struct {
  54269. s *Service
  54270. project string
  54271. zone string
  54272. resource string
  54273. testpermissionsrequest *TestPermissionsRequest
  54274. urlParams_ gensupport.URLParams
  54275. ctx_ context.Context
  54276. header_ http.Header
  54277. }
  54278. // TestIamPermissions: Returns permissions that a caller has on the
  54279. // specified resource.
  54280. func (r *InstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstancesTestIamPermissionsCall {
  54281. c := &InstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54282. c.project = project
  54283. c.zone = zone
  54284. c.resource = resource
  54285. c.testpermissionsrequest = testpermissionsrequest
  54286. return c
  54287. }
  54288. // Fields allows partial responses to be retrieved. See
  54289. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54290. // for more information.
  54291. func (c *InstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstancesTestIamPermissionsCall {
  54292. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54293. return c
  54294. }
  54295. // Context sets the context to be used in this call's Do method. Any
  54296. // pending HTTP request will be aborted if the provided context is
  54297. // canceled.
  54298. func (c *InstancesTestIamPermissionsCall) Context(ctx context.Context) *InstancesTestIamPermissionsCall {
  54299. c.ctx_ = ctx
  54300. return c
  54301. }
  54302. // Header returns an http.Header that can be modified by the caller to
  54303. // add HTTP headers to the request.
  54304. func (c *InstancesTestIamPermissionsCall) Header() http.Header {
  54305. if c.header_ == nil {
  54306. c.header_ = make(http.Header)
  54307. }
  54308. return c.header_
  54309. }
  54310. func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  54311. reqHeaders := make(http.Header)
  54312. for k, v := range c.header_ {
  54313. reqHeaders[k] = v
  54314. }
  54315. reqHeaders.Set("User-Agent", c.s.userAgent())
  54316. var body io.Reader = nil
  54317. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  54318. if err != nil {
  54319. return nil, err
  54320. }
  54321. reqHeaders.Set("Content-Type", "application/json")
  54322. c.urlParams_.Set("alt", alt)
  54323. c.urlParams_.Set("prettyPrint", "false")
  54324. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/testIamPermissions")
  54325. urls += "?" + c.urlParams_.Encode()
  54326. req, err := http.NewRequest("POST", urls, body)
  54327. if err != nil {
  54328. return nil, err
  54329. }
  54330. req.Header = reqHeaders
  54331. googleapi.Expand(req.URL, map[string]string{
  54332. "project": c.project,
  54333. "zone": c.zone,
  54334. "resource": c.resource,
  54335. })
  54336. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54337. }
  54338. // Do executes the "compute.instances.testIamPermissions" call.
  54339. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  54340. // non-2xx status code is an error. Response headers are in either
  54341. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  54342. // returned at all) in error.(*googleapi.Error).Header. Use
  54343. // googleapi.IsNotModified to check whether the returned error was
  54344. // because http.StatusNotModified was returned.
  54345. func (c *InstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  54346. gensupport.SetOptions(c.urlParams_, opts...)
  54347. res, err := c.doRequest("json")
  54348. if res != nil && res.StatusCode == http.StatusNotModified {
  54349. if res.Body != nil {
  54350. res.Body.Close()
  54351. }
  54352. return nil, &googleapi.Error{
  54353. Code: res.StatusCode,
  54354. Header: res.Header,
  54355. }
  54356. }
  54357. if err != nil {
  54358. return nil, err
  54359. }
  54360. defer googleapi.CloseBody(res)
  54361. if err := googleapi.CheckResponse(res); err != nil {
  54362. return nil, err
  54363. }
  54364. ret := &TestPermissionsResponse{
  54365. ServerResponse: googleapi.ServerResponse{
  54366. Header: res.Header,
  54367. HTTPStatusCode: res.StatusCode,
  54368. },
  54369. }
  54370. target := &ret
  54371. if err := gensupport.DecodeResponse(target, res); err != nil {
  54372. return nil, err
  54373. }
  54374. return ret, nil
  54375. // {
  54376. // "description": "Returns permissions that a caller has on the specified resource.",
  54377. // "httpMethod": "POST",
  54378. // "id": "compute.instances.testIamPermissions",
  54379. // "parameterOrder": [
  54380. // "project",
  54381. // "zone",
  54382. // "resource"
  54383. // ],
  54384. // "parameters": {
  54385. // "project": {
  54386. // "description": "Project ID for this request.",
  54387. // "location": "path",
  54388. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54389. // "required": true,
  54390. // "type": "string"
  54391. // },
  54392. // "resource": {
  54393. // "description": "Name or id of the resource for this request.",
  54394. // "location": "path",
  54395. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54396. // "required": true,
  54397. // "type": "string"
  54398. // },
  54399. // "zone": {
  54400. // "description": "The name of the zone for this request.",
  54401. // "location": "path",
  54402. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54403. // "required": true,
  54404. // "type": "string"
  54405. // }
  54406. // },
  54407. // "path": "{project}/zones/{zone}/instances/{resource}/testIamPermissions",
  54408. // "request": {
  54409. // "$ref": "TestPermissionsRequest"
  54410. // },
  54411. // "response": {
  54412. // "$ref": "TestPermissionsResponse"
  54413. // },
  54414. // "scopes": [
  54415. // "https://www.googleapis.com/auth/cloud-platform",
  54416. // "https://www.googleapis.com/auth/compute",
  54417. // "https://www.googleapis.com/auth/compute.readonly"
  54418. // ]
  54419. // }
  54420. }
  54421. // method id "compute.instances.updateAccessConfig":
  54422. type InstancesUpdateAccessConfigCall struct {
  54423. s *Service
  54424. project string
  54425. zone string
  54426. instance string
  54427. accessconfig *AccessConfig
  54428. urlParams_ gensupport.URLParams
  54429. ctx_ context.Context
  54430. header_ http.Header
  54431. }
  54432. // UpdateAccessConfig: Updates the specified access config from an
  54433. // instance's network interface with the data included in the request.
  54434. // This method supports PATCH semantics and uses the JSON merge patch
  54435. // format and processing rules.
  54436. func (r *InstancesService) UpdateAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesUpdateAccessConfigCall {
  54437. c := &InstancesUpdateAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54438. c.project = project
  54439. c.zone = zone
  54440. c.instance = instance
  54441. c.urlParams_.Set("networkInterface", networkInterface)
  54442. c.accessconfig = accessconfig
  54443. return c
  54444. }
  54445. // RequestId sets the optional parameter "requestId": An optional
  54446. // request ID to identify requests. Specify a unique request ID so that
  54447. // if you must retry your request, the server will know to ignore the
  54448. // request if it has already been completed.
  54449. //
  54450. // For example, consider a situation where you make an initial request
  54451. // and the request times out. If you make the request again with the
  54452. // same request ID, the server can check if original operation with the
  54453. // same request ID was received, and if so, will ignore the second
  54454. // request. This prevents clients from accidentally creating duplicate
  54455. // commitments.
  54456. //
  54457. // The request ID must be a valid UUID with the exception that zero UUID
  54458. // is not supported (00000000-0000-0000-0000-000000000000).
  54459. func (c *InstancesUpdateAccessConfigCall) RequestId(requestId string) *InstancesUpdateAccessConfigCall {
  54460. c.urlParams_.Set("requestId", requestId)
  54461. return c
  54462. }
  54463. // Fields allows partial responses to be retrieved. See
  54464. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54465. // for more information.
  54466. func (c *InstancesUpdateAccessConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateAccessConfigCall {
  54467. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54468. return c
  54469. }
  54470. // Context sets the context to be used in this call's Do method. Any
  54471. // pending HTTP request will be aborted if the provided context is
  54472. // canceled.
  54473. func (c *InstancesUpdateAccessConfigCall) Context(ctx context.Context) *InstancesUpdateAccessConfigCall {
  54474. c.ctx_ = ctx
  54475. return c
  54476. }
  54477. // Header returns an http.Header that can be modified by the caller to
  54478. // add HTTP headers to the request.
  54479. func (c *InstancesUpdateAccessConfigCall) Header() http.Header {
  54480. if c.header_ == nil {
  54481. c.header_ = make(http.Header)
  54482. }
  54483. return c.header_
  54484. }
  54485. func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  54486. reqHeaders := make(http.Header)
  54487. for k, v := range c.header_ {
  54488. reqHeaders[k] = v
  54489. }
  54490. reqHeaders.Set("User-Agent", c.s.userAgent())
  54491. var body io.Reader = nil
  54492. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  54493. if err != nil {
  54494. return nil, err
  54495. }
  54496. reqHeaders.Set("Content-Type", "application/json")
  54497. c.urlParams_.Set("alt", alt)
  54498. c.urlParams_.Set("prettyPrint", "false")
  54499. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateAccessConfig")
  54500. urls += "?" + c.urlParams_.Encode()
  54501. req, err := http.NewRequest("POST", urls, body)
  54502. if err != nil {
  54503. return nil, err
  54504. }
  54505. req.Header = reqHeaders
  54506. googleapi.Expand(req.URL, map[string]string{
  54507. "project": c.project,
  54508. "zone": c.zone,
  54509. "instance": c.instance,
  54510. })
  54511. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54512. }
  54513. // Do executes the "compute.instances.updateAccessConfig" call.
  54514. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54515. // status code is an error. Response headers are in either
  54516. // *Operation.ServerResponse.Header or (if a response was returned at
  54517. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54518. // to check whether the returned error was because
  54519. // http.StatusNotModified was returned.
  54520. func (c *InstancesUpdateAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54521. gensupport.SetOptions(c.urlParams_, opts...)
  54522. res, err := c.doRequest("json")
  54523. if res != nil && res.StatusCode == http.StatusNotModified {
  54524. if res.Body != nil {
  54525. res.Body.Close()
  54526. }
  54527. return nil, &googleapi.Error{
  54528. Code: res.StatusCode,
  54529. Header: res.Header,
  54530. }
  54531. }
  54532. if err != nil {
  54533. return nil, err
  54534. }
  54535. defer googleapi.CloseBody(res)
  54536. if err := googleapi.CheckResponse(res); err != nil {
  54537. return nil, err
  54538. }
  54539. ret := &Operation{
  54540. ServerResponse: googleapi.ServerResponse{
  54541. Header: res.Header,
  54542. HTTPStatusCode: res.StatusCode,
  54543. },
  54544. }
  54545. target := &ret
  54546. if err := gensupport.DecodeResponse(target, res); err != nil {
  54547. return nil, err
  54548. }
  54549. return ret, nil
  54550. // {
  54551. // "description": "Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  54552. // "httpMethod": "POST",
  54553. // "id": "compute.instances.updateAccessConfig",
  54554. // "parameterOrder": [
  54555. // "project",
  54556. // "zone",
  54557. // "instance",
  54558. // "networkInterface"
  54559. // ],
  54560. // "parameters": {
  54561. // "instance": {
  54562. // "description": "The instance name for this request.",
  54563. // "location": "path",
  54564. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54565. // "required": true,
  54566. // "type": "string"
  54567. // },
  54568. // "networkInterface": {
  54569. // "description": "The name of the network interface where the access config is attached.",
  54570. // "location": "query",
  54571. // "required": true,
  54572. // "type": "string"
  54573. // },
  54574. // "project": {
  54575. // "description": "Project ID for this request.",
  54576. // "location": "path",
  54577. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54578. // "required": true,
  54579. // "type": "string"
  54580. // },
  54581. // "requestId": {
  54582. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54583. // "location": "query",
  54584. // "type": "string"
  54585. // },
  54586. // "zone": {
  54587. // "description": "The name of the zone for this request.",
  54588. // "location": "path",
  54589. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54590. // "required": true,
  54591. // "type": "string"
  54592. // }
  54593. // },
  54594. // "path": "{project}/zones/{zone}/instances/{instance}/updateAccessConfig",
  54595. // "request": {
  54596. // "$ref": "AccessConfig"
  54597. // },
  54598. // "response": {
  54599. // "$ref": "Operation"
  54600. // },
  54601. // "scopes": [
  54602. // "https://www.googleapis.com/auth/cloud-platform",
  54603. // "https://www.googleapis.com/auth/compute"
  54604. // ]
  54605. // }
  54606. }
  54607. // method id "compute.instances.updateNetworkInterface":
  54608. type InstancesUpdateNetworkInterfaceCall struct {
  54609. s *Service
  54610. project string
  54611. zone string
  54612. instance string
  54613. networkinterface *NetworkInterface
  54614. urlParams_ gensupport.URLParams
  54615. ctx_ context.Context
  54616. header_ http.Header
  54617. }
  54618. // UpdateNetworkInterface: Updates an instance's network interface. This
  54619. // method follows PATCH semantics.
  54620. func (r *InstancesService) UpdateNetworkInterface(project string, zone string, instance string, networkInterface string, networkinterface *NetworkInterface) *InstancesUpdateNetworkInterfaceCall {
  54621. c := &InstancesUpdateNetworkInterfaceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54622. c.project = project
  54623. c.zone = zone
  54624. c.instance = instance
  54625. c.urlParams_.Set("networkInterface", networkInterface)
  54626. c.networkinterface = networkinterface
  54627. return c
  54628. }
  54629. // RequestId sets the optional parameter "requestId": An optional
  54630. // request ID to identify requests. Specify a unique request ID so that
  54631. // if you must retry your request, the server will know to ignore the
  54632. // request if it has already been completed.
  54633. //
  54634. // For example, consider a situation where you make an initial request
  54635. // and the request times out. If you make the request again with the
  54636. // same request ID, the server can check if original operation with the
  54637. // same request ID was received, and if so, will ignore the second
  54638. // request. This prevents clients from accidentally creating duplicate
  54639. // commitments.
  54640. //
  54641. // The request ID must be a valid UUID with the exception that zero UUID
  54642. // is not supported (00000000-0000-0000-0000-000000000000).
  54643. func (c *InstancesUpdateNetworkInterfaceCall) RequestId(requestId string) *InstancesUpdateNetworkInterfaceCall {
  54644. c.urlParams_.Set("requestId", requestId)
  54645. return c
  54646. }
  54647. // Fields allows partial responses to be retrieved. See
  54648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54649. // for more information.
  54650. func (c *InstancesUpdateNetworkInterfaceCall) Fields(s ...googleapi.Field) *InstancesUpdateNetworkInterfaceCall {
  54651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54652. return c
  54653. }
  54654. // Context sets the context to be used in this call's Do method. Any
  54655. // pending HTTP request will be aborted if the provided context is
  54656. // canceled.
  54657. func (c *InstancesUpdateNetworkInterfaceCall) Context(ctx context.Context) *InstancesUpdateNetworkInterfaceCall {
  54658. c.ctx_ = ctx
  54659. return c
  54660. }
  54661. // Header returns an http.Header that can be modified by the caller to
  54662. // add HTTP headers to the request.
  54663. func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header {
  54664. if c.header_ == nil {
  54665. c.header_ = make(http.Header)
  54666. }
  54667. return c.header_
  54668. }
  54669. func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) {
  54670. reqHeaders := make(http.Header)
  54671. for k, v := range c.header_ {
  54672. reqHeaders[k] = v
  54673. }
  54674. reqHeaders.Set("User-Agent", c.s.userAgent())
  54675. var body io.Reader = nil
  54676. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface)
  54677. if err != nil {
  54678. return nil, err
  54679. }
  54680. reqHeaders.Set("Content-Type", "application/json")
  54681. c.urlParams_.Set("alt", alt)
  54682. c.urlParams_.Set("prettyPrint", "false")
  54683. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")
  54684. urls += "?" + c.urlParams_.Encode()
  54685. req, err := http.NewRequest("PATCH", urls, body)
  54686. if err != nil {
  54687. return nil, err
  54688. }
  54689. req.Header = reqHeaders
  54690. googleapi.Expand(req.URL, map[string]string{
  54691. "project": c.project,
  54692. "zone": c.zone,
  54693. "instance": c.instance,
  54694. })
  54695. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54696. }
  54697. // Do executes the "compute.instances.updateNetworkInterface" call.
  54698. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54699. // status code is an error. Response headers are in either
  54700. // *Operation.ServerResponse.Header or (if a response was returned at
  54701. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54702. // to check whether the returned error was because
  54703. // http.StatusNotModified was returned.
  54704. func (c *InstancesUpdateNetworkInterfaceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54705. gensupport.SetOptions(c.urlParams_, opts...)
  54706. res, err := c.doRequest("json")
  54707. if res != nil && res.StatusCode == http.StatusNotModified {
  54708. if res.Body != nil {
  54709. res.Body.Close()
  54710. }
  54711. return nil, &googleapi.Error{
  54712. Code: res.StatusCode,
  54713. Header: res.Header,
  54714. }
  54715. }
  54716. if err != nil {
  54717. return nil, err
  54718. }
  54719. defer googleapi.CloseBody(res)
  54720. if err := googleapi.CheckResponse(res); err != nil {
  54721. return nil, err
  54722. }
  54723. ret := &Operation{
  54724. ServerResponse: googleapi.ServerResponse{
  54725. Header: res.Header,
  54726. HTTPStatusCode: res.StatusCode,
  54727. },
  54728. }
  54729. target := &ret
  54730. if err := gensupport.DecodeResponse(target, res); err != nil {
  54731. return nil, err
  54732. }
  54733. return ret, nil
  54734. // {
  54735. // "description": "Updates an instance's network interface. This method follows PATCH semantics.",
  54736. // "httpMethod": "PATCH",
  54737. // "id": "compute.instances.updateNetworkInterface",
  54738. // "parameterOrder": [
  54739. // "project",
  54740. // "zone",
  54741. // "instance",
  54742. // "networkInterface"
  54743. // ],
  54744. // "parameters": {
  54745. // "instance": {
  54746. // "description": "The instance name for this request.",
  54747. // "location": "path",
  54748. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54749. // "required": true,
  54750. // "type": "string"
  54751. // },
  54752. // "networkInterface": {
  54753. // "description": "The name of the network interface to update.",
  54754. // "location": "query",
  54755. // "required": true,
  54756. // "type": "string"
  54757. // },
  54758. // "project": {
  54759. // "description": "Project ID for this request.",
  54760. // "location": "path",
  54761. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54762. // "required": true,
  54763. // "type": "string"
  54764. // },
  54765. // "requestId": {
  54766. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54767. // "location": "query",
  54768. // "type": "string"
  54769. // },
  54770. // "zone": {
  54771. // "description": "The name of the zone for this request.",
  54772. // "location": "path",
  54773. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54774. // "required": true,
  54775. // "type": "string"
  54776. // }
  54777. // },
  54778. // "path": "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface",
  54779. // "request": {
  54780. // "$ref": "NetworkInterface"
  54781. // },
  54782. // "response": {
  54783. // "$ref": "Operation"
  54784. // },
  54785. // "scopes": [
  54786. // "https://www.googleapis.com/auth/cloud-platform",
  54787. // "https://www.googleapis.com/auth/compute"
  54788. // ]
  54789. // }
  54790. }
  54791. // method id "compute.interconnectAttachments.aggregatedList":
  54792. type InterconnectAttachmentsAggregatedListCall struct {
  54793. s *Service
  54794. project string
  54795. urlParams_ gensupport.URLParams
  54796. ifNoneMatch_ string
  54797. ctx_ context.Context
  54798. header_ http.Header
  54799. }
  54800. // AggregatedList: Retrieves an aggregated list of interconnect
  54801. // attachments.
  54802. func (r *InterconnectAttachmentsService) AggregatedList(project string) *InterconnectAttachmentsAggregatedListCall {
  54803. c := &InterconnectAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54804. c.project = project
  54805. return c
  54806. }
  54807. // Filter sets the optional parameter "filter": A filter expression that
  54808. // filters resources listed in the response. The expression must specify
  54809. // the field name, a comparison operator, and the value that you want to
  54810. // use for filtering. The value must be a string, a number, or a
  54811. // boolean. The comparison operator must be either =, !=, >, or <.
  54812. //
  54813. // For example, if you are filtering Compute Engine instances, you can
  54814. // exclude instances named example-instance by specifying name !=
  54815. // example-instance.
  54816. //
  54817. // You can also filter nested fields. For example, you could specify
  54818. // scheduling.automaticRestart = false to include instances only if they
  54819. // are not scheduled for automatic restarts. You can use filtering on
  54820. // nested fields to filter based on resource labels.
  54821. //
  54822. // To filter on multiple expressions, provide each separate expression
  54823. // within parentheses. For example, (scheduling.automaticRestart = true)
  54824. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  54825. // AND expression. However, you can include AND and OR expressions
  54826. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  54827. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  54828. // true).
  54829. func (c *InterconnectAttachmentsAggregatedListCall) Filter(filter string) *InterconnectAttachmentsAggregatedListCall {
  54830. c.urlParams_.Set("filter", filter)
  54831. return c
  54832. }
  54833. // MaxResults sets the optional parameter "maxResults": The maximum
  54834. // number of results per page that should be returned. If the number of
  54835. // available results is larger than maxResults, Compute Engine returns a
  54836. // nextPageToken that can be used to get the next page of results in
  54837. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  54838. // (Default: 500)
  54839. func (c *InterconnectAttachmentsAggregatedListCall) MaxResults(maxResults int64) *InterconnectAttachmentsAggregatedListCall {
  54840. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  54841. return c
  54842. }
  54843. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  54844. // a certain order. By default, results are returned in alphanumerical
  54845. // order based on the resource name.
  54846. //
  54847. // You can also sort results in descending order based on the creation
  54848. // timestamp using orderBy="creationTimestamp desc". This sorts results
  54849. // based on the creationTimestamp field in reverse chronological order
  54850. // (newest result first). Use this to sort resources like operations so
  54851. // that the newest operation is returned first.
  54852. //
  54853. // Currently, only sorting by name or creationTimestamp desc is
  54854. // supported.
  54855. func (c *InterconnectAttachmentsAggregatedListCall) OrderBy(orderBy string) *InterconnectAttachmentsAggregatedListCall {
  54856. c.urlParams_.Set("orderBy", orderBy)
  54857. return c
  54858. }
  54859. // PageToken sets the optional parameter "pageToken": Specifies a page
  54860. // token to use. Set pageToken to the nextPageToken returned by a
  54861. // previous list request to get the next page of results.
  54862. func (c *InterconnectAttachmentsAggregatedListCall) PageToken(pageToken string) *InterconnectAttachmentsAggregatedListCall {
  54863. c.urlParams_.Set("pageToken", pageToken)
  54864. return c
  54865. }
  54866. // Fields allows partial responses to be retrieved. See
  54867. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54868. // for more information.
  54869. func (c *InterconnectAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsAggregatedListCall {
  54870. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54871. return c
  54872. }
  54873. // IfNoneMatch sets the optional parameter which makes the operation
  54874. // fail if the object's ETag matches the given value. This is useful for
  54875. // getting updates only after the object has changed since the last
  54876. // request. Use googleapi.IsNotModified to check whether the response
  54877. // error from Do is the result of In-None-Match.
  54878. func (c *InterconnectAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsAggregatedListCall {
  54879. c.ifNoneMatch_ = entityTag
  54880. return c
  54881. }
  54882. // Context sets the context to be used in this call's Do method. Any
  54883. // pending HTTP request will be aborted if the provided context is
  54884. // canceled.
  54885. func (c *InterconnectAttachmentsAggregatedListCall) Context(ctx context.Context) *InterconnectAttachmentsAggregatedListCall {
  54886. c.ctx_ = ctx
  54887. return c
  54888. }
  54889. // Header returns an http.Header that can be modified by the caller to
  54890. // add HTTP headers to the request.
  54891. func (c *InterconnectAttachmentsAggregatedListCall) Header() http.Header {
  54892. if c.header_ == nil {
  54893. c.header_ = make(http.Header)
  54894. }
  54895. return c.header_
  54896. }
  54897. func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  54898. reqHeaders := make(http.Header)
  54899. for k, v := range c.header_ {
  54900. reqHeaders[k] = v
  54901. }
  54902. reqHeaders.Set("User-Agent", c.s.userAgent())
  54903. if c.ifNoneMatch_ != "" {
  54904. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54905. }
  54906. var body io.Reader = nil
  54907. c.urlParams_.Set("alt", alt)
  54908. c.urlParams_.Set("prettyPrint", "false")
  54909. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/interconnectAttachments")
  54910. urls += "?" + c.urlParams_.Encode()
  54911. req, err := http.NewRequest("GET", urls, body)
  54912. if err != nil {
  54913. return nil, err
  54914. }
  54915. req.Header = reqHeaders
  54916. googleapi.Expand(req.URL, map[string]string{
  54917. "project": c.project,
  54918. })
  54919. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54920. }
  54921. // Do executes the "compute.interconnectAttachments.aggregatedList" call.
  54922. // Exactly one of *InterconnectAttachmentAggregatedList or error will be
  54923. // non-nil. Any non-2xx status code is an error. Response headers are in
  54924. // either *InterconnectAttachmentAggregatedList.ServerResponse.Header or
  54925. // (if a response was returned at all) in
  54926. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  54927. // whether the returned error was because http.StatusNotModified was
  54928. // returned.
  54929. func (c *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentAggregatedList, error) {
  54930. gensupport.SetOptions(c.urlParams_, opts...)
  54931. res, err := c.doRequest("json")
  54932. if res != nil && res.StatusCode == http.StatusNotModified {
  54933. if res.Body != nil {
  54934. res.Body.Close()
  54935. }
  54936. return nil, &googleapi.Error{
  54937. Code: res.StatusCode,
  54938. Header: res.Header,
  54939. }
  54940. }
  54941. if err != nil {
  54942. return nil, err
  54943. }
  54944. defer googleapi.CloseBody(res)
  54945. if err := googleapi.CheckResponse(res); err != nil {
  54946. return nil, err
  54947. }
  54948. ret := &InterconnectAttachmentAggregatedList{
  54949. ServerResponse: googleapi.ServerResponse{
  54950. Header: res.Header,
  54951. HTTPStatusCode: res.StatusCode,
  54952. },
  54953. }
  54954. target := &ret
  54955. if err := gensupport.DecodeResponse(target, res); err != nil {
  54956. return nil, err
  54957. }
  54958. return ret, nil
  54959. // {
  54960. // "description": "Retrieves an aggregated list of interconnect attachments.",
  54961. // "httpMethod": "GET",
  54962. // "id": "compute.interconnectAttachments.aggregatedList",
  54963. // "parameterOrder": [
  54964. // "project"
  54965. // ],
  54966. // "parameters": {
  54967. // "filter": {
  54968. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  54969. // "location": "query",
  54970. // "type": "string"
  54971. // },
  54972. // "maxResults": {
  54973. // "default": "500",
  54974. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  54975. // "format": "uint32",
  54976. // "location": "query",
  54977. // "minimum": "0",
  54978. // "type": "integer"
  54979. // },
  54980. // "orderBy": {
  54981. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  54982. // "location": "query",
  54983. // "type": "string"
  54984. // },
  54985. // "pageToken": {
  54986. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  54987. // "location": "query",
  54988. // "type": "string"
  54989. // },
  54990. // "project": {
  54991. // "description": "Project ID for this request.",
  54992. // "location": "path",
  54993. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54994. // "required": true,
  54995. // "type": "string"
  54996. // }
  54997. // },
  54998. // "path": "{project}/aggregated/interconnectAttachments",
  54999. // "response": {
  55000. // "$ref": "InterconnectAttachmentAggregatedList"
  55001. // },
  55002. // "scopes": [
  55003. // "https://www.googleapis.com/auth/cloud-platform",
  55004. // "https://www.googleapis.com/auth/compute",
  55005. // "https://www.googleapis.com/auth/compute.readonly"
  55006. // ]
  55007. // }
  55008. }
  55009. // Pages invokes f for each page of results.
  55010. // A non-nil error returned from f will halt the iteration.
  55011. // The provided context supersedes any context provided to the Context method.
  55012. func (c *InterconnectAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentAggregatedList) error) error {
  55013. c.ctx_ = ctx
  55014. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  55015. for {
  55016. x, err := c.Do()
  55017. if err != nil {
  55018. return err
  55019. }
  55020. if err := f(x); err != nil {
  55021. return err
  55022. }
  55023. if x.NextPageToken == "" {
  55024. return nil
  55025. }
  55026. c.PageToken(x.NextPageToken)
  55027. }
  55028. }
  55029. // method id "compute.interconnectAttachments.delete":
  55030. type InterconnectAttachmentsDeleteCall struct {
  55031. s *Service
  55032. project string
  55033. region string
  55034. interconnectAttachment string
  55035. urlParams_ gensupport.URLParams
  55036. ctx_ context.Context
  55037. header_ http.Header
  55038. }
  55039. // Delete: Deletes the specified interconnect attachment.
  55040. func (r *InterconnectAttachmentsService) Delete(project string, region string, interconnectAttachment string) *InterconnectAttachmentsDeleteCall {
  55041. c := &InterconnectAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55042. c.project = project
  55043. c.region = region
  55044. c.interconnectAttachment = interconnectAttachment
  55045. return c
  55046. }
  55047. // RequestId sets the optional parameter "requestId": An optional
  55048. // request ID to identify requests. Specify a unique request ID so that
  55049. // if you must retry your request, the server will know to ignore the
  55050. // request if it has already been completed.
  55051. //
  55052. // For example, consider a situation where you make an initial request
  55053. // and the request times out. If you make the request again with the
  55054. // same request ID, the server can check if original operation with the
  55055. // same request ID was received, and if so, will ignore the second
  55056. // request. This prevents clients from accidentally creating duplicate
  55057. // commitments.
  55058. //
  55059. // The request ID must be a valid UUID with the exception that zero UUID
  55060. // is not supported (00000000-0000-0000-0000-000000000000).
  55061. func (c *InterconnectAttachmentsDeleteCall) RequestId(requestId string) *InterconnectAttachmentsDeleteCall {
  55062. c.urlParams_.Set("requestId", requestId)
  55063. return c
  55064. }
  55065. // Fields allows partial responses to be retrieved. See
  55066. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55067. // for more information.
  55068. func (c *InterconnectAttachmentsDeleteCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsDeleteCall {
  55069. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55070. return c
  55071. }
  55072. // Context sets the context to be used in this call's Do method. Any
  55073. // pending HTTP request will be aborted if the provided context is
  55074. // canceled.
  55075. func (c *InterconnectAttachmentsDeleteCall) Context(ctx context.Context) *InterconnectAttachmentsDeleteCall {
  55076. c.ctx_ = ctx
  55077. return c
  55078. }
  55079. // Header returns an http.Header that can be modified by the caller to
  55080. // add HTTP headers to the request.
  55081. func (c *InterconnectAttachmentsDeleteCall) Header() http.Header {
  55082. if c.header_ == nil {
  55083. c.header_ = make(http.Header)
  55084. }
  55085. return c.header_
  55086. }
  55087. func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  55088. reqHeaders := make(http.Header)
  55089. for k, v := range c.header_ {
  55090. reqHeaders[k] = v
  55091. }
  55092. reqHeaders.Set("User-Agent", c.s.userAgent())
  55093. var body io.Reader = nil
  55094. c.urlParams_.Set("alt", alt)
  55095. c.urlParams_.Set("prettyPrint", "false")
  55096. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  55097. urls += "?" + c.urlParams_.Encode()
  55098. req, err := http.NewRequest("DELETE", urls, body)
  55099. if err != nil {
  55100. return nil, err
  55101. }
  55102. req.Header = reqHeaders
  55103. googleapi.Expand(req.URL, map[string]string{
  55104. "project": c.project,
  55105. "region": c.region,
  55106. "interconnectAttachment": c.interconnectAttachment,
  55107. })
  55108. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55109. }
  55110. // Do executes the "compute.interconnectAttachments.delete" call.
  55111. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55112. // status code is an error. Response headers are in either
  55113. // *Operation.ServerResponse.Header or (if a response was returned at
  55114. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55115. // to check whether the returned error was because
  55116. // http.StatusNotModified was returned.
  55117. func (c *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55118. gensupport.SetOptions(c.urlParams_, opts...)
  55119. res, err := c.doRequest("json")
  55120. if res != nil && res.StatusCode == http.StatusNotModified {
  55121. if res.Body != nil {
  55122. res.Body.Close()
  55123. }
  55124. return nil, &googleapi.Error{
  55125. Code: res.StatusCode,
  55126. Header: res.Header,
  55127. }
  55128. }
  55129. if err != nil {
  55130. return nil, err
  55131. }
  55132. defer googleapi.CloseBody(res)
  55133. if err := googleapi.CheckResponse(res); err != nil {
  55134. return nil, err
  55135. }
  55136. ret := &Operation{
  55137. ServerResponse: googleapi.ServerResponse{
  55138. Header: res.Header,
  55139. HTTPStatusCode: res.StatusCode,
  55140. },
  55141. }
  55142. target := &ret
  55143. if err := gensupport.DecodeResponse(target, res); err != nil {
  55144. return nil, err
  55145. }
  55146. return ret, nil
  55147. // {
  55148. // "description": "Deletes the specified interconnect attachment.",
  55149. // "httpMethod": "DELETE",
  55150. // "id": "compute.interconnectAttachments.delete",
  55151. // "parameterOrder": [
  55152. // "project",
  55153. // "region",
  55154. // "interconnectAttachment"
  55155. // ],
  55156. // "parameters": {
  55157. // "interconnectAttachment": {
  55158. // "description": "Name of the interconnect attachment to delete.",
  55159. // "location": "path",
  55160. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  55161. // "required": true,
  55162. // "type": "string"
  55163. // },
  55164. // "project": {
  55165. // "description": "Project ID for this request.",
  55166. // "location": "path",
  55167. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55168. // "required": true,
  55169. // "type": "string"
  55170. // },
  55171. // "region": {
  55172. // "description": "Name of the region for this request.",
  55173. // "location": "path",
  55174. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55175. // "required": true,
  55176. // "type": "string"
  55177. // },
  55178. // "requestId": {
  55179. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55180. // "location": "query",
  55181. // "type": "string"
  55182. // }
  55183. // },
  55184. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  55185. // "response": {
  55186. // "$ref": "Operation"
  55187. // },
  55188. // "scopes": [
  55189. // "https://www.googleapis.com/auth/cloud-platform",
  55190. // "https://www.googleapis.com/auth/compute"
  55191. // ]
  55192. // }
  55193. }
  55194. // method id "compute.interconnectAttachments.get":
  55195. type InterconnectAttachmentsGetCall struct {
  55196. s *Service
  55197. project string
  55198. region string
  55199. interconnectAttachment string
  55200. urlParams_ gensupport.URLParams
  55201. ifNoneMatch_ string
  55202. ctx_ context.Context
  55203. header_ http.Header
  55204. }
  55205. // Get: Returns the specified interconnect attachment.
  55206. func (r *InterconnectAttachmentsService) Get(project string, region string, interconnectAttachment string) *InterconnectAttachmentsGetCall {
  55207. c := &InterconnectAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55208. c.project = project
  55209. c.region = region
  55210. c.interconnectAttachment = interconnectAttachment
  55211. return c
  55212. }
  55213. // Fields allows partial responses to be retrieved. See
  55214. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55215. // for more information.
  55216. func (c *InterconnectAttachmentsGetCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetCall {
  55217. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55218. return c
  55219. }
  55220. // IfNoneMatch sets the optional parameter which makes the operation
  55221. // fail if the object's ETag matches the given value. This is useful for
  55222. // getting updates only after the object has changed since the last
  55223. // request. Use googleapi.IsNotModified to check whether the response
  55224. // error from Do is the result of In-None-Match.
  55225. func (c *InterconnectAttachmentsGetCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetCall {
  55226. c.ifNoneMatch_ = entityTag
  55227. return c
  55228. }
  55229. // Context sets the context to be used in this call's Do method. Any
  55230. // pending HTTP request will be aborted if the provided context is
  55231. // canceled.
  55232. func (c *InterconnectAttachmentsGetCall) Context(ctx context.Context) *InterconnectAttachmentsGetCall {
  55233. c.ctx_ = ctx
  55234. return c
  55235. }
  55236. // Header returns an http.Header that can be modified by the caller to
  55237. // add HTTP headers to the request.
  55238. func (c *InterconnectAttachmentsGetCall) Header() http.Header {
  55239. if c.header_ == nil {
  55240. c.header_ = make(http.Header)
  55241. }
  55242. return c.header_
  55243. }
  55244. func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
  55245. reqHeaders := make(http.Header)
  55246. for k, v := range c.header_ {
  55247. reqHeaders[k] = v
  55248. }
  55249. reqHeaders.Set("User-Agent", c.s.userAgent())
  55250. if c.ifNoneMatch_ != "" {
  55251. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55252. }
  55253. var body io.Reader = nil
  55254. c.urlParams_.Set("alt", alt)
  55255. c.urlParams_.Set("prettyPrint", "false")
  55256. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  55257. urls += "?" + c.urlParams_.Encode()
  55258. req, err := http.NewRequest("GET", urls, body)
  55259. if err != nil {
  55260. return nil, err
  55261. }
  55262. req.Header = reqHeaders
  55263. googleapi.Expand(req.URL, map[string]string{
  55264. "project": c.project,
  55265. "region": c.region,
  55266. "interconnectAttachment": c.interconnectAttachment,
  55267. })
  55268. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55269. }
  55270. // Do executes the "compute.interconnectAttachments.get" call.
  55271. // Exactly one of *InterconnectAttachment or error will be non-nil. Any
  55272. // non-2xx status code is an error. Response headers are in either
  55273. // *InterconnectAttachment.ServerResponse.Header or (if a response was
  55274. // returned at all) in error.(*googleapi.Error).Header. Use
  55275. // googleapi.IsNotModified to check whether the returned error was
  55276. // because http.StatusNotModified was returned.
  55277. func (c *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachment, error) {
  55278. gensupport.SetOptions(c.urlParams_, opts...)
  55279. res, err := c.doRequest("json")
  55280. if res != nil && res.StatusCode == http.StatusNotModified {
  55281. if res.Body != nil {
  55282. res.Body.Close()
  55283. }
  55284. return nil, &googleapi.Error{
  55285. Code: res.StatusCode,
  55286. Header: res.Header,
  55287. }
  55288. }
  55289. if err != nil {
  55290. return nil, err
  55291. }
  55292. defer googleapi.CloseBody(res)
  55293. if err := googleapi.CheckResponse(res); err != nil {
  55294. return nil, err
  55295. }
  55296. ret := &InterconnectAttachment{
  55297. ServerResponse: googleapi.ServerResponse{
  55298. Header: res.Header,
  55299. HTTPStatusCode: res.StatusCode,
  55300. },
  55301. }
  55302. target := &ret
  55303. if err := gensupport.DecodeResponse(target, res); err != nil {
  55304. return nil, err
  55305. }
  55306. return ret, nil
  55307. // {
  55308. // "description": "Returns the specified interconnect attachment.",
  55309. // "httpMethod": "GET",
  55310. // "id": "compute.interconnectAttachments.get",
  55311. // "parameterOrder": [
  55312. // "project",
  55313. // "region",
  55314. // "interconnectAttachment"
  55315. // ],
  55316. // "parameters": {
  55317. // "interconnectAttachment": {
  55318. // "description": "Name of the interconnect attachment to return.",
  55319. // "location": "path",
  55320. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  55321. // "required": true,
  55322. // "type": "string"
  55323. // },
  55324. // "project": {
  55325. // "description": "Project ID for this request.",
  55326. // "location": "path",
  55327. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55328. // "required": true,
  55329. // "type": "string"
  55330. // },
  55331. // "region": {
  55332. // "description": "Name of the region for this request.",
  55333. // "location": "path",
  55334. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55335. // "required": true,
  55336. // "type": "string"
  55337. // }
  55338. // },
  55339. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  55340. // "response": {
  55341. // "$ref": "InterconnectAttachment"
  55342. // },
  55343. // "scopes": [
  55344. // "https://www.googleapis.com/auth/cloud-platform",
  55345. // "https://www.googleapis.com/auth/compute",
  55346. // "https://www.googleapis.com/auth/compute.readonly"
  55347. // ]
  55348. // }
  55349. }
  55350. // method id "compute.interconnectAttachments.insert":
  55351. type InterconnectAttachmentsInsertCall struct {
  55352. s *Service
  55353. project string
  55354. region string
  55355. interconnectattachment *InterconnectAttachment
  55356. urlParams_ gensupport.URLParams
  55357. ctx_ context.Context
  55358. header_ http.Header
  55359. }
  55360. // Insert: Creates an InterconnectAttachment in the specified project
  55361. // using the data included in the request.
  55362. func (r *InterconnectAttachmentsService) Insert(project string, region string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsInsertCall {
  55363. c := &InterconnectAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55364. c.project = project
  55365. c.region = region
  55366. c.interconnectattachment = interconnectattachment
  55367. return c
  55368. }
  55369. // RequestId sets the optional parameter "requestId": An optional
  55370. // request ID to identify requests. Specify a unique request ID so that
  55371. // if you must retry your request, the server will know to ignore the
  55372. // request if it has already been completed.
  55373. //
  55374. // For example, consider a situation where you make an initial request
  55375. // and the request times out. If you make the request again with the
  55376. // same request ID, the server can check if original operation with the
  55377. // same request ID was received, and if so, will ignore the second
  55378. // request. This prevents clients from accidentally creating duplicate
  55379. // commitments.
  55380. //
  55381. // The request ID must be a valid UUID with the exception that zero UUID
  55382. // is not supported (00000000-0000-0000-0000-000000000000).
  55383. func (c *InterconnectAttachmentsInsertCall) RequestId(requestId string) *InterconnectAttachmentsInsertCall {
  55384. c.urlParams_.Set("requestId", requestId)
  55385. return c
  55386. }
  55387. // Fields allows partial responses to be retrieved. See
  55388. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55389. // for more information.
  55390. func (c *InterconnectAttachmentsInsertCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsInsertCall {
  55391. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55392. return c
  55393. }
  55394. // Context sets the context to be used in this call's Do method. Any
  55395. // pending HTTP request will be aborted if the provided context is
  55396. // canceled.
  55397. func (c *InterconnectAttachmentsInsertCall) Context(ctx context.Context) *InterconnectAttachmentsInsertCall {
  55398. c.ctx_ = ctx
  55399. return c
  55400. }
  55401. // Header returns an http.Header that can be modified by the caller to
  55402. // add HTTP headers to the request.
  55403. func (c *InterconnectAttachmentsInsertCall) Header() http.Header {
  55404. if c.header_ == nil {
  55405. c.header_ = make(http.Header)
  55406. }
  55407. return c.header_
  55408. }
  55409. func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  55410. reqHeaders := make(http.Header)
  55411. for k, v := range c.header_ {
  55412. reqHeaders[k] = v
  55413. }
  55414. reqHeaders.Set("User-Agent", c.s.userAgent())
  55415. var body io.Reader = nil
  55416. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  55417. if err != nil {
  55418. return nil, err
  55419. }
  55420. reqHeaders.Set("Content-Type", "application/json")
  55421. c.urlParams_.Set("alt", alt)
  55422. c.urlParams_.Set("prettyPrint", "false")
  55423. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  55424. urls += "?" + c.urlParams_.Encode()
  55425. req, err := http.NewRequest("POST", urls, body)
  55426. if err != nil {
  55427. return nil, err
  55428. }
  55429. req.Header = reqHeaders
  55430. googleapi.Expand(req.URL, map[string]string{
  55431. "project": c.project,
  55432. "region": c.region,
  55433. })
  55434. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55435. }
  55436. // Do executes the "compute.interconnectAttachments.insert" call.
  55437. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55438. // status code is an error. Response headers are in either
  55439. // *Operation.ServerResponse.Header or (if a response was returned at
  55440. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55441. // to check whether the returned error was because
  55442. // http.StatusNotModified was returned.
  55443. func (c *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55444. gensupport.SetOptions(c.urlParams_, opts...)
  55445. res, err := c.doRequest("json")
  55446. if res != nil && res.StatusCode == http.StatusNotModified {
  55447. if res.Body != nil {
  55448. res.Body.Close()
  55449. }
  55450. return nil, &googleapi.Error{
  55451. Code: res.StatusCode,
  55452. Header: res.Header,
  55453. }
  55454. }
  55455. if err != nil {
  55456. return nil, err
  55457. }
  55458. defer googleapi.CloseBody(res)
  55459. if err := googleapi.CheckResponse(res); err != nil {
  55460. return nil, err
  55461. }
  55462. ret := &Operation{
  55463. ServerResponse: googleapi.ServerResponse{
  55464. Header: res.Header,
  55465. HTTPStatusCode: res.StatusCode,
  55466. },
  55467. }
  55468. target := &ret
  55469. if err := gensupport.DecodeResponse(target, res); err != nil {
  55470. return nil, err
  55471. }
  55472. return ret, nil
  55473. // {
  55474. // "description": "Creates an InterconnectAttachment in the specified project using the data included in the request.",
  55475. // "httpMethod": "POST",
  55476. // "id": "compute.interconnectAttachments.insert",
  55477. // "parameterOrder": [
  55478. // "project",
  55479. // "region"
  55480. // ],
  55481. // "parameters": {
  55482. // "project": {
  55483. // "description": "Project ID for this request.",
  55484. // "location": "path",
  55485. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55486. // "required": true,
  55487. // "type": "string"
  55488. // },
  55489. // "region": {
  55490. // "description": "Name of the region for this request.",
  55491. // "location": "path",
  55492. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55493. // "required": true,
  55494. // "type": "string"
  55495. // },
  55496. // "requestId": {
  55497. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55498. // "location": "query",
  55499. // "type": "string"
  55500. // }
  55501. // },
  55502. // "path": "{project}/regions/{region}/interconnectAttachments",
  55503. // "request": {
  55504. // "$ref": "InterconnectAttachment"
  55505. // },
  55506. // "response": {
  55507. // "$ref": "Operation"
  55508. // },
  55509. // "scopes": [
  55510. // "https://www.googleapis.com/auth/cloud-platform",
  55511. // "https://www.googleapis.com/auth/compute"
  55512. // ]
  55513. // }
  55514. }
  55515. // method id "compute.interconnectAttachments.list":
  55516. type InterconnectAttachmentsListCall struct {
  55517. s *Service
  55518. project string
  55519. region string
  55520. urlParams_ gensupport.URLParams
  55521. ifNoneMatch_ string
  55522. ctx_ context.Context
  55523. header_ http.Header
  55524. }
  55525. // List: Retrieves the list of interconnect attachments contained within
  55526. // the specified region.
  55527. func (r *InterconnectAttachmentsService) List(project string, region string) *InterconnectAttachmentsListCall {
  55528. c := &InterconnectAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55529. c.project = project
  55530. c.region = region
  55531. return c
  55532. }
  55533. // Filter sets the optional parameter "filter": A filter expression that
  55534. // filters resources listed in the response. The expression must specify
  55535. // the field name, a comparison operator, and the value that you want to
  55536. // use for filtering. The value must be a string, a number, or a
  55537. // boolean. The comparison operator must be either =, !=, >, or <.
  55538. //
  55539. // For example, if you are filtering Compute Engine instances, you can
  55540. // exclude instances named example-instance by specifying name !=
  55541. // example-instance.
  55542. //
  55543. // You can also filter nested fields. For example, you could specify
  55544. // scheduling.automaticRestart = false to include instances only if they
  55545. // are not scheduled for automatic restarts. You can use filtering on
  55546. // nested fields to filter based on resource labels.
  55547. //
  55548. // To filter on multiple expressions, provide each separate expression
  55549. // within parentheses. For example, (scheduling.automaticRestart = true)
  55550. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  55551. // AND expression. However, you can include AND and OR expressions
  55552. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  55553. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  55554. // true).
  55555. func (c *InterconnectAttachmentsListCall) Filter(filter string) *InterconnectAttachmentsListCall {
  55556. c.urlParams_.Set("filter", filter)
  55557. return c
  55558. }
  55559. // MaxResults sets the optional parameter "maxResults": The maximum
  55560. // number of results per page that should be returned. If the number of
  55561. // available results is larger than maxResults, Compute Engine returns a
  55562. // nextPageToken that can be used to get the next page of results in
  55563. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55564. // (Default: 500)
  55565. func (c *InterconnectAttachmentsListCall) MaxResults(maxResults int64) *InterconnectAttachmentsListCall {
  55566. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55567. return c
  55568. }
  55569. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55570. // a certain order. By default, results are returned in alphanumerical
  55571. // order based on the resource name.
  55572. //
  55573. // You can also sort results in descending order based on the creation
  55574. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55575. // based on the creationTimestamp field in reverse chronological order
  55576. // (newest result first). Use this to sort resources like operations so
  55577. // that the newest operation is returned first.
  55578. //
  55579. // Currently, only sorting by name or creationTimestamp desc is
  55580. // supported.
  55581. func (c *InterconnectAttachmentsListCall) OrderBy(orderBy string) *InterconnectAttachmentsListCall {
  55582. c.urlParams_.Set("orderBy", orderBy)
  55583. return c
  55584. }
  55585. // PageToken sets the optional parameter "pageToken": Specifies a page
  55586. // token to use. Set pageToken to the nextPageToken returned by a
  55587. // previous list request to get the next page of results.
  55588. func (c *InterconnectAttachmentsListCall) PageToken(pageToken string) *InterconnectAttachmentsListCall {
  55589. c.urlParams_.Set("pageToken", pageToken)
  55590. return c
  55591. }
  55592. // Fields allows partial responses to be retrieved. See
  55593. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55594. // for more information.
  55595. func (c *InterconnectAttachmentsListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsListCall {
  55596. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55597. return c
  55598. }
  55599. // IfNoneMatch sets the optional parameter which makes the operation
  55600. // fail if the object's ETag matches the given value. This is useful for
  55601. // getting updates only after the object has changed since the last
  55602. // request. Use googleapi.IsNotModified to check whether the response
  55603. // error from Do is the result of In-None-Match.
  55604. func (c *InterconnectAttachmentsListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsListCall {
  55605. c.ifNoneMatch_ = entityTag
  55606. return c
  55607. }
  55608. // Context sets the context to be used in this call's Do method. Any
  55609. // pending HTTP request will be aborted if the provided context is
  55610. // canceled.
  55611. func (c *InterconnectAttachmentsListCall) Context(ctx context.Context) *InterconnectAttachmentsListCall {
  55612. c.ctx_ = ctx
  55613. return c
  55614. }
  55615. // Header returns an http.Header that can be modified by the caller to
  55616. // add HTTP headers to the request.
  55617. func (c *InterconnectAttachmentsListCall) Header() http.Header {
  55618. if c.header_ == nil {
  55619. c.header_ = make(http.Header)
  55620. }
  55621. return c.header_
  55622. }
  55623. func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
  55624. reqHeaders := make(http.Header)
  55625. for k, v := range c.header_ {
  55626. reqHeaders[k] = v
  55627. }
  55628. reqHeaders.Set("User-Agent", c.s.userAgent())
  55629. if c.ifNoneMatch_ != "" {
  55630. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55631. }
  55632. var body io.Reader = nil
  55633. c.urlParams_.Set("alt", alt)
  55634. c.urlParams_.Set("prettyPrint", "false")
  55635. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  55636. urls += "?" + c.urlParams_.Encode()
  55637. req, err := http.NewRequest("GET", urls, body)
  55638. if err != nil {
  55639. return nil, err
  55640. }
  55641. req.Header = reqHeaders
  55642. googleapi.Expand(req.URL, map[string]string{
  55643. "project": c.project,
  55644. "region": c.region,
  55645. })
  55646. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55647. }
  55648. // Do executes the "compute.interconnectAttachments.list" call.
  55649. // Exactly one of *InterconnectAttachmentList or error will be non-nil.
  55650. // Any non-2xx status code is an error. Response headers are in either
  55651. // *InterconnectAttachmentList.ServerResponse.Header or (if a response
  55652. // was returned at all) in error.(*googleapi.Error).Header. Use
  55653. // googleapi.IsNotModified to check whether the returned error was
  55654. // because http.StatusNotModified was returned.
  55655. func (c *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentList, error) {
  55656. gensupport.SetOptions(c.urlParams_, opts...)
  55657. res, err := c.doRequest("json")
  55658. if res != nil && res.StatusCode == http.StatusNotModified {
  55659. if res.Body != nil {
  55660. res.Body.Close()
  55661. }
  55662. return nil, &googleapi.Error{
  55663. Code: res.StatusCode,
  55664. Header: res.Header,
  55665. }
  55666. }
  55667. if err != nil {
  55668. return nil, err
  55669. }
  55670. defer googleapi.CloseBody(res)
  55671. if err := googleapi.CheckResponse(res); err != nil {
  55672. return nil, err
  55673. }
  55674. ret := &InterconnectAttachmentList{
  55675. ServerResponse: googleapi.ServerResponse{
  55676. Header: res.Header,
  55677. HTTPStatusCode: res.StatusCode,
  55678. },
  55679. }
  55680. target := &ret
  55681. if err := gensupport.DecodeResponse(target, res); err != nil {
  55682. return nil, err
  55683. }
  55684. return ret, nil
  55685. // {
  55686. // "description": "Retrieves the list of interconnect attachments contained within the specified region.",
  55687. // "httpMethod": "GET",
  55688. // "id": "compute.interconnectAttachments.list",
  55689. // "parameterOrder": [
  55690. // "project",
  55691. // "region"
  55692. // ],
  55693. // "parameters": {
  55694. // "filter": {
  55695. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  55696. // "location": "query",
  55697. // "type": "string"
  55698. // },
  55699. // "maxResults": {
  55700. // "default": "500",
  55701. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  55702. // "format": "uint32",
  55703. // "location": "query",
  55704. // "minimum": "0",
  55705. // "type": "integer"
  55706. // },
  55707. // "orderBy": {
  55708. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  55709. // "location": "query",
  55710. // "type": "string"
  55711. // },
  55712. // "pageToken": {
  55713. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  55714. // "location": "query",
  55715. // "type": "string"
  55716. // },
  55717. // "project": {
  55718. // "description": "Project ID for this request.",
  55719. // "location": "path",
  55720. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55721. // "required": true,
  55722. // "type": "string"
  55723. // },
  55724. // "region": {
  55725. // "description": "Name of the region for this request.",
  55726. // "location": "path",
  55727. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55728. // "required": true,
  55729. // "type": "string"
  55730. // }
  55731. // },
  55732. // "path": "{project}/regions/{region}/interconnectAttachments",
  55733. // "response": {
  55734. // "$ref": "InterconnectAttachmentList"
  55735. // },
  55736. // "scopes": [
  55737. // "https://www.googleapis.com/auth/cloud-platform",
  55738. // "https://www.googleapis.com/auth/compute",
  55739. // "https://www.googleapis.com/auth/compute.readonly"
  55740. // ]
  55741. // }
  55742. }
  55743. // Pages invokes f for each page of results.
  55744. // A non-nil error returned from f will halt the iteration.
  55745. // The provided context supersedes any context provided to the Context method.
  55746. func (c *InterconnectAttachmentsListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentList) error) error {
  55747. c.ctx_ = ctx
  55748. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  55749. for {
  55750. x, err := c.Do()
  55751. if err != nil {
  55752. return err
  55753. }
  55754. if err := f(x); err != nil {
  55755. return err
  55756. }
  55757. if x.NextPageToken == "" {
  55758. return nil
  55759. }
  55760. c.PageToken(x.NextPageToken)
  55761. }
  55762. }
  55763. // method id "compute.interconnectAttachments.patch":
  55764. type InterconnectAttachmentsPatchCall struct {
  55765. s *Service
  55766. project string
  55767. region string
  55768. interconnectAttachment string
  55769. interconnectattachment *InterconnectAttachment
  55770. urlParams_ gensupport.URLParams
  55771. ctx_ context.Context
  55772. header_ http.Header
  55773. }
  55774. // Patch: Updates the specified interconnect attachment with the data
  55775. // included in the request. This method supports PATCH semantics and
  55776. // uses the JSON merge patch format and processing rules.
  55777. func (r *InterconnectAttachmentsService) Patch(project string, region string, interconnectAttachment string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsPatchCall {
  55778. c := &InterconnectAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55779. c.project = project
  55780. c.region = region
  55781. c.interconnectAttachment = interconnectAttachment
  55782. c.interconnectattachment = interconnectattachment
  55783. return c
  55784. }
  55785. // RequestId sets the optional parameter "requestId": An optional
  55786. // request ID to identify requests. Specify a unique request ID so that
  55787. // if you must retry your request, the server will know to ignore the
  55788. // request if it has already been completed.
  55789. //
  55790. // For example, consider a situation where you make an initial request
  55791. // and the request times out. If you make the request again with the
  55792. // same request ID, the server can check if original operation with the
  55793. // same request ID was received, and if so, will ignore the second
  55794. // request. This prevents clients from accidentally creating duplicate
  55795. // commitments.
  55796. //
  55797. // The request ID must be a valid UUID with the exception that zero UUID
  55798. // is not supported (00000000-0000-0000-0000-000000000000).
  55799. func (c *InterconnectAttachmentsPatchCall) RequestId(requestId string) *InterconnectAttachmentsPatchCall {
  55800. c.urlParams_.Set("requestId", requestId)
  55801. return c
  55802. }
  55803. // Fields allows partial responses to be retrieved. See
  55804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55805. // for more information.
  55806. func (c *InterconnectAttachmentsPatchCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsPatchCall {
  55807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55808. return c
  55809. }
  55810. // Context sets the context to be used in this call's Do method. Any
  55811. // pending HTTP request will be aborted if the provided context is
  55812. // canceled.
  55813. func (c *InterconnectAttachmentsPatchCall) Context(ctx context.Context) *InterconnectAttachmentsPatchCall {
  55814. c.ctx_ = ctx
  55815. return c
  55816. }
  55817. // Header returns an http.Header that can be modified by the caller to
  55818. // add HTTP headers to the request.
  55819. func (c *InterconnectAttachmentsPatchCall) Header() http.Header {
  55820. if c.header_ == nil {
  55821. c.header_ = make(http.Header)
  55822. }
  55823. return c.header_
  55824. }
  55825. func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) {
  55826. reqHeaders := make(http.Header)
  55827. for k, v := range c.header_ {
  55828. reqHeaders[k] = v
  55829. }
  55830. reqHeaders.Set("User-Agent", c.s.userAgent())
  55831. var body io.Reader = nil
  55832. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  55833. if err != nil {
  55834. return nil, err
  55835. }
  55836. reqHeaders.Set("Content-Type", "application/json")
  55837. c.urlParams_.Set("alt", alt)
  55838. c.urlParams_.Set("prettyPrint", "false")
  55839. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  55840. urls += "?" + c.urlParams_.Encode()
  55841. req, err := http.NewRequest("PATCH", urls, body)
  55842. if err != nil {
  55843. return nil, err
  55844. }
  55845. req.Header = reqHeaders
  55846. googleapi.Expand(req.URL, map[string]string{
  55847. "project": c.project,
  55848. "region": c.region,
  55849. "interconnectAttachment": c.interconnectAttachment,
  55850. })
  55851. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55852. }
  55853. // Do executes the "compute.interconnectAttachments.patch" call.
  55854. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55855. // status code is an error. Response headers are in either
  55856. // *Operation.ServerResponse.Header or (if a response was returned at
  55857. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55858. // to check whether the returned error was because
  55859. // http.StatusNotModified was returned.
  55860. func (c *InterconnectAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55861. gensupport.SetOptions(c.urlParams_, opts...)
  55862. res, err := c.doRequest("json")
  55863. if res != nil && res.StatusCode == http.StatusNotModified {
  55864. if res.Body != nil {
  55865. res.Body.Close()
  55866. }
  55867. return nil, &googleapi.Error{
  55868. Code: res.StatusCode,
  55869. Header: res.Header,
  55870. }
  55871. }
  55872. if err != nil {
  55873. return nil, err
  55874. }
  55875. defer googleapi.CloseBody(res)
  55876. if err := googleapi.CheckResponse(res); err != nil {
  55877. return nil, err
  55878. }
  55879. ret := &Operation{
  55880. ServerResponse: googleapi.ServerResponse{
  55881. Header: res.Header,
  55882. HTTPStatusCode: res.StatusCode,
  55883. },
  55884. }
  55885. target := &ret
  55886. if err := gensupport.DecodeResponse(target, res); err != nil {
  55887. return nil, err
  55888. }
  55889. return ret, nil
  55890. // {
  55891. // "description": "Updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  55892. // "httpMethod": "PATCH",
  55893. // "id": "compute.interconnectAttachments.patch",
  55894. // "parameterOrder": [
  55895. // "project",
  55896. // "region",
  55897. // "interconnectAttachment"
  55898. // ],
  55899. // "parameters": {
  55900. // "interconnectAttachment": {
  55901. // "description": "Name of the interconnect attachment to patch.",
  55902. // "location": "path",
  55903. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  55904. // "required": true,
  55905. // "type": "string"
  55906. // },
  55907. // "project": {
  55908. // "description": "Project ID for this request.",
  55909. // "location": "path",
  55910. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55911. // "required": true,
  55912. // "type": "string"
  55913. // },
  55914. // "region": {
  55915. // "description": "Name of the region scoping this request.",
  55916. // "location": "path",
  55917. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55918. // "required": true,
  55919. // "type": "string"
  55920. // },
  55921. // "requestId": {
  55922. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55923. // "location": "query",
  55924. // "type": "string"
  55925. // }
  55926. // },
  55927. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  55928. // "request": {
  55929. // "$ref": "InterconnectAttachment"
  55930. // },
  55931. // "response": {
  55932. // "$ref": "Operation"
  55933. // },
  55934. // "scopes": [
  55935. // "https://www.googleapis.com/auth/cloud-platform",
  55936. // "https://www.googleapis.com/auth/compute"
  55937. // ]
  55938. // }
  55939. }
  55940. // method id "compute.interconnectLocations.get":
  55941. type InterconnectLocationsGetCall struct {
  55942. s *Service
  55943. project string
  55944. interconnectLocation string
  55945. urlParams_ gensupport.URLParams
  55946. ifNoneMatch_ string
  55947. ctx_ context.Context
  55948. header_ http.Header
  55949. }
  55950. // Get: Returns the details for the specified interconnect location.
  55951. // Gets a list of available interconnect locations by making a list()
  55952. // request.
  55953. func (r *InterconnectLocationsService) Get(project string, interconnectLocation string) *InterconnectLocationsGetCall {
  55954. c := &InterconnectLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55955. c.project = project
  55956. c.interconnectLocation = interconnectLocation
  55957. return c
  55958. }
  55959. // Fields allows partial responses to be retrieved. See
  55960. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55961. // for more information.
  55962. func (c *InterconnectLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectLocationsGetCall {
  55963. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55964. return c
  55965. }
  55966. // IfNoneMatch sets the optional parameter which makes the operation
  55967. // fail if the object's ETag matches the given value. This is useful for
  55968. // getting updates only after the object has changed since the last
  55969. // request. Use googleapi.IsNotModified to check whether the response
  55970. // error from Do is the result of In-None-Match.
  55971. func (c *InterconnectLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectLocationsGetCall {
  55972. c.ifNoneMatch_ = entityTag
  55973. return c
  55974. }
  55975. // Context sets the context to be used in this call's Do method. Any
  55976. // pending HTTP request will be aborted if the provided context is
  55977. // canceled.
  55978. func (c *InterconnectLocationsGetCall) Context(ctx context.Context) *InterconnectLocationsGetCall {
  55979. c.ctx_ = ctx
  55980. return c
  55981. }
  55982. // Header returns an http.Header that can be modified by the caller to
  55983. // add HTTP headers to the request.
  55984. func (c *InterconnectLocationsGetCall) Header() http.Header {
  55985. if c.header_ == nil {
  55986. c.header_ = make(http.Header)
  55987. }
  55988. return c.header_
  55989. }
  55990. func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  55991. reqHeaders := make(http.Header)
  55992. for k, v := range c.header_ {
  55993. reqHeaders[k] = v
  55994. }
  55995. reqHeaders.Set("User-Agent", c.s.userAgent())
  55996. if c.ifNoneMatch_ != "" {
  55997. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55998. }
  55999. var body io.Reader = nil
  56000. c.urlParams_.Set("alt", alt)
  56001. c.urlParams_.Set("prettyPrint", "false")
  56002. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations/{interconnectLocation}")
  56003. urls += "?" + c.urlParams_.Encode()
  56004. req, err := http.NewRequest("GET", urls, body)
  56005. if err != nil {
  56006. return nil, err
  56007. }
  56008. req.Header = reqHeaders
  56009. googleapi.Expand(req.URL, map[string]string{
  56010. "project": c.project,
  56011. "interconnectLocation": c.interconnectLocation,
  56012. })
  56013. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56014. }
  56015. // Do executes the "compute.interconnectLocations.get" call.
  56016. // Exactly one of *InterconnectLocation or error will be non-nil. Any
  56017. // non-2xx status code is an error. Response headers are in either
  56018. // *InterconnectLocation.ServerResponse.Header or (if a response was
  56019. // returned at all) in error.(*googleapi.Error).Header. Use
  56020. // googleapi.IsNotModified to check whether the returned error was
  56021. // because http.StatusNotModified was returned.
  56022. func (c *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectLocation, error) {
  56023. gensupport.SetOptions(c.urlParams_, opts...)
  56024. res, err := c.doRequest("json")
  56025. if res != nil && res.StatusCode == http.StatusNotModified {
  56026. if res.Body != nil {
  56027. res.Body.Close()
  56028. }
  56029. return nil, &googleapi.Error{
  56030. Code: res.StatusCode,
  56031. Header: res.Header,
  56032. }
  56033. }
  56034. if err != nil {
  56035. return nil, err
  56036. }
  56037. defer googleapi.CloseBody(res)
  56038. if err := googleapi.CheckResponse(res); err != nil {
  56039. return nil, err
  56040. }
  56041. ret := &InterconnectLocation{
  56042. ServerResponse: googleapi.ServerResponse{
  56043. Header: res.Header,
  56044. HTTPStatusCode: res.StatusCode,
  56045. },
  56046. }
  56047. target := &ret
  56048. if err := gensupport.DecodeResponse(target, res); err != nil {
  56049. return nil, err
  56050. }
  56051. return ret, nil
  56052. // {
  56053. // "description": "Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request.",
  56054. // "httpMethod": "GET",
  56055. // "id": "compute.interconnectLocations.get",
  56056. // "parameterOrder": [
  56057. // "project",
  56058. // "interconnectLocation"
  56059. // ],
  56060. // "parameters": {
  56061. // "interconnectLocation": {
  56062. // "description": "Name of the interconnect location to return.",
  56063. // "location": "path",
  56064. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56065. // "required": true,
  56066. // "type": "string"
  56067. // },
  56068. // "project": {
  56069. // "description": "Project ID for this request.",
  56070. // "location": "path",
  56071. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56072. // "required": true,
  56073. // "type": "string"
  56074. // }
  56075. // },
  56076. // "path": "{project}/global/interconnectLocations/{interconnectLocation}",
  56077. // "response": {
  56078. // "$ref": "InterconnectLocation"
  56079. // },
  56080. // "scopes": [
  56081. // "https://www.googleapis.com/auth/cloud-platform",
  56082. // "https://www.googleapis.com/auth/compute",
  56083. // "https://www.googleapis.com/auth/compute.readonly"
  56084. // ]
  56085. // }
  56086. }
  56087. // method id "compute.interconnectLocations.list":
  56088. type InterconnectLocationsListCall struct {
  56089. s *Service
  56090. project string
  56091. urlParams_ gensupport.URLParams
  56092. ifNoneMatch_ string
  56093. ctx_ context.Context
  56094. header_ http.Header
  56095. }
  56096. // List: Retrieves the list of interconnect locations available to the
  56097. // specified project.
  56098. func (r *InterconnectLocationsService) List(project string) *InterconnectLocationsListCall {
  56099. c := &InterconnectLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56100. c.project = project
  56101. return c
  56102. }
  56103. // Filter sets the optional parameter "filter": A filter expression that
  56104. // filters resources listed in the response. The expression must specify
  56105. // the field name, a comparison operator, and the value that you want to
  56106. // use for filtering. The value must be a string, a number, or a
  56107. // boolean. The comparison operator must be either =, !=, >, or <.
  56108. //
  56109. // For example, if you are filtering Compute Engine instances, you can
  56110. // exclude instances named example-instance by specifying name !=
  56111. // example-instance.
  56112. //
  56113. // You can also filter nested fields. For example, you could specify
  56114. // scheduling.automaticRestart = false to include instances only if they
  56115. // are not scheduled for automatic restarts. You can use filtering on
  56116. // nested fields to filter based on resource labels.
  56117. //
  56118. // To filter on multiple expressions, provide each separate expression
  56119. // within parentheses. For example, (scheduling.automaticRestart = true)
  56120. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  56121. // AND expression. However, you can include AND and OR expressions
  56122. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  56123. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  56124. // true).
  56125. func (c *InterconnectLocationsListCall) Filter(filter string) *InterconnectLocationsListCall {
  56126. c.urlParams_.Set("filter", filter)
  56127. return c
  56128. }
  56129. // MaxResults sets the optional parameter "maxResults": The maximum
  56130. // number of results per page that should be returned. If the number of
  56131. // available results is larger than maxResults, Compute Engine returns a
  56132. // nextPageToken that can be used to get the next page of results in
  56133. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  56134. // (Default: 500)
  56135. func (c *InterconnectLocationsListCall) MaxResults(maxResults int64) *InterconnectLocationsListCall {
  56136. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  56137. return c
  56138. }
  56139. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  56140. // a certain order. By default, results are returned in alphanumerical
  56141. // order based on the resource name.
  56142. //
  56143. // You can also sort results in descending order based on the creation
  56144. // timestamp using orderBy="creationTimestamp desc". This sorts results
  56145. // based on the creationTimestamp field in reverse chronological order
  56146. // (newest result first). Use this to sort resources like operations so
  56147. // that the newest operation is returned first.
  56148. //
  56149. // Currently, only sorting by name or creationTimestamp desc is
  56150. // supported.
  56151. func (c *InterconnectLocationsListCall) OrderBy(orderBy string) *InterconnectLocationsListCall {
  56152. c.urlParams_.Set("orderBy", orderBy)
  56153. return c
  56154. }
  56155. // PageToken sets the optional parameter "pageToken": Specifies a page
  56156. // token to use. Set pageToken to the nextPageToken returned by a
  56157. // previous list request to get the next page of results.
  56158. func (c *InterconnectLocationsListCall) PageToken(pageToken string) *InterconnectLocationsListCall {
  56159. c.urlParams_.Set("pageToken", pageToken)
  56160. return c
  56161. }
  56162. // Fields allows partial responses to be retrieved. See
  56163. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56164. // for more information.
  56165. func (c *InterconnectLocationsListCall) Fields(s ...googleapi.Field) *InterconnectLocationsListCall {
  56166. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56167. return c
  56168. }
  56169. // IfNoneMatch sets the optional parameter which makes the operation
  56170. // fail if the object's ETag matches the given value. This is useful for
  56171. // getting updates only after the object has changed since the last
  56172. // request. Use googleapi.IsNotModified to check whether the response
  56173. // error from Do is the result of In-None-Match.
  56174. func (c *InterconnectLocationsListCall) IfNoneMatch(entityTag string) *InterconnectLocationsListCall {
  56175. c.ifNoneMatch_ = entityTag
  56176. return c
  56177. }
  56178. // Context sets the context to be used in this call's Do method. Any
  56179. // pending HTTP request will be aborted if the provided context is
  56180. // canceled.
  56181. func (c *InterconnectLocationsListCall) Context(ctx context.Context) *InterconnectLocationsListCall {
  56182. c.ctx_ = ctx
  56183. return c
  56184. }
  56185. // Header returns an http.Header that can be modified by the caller to
  56186. // add HTTP headers to the request.
  56187. func (c *InterconnectLocationsListCall) Header() http.Header {
  56188. if c.header_ == nil {
  56189. c.header_ = make(http.Header)
  56190. }
  56191. return c.header_
  56192. }
  56193. func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, error) {
  56194. reqHeaders := make(http.Header)
  56195. for k, v := range c.header_ {
  56196. reqHeaders[k] = v
  56197. }
  56198. reqHeaders.Set("User-Agent", c.s.userAgent())
  56199. if c.ifNoneMatch_ != "" {
  56200. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56201. }
  56202. var body io.Reader = nil
  56203. c.urlParams_.Set("alt", alt)
  56204. c.urlParams_.Set("prettyPrint", "false")
  56205. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations")
  56206. urls += "?" + c.urlParams_.Encode()
  56207. req, err := http.NewRequest("GET", urls, body)
  56208. if err != nil {
  56209. return nil, err
  56210. }
  56211. req.Header = reqHeaders
  56212. googleapi.Expand(req.URL, map[string]string{
  56213. "project": c.project,
  56214. })
  56215. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56216. }
  56217. // Do executes the "compute.interconnectLocations.list" call.
  56218. // Exactly one of *InterconnectLocationList or error will be non-nil.
  56219. // Any non-2xx status code is an error. Response headers are in either
  56220. // *InterconnectLocationList.ServerResponse.Header or (if a response was
  56221. // returned at all) in error.(*googleapi.Error).Header. Use
  56222. // googleapi.IsNotModified to check whether the returned error was
  56223. // because http.StatusNotModified was returned.
  56224. func (c *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectLocationList, error) {
  56225. gensupport.SetOptions(c.urlParams_, opts...)
  56226. res, err := c.doRequest("json")
  56227. if res != nil && res.StatusCode == http.StatusNotModified {
  56228. if res.Body != nil {
  56229. res.Body.Close()
  56230. }
  56231. return nil, &googleapi.Error{
  56232. Code: res.StatusCode,
  56233. Header: res.Header,
  56234. }
  56235. }
  56236. if err != nil {
  56237. return nil, err
  56238. }
  56239. defer googleapi.CloseBody(res)
  56240. if err := googleapi.CheckResponse(res); err != nil {
  56241. return nil, err
  56242. }
  56243. ret := &InterconnectLocationList{
  56244. ServerResponse: googleapi.ServerResponse{
  56245. Header: res.Header,
  56246. HTTPStatusCode: res.StatusCode,
  56247. },
  56248. }
  56249. target := &ret
  56250. if err := gensupport.DecodeResponse(target, res); err != nil {
  56251. return nil, err
  56252. }
  56253. return ret, nil
  56254. // {
  56255. // "description": "Retrieves the list of interconnect locations available to the specified project.",
  56256. // "httpMethod": "GET",
  56257. // "id": "compute.interconnectLocations.list",
  56258. // "parameterOrder": [
  56259. // "project"
  56260. // ],
  56261. // "parameters": {
  56262. // "filter": {
  56263. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  56264. // "location": "query",
  56265. // "type": "string"
  56266. // },
  56267. // "maxResults": {
  56268. // "default": "500",
  56269. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  56270. // "format": "uint32",
  56271. // "location": "query",
  56272. // "minimum": "0",
  56273. // "type": "integer"
  56274. // },
  56275. // "orderBy": {
  56276. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  56277. // "location": "query",
  56278. // "type": "string"
  56279. // },
  56280. // "pageToken": {
  56281. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  56282. // "location": "query",
  56283. // "type": "string"
  56284. // },
  56285. // "project": {
  56286. // "description": "Project ID for this request.",
  56287. // "location": "path",
  56288. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56289. // "required": true,
  56290. // "type": "string"
  56291. // }
  56292. // },
  56293. // "path": "{project}/global/interconnectLocations",
  56294. // "response": {
  56295. // "$ref": "InterconnectLocationList"
  56296. // },
  56297. // "scopes": [
  56298. // "https://www.googleapis.com/auth/cloud-platform",
  56299. // "https://www.googleapis.com/auth/compute",
  56300. // "https://www.googleapis.com/auth/compute.readonly"
  56301. // ]
  56302. // }
  56303. }
  56304. // Pages invokes f for each page of results.
  56305. // A non-nil error returned from f will halt the iteration.
  56306. // The provided context supersedes any context provided to the Context method.
  56307. func (c *InterconnectLocationsListCall) Pages(ctx context.Context, f func(*InterconnectLocationList) error) error {
  56308. c.ctx_ = ctx
  56309. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  56310. for {
  56311. x, err := c.Do()
  56312. if err != nil {
  56313. return err
  56314. }
  56315. if err := f(x); err != nil {
  56316. return err
  56317. }
  56318. if x.NextPageToken == "" {
  56319. return nil
  56320. }
  56321. c.PageToken(x.NextPageToken)
  56322. }
  56323. }
  56324. // method id "compute.interconnects.delete":
  56325. type InterconnectsDeleteCall struct {
  56326. s *Service
  56327. project string
  56328. interconnect string
  56329. urlParams_ gensupport.URLParams
  56330. ctx_ context.Context
  56331. header_ http.Header
  56332. }
  56333. // Delete: Deletes the specified interconnect.
  56334. func (r *InterconnectsService) Delete(project string, interconnect string) *InterconnectsDeleteCall {
  56335. c := &InterconnectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56336. c.project = project
  56337. c.interconnect = interconnect
  56338. return c
  56339. }
  56340. // RequestId sets the optional parameter "requestId": An optional
  56341. // request ID to identify requests. Specify a unique request ID so that
  56342. // if you must retry your request, the server will know to ignore the
  56343. // request if it has already been completed.
  56344. //
  56345. // For example, consider a situation where you make an initial request
  56346. // and the request times out. If you make the request again with the
  56347. // same request ID, the server can check if original operation with the
  56348. // same request ID was received, and if so, will ignore the second
  56349. // request. This prevents clients from accidentally creating duplicate
  56350. // commitments.
  56351. //
  56352. // The request ID must be a valid UUID with the exception that zero UUID
  56353. // is not supported (00000000-0000-0000-0000-000000000000).
  56354. func (c *InterconnectsDeleteCall) RequestId(requestId string) *InterconnectsDeleteCall {
  56355. c.urlParams_.Set("requestId", requestId)
  56356. return c
  56357. }
  56358. // Fields allows partial responses to be retrieved. See
  56359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56360. // for more information.
  56361. func (c *InterconnectsDeleteCall) Fields(s ...googleapi.Field) *InterconnectsDeleteCall {
  56362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56363. return c
  56364. }
  56365. // Context sets the context to be used in this call's Do method. Any
  56366. // pending HTTP request will be aborted if the provided context is
  56367. // canceled.
  56368. func (c *InterconnectsDeleteCall) Context(ctx context.Context) *InterconnectsDeleteCall {
  56369. c.ctx_ = ctx
  56370. return c
  56371. }
  56372. // Header returns an http.Header that can be modified by the caller to
  56373. // add HTTP headers to the request.
  56374. func (c *InterconnectsDeleteCall) Header() http.Header {
  56375. if c.header_ == nil {
  56376. c.header_ = make(http.Header)
  56377. }
  56378. return c.header_
  56379. }
  56380. func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  56381. reqHeaders := make(http.Header)
  56382. for k, v := range c.header_ {
  56383. reqHeaders[k] = v
  56384. }
  56385. reqHeaders.Set("User-Agent", c.s.userAgent())
  56386. var body io.Reader = nil
  56387. c.urlParams_.Set("alt", alt)
  56388. c.urlParams_.Set("prettyPrint", "false")
  56389. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  56390. urls += "?" + c.urlParams_.Encode()
  56391. req, err := http.NewRequest("DELETE", urls, body)
  56392. if err != nil {
  56393. return nil, err
  56394. }
  56395. req.Header = reqHeaders
  56396. googleapi.Expand(req.URL, map[string]string{
  56397. "project": c.project,
  56398. "interconnect": c.interconnect,
  56399. })
  56400. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56401. }
  56402. // Do executes the "compute.interconnects.delete" call.
  56403. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56404. // status code is an error. Response headers are in either
  56405. // *Operation.ServerResponse.Header or (if a response was returned at
  56406. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56407. // to check whether the returned error was because
  56408. // http.StatusNotModified was returned.
  56409. func (c *InterconnectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56410. gensupport.SetOptions(c.urlParams_, opts...)
  56411. res, err := c.doRequest("json")
  56412. if res != nil && res.StatusCode == http.StatusNotModified {
  56413. if res.Body != nil {
  56414. res.Body.Close()
  56415. }
  56416. return nil, &googleapi.Error{
  56417. Code: res.StatusCode,
  56418. Header: res.Header,
  56419. }
  56420. }
  56421. if err != nil {
  56422. return nil, err
  56423. }
  56424. defer googleapi.CloseBody(res)
  56425. if err := googleapi.CheckResponse(res); err != nil {
  56426. return nil, err
  56427. }
  56428. ret := &Operation{
  56429. ServerResponse: googleapi.ServerResponse{
  56430. Header: res.Header,
  56431. HTTPStatusCode: res.StatusCode,
  56432. },
  56433. }
  56434. target := &ret
  56435. if err := gensupport.DecodeResponse(target, res); err != nil {
  56436. return nil, err
  56437. }
  56438. return ret, nil
  56439. // {
  56440. // "description": "Deletes the specified interconnect.",
  56441. // "httpMethod": "DELETE",
  56442. // "id": "compute.interconnects.delete",
  56443. // "parameterOrder": [
  56444. // "project",
  56445. // "interconnect"
  56446. // ],
  56447. // "parameters": {
  56448. // "interconnect": {
  56449. // "description": "Name of the interconnect to delete.",
  56450. // "location": "path",
  56451. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56452. // "required": true,
  56453. // "type": "string"
  56454. // },
  56455. // "project": {
  56456. // "description": "Project ID for this request.",
  56457. // "location": "path",
  56458. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56459. // "required": true,
  56460. // "type": "string"
  56461. // },
  56462. // "requestId": {
  56463. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56464. // "location": "query",
  56465. // "type": "string"
  56466. // }
  56467. // },
  56468. // "path": "{project}/global/interconnects/{interconnect}",
  56469. // "response": {
  56470. // "$ref": "Operation"
  56471. // },
  56472. // "scopes": [
  56473. // "https://www.googleapis.com/auth/cloud-platform",
  56474. // "https://www.googleapis.com/auth/compute"
  56475. // ]
  56476. // }
  56477. }
  56478. // method id "compute.interconnects.get":
  56479. type InterconnectsGetCall struct {
  56480. s *Service
  56481. project string
  56482. interconnect string
  56483. urlParams_ gensupport.URLParams
  56484. ifNoneMatch_ string
  56485. ctx_ context.Context
  56486. header_ http.Header
  56487. }
  56488. // Get: Returns the specified interconnect. Get a list of available
  56489. // interconnects by making a list() request.
  56490. func (r *InterconnectsService) Get(project string, interconnect string) *InterconnectsGetCall {
  56491. c := &InterconnectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56492. c.project = project
  56493. c.interconnect = interconnect
  56494. return c
  56495. }
  56496. // Fields allows partial responses to be retrieved. See
  56497. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56498. // for more information.
  56499. func (c *InterconnectsGetCall) Fields(s ...googleapi.Field) *InterconnectsGetCall {
  56500. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56501. return c
  56502. }
  56503. // IfNoneMatch sets the optional parameter which makes the operation
  56504. // fail if the object's ETag matches the given value. This is useful for
  56505. // getting updates only after the object has changed since the last
  56506. // request. Use googleapi.IsNotModified to check whether the response
  56507. // error from Do is the result of In-None-Match.
  56508. func (c *InterconnectsGetCall) IfNoneMatch(entityTag string) *InterconnectsGetCall {
  56509. c.ifNoneMatch_ = entityTag
  56510. return c
  56511. }
  56512. // Context sets the context to be used in this call's Do method. Any
  56513. // pending HTTP request will be aborted if the provided context is
  56514. // canceled.
  56515. func (c *InterconnectsGetCall) Context(ctx context.Context) *InterconnectsGetCall {
  56516. c.ctx_ = ctx
  56517. return c
  56518. }
  56519. // Header returns an http.Header that can be modified by the caller to
  56520. // add HTTP headers to the request.
  56521. func (c *InterconnectsGetCall) Header() http.Header {
  56522. if c.header_ == nil {
  56523. c.header_ = make(http.Header)
  56524. }
  56525. return c.header_
  56526. }
  56527. func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) {
  56528. reqHeaders := make(http.Header)
  56529. for k, v := range c.header_ {
  56530. reqHeaders[k] = v
  56531. }
  56532. reqHeaders.Set("User-Agent", c.s.userAgent())
  56533. if c.ifNoneMatch_ != "" {
  56534. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56535. }
  56536. var body io.Reader = nil
  56537. c.urlParams_.Set("alt", alt)
  56538. c.urlParams_.Set("prettyPrint", "false")
  56539. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  56540. urls += "?" + c.urlParams_.Encode()
  56541. req, err := http.NewRequest("GET", urls, body)
  56542. if err != nil {
  56543. return nil, err
  56544. }
  56545. req.Header = reqHeaders
  56546. googleapi.Expand(req.URL, map[string]string{
  56547. "project": c.project,
  56548. "interconnect": c.interconnect,
  56549. })
  56550. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56551. }
  56552. // Do executes the "compute.interconnects.get" call.
  56553. // Exactly one of *Interconnect or error will be non-nil. Any non-2xx
  56554. // status code is an error. Response headers are in either
  56555. // *Interconnect.ServerResponse.Header or (if a response was returned at
  56556. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56557. // to check whether the returned error was because
  56558. // http.StatusNotModified was returned.
  56559. func (c *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, error) {
  56560. gensupport.SetOptions(c.urlParams_, opts...)
  56561. res, err := c.doRequest("json")
  56562. if res != nil && res.StatusCode == http.StatusNotModified {
  56563. if res.Body != nil {
  56564. res.Body.Close()
  56565. }
  56566. return nil, &googleapi.Error{
  56567. Code: res.StatusCode,
  56568. Header: res.Header,
  56569. }
  56570. }
  56571. if err != nil {
  56572. return nil, err
  56573. }
  56574. defer googleapi.CloseBody(res)
  56575. if err := googleapi.CheckResponse(res); err != nil {
  56576. return nil, err
  56577. }
  56578. ret := &Interconnect{
  56579. ServerResponse: googleapi.ServerResponse{
  56580. Header: res.Header,
  56581. HTTPStatusCode: res.StatusCode,
  56582. },
  56583. }
  56584. target := &ret
  56585. if err := gensupport.DecodeResponse(target, res); err != nil {
  56586. return nil, err
  56587. }
  56588. return ret, nil
  56589. // {
  56590. // "description": "Returns the specified interconnect. Get a list of available interconnects by making a list() request.",
  56591. // "httpMethod": "GET",
  56592. // "id": "compute.interconnects.get",
  56593. // "parameterOrder": [
  56594. // "project",
  56595. // "interconnect"
  56596. // ],
  56597. // "parameters": {
  56598. // "interconnect": {
  56599. // "description": "Name of the interconnect to return.",
  56600. // "location": "path",
  56601. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56602. // "required": true,
  56603. // "type": "string"
  56604. // },
  56605. // "project": {
  56606. // "description": "Project ID for this request.",
  56607. // "location": "path",
  56608. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56609. // "required": true,
  56610. // "type": "string"
  56611. // }
  56612. // },
  56613. // "path": "{project}/global/interconnects/{interconnect}",
  56614. // "response": {
  56615. // "$ref": "Interconnect"
  56616. // },
  56617. // "scopes": [
  56618. // "https://www.googleapis.com/auth/cloud-platform",
  56619. // "https://www.googleapis.com/auth/compute",
  56620. // "https://www.googleapis.com/auth/compute.readonly"
  56621. // ]
  56622. // }
  56623. }
  56624. // method id "compute.interconnects.getDiagnostics":
  56625. type InterconnectsGetDiagnosticsCall struct {
  56626. s *Service
  56627. project string
  56628. interconnect string
  56629. urlParams_ gensupport.URLParams
  56630. ifNoneMatch_ string
  56631. ctx_ context.Context
  56632. header_ http.Header
  56633. }
  56634. // GetDiagnostics: Returns the interconnectDiagnostics for the specified
  56635. // interconnect.
  56636. func (r *InterconnectsService) GetDiagnostics(project string, interconnect string) *InterconnectsGetDiagnosticsCall {
  56637. c := &InterconnectsGetDiagnosticsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56638. c.project = project
  56639. c.interconnect = interconnect
  56640. return c
  56641. }
  56642. // Fields allows partial responses to be retrieved. See
  56643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56644. // for more information.
  56645. func (c *InterconnectsGetDiagnosticsCall) Fields(s ...googleapi.Field) *InterconnectsGetDiagnosticsCall {
  56646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56647. return c
  56648. }
  56649. // IfNoneMatch sets the optional parameter which makes the operation
  56650. // fail if the object's ETag matches the given value. This is useful for
  56651. // getting updates only after the object has changed since the last
  56652. // request. Use googleapi.IsNotModified to check whether the response
  56653. // error from Do is the result of In-None-Match.
  56654. func (c *InterconnectsGetDiagnosticsCall) IfNoneMatch(entityTag string) *InterconnectsGetDiagnosticsCall {
  56655. c.ifNoneMatch_ = entityTag
  56656. return c
  56657. }
  56658. // Context sets the context to be used in this call's Do method. Any
  56659. // pending HTTP request will be aborted if the provided context is
  56660. // canceled.
  56661. func (c *InterconnectsGetDiagnosticsCall) Context(ctx context.Context) *InterconnectsGetDiagnosticsCall {
  56662. c.ctx_ = ctx
  56663. return c
  56664. }
  56665. // Header returns an http.Header that can be modified by the caller to
  56666. // add HTTP headers to the request.
  56667. func (c *InterconnectsGetDiagnosticsCall) Header() http.Header {
  56668. if c.header_ == nil {
  56669. c.header_ = make(http.Header)
  56670. }
  56671. return c.header_
  56672. }
  56673. func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, error) {
  56674. reqHeaders := make(http.Header)
  56675. for k, v := range c.header_ {
  56676. reqHeaders[k] = v
  56677. }
  56678. reqHeaders.Set("User-Agent", c.s.userAgent())
  56679. if c.ifNoneMatch_ != "" {
  56680. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56681. }
  56682. var body io.Reader = nil
  56683. c.urlParams_.Set("alt", alt)
  56684. c.urlParams_.Set("prettyPrint", "false")
  56685. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}/getDiagnostics")
  56686. urls += "?" + c.urlParams_.Encode()
  56687. req, err := http.NewRequest("GET", urls, body)
  56688. if err != nil {
  56689. return nil, err
  56690. }
  56691. req.Header = reqHeaders
  56692. googleapi.Expand(req.URL, map[string]string{
  56693. "project": c.project,
  56694. "interconnect": c.interconnect,
  56695. })
  56696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56697. }
  56698. // Do executes the "compute.interconnects.getDiagnostics" call.
  56699. // Exactly one of *InterconnectsGetDiagnosticsResponse or error will be
  56700. // non-nil. Any non-2xx status code is an error. Response headers are in
  56701. // either *InterconnectsGetDiagnosticsResponse.ServerResponse.Header or
  56702. // (if a response was returned at all) in
  56703. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  56704. // whether the returned error was because http.StatusNotModified was
  56705. // returned.
  56706. func (c *InterconnectsGetDiagnosticsCall) Do(opts ...googleapi.CallOption) (*InterconnectsGetDiagnosticsResponse, error) {
  56707. gensupport.SetOptions(c.urlParams_, opts...)
  56708. res, err := c.doRequest("json")
  56709. if res != nil && res.StatusCode == http.StatusNotModified {
  56710. if res.Body != nil {
  56711. res.Body.Close()
  56712. }
  56713. return nil, &googleapi.Error{
  56714. Code: res.StatusCode,
  56715. Header: res.Header,
  56716. }
  56717. }
  56718. if err != nil {
  56719. return nil, err
  56720. }
  56721. defer googleapi.CloseBody(res)
  56722. if err := googleapi.CheckResponse(res); err != nil {
  56723. return nil, err
  56724. }
  56725. ret := &InterconnectsGetDiagnosticsResponse{
  56726. ServerResponse: googleapi.ServerResponse{
  56727. Header: res.Header,
  56728. HTTPStatusCode: res.StatusCode,
  56729. },
  56730. }
  56731. target := &ret
  56732. if err := gensupport.DecodeResponse(target, res); err != nil {
  56733. return nil, err
  56734. }
  56735. return ret, nil
  56736. // {
  56737. // "description": "Returns the interconnectDiagnostics for the specified interconnect.",
  56738. // "httpMethod": "GET",
  56739. // "id": "compute.interconnects.getDiagnostics",
  56740. // "parameterOrder": [
  56741. // "project",
  56742. // "interconnect"
  56743. // ],
  56744. // "parameters": {
  56745. // "interconnect": {
  56746. // "description": "Name of the interconnect resource to query.",
  56747. // "location": "path",
  56748. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56749. // "required": true,
  56750. // "type": "string"
  56751. // },
  56752. // "project": {
  56753. // "description": "Project ID for this request.",
  56754. // "location": "path",
  56755. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56756. // "required": true,
  56757. // "type": "string"
  56758. // }
  56759. // },
  56760. // "path": "{project}/global/interconnects/{interconnect}/getDiagnostics",
  56761. // "response": {
  56762. // "$ref": "InterconnectsGetDiagnosticsResponse"
  56763. // },
  56764. // "scopes": [
  56765. // "https://www.googleapis.com/auth/cloud-platform",
  56766. // "https://www.googleapis.com/auth/compute",
  56767. // "https://www.googleapis.com/auth/compute.readonly"
  56768. // ]
  56769. // }
  56770. }
  56771. // method id "compute.interconnects.insert":
  56772. type InterconnectsInsertCall struct {
  56773. s *Service
  56774. project string
  56775. interconnect *Interconnect
  56776. urlParams_ gensupport.URLParams
  56777. ctx_ context.Context
  56778. header_ http.Header
  56779. }
  56780. // Insert: Creates a Interconnect in the specified project using the
  56781. // data included in the request.
  56782. func (r *InterconnectsService) Insert(project string, interconnect *Interconnect) *InterconnectsInsertCall {
  56783. c := &InterconnectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56784. c.project = project
  56785. c.interconnect = interconnect
  56786. return c
  56787. }
  56788. // RequestId sets the optional parameter "requestId": An optional
  56789. // request ID to identify requests. Specify a unique request ID so that
  56790. // if you must retry your request, the server will know to ignore the
  56791. // request if it has already been completed.
  56792. //
  56793. // For example, consider a situation where you make an initial request
  56794. // and the request times out. If you make the request again with the
  56795. // same request ID, the server can check if original operation with the
  56796. // same request ID was received, and if so, will ignore the second
  56797. // request. This prevents clients from accidentally creating duplicate
  56798. // commitments.
  56799. //
  56800. // The request ID must be a valid UUID with the exception that zero UUID
  56801. // is not supported (00000000-0000-0000-0000-000000000000).
  56802. func (c *InterconnectsInsertCall) RequestId(requestId string) *InterconnectsInsertCall {
  56803. c.urlParams_.Set("requestId", requestId)
  56804. return c
  56805. }
  56806. // Fields allows partial responses to be retrieved. See
  56807. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56808. // for more information.
  56809. func (c *InterconnectsInsertCall) Fields(s ...googleapi.Field) *InterconnectsInsertCall {
  56810. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56811. return c
  56812. }
  56813. // Context sets the context to be used in this call's Do method. Any
  56814. // pending HTTP request will be aborted if the provided context is
  56815. // canceled.
  56816. func (c *InterconnectsInsertCall) Context(ctx context.Context) *InterconnectsInsertCall {
  56817. c.ctx_ = ctx
  56818. return c
  56819. }
  56820. // Header returns an http.Header that can be modified by the caller to
  56821. // add HTTP headers to the request.
  56822. func (c *InterconnectsInsertCall) Header() http.Header {
  56823. if c.header_ == nil {
  56824. c.header_ = make(http.Header)
  56825. }
  56826. return c.header_
  56827. }
  56828. func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) {
  56829. reqHeaders := make(http.Header)
  56830. for k, v := range c.header_ {
  56831. reqHeaders[k] = v
  56832. }
  56833. reqHeaders.Set("User-Agent", c.s.userAgent())
  56834. var body io.Reader = nil
  56835. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect)
  56836. if err != nil {
  56837. return nil, err
  56838. }
  56839. reqHeaders.Set("Content-Type", "application/json")
  56840. c.urlParams_.Set("alt", alt)
  56841. c.urlParams_.Set("prettyPrint", "false")
  56842. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  56843. urls += "?" + c.urlParams_.Encode()
  56844. req, err := http.NewRequest("POST", urls, body)
  56845. if err != nil {
  56846. return nil, err
  56847. }
  56848. req.Header = reqHeaders
  56849. googleapi.Expand(req.URL, map[string]string{
  56850. "project": c.project,
  56851. })
  56852. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56853. }
  56854. // Do executes the "compute.interconnects.insert" call.
  56855. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56856. // status code is an error. Response headers are in either
  56857. // *Operation.ServerResponse.Header or (if a response was returned at
  56858. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56859. // to check whether the returned error was because
  56860. // http.StatusNotModified was returned.
  56861. func (c *InterconnectsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56862. gensupport.SetOptions(c.urlParams_, opts...)
  56863. res, err := c.doRequest("json")
  56864. if res != nil && res.StatusCode == http.StatusNotModified {
  56865. if res.Body != nil {
  56866. res.Body.Close()
  56867. }
  56868. return nil, &googleapi.Error{
  56869. Code: res.StatusCode,
  56870. Header: res.Header,
  56871. }
  56872. }
  56873. if err != nil {
  56874. return nil, err
  56875. }
  56876. defer googleapi.CloseBody(res)
  56877. if err := googleapi.CheckResponse(res); err != nil {
  56878. return nil, err
  56879. }
  56880. ret := &Operation{
  56881. ServerResponse: googleapi.ServerResponse{
  56882. Header: res.Header,
  56883. HTTPStatusCode: res.StatusCode,
  56884. },
  56885. }
  56886. target := &ret
  56887. if err := gensupport.DecodeResponse(target, res); err != nil {
  56888. return nil, err
  56889. }
  56890. return ret, nil
  56891. // {
  56892. // "description": "Creates a Interconnect in the specified project using the data included in the request.",
  56893. // "httpMethod": "POST",
  56894. // "id": "compute.interconnects.insert",
  56895. // "parameterOrder": [
  56896. // "project"
  56897. // ],
  56898. // "parameters": {
  56899. // "project": {
  56900. // "description": "Project ID for this request.",
  56901. // "location": "path",
  56902. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56903. // "required": true,
  56904. // "type": "string"
  56905. // },
  56906. // "requestId": {
  56907. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56908. // "location": "query",
  56909. // "type": "string"
  56910. // }
  56911. // },
  56912. // "path": "{project}/global/interconnects",
  56913. // "request": {
  56914. // "$ref": "Interconnect"
  56915. // },
  56916. // "response": {
  56917. // "$ref": "Operation"
  56918. // },
  56919. // "scopes": [
  56920. // "https://www.googleapis.com/auth/cloud-platform",
  56921. // "https://www.googleapis.com/auth/compute"
  56922. // ]
  56923. // }
  56924. }
  56925. // method id "compute.interconnects.list":
  56926. type InterconnectsListCall struct {
  56927. s *Service
  56928. project string
  56929. urlParams_ gensupport.URLParams
  56930. ifNoneMatch_ string
  56931. ctx_ context.Context
  56932. header_ http.Header
  56933. }
  56934. // List: Retrieves the list of interconnect available to the specified
  56935. // project.
  56936. func (r *InterconnectsService) List(project string) *InterconnectsListCall {
  56937. c := &InterconnectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56938. c.project = project
  56939. return c
  56940. }
  56941. // Filter sets the optional parameter "filter": A filter expression that
  56942. // filters resources listed in the response. The expression must specify
  56943. // the field name, a comparison operator, and the value that you want to
  56944. // use for filtering. The value must be a string, a number, or a
  56945. // boolean. The comparison operator must be either =, !=, >, or <.
  56946. //
  56947. // For example, if you are filtering Compute Engine instances, you can
  56948. // exclude instances named example-instance by specifying name !=
  56949. // example-instance.
  56950. //
  56951. // You can also filter nested fields. For example, you could specify
  56952. // scheduling.automaticRestart = false to include instances only if they
  56953. // are not scheduled for automatic restarts. You can use filtering on
  56954. // nested fields to filter based on resource labels.
  56955. //
  56956. // To filter on multiple expressions, provide each separate expression
  56957. // within parentheses. For example, (scheduling.automaticRestart = true)
  56958. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  56959. // AND expression. However, you can include AND and OR expressions
  56960. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  56961. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  56962. // true).
  56963. func (c *InterconnectsListCall) Filter(filter string) *InterconnectsListCall {
  56964. c.urlParams_.Set("filter", filter)
  56965. return c
  56966. }
  56967. // MaxResults sets the optional parameter "maxResults": The maximum
  56968. // number of results per page that should be returned. If the number of
  56969. // available results is larger than maxResults, Compute Engine returns a
  56970. // nextPageToken that can be used to get the next page of results in
  56971. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  56972. // (Default: 500)
  56973. func (c *InterconnectsListCall) MaxResults(maxResults int64) *InterconnectsListCall {
  56974. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  56975. return c
  56976. }
  56977. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  56978. // a certain order. By default, results are returned in alphanumerical
  56979. // order based on the resource name.
  56980. //
  56981. // You can also sort results in descending order based on the creation
  56982. // timestamp using orderBy="creationTimestamp desc". This sorts results
  56983. // based on the creationTimestamp field in reverse chronological order
  56984. // (newest result first). Use this to sort resources like operations so
  56985. // that the newest operation is returned first.
  56986. //
  56987. // Currently, only sorting by name or creationTimestamp desc is
  56988. // supported.
  56989. func (c *InterconnectsListCall) OrderBy(orderBy string) *InterconnectsListCall {
  56990. c.urlParams_.Set("orderBy", orderBy)
  56991. return c
  56992. }
  56993. // PageToken sets the optional parameter "pageToken": Specifies a page
  56994. // token to use. Set pageToken to the nextPageToken returned by a
  56995. // previous list request to get the next page of results.
  56996. func (c *InterconnectsListCall) PageToken(pageToken string) *InterconnectsListCall {
  56997. c.urlParams_.Set("pageToken", pageToken)
  56998. return c
  56999. }
  57000. // Fields allows partial responses to be retrieved. See
  57001. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57002. // for more information.
  57003. func (c *InterconnectsListCall) Fields(s ...googleapi.Field) *InterconnectsListCall {
  57004. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57005. return c
  57006. }
  57007. // IfNoneMatch sets the optional parameter which makes the operation
  57008. // fail if the object's ETag matches the given value. This is useful for
  57009. // getting updates only after the object has changed since the last
  57010. // request. Use googleapi.IsNotModified to check whether the response
  57011. // error from Do is the result of In-None-Match.
  57012. func (c *InterconnectsListCall) IfNoneMatch(entityTag string) *InterconnectsListCall {
  57013. c.ifNoneMatch_ = entityTag
  57014. return c
  57015. }
  57016. // Context sets the context to be used in this call's Do method. Any
  57017. // pending HTTP request will be aborted if the provided context is
  57018. // canceled.
  57019. func (c *InterconnectsListCall) Context(ctx context.Context) *InterconnectsListCall {
  57020. c.ctx_ = ctx
  57021. return c
  57022. }
  57023. // Header returns an http.Header that can be modified by the caller to
  57024. // add HTTP headers to the request.
  57025. func (c *InterconnectsListCall) Header() http.Header {
  57026. if c.header_ == nil {
  57027. c.header_ = make(http.Header)
  57028. }
  57029. return c.header_
  57030. }
  57031. func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) {
  57032. reqHeaders := make(http.Header)
  57033. for k, v := range c.header_ {
  57034. reqHeaders[k] = v
  57035. }
  57036. reqHeaders.Set("User-Agent", c.s.userAgent())
  57037. if c.ifNoneMatch_ != "" {
  57038. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57039. }
  57040. var body io.Reader = nil
  57041. c.urlParams_.Set("alt", alt)
  57042. c.urlParams_.Set("prettyPrint", "false")
  57043. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  57044. urls += "?" + c.urlParams_.Encode()
  57045. req, err := http.NewRequest("GET", urls, body)
  57046. if err != nil {
  57047. return nil, err
  57048. }
  57049. req.Header = reqHeaders
  57050. googleapi.Expand(req.URL, map[string]string{
  57051. "project": c.project,
  57052. })
  57053. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57054. }
  57055. // Do executes the "compute.interconnects.list" call.
  57056. // Exactly one of *InterconnectList or error will be non-nil. Any
  57057. // non-2xx status code is an error. Response headers are in either
  57058. // *InterconnectList.ServerResponse.Header or (if a response was
  57059. // returned at all) in error.(*googleapi.Error).Header. Use
  57060. // googleapi.IsNotModified to check whether the returned error was
  57061. // because http.StatusNotModified was returned.
  57062. func (c *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectList, error) {
  57063. gensupport.SetOptions(c.urlParams_, opts...)
  57064. res, err := c.doRequest("json")
  57065. if res != nil && res.StatusCode == http.StatusNotModified {
  57066. if res.Body != nil {
  57067. res.Body.Close()
  57068. }
  57069. return nil, &googleapi.Error{
  57070. Code: res.StatusCode,
  57071. Header: res.Header,
  57072. }
  57073. }
  57074. if err != nil {
  57075. return nil, err
  57076. }
  57077. defer googleapi.CloseBody(res)
  57078. if err := googleapi.CheckResponse(res); err != nil {
  57079. return nil, err
  57080. }
  57081. ret := &InterconnectList{
  57082. ServerResponse: googleapi.ServerResponse{
  57083. Header: res.Header,
  57084. HTTPStatusCode: res.StatusCode,
  57085. },
  57086. }
  57087. target := &ret
  57088. if err := gensupport.DecodeResponse(target, res); err != nil {
  57089. return nil, err
  57090. }
  57091. return ret, nil
  57092. // {
  57093. // "description": "Retrieves the list of interconnect available to the specified project.",
  57094. // "httpMethod": "GET",
  57095. // "id": "compute.interconnects.list",
  57096. // "parameterOrder": [
  57097. // "project"
  57098. // ],
  57099. // "parameters": {
  57100. // "filter": {
  57101. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  57102. // "location": "query",
  57103. // "type": "string"
  57104. // },
  57105. // "maxResults": {
  57106. // "default": "500",
  57107. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  57108. // "format": "uint32",
  57109. // "location": "query",
  57110. // "minimum": "0",
  57111. // "type": "integer"
  57112. // },
  57113. // "orderBy": {
  57114. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  57115. // "location": "query",
  57116. // "type": "string"
  57117. // },
  57118. // "pageToken": {
  57119. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  57120. // "location": "query",
  57121. // "type": "string"
  57122. // },
  57123. // "project": {
  57124. // "description": "Project ID for this request.",
  57125. // "location": "path",
  57126. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57127. // "required": true,
  57128. // "type": "string"
  57129. // }
  57130. // },
  57131. // "path": "{project}/global/interconnects",
  57132. // "response": {
  57133. // "$ref": "InterconnectList"
  57134. // },
  57135. // "scopes": [
  57136. // "https://www.googleapis.com/auth/cloud-platform",
  57137. // "https://www.googleapis.com/auth/compute",
  57138. // "https://www.googleapis.com/auth/compute.readonly"
  57139. // ]
  57140. // }
  57141. }
  57142. // Pages invokes f for each page of results.
  57143. // A non-nil error returned from f will halt the iteration.
  57144. // The provided context supersedes any context provided to the Context method.
  57145. func (c *InterconnectsListCall) Pages(ctx context.Context, f func(*InterconnectList) error) error {
  57146. c.ctx_ = ctx
  57147. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  57148. for {
  57149. x, err := c.Do()
  57150. if err != nil {
  57151. return err
  57152. }
  57153. if err := f(x); err != nil {
  57154. return err
  57155. }
  57156. if x.NextPageToken == "" {
  57157. return nil
  57158. }
  57159. c.PageToken(x.NextPageToken)
  57160. }
  57161. }
  57162. // method id "compute.interconnects.patch":
  57163. type InterconnectsPatchCall struct {
  57164. s *Service
  57165. project string
  57166. interconnect string
  57167. interconnect2 *Interconnect
  57168. urlParams_ gensupport.URLParams
  57169. ctx_ context.Context
  57170. header_ http.Header
  57171. }
  57172. // Patch: Updates the specified interconnect with the data included in
  57173. // the request. This method supports PATCH semantics and uses the JSON
  57174. // merge patch format and processing rules.
  57175. func (r *InterconnectsService) Patch(project string, interconnect string, interconnect2 *Interconnect) *InterconnectsPatchCall {
  57176. c := &InterconnectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57177. c.project = project
  57178. c.interconnect = interconnect
  57179. c.interconnect2 = interconnect2
  57180. return c
  57181. }
  57182. // RequestId sets the optional parameter "requestId": An optional
  57183. // request ID to identify requests. Specify a unique request ID so that
  57184. // if you must retry your request, the server will know to ignore the
  57185. // request if it has already been completed.
  57186. //
  57187. // For example, consider a situation where you make an initial request
  57188. // and the request times out. If you make the request again with the
  57189. // same request ID, the server can check if original operation with the
  57190. // same request ID was received, and if so, will ignore the second
  57191. // request. This prevents clients from accidentally creating duplicate
  57192. // commitments.
  57193. //
  57194. // The request ID must be a valid UUID with the exception that zero UUID
  57195. // is not supported (00000000-0000-0000-0000-000000000000).
  57196. func (c *InterconnectsPatchCall) RequestId(requestId string) *InterconnectsPatchCall {
  57197. c.urlParams_.Set("requestId", requestId)
  57198. return c
  57199. }
  57200. // Fields allows partial responses to be retrieved. See
  57201. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57202. // for more information.
  57203. func (c *InterconnectsPatchCall) Fields(s ...googleapi.Field) *InterconnectsPatchCall {
  57204. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57205. return c
  57206. }
  57207. // Context sets the context to be used in this call's Do method. Any
  57208. // pending HTTP request will be aborted if the provided context is
  57209. // canceled.
  57210. func (c *InterconnectsPatchCall) Context(ctx context.Context) *InterconnectsPatchCall {
  57211. c.ctx_ = ctx
  57212. return c
  57213. }
  57214. // Header returns an http.Header that can be modified by the caller to
  57215. // add HTTP headers to the request.
  57216. func (c *InterconnectsPatchCall) Header() http.Header {
  57217. if c.header_ == nil {
  57218. c.header_ = make(http.Header)
  57219. }
  57220. return c.header_
  57221. }
  57222. func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) {
  57223. reqHeaders := make(http.Header)
  57224. for k, v := range c.header_ {
  57225. reqHeaders[k] = v
  57226. }
  57227. reqHeaders.Set("User-Agent", c.s.userAgent())
  57228. var body io.Reader = nil
  57229. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2)
  57230. if err != nil {
  57231. return nil, err
  57232. }
  57233. reqHeaders.Set("Content-Type", "application/json")
  57234. c.urlParams_.Set("alt", alt)
  57235. c.urlParams_.Set("prettyPrint", "false")
  57236. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  57237. urls += "?" + c.urlParams_.Encode()
  57238. req, err := http.NewRequest("PATCH", urls, body)
  57239. if err != nil {
  57240. return nil, err
  57241. }
  57242. req.Header = reqHeaders
  57243. googleapi.Expand(req.URL, map[string]string{
  57244. "project": c.project,
  57245. "interconnect": c.interconnect,
  57246. })
  57247. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57248. }
  57249. // Do executes the "compute.interconnects.patch" call.
  57250. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57251. // status code is an error. Response headers are in either
  57252. // *Operation.ServerResponse.Header or (if a response was returned at
  57253. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57254. // to check whether the returned error was because
  57255. // http.StatusNotModified was returned.
  57256. func (c *InterconnectsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57257. gensupport.SetOptions(c.urlParams_, opts...)
  57258. res, err := c.doRequest("json")
  57259. if res != nil && res.StatusCode == http.StatusNotModified {
  57260. if res.Body != nil {
  57261. res.Body.Close()
  57262. }
  57263. return nil, &googleapi.Error{
  57264. Code: res.StatusCode,
  57265. Header: res.Header,
  57266. }
  57267. }
  57268. if err != nil {
  57269. return nil, err
  57270. }
  57271. defer googleapi.CloseBody(res)
  57272. if err := googleapi.CheckResponse(res); err != nil {
  57273. return nil, err
  57274. }
  57275. ret := &Operation{
  57276. ServerResponse: googleapi.ServerResponse{
  57277. Header: res.Header,
  57278. HTTPStatusCode: res.StatusCode,
  57279. },
  57280. }
  57281. target := &ret
  57282. if err := gensupport.DecodeResponse(target, res); err != nil {
  57283. return nil, err
  57284. }
  57285. return ret, nil
  57286. // {
  57287. // "description": "Updates the specified interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  57288. // "httpMethod": "PATCH",
  57289. // "id": "compute.interconnects.patch",
  57290. // "parameterOrder": [
  57291. // "project",
  57292. // "interconnect"
  57293. // ],
  57294. // "parameters": {
  57295. // "interconnect": {
  57296. // "description": "Name of the interconnect to update.",
  57297. // "location": "path",
  57298. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57299. // "required": true,
  57300. // "type": "string"
  57301. // },
  57302. // "project": {
  57303. // "description": "Project ID for this request.",
  57304. // "location": "path",
  57305. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57306. // "required": true,
  57307. // "type": "string"
  57308. // },
  57309. // "requestId": {
  57310. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57311. // "location": "query",
  57312. // "type": "string"
  57313. // }
  57314. // },
  57315. // "path": "{project}/global/interconnects/{interconnect}",
  57316. // "request": {
  57317. // "$ref": "Interconnect"
  57318. // },
  57319. // "response": {
  57320. // "$ref": "Operation"
  57321. // },
  57322. // "scopes": [
  57323. // "https://www.googleapis.com/auth/cloud-platform",
  57324. // "https://www.googleapis.com/auth/compute"
  57325. // ]
  57326. // }
  57327. }
  57328. // method id "compute.licenseCodes.get":
  57329. type LicenseCodesGetCall struct {
  57330. s *Service
  57331. project string
  57332. licenseCode string
  57333. urlParams_ gensupport.URLParams
  57334. ifNoneMatch_ string
  57335. ctx_ context.Context
  57336. header_ http.Header
  57337. }
  57338. // Get: Return a specified license code. License codes are mirrored
  57339. // across all projects that have permissions to read the License Code.
  57340. func (r *LicenseCodesService) Get(project string, licenseCode string) *LicenseCodesGetCall {
  57341. c := &LicenseCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57342. c.project = project
  57343. c.licenseCode = licenseCode
  57344. return c
  57345. }
  57346. // Fields allows partial responses to be retrieved. See
  57347. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57348. // for more information.
  57349. func (c *LicenseCodesGetCall) Fields(s ...googleapi.Field) *LicenseCodesGetCall {
  57350. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57351. return c
  57352. }
  57353. // IfNoneMatch sets the optional parameter which makes the operation
  57354. // fail if the object's ETag matches the given value. This is useful for
  57355. // getting updates only after the object has changed since the last
  57356. // request. Use googleapi.IsNotModified to check whether the response
  57357. // error from Do is the result of In-None-Match.
  57358. func (c *LicenseCodesGetCall) IfNoneMatch(entityTag string) *LicenseCodesGetCall {
  57359. c.ifNoneMatch_ = entityTag
  57360. return c
  57361. }
  57362. // Context sets the context to be used in this call's Do method. Any
  57363. // pending HTTP request will be aborted if the provided context is
  57364. // canceled.
  57365. func (c *LicenseCodesGetCall) Context(ctx context.Context) *LicenseCodesGetCall {
  57366. c.ctx_ = ctx
  57367. return c
  57368. }
  57369. // Header returns an http.Header that can be modified by the caller to
  57370. // add HTTP headers to the request.
  57371. func (c *LicenseCodesGetCall) Header() http.Header {
  57372. if c.header_ == nil {
  57373. c.header_ = make(http.Header)
  57374. }
  57375. return c.header_
  57376. }
  57377. func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) {
  57378. reqHeaders := make(http.Header)
  57379. for k, v := range c.header_ {
  57380. reqHeaders[k] = v
  57381. }
  57382. reqHeaders.Set("User-Agent", c.s.userAgent())
  57383. if c.ifNoneMatch_ != "" {
  57384. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57385. }
  57386. var body io.Reader = nil
  57387. c.urlParams_.Set("alt", alt)
  57388. c.urlParams_.Set("prettyPrint", "false")
  57389. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{licenseCode}")
  57390. urls += "?" + c.urlParams_.Encode()
  57391. req, err := http.NewRequest("GET", urls, body)
  57392. if err != nil {
  57393. return nil, err
  57394. }
  57395. req.Header = reqHeaders
  57396. googleapi.Expand(req.URL, map[string]string{
  57397. "project": c.project,
  57398. "licenseCode": c.licenseCode,
  57399. })
  57400. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57401. }
  57402. // Do executes the "compute.licenseCodes.get" call.
  57403. // Exactly one of *LicenseCode or error will be non-nil. Any non-2xx
  57404. // status code is an error. Response headers are in either
  57405. // *LicenseCode.ServerResponse.Header or (if a response was returned at
  57406. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57407. // to check whether the returned error was because
  57408. // http.StatusNotModified was returned.
  57409. func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, error) {
  57410. gensupport.SetOptions(c.urlParams_, opts...)
  57411. res, err := c.doRequest("json")
  57412. if res != nil && res.StatusCode == http.StatusNotModified {
  57413. if res.Body != nil {
  57414. res.Body.Close()
  57415. }
  57416. return nil, &googleapi.Error{
  57417. Code: res.StatusCode,
  57418. Header: res.Header,
  57419. }
  57420. }
  57421. if err != nil {
  57422. return nil, err
  57423. }
  57424. defer googleapi.CloseBody(res)
  57425. if err := googleapi.CheckResponse(res); err != nil {
  57426. return nil, err
  57427. }
  57428. ret := &LicenseCode{
  57429. ServerResponse: googleapi.ServerResponse{
  57430. Header: res.Header,
  57431. HTTPStatusCode: res.StatusCode,
  57432. },
  57433. }
  57434. target := &ret
  57435. if err := gensupport.DecodeResponse(target, res); err != nil {
  57436. return nil, err
  57437. }
  57438. return ret, nil
  57439. // {
  57440. // "description": "Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code.",
  57441. // "httpMethod": "GET",
  57442. // "id": "compute.licenseCodes.get",
  57443. // "parameterOrder": [
  57444. // "project",
  57445. // "licenseCode"
  57446. // ],
  57447. // "parameters": {
  57448. // "licenseCode": {
  57449. // "description": "Number corresponding to the License code resource to return.",
  57450. // "location": "path",
  57451. // "pattern": "[0-9]{0,61}?",
  57452. // "required": true,
  57453. // "type": "string"
  57454. // },
  57455. // "project": {
  57456. // "description": "Project ID for this request.",
  57457. // "location": "path",
  57458. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57459. // "required": true,
  57460. // "type": "string"
  57461. // }
  57462. // },
  57463. // "path": "{project}/global/licenseCodes/{licenseCode}",
  57464. // "response": {
  57465. // "$ref": "LicenseCode"
  57466. // },
  57467. // "scopes": [
  57468. // "https://www.googleapis.com/auth/cloud-platform",
  57469. // "https://www.googleapis.com/auth/compute",
  57470. // "https://www.googleapis.com/auth/compute.readonly"
  57471. // ]
  57472. // }
  57473. }
  57474. // method id "compute.licenseCodes.testIamPermissions":
  57475. type LicenseCodesTestIamPermissionsCall struct {
  57476. s *Service
  57477. project string
  57478. resource string
  57479. testpermissionsrequest *TestPermissionsRequest
  57480. urlParams_ gensupport.URLParams
  57481. ctx_ context.Context
  57482. header_ http.Header
  57483. }
  57484. // TestIamPermissions: Returns permissions that a caller has on the
  57485. // specified resource.
  57486. func (r *LicenseCodesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicenseCodesTestIamPermissionsCall {
  57487. c := &LicenseCodesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57488. c.project = project
  57489. c.resource = resource
  57490. c.testpermissionsrequest = testpermissionsrequest
  57491. return c
  57492. }
  57493. // Fields allows partial responses to be retrieved. See
  57494. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57495. // for more information.
  57496. func (c *LicenseCodesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicenseCodesTestIamPermissionsCall {
  57497. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57498. return c
  57499. }
  57500. // Context sets the context to be used in this call's Do method. Any
  57501. // pending HTTP request will be aborted if the provided context is
  57502. // canceled.
  57503. func (c *LicenseCodesTestIamPermissionsCall) Context(ctx context.Context) *LicenseCodesTestIamPermissionsCall {
  57504. c.ctx_ = ctx
  57505. return c
  57506. }
  57507. // Header returns an http.Header that can be modified by the caller to
  57508. // add HTTP headers to the request.
  57509. func (c *LicenseCodesTestIamPermissionsCall) Header() http.Header {
  57510. if c.header_ == nil {
  57511. c.header_ = make(http.Header)
  57512. }
  57513. return c.header_
  57514. }
  57515. func (c *LicenseCodesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  57516. reqHeaders := make(http.Header)
  57517. for k, v := range c.header_ {
  57518. reqHeaders[k] = v
  57519. }
  57520. reqHeaders.Set("User-Agent", c.s.userAgent())
  57521. var body io.Reader = nil
  57522. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  57523. if err != nil {
  57524. return nil, err
  57525. }
  57526. reqHeaders.Set("Content-Type", "application/json")
  57527. c.urlParams_.Set("alt", alt)
  57528. c.urlParams_.Set("prettyPrint", "false")
  57529. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/testIamPermissions")
  57530. urls += "?" + c.urlParams_.Encode()
  57531. req, err := http.NewRequest("POST", urls, body)
  57532. if err != nil {
  57533. return nil, err
  57534. }
  57535. req.Header = reqHeaders
  57536. googleapi.Expand(req.URL, map[string]string{
  57537. "project": c.project,
  57538. "resource": c.resource,
  57539. })
  57540. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57541. }
  57542. // Do executes the "compute.licenseCodes.testIamPermissions" call.
  57543. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  57544. // non-2xx status code is an error. Response headers are in either
  57545. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  57546. // returned at all) in error.(*googleapi.Error).Header. Use
  57547. // googleapi.IsNotModified to check whether the returned error was
  57548. // because http.StatusNotModified was returned.
  57549. func (c *LicenseCodesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  57550. gensupport.SetOptions(c.urlParams_, opts...)
  57551. res, err := c.doRequest("json")
  57552. if res != nil && res.StatusCode == http.StatusNotModified {
  57553. if res.Body != nil {
  57554. res.Body.Close()
  57555. }
  57556. return nil, &googleapi.Error{
  57557. Code: res.StatusCode,
  57558. Header: res.Header,
  57559. }
  57560. }
  57561. if err != nil {
  57562. return nil, err
  57563. }
  57564. defer googleapi.CloseBody(res)
  57565. if err := googleapi.CheckResponse(res); err != nil {
  57566. return nil, err
  57567. }
  57568. ret := &TestPermissionsResponse{
  57569. ServerResponse: googleapi.ServerResponse{
  57570. Header: res.Header,
  57571. HTTPStatusCode: res.StatusCode,
  57572. },
  57573. }
  57574. target := &ret
  57575. if err := gensupport.DecodeResponse(target, res); err != nil {
  57576. return nil, err
  57577. }
  57578. return ret, nil
  57579. // {
  57580. // "description": "Returns permissions that a caller has on the specified resource.",
  57581. // "httpMethod": "POST",
  57582. // "id": "compute.licenseCodes.testIamPermissions",
  57583. // "parameterOrder": [
  57584. // "project",
  57585. // "resource"
  57586. // ],
  57587. // "parameters": {
  57588. // "project": {
  57589. // "description": "Project ID for this request.",
  57590. // "location": "path",
  57591. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57592. // "required": true,
  57593. // "type": "string"
  57594. // },
  57595. // "resource": {
  57596. // "description": "Name or id of the resource for this request.",
  57597. // "location": "path",
  57598. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57599. // "required": true,
  57600. // "type": "string"
  57601. // }
  57602. // },
  57603. // "path": "{project}/global/licenseCodes/{resource}/testIamPermissions",
  57604. // "request": {
  57605. // "$ref": "TestPermissionsRequest"
  57606. // },
  57607. // "response": {
  57608. // "$ref": "TestPermissionsResponse"
  57609. // },
  57610. // "scopes": [
  57611. // "https://www.googleapis.com/auth/cloud-platform",
  57612. // "https://www.googleapis.com/auth/compute",
  57613. // "https://www.googleapis.com/auth/compute.readonly"
  57614. // ]
  57615. // }
  57616. }
  57617. // method id "compute.licenses.delete":
  57618. type LicensesDeleteCall struct {
  57619. s *Service
  57620. project string
  57621. license string
  57622. urlParams_ gensupport.URLParams
  57623. ctx_ context.Context
  57624. header_ http.Header
  57625. }
  57626. // Delete: Deletes the specified license.
  57627. func (r *LicensesService) Delete(project string, license string) *LicensesDeleteCall {
  57628. c := &LicensesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57629. c.project = project
  57630. c.license = license
  57631. return c
  57632. }
  57633. // RequestId sets the optional parameter "requestId": An optional
  57634. // request ID to identify requests. Specify a unique request ID so that
  57635. // if you must retry your request, the server will know to ignore the
  57636. // request if it has already been completed.
  57637. //
  57638. // For example, consider a situation where you make an initial request
  57639. // and the request times out. If you make the request again with the
  57640. // same request ID, the server can check if original operation with the
  57641. // same request ID was received, and if so, will ignore the second
  57642. // request. This prevents clients from accidentally creating duplicate
  57643. // commitments.
  57644. //
  57645. // The request ID must be a valid UUID with the exception that zero UUID
  57646. // is not supported (00000000-0000-0000-0000-000000000000).
  57647. func (c *LicensesDeleteCall) RequestId(requestId string) *LicensesDeleteCall {
  57648. c.urlParams_.Set("requestId", requestId)
  57649. return c
  57650. }
  57651. // Fields allows partial responses to be retrieved. See
  57652. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57653. // for more information.
  57654. func (c *LicensesDeleteCall) Fields(s ...googleapi.Field) *LicensesDeleteCall {
  57655. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57656. return c
  57657. }
  57658. // Context sets the context to be used in this call's Do method. Any
  57659. // pending HTTP request will be aborted if the provided context is
  57660. // canceled.
  57661. func (c *LicensesDeleteCall) Context(ctx context.Context) *LicensesDeleteCall {
  57662. c.ctx_ = ctx
  57663. return c
  57664. }
  57665. // Header returns an http.Header that can be modified by the caller to
  57666. // add HTTP headers to the request.
  57667. func (c *LicensesDeleteCall) Header() http.Header {
  57668. if c.header_ == nil {
  57669. c.header_ = make(http.Header)
  57670. }
  57671. return c.header_
  57672. }
  57673. func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) {
  57674. reqHeaders := make(http.Header)
  57675. for k, v := range c.header_ {
  57676. reqHeaders[k] = v
  57677. }
  57678. reqHeaders.Set("User-Agent", c.s.userAgent())
  57679. var body io.Reader = nil
  57680. c.urlParams_.Set("alt", alt)
  57681. c.urlParams_.Set("prettyPrint", "false")
  57682. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  57683. urls += "?" + c.urlParams_.Encode()
  57684. req, err := http.NewRequest("DELETE", urls, body)
  57685. if err != nil {
  57686. return nil, err
  57687. }
  57688. req.Header = reqHeaders
  57689. googleapi.Expand(req.URL, map[string]string{
  57690. "project": c.project,
  57691. "license": c.license,
  57692. })
  57693. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57694. }
  57695. // Do executes the "compute.licenses.delete" call.
  57696. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57697. // status code is an error. Response headers are in either
  57698. // *Operation.ServerResponse.Header or (if a response was returned at
  57699. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57700. // to check whether the returned error was because
  57701. // http.StatusNotModified was returned.
  57702. func (c *LicensesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57703. gensupport.SetOptions(c.urlParams_, opts...)
  57704. res, err := c.doRequest("json")
  57705. if res != nil && res.StatusCode == http.StatusNotModified {
  57706. if res.Body != nil {
  57707. res.Body.Close()
  57708. }
  57709. return nil, &googleapi.Error{
  57710. Code: res.StatusCode,
  57711. Header: res.Header,
  57712. }
  57713. }
  57714. if err != nil {
  57715. return nil, err
  57716. }
  57717. defer googleapi.CloseBody(res)
  57718. if err := googleapi.CheckResponse(res); err != nil {
  57719. return nil, err
  57720. }
  57721. ret := &Operation{
  57722. ServerResponse: googleapi.ServerResponse{
  57723. Header: res.Header,
  57724. HTTPStatusCode: res.StatusCode,
  57725. },
  57726. }
  57727. target := &ret
  57728. if err := gensupport.DecodeResponse(target, res); err != nil {
  57729. return nil, err
  57730. }
  57731. return ret, nil
  57732. // {
  57733. // "description": "Deletes the specified license.",
  57734. // "httpMethod": "DELETE",
  57735. // "id": "compute.licenses.delete",
  57736. // "parameterOrder": [
  57737. // "project",
  57738. // "license"
  57739. // ],
  57740. // "parameters": {
  57741. // "license": {
  57742. // "description": "Name of the license resource to delete.",
  57743. // "location": "path",
  57744. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57745. // "required": true,
  57746. // "type": "string"
  57747. // },
  57748. // "project": {
  57749. // "description": "Project ID for this request.",
  57750. // "location": "path",
  57751. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57752. // "required": true,
  57753. // "type": "string"
  57754. // },
  57755. // "requestId": {
  57756. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57757. // "location": "query",
  57758. // "type": "string"
  57759. // }
  57760. // },
  57761. // "path": "{project}/global/licenses/{license}",
  57762. // "response": {
  57763. // "$ref": "Operation"
  57764. // },
  57765. // "scopes": [
  57766. // "https://www.googleapis.com/auth/cloud-platform",
  57767. // "https://www.googleapis.com/auth/compute"
  57768. // ]
  57769. // }
  57770. }
  57771. // method id "compute.licenses.get":
  57772. type LicensesGetCall struct {
  57773. s *Service
  57774. project string
  57775. license string
  57776. urlParams_ gensupport.URLParams
  57777. ifNoneMatch_ string
  57778. ctx_ context.Context
  57779. header_ http.Header
  57780. }
  57781. // Get: Returns the specified License resource.
  57782. // For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get
  57783. func (r *LicensesService) Get(project string, license string) *LicensesGetCall {
  57784. c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57785. c.project = project
  57786. c.license = license
  57787. return c
  57788. }
  57789. // Fields allows partial responses to be retrieved. See
  57790. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57791. // for more information.
  57792. func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall {
  57793. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57794. return c
  57795. }
  57796. // IfNoneMatch sets the optional parameter which makes the operation
  57797. // fail if the object's ETag matches the given value. This is useful for
  57798. // getting updates only after the object has changed since the last
  57799. // request. Use googleapi.IsNotModified to check whether the response
  57800. // error from Do is the result of In-None-Match.
  57801. func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall {
  57802. c.ifNoneMatch_ = entityTag
  57803. return c
  57804. }
  57805. // Context sets the context to be used in this call's Do method. Any
  57806. // pending HTTP request will be aborted if the provided context is
  57807. // canceled.
  57808. func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall {
  57809. c.ctx_ = ctx
  57810. return c
  57811. }
  57812. // Header returns an http.Header that can be modified by the caller to
  57813. // add HTTP headers to the request.
  57814. func (c *LicensesGetCall) Header() http.Header {
  57815. if c.header_ == nil {
  57816. c.header_ = make(http.Header)
  57817. }
  57818. return c.header_
  57819. }
  57820. func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) {
  57821. reqHeaders := make(http.Header)
  57822. for k, v := range c.header_ {
  57823. reqHeaders[k] = v
  57824. }
  57825. reqHeaders.Set("User-Agent", c.s.userAgent())
  57826. if c.ifNoneMatch_ != "" {
  57827. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57828. }
  57829. var body io.Reader = nil
  57830. c.urlParams_.Set("alt", alt)
  57831. c.urlParams_.Set("prettyPrint", "false")
  57832. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  57833. urls += "?" + c.urlParams_.Encode()
  57834. req, err := http.NewRequest("GET", urls, body)
  57835. if err != nil {
  57836. return nil, err
  57837. }
  57838. req.Header = reqHeaders
  57839. googleapi.Expand(req.URL, map[string]string{
  57840. "project": c.project,
  57841. "license": c.license,
  57842. })
  57843. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57844. }
  57845. // Do executes the "compute.licenses.get" call.
  57846. // Exactly one of *License or error will be non-nil. Any non-2xx status
  57847. // code is an error. Response headers are in either
  57848. // *License.ServerResponse.Header or (if a response was returned at all)
  57849. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  57850. // check whether the returned error was because http.StatusNotModified
  57851. // was returned.
  57852. func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) {
  57853. gensupport.SetOptions(c.urlParams_, opts...)
  57854. res, err := c.doRequest("json")
  57855. if res != nil && res.StatusCode == http.StatusNotModified {
  57856. if res.Body != nil {
  57857. res.Body.Close()
  57858. }
  57859. return nil, &googleapi.Error{
  57860. Code: res.StatusCode,
  57861. Header: res.Header,
  57862. }
  57863. }
  57864. if err != nil {
  57865. return nil, err
  57866. }
  57867. defer googleapi.CloseBody(res)
  57868. if err := googleapi.CheckResponse(res); err != nil {
  57869. return nil, err
  57870. }
  57871. ret := &License{
  57872. ServerResponse: googleapi.ServerResponse{
  57873. Header: res.Header,
  57874. HTTPStatusCode: res.StatusCode,
  57875. },
  57876. }
  57877. target := &ret
  57878. if err := gensupport.DecodeResponse(target, res); err != nil {
  57879. return nil, err
  57880. }
  57881. return ret, nil
  57882. // {
  57883. // "description": "Returns the specified License resource.",
  57884. // "httpMethod": "GET",
  57885. // "id": "compute.licenses.get",
  57886. // "parameterOrder": [
  57887. // "project",
  57888. // "license"
  57889. // ],
  57890. // "parameters": {
  57891. // "license": {
  57892. // "description": "Name of the License resource to return.",
  57893. // "location": "path",
  57894. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57895. // "required": true,
  57896. // "type": "string"
  57897. // },
  57898. // "project": {
  57899. // "description": "Project ID for this request.",
  57900. // "location": "path",
  57901. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57902. // "required": true,
  57903. // "type": "string"
  57904. // }
  57905. // },
  57906. // "path": "{project}/global/licenses/{license}",
  57907. // "response": {
  57908. // "$ref": "License"
  57909. // },
  57910. // "scopes": [
  57911. // "https://www.googleapis.com/auth/cloud-platform",
  57912. // "https://www.googleapis.com/auth/compute",
  57913. // "https://www.googleapis.com/auth/compute.readonly"
  57914. // ]
  57915. // }
  57916. }
  57917. // method id "compute.licenses.getIamPolicy":
  57918. type LicensesGetIamPolicyCall struct {
  57919. s *Service
  57920. project string
  57921. resource string
  57922. urlParams_ gensupport.URLParams
  57923. ifNoneMatch_ string
  57924. ctx_ context.Context
  57925. header_ http.Header
  57926. }
  57927. // GetIamPolicy: Gets the access control policy for a resource. May be
  57928. // empty if no such policy or resource exists.
  57929. func (r *LicensesService) GetIamPolicy(project string, resource string) *LicensesGetIamPolicyCall {
  57930. c := &LicensesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57931. c.project = project
  57932. c.resource = resource
  57933. return c
  57934. }
  57935. // Fields allows partial responses to be retrieved. See
  57936. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57937. // for more information.
  57938. func (c *LicensesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesGetIamPolicyCall {
  57939. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57940. return c
  57941. }
  57942. // IfNoneMatch sets the optional parameter which makes the operation
  57943. // fail if the object's ETag matches the given value. This is useful for
  57944. // getting updates only after the object has changed since the last
  57945. // request. Use googleapi.IsNotModified to check whether the response
  57946. // error from Do is the result of In-None-Match.
  57947. func (c *LicensesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicensesGetIamPolicyCall {
  57948. c.ifNoneMatch_ = entityTag
  57949. return c
  57950. }
  57951. // Context sets the context to be used in this call's Do method. Any
  57952. // pending HTTP request will be aborted if the provided context is
  57953. // canceled.
  57954. func (c *LicensesGetIamPolicyCall) Context(ctx context.Context) *LicensesGetIamPolicyCall {
  57955. c.ctx_ = ctx
  57956. return c
  57957. }
  57958. // Header returns an http.Header that can be modified by the caller to
  57959. // add HTTP headers to the request.
  57960. func (c *LicensesGetIamPolicyCall) Header() http.Header {
  57961. if c.header_ == nil {
  57962. c.header_ = make(http.Header)
  57963. }
  57964. return c.header_
  57965. }
  57966. func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  57967. reqHeaders := make(http.Header)
  57968. for k, v := range c.header_ {
  57969. reqHeaders[k] = v
  57970. }
  57971. reqHeaders.Set("User-Agent", c.s.userAgent())
  57972. if c.ifNoneMatch_ != "" {
  57973. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57974. }
  57975. var body io.Reader = nil
  57976. c.urlParams_.Set("alt", alt)
  57977. c.urlParams_.Set("prettyPrint", "false")
  57978. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/getIamPolicy")
  57979. urls += "?" + c.urlParams_.Encode()
  57980. req, err := http.NewRequest("GET", urls, body)
  57981. if err != nil {
  57982. return nil, err
  57983. }
  57984. req.Header = reqHeaders
  57985. googleapi.Expand(req.URL, map[string]string{
  57986. "project": c.project,
  57987. "resource": c.resource,
  57988. })
  57989. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57990. }
  57991. // Do executes the "compute.licenses.getIamPolicy" call.
  57992. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  57993. // code is an error. Response headers are in either
  57994. // *Policy.ServerResponse.Header or (if a response was returned at all)
  57995. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  57996. // check whether the returned error was because http.StatusNotModified
  57997. // was returned.
  57998. func (c *LicensesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  57999. gensupport.SetOptions(c.urlParams_, opts...)
  58000. res, err := c.doRequest("json")
  58001. if res != nil && res.StatusCode == http.StatusNotModified {
  58002. if res.Body != nil {
  58003. res.Body.Close()
  58004. }
  58005. return nil, &googleapi.Error{
  58006. Code: res.StatusCode,
  58007. Header: res.Header,
  58008. }
  58009. }
  58010. if err != nil {
  58011. return nil, err
  58012. }
  58013. defer googleapi.CloseBody(res)
  58014. if err := googleapi.CheckResponse(res); err != nil {
  58015. return nil, err
  58016. }
  58017. ret := &Policy{
  58018. ServerResponse: googleapi.ServerResponse{
  58019. Header: res.Header,
  58020. HTTPStatusCode: res.StatusCode,
  58021. },
  58022. }
  58023. target := &ret
  58024. if err := gensupport.DecodeResponse(target, res); err != nil {
  58025. return nil, err
  58026. }
  58027. return ret, nil
  58028. // {
  58029. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  58030. // "httpMethod": "GET",
  58031. // "id": "compute.licenses.getIamPolicy",
  58032. // "parameterOrder": [
  58033. // "project",
  58034. // "resource"
  58035. // ],
  58036. // "parameters": {
  58037. // "project": {
  58038. // "description": "Project ID for this request.",
  58039. // "location": "path",
  58040. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58041. // "required": true,
  58042. // "type": "string"
  58043. // },
  58044. // "resource": {
  58045. // "description": "Name or id of the resource for this request.",
  58046. // "location": "path",
  58047. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58048. // "required": true,
  58049. // "type": "string"
  58050. // }
  58051. // },
  58052. // "path": "{project}/global/licenses/{resource}/getIamPolicy",
  58053. // "response": {
  58054. // "$ref": "Policy"
  58055. // },
  58056. // "scopes": [
  58057. // "https://www.googleapis.com/auth/cloud-platform",
  58058. // "https://www.googleapis.com/auth/compute",
  58059. // "https://www.googleapis.com/auth/compute.readonly"
  58060. // ]
  58061. // }
  58062. }
  58063. // method id "compute.licenses.insert":
  58064. type LicensesInsertCall struct {
  58065. s *Service
  58066. project string
  58067. license *License
  58068. urlParams_ gensupport.URLParams
  58069. ctx_ context.Context
  58070. header_ http.Header
  58071. }
  58072. // Insert: Create a License resource in the specified project.
  58073. func (r *LicensesService) Insert(project string, license *License) *LicensesInsertCall {
  58074. c := &LicensesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58075. c.project = project
  58076. c.license = license
  58077. return c
  58078. }
  58079. // RequestId sets the optional parameter "requestId": An optional
  58080. // request ID to identify requests. Specify a unique request ID so that
  58081. // if you must retry your request, the server will know to ignore the
  58082. // request if it has already been completed.
  58083. //
  58084. // For example, consider a situation where you make an initial request
  58085. // and the request times out. If you make the request again with the
  58086. // same request ID, the server can check if original operation with the
  58087. // same request ID was received, and if so, will ignore the second
  58088. // request. This prevents clients from accidentally creating duplicate
  58089. // commitments.
  58090. //
  58091. // The request ID must be a valid UUID with the exception that zero UUID
  58092. // is not supported (00000000-0000-0000-0000-000000000000).
  58093. func (c *LicensesInsertCall) RequestId(requestId string) *LicensesInsertCall {
  58094. c.urlParams_.Set("requestId", requestId)
  58095. return c
  58096. }
  58097. // Fields allows partial responses to be retrieved. See
  58098. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58099. // for more information.
  58100. func (c *LicensesInsertCall) Fields(s ...googleapi.Field) *LicensesInsertCall {
  58101. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58102. return c
  58103. }
  58104. // Context sets the context to be used in this call's Do method. Any
  58105. // pending HTTP request will be aborted if the provided context is
  58106. // canceled.
  58107. func (c *LicensesInsertCall) Context(ctx context.Context) *LicensesInsertCall {
  58108. c.ctx_ = ctx
  58109. return c
  58110. }
  58111. // Header returns an http.Header that can be modified by the caller to
  58112. // add HTTP headers to the request.
  58113. func (c *LicensesInsertCall) Header() http.Header {
  58114. if c.header_ == nil {
  58115. c.header_ = make(http.Header)
  58116. }
  58117. return c.header_
  58118. }
  58119. func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) {
  58120. reqHeaders := make(http.Header)
  58121. for k, v := range c.header_ {
  58122. reqHeaders[k] = v
  58123. }
  58124. reqHeaders.Set("User-Agent", c.s.userAgent())
  58125. var body io.Reader = nil
  58126. body, err := googleapi.WithoutDataWrapper.JSONReader(c.license)
  58127. if err != nil {
  58128. return nil, err
  58129. }
  58130. reqHeaders.Set("Content-Type", "application/json")
  58131. c.urlParams_.Set("alt", alt)
  58132. c.urlParams_.Set("prettyPrint", "false")
  58133. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  58134. urls += "?" + c.urlParams_.Encode()
  58135. req, err := http.NewRequest("POST", urls, body)
  58136. if err != nil {
  58137. return nil, err
  58138. }
  58139. req.Header = reqHeaders
  58140. googleapi.Expand(req.URL, map[string]string{
  58141. "project": c.project,
  58142. })
  58143. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58144. }
  58145. // Do executes the "compute.licenses.insert" call.
  58146. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58147. // status code is an error. Response headers are in either
  58148. // *Operation.ServerResponse.Header or (if a response was returned at
  58149. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58150. // to check whether the returned error was because
  58151. // http.StatusNotModified was returned.
  58152. func (c *LicensesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58153. gensupport.SetOptions(c.urlParams_, opts...)
  58154. res, err := c.doRequest("json")
  58155. if res != nil && res.StatusCode == http.StatusNotModified {
  58156. if res.Body != nil {
  58157. res.Body.Close()
  58158. }
  58159. return nil, &googleapi.Error{
  58160. Code: res.StatusCode,
  58161. Header: res.Header,
  58162. }
  58163. }
  58164. if err != nil {
  58165. return nil, err
  58166. }
  58167. defer googleapi.CloseBody(res)
  58168. if err := googleapi.CheckResponse(res); err != nil {
  58169. return nil, err
  58170. }
  58171. ret := &Operation{
  58172. ServerResponse: googleapi.ServerResponse{
  58173. Header: res.Header,
  58174. HTTPStatusCode: res.StatusCode,
  58175. },
  58176. }
  58177. target := &ret
  58178. if err := gensupport.DecodeResponse(target, res); err != nil {
  58179. return nil, err
  58180. }
  58181. return ret, nil
  58182. // {
  58183. // "description": "Create a License resource in the specified project.",
  58184. // "httpMethod": "POST",
  58185. // "id": "compute.licenses.insert",
  58186. // "parameterOrder": [
  58187. // "project"
  58188. // ],
  58189. // "parameters": {
  58190. // "project": {
  58191. // "description": "Project ID for this request.",
  58192. // "location": "path",
  58193. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58194. // "required": true,
  58195. // "type": "string"
  58196. // },
  58197. // "requestId": {
  58198. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58199. // "location": "query",
  58200. // "type": "string"
  58201. // }
  58202. // },
  58203. // "path": "{project}/global/licenses",
  58204. // "request": {
  58205. // "$ref": "License"
  58206. // },
  58207. // "response": {
  58208. // "$ref": "Operation"
  58209. // },
  58210. // "scopes": [
  58211. // "https://www.googleapis.com/auth/cloud-platform",
  58212. // "https://www.googleapis.com/auth/compute",
  58213. // "https://www.googleapis.com/auth/devstorage.full_control",
  58214. // "https://www.googleapis.com/auth/devstorage.read_only",
  58215. // "https://www.googleapis.com/auth/devstorage.read_write"
  58216. // ]
  58217. // }
  58218. }
  58219. // method id "compute.licenses.list":
  58220. type LicensesListCall struct {
  58221. s *Service
  58222. project string
  58223. urlParams_ gensupport.URLParams
  58224. ifNoneMatch_ string
  58225. ctx_ context.Context
  58226. header_ http.Header
  58227. }
  58228. // List: Retrieves the list of licenses available in the specified
  58229. // project. This method does not get any licenses that belong to other
  58230. // projects, including licenses attached to publicly-available images,
  58231. // like Debian 9. If you want to get a list of publicly-available
  58232. // licenses, use this method to make a request to the respective image
  58233. // project, such as debian-cloud or windows-cloud.
  58234. func (r *LicensesService) List(project string) *LicensesListCall {
  58235. c := &LicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58236. c.project = project
  58237. return c
  58238. }
  58239. // Filter sets the optional parameter "filter": A filter expression that
  58240. // filters resources listed in the response. The expression must specify
  58241. // the field name, a comparison operator, and the value that you want to
  58242. // use for filtering. The value must be a string, a number, or a
  58243. // boolean. The comparison operator must be either =, !=, >, or <.
  58244. //
  58245. // For example, if you are filtering Compute Engine instances, you can
  58246. // exclude instances named example-instance by specifying name !=
  58247. // example-instance.
  58248. //
  58249. // You can also filter nested fields. For example, you could specify
  58250. // scheduling.automaticRestart = false to include instances only if they
  58251. // are not scheduled for automatic restarts. You can use filtering on
  58252. // nested fields to filter based on resource labels.
  58253. //
  58254. // To filter on multiple expressions, provide each separate expression
  58255. // within parentheses. For example, (scheduling.automaticRestart = true)
  58256. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  58257. // AND expression. However, you can include AND and OR expressions
  58258. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  58259. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  58260. // true).
  58261. func (c *LicensesListCall) Filter(filter string) *LicensesListCall {
  58262. c.urlParams_.Set("filter", filter)
  58263. return c
  58264. }
  58265. // MaxResults sets the optional parameter "maxResults": The maximum
  58266. // number of results per page that should be returned. If the number of
  58267. // available results is larger than maxResults, Compute Engine returns a
  58268. // nextPageToken that can be used to get the next page of results in
  58269. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  58270. // (Default: 500)
  58271. func (c *LicensesListCall) MaxResults(maxResults int64) *LicensesListCall {
  58272. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  58273. return c
  58274. }
  58275. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  58276. // a certain order. By default, results are returned in alphanumerical
  58277. // order based on the resource name.
  58278. //
  58279. // You can also sort results in descending order based on the creation
  58280. // timestamp using orderBy="creationTimestamp desc". This sorts results
  58281. // based on the creationTimestamp field in reverse chronological order
  58282. // (newest result first). Use this to sort resources like operations so
  58283. // that the newest operation is returned first.
  58284. //
  58285. // Currently, only sorting by name or creationTimestamp desc is
  58286. // supported.
  58287. func (c *LicensesListCall) OrderBy(orderBy string) *LicensesListCall {
  58288. c.urlParams_.Set("orderBy", orderBy)
  58289. return c
  58290. }
  58291. // PageToken sets the optional parameter "pageToken": Specifies a page
  58292. // token to use. Set pageToken to the nextPageToken returned by a
  58293. // previous list request to get the next page of results.
  58294. func (c *LicensesListCall) PageToken(pageToken string) *LicensesListCall {
  58295. c.urlParams_.Set("pageToken", pageToken)
  58296. return c
  58297. }
  58298. // Fields allows partial responses to be retrieved. See
  58299. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58300. // for more information.
  58301. func (c *LicensesListCall) Fields(s ...googleapi.Field) *LicensesListCall {
  58302. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58303. return c
  58304. }
  58305. // IfNoneMatch sets the optional parameter which makes the operation
  58306. // fail if the object's ETag matches the given value. This is useful for
  58307. // getting updates only after the object has changed since the last
  58308. // request. Use googleapi.IsNotModified to check whether the response
  58309. // error from Do is the result of In-None-Match.
  58310. func (c *LicensesListCall) IfNoneMatch(entityTag string) *LicensesListCall {
  58311. c.ifNoneMatch_ = entityTag
  58312. return c
  58313. }
  58314. // Context sets the context to be used in this call's Do method. Any
  58315. // pending HTTP request will be aborted if the provided context is
  58316. // canceled.
  58317. func (c *LicensesListCall) Context(ctx context.Context) *LicensesListCall {
  58318. c.ctx_ = ctx
  58319. return c
  58320. }
  58321. // Header returns an http.Header that can be modified by the caller to
  58322. // add HTTP headers to the request.
  58323. func (c *LicensesListCall) Header() http.Header {
  58324. if c.header_ == nil {
  58325. c.header_ = make(http.Header)
  58326. }
  58327. return c.header_
  58328. }
  58329. func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) {
  58330. reqHeaders := make(http.Header)
  58331. for k, v := range c.header_ {
  58332. reqHeaders[k] = v
  58333. }
  58334. reqHeaders.Set("User-Agent", c.s.userAgent())
  58335. if c.ifNoneMatch_ != "" {
  58336. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58337. }
  58338. var body io.Reader = nil
  58339. c.urlParams_.Set("alt", alt)
  58340. c.urlParams_.Set("prettyPrint", "false")
  58341. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  58342. urls += "?" + c.urlParams_.Encode()
  58343. req, err := http.NewRequest("GET", urls, body)
  58344. if err != nil {
  58345. return nil, err
  58346. }
  58347. req.Header = reqHeaders
  58348. googleapi.Expand(req.URL, map[string]string{
  58349. "project": c.project,
  58350. })
  58351. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58352. }
  58353. // Do executes the "compute.licenses.list" call.
  58354. // Exactly one of *LicensesListResponse or error will be non-nil. Any
  58355. // non-2xx status code is an error. Response headers are in either
  58356. // *LicensesListResponse.ServerResponse.Header or (if a response was
  58357. // returned at all) in error.(*googleapi.Error).Header. Use
  58358. // googleapi.IsNotModified to check whether the returned error was
  58359. // because http.StatusNotModified was returned.
  58360. func (c *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListResponse, error) {
  58361. gensupport.SetOptions(c.urlParams_, opts...)
  58362. res, err := c.doRequest("json")
  58363. if res != nil && res.StatusCode == http.StatusNotModified {
  58364. if res.Body != nil {
  58365. res.Body.Close()
  58366. }
  58367. return nil, &googleapi.Error{
  58368. Code: res.StatusCode,
  58369. Header: res.Header,
  58370. }
  58371. }
  58372. if err != nil {
  58373. return nil, err
  58374. }
  58375. defer googleapi.CloseBody(res)
  58376. if err := googleapi.CheckResponse(res); err != nil {
  58377. return nil, err
  58378. }
  58379. ret := &LicensesListResponse{
  58380. ServerResponse: googleapi.ServerResponse{
  58381. Header: res.Header,
  58382. HTTPStatusCode: res.StatusCode,
  58383. },
  58384. }
  58385. target := &ret
  58386. if err := gensupport.DecodeResponse(target, res); err != nil {
  58387. return nil, err
  58388. }
  58389. return ret, nil
  58390. // {
  58391. // "description": "Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.",
  58392. // "httpMethod": "GET",
  58393. // "id": "compute.licenses.list",
  58394. // "parameterOrder": [
  58395. // "project"
  58396. // ],
  58397. // "parameters": {
  58398. // "filter": {
  58399. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  58400. // "location": "query",
  58401. // "type": "string"
  58402. // },
  58403. // "maxResults": {
  58404. // "default": "500",
  58405. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  58406. // "format": "uint32",
  58407. // "location": "query",
  58408. // "minimum": "0",
  58409. // "type": "integer"
  58410. // },
  58411. // "orderBy": {
  58412. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  58413. // "location": "query",
  58414. // "type": "string"
  58415. // },
  58416. // "pageToken": {
  58417. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  58418. // "location": "query",
  58419. // "type": "string"
  58420. // },
  58421. // "project": {
  58422. // "description": "Project ID for this request.",
  58423. // "location": "path",
  58424. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58425. // "required": true,
  58426. // "type": "string"
  58427. // }
  58428. // },
  58429. // "path": "{project}/global/licenses",
  58430. // "response": {
  58431. // "$ref": "LicensesListResponse"
  58432. // },
  58433. // "scopes": [
  58434. // "https://www.googleapis.com/auth/cloud-platform",
  58435. // "https://www.googleapis.com/auth/compute",
  58436. // "https://www.googleapis.com/auth/compute.readonly"
  58437. // ]
  58438. // }
  58439. }
  58440. // Pages invokes f for each page of results.
  58441. // A non-nil error returned from f will halt the iteration.
  58442. // The provided context supersedes any context provided to the Context method.
  58443. func (c *LicensesListCall) Pages(ctx context.Context, f func(*LicensesListResponse) error) error {
  58444. c.ctx_ = ctx
  58445. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  58446. for {
  58447. x, err := c.Do()
  58448. if err != nil {
  58449. return err
  58450. }
  58451. if err := f(x); err != nil {
  58452. return err
  58453. }
  58454. if x.NextPageToken == "" {
  58455. return nil
  58456. }
  58457. c.PageToken(x.NextPageToken)
  58458. }
  58459. }
  58460. // method id "compute.licenses.setIamPolicy":
  58461. type LicensesSetIamPolicyCall struct {
  58462. s *Service
  58463. project string
  58464. resource string
  58465. globalsetpolicyrequest *GlobalSetPolicyRequest
  58466. urlParams_ gensupport.URLParams
  58467. ctx_ context.Context
  58468. header_ http.Header
  58469. }
  58470. // SetIamPolicy: Sets the access control policy on the specified
  58471. // resource. Replaces any existing policy.
  58472. func (r *LicensesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicensesSetIamPolicyCall {
  58473. c := &LicensesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58474. c.project = project
  58475. c.resource = resource
  58476. c.globalsetpolicyrequest = globalsetpolicyrequest
  58477. return c
  58478. }
  58479. // Fields allows partial responses to be retrieved. See
  58480. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58481. // for more information.
  58482. func (c *LicensesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesSetIamPolicyCall {
  58483. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58484. return c
  58485. }
  58486. // Context sets the context to be used in this call's Do method. Any
  58487. // pending HTTP request will be aborted if the provided context is
  58488. // canceled.
  58489. func (c *LicensesSetIamPolicyCall) Context(ctx context.Context) *LicensesSetIamPolicyCall {
  58490. c.ctx_ = ctx
  58491. return c
  58492. }
  58493. // Header returns an http.Header that can be modified by the caller to
  58494. // add HTTP headers to the request.
  58495. func (c *LicensesSetIamPolicyCall) Header() http.Header {
  58496. if c.header_ == nil {
  58497. c.header_ = make(http.Header)
  58498. }
  58499. return c.header_
  58500. }
  58501. func (c *LicensesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  58502. reqHeaders := make(http.Header)
  58503. for k, v := range c.header_ {
  58504. reqHeaders[k] = v
  58505. }
  58506. reqHeaders.Set("User-Agent", c.s.userAgent())
  58507. var body io.Reader = nil
  58508. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  58509. if err != nil {
  58510. return nil, err
  58511. }
  58512. reqHeaders.Set("Content-Type", "application/json")
  58513. c.urlParams_.Set("alt", alt)
  58514. c.urlParams_.Set("prettyPrint", "false")
  58515. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/setIamPolicy")
  58516. urls += "?" + c.urlParams_.Encode()
  58517. req, err := http.NewRequest("POST", urls, body)
  58518. if err != nil {
  58519. return nil, err
  58520. }
  58521. req.Header = reqHeaders
  58522. googleapi.Expand(req.URL, map[string]string{
  58523. "project": c.project,
  58524. "resource": c.resource,
  58525. })
  58526. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58527. }
  58528. // Do executes the "compute.licenses.setIamPolicy" call.
  58529. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  58530. // code is an error. Response headers are in either
  58531. // *Policy.ServerResponse.Header or (if a response was returned at all)
  58532. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  58533. // check whether the returned error was because http.StatusNotModified
  58534. // was returned.
  58535. func (c *LicensesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  58536. gensupport.SetOptions(c.urlParams_, opts...)
  58537. res, err := c.doRequest("json")
  58538. if res != nil && res.StatusCode == http.StatusNotModified {
  58539. if res.Body != nil {
  58540. res.Body.Close()
  58541. }
  58542. return nil, &googleapi.Error{
  58543. Code: res.StatusCode,
  58544. Header: res.Header,
  58545. }
  58546. }
  58547. if err != nil {
  58548. return nil, err
  58549. }
  58550. defer googleapi.CloseBody(res)
  58551. if err := googleapi.CheckResponse(res); err != nil {
  58552. return nil, err
  58553. }
  58554. ret := &Policy{
  58555. ServerResponse: googleapi.ServerResponse{
  58556. Header: res.Header,
  58557. HTTPStatusCode: res.StatusCode,
  58558. },
  58559. }
  58560. target := &ret
  58561. if err := gensupport.DecodeResponse(target, res); err != nil {
  58562. return nil, err
  58563. }
  58564. return ret, nil
  58565. // {
  58566. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  58567. // "httpMethod": "POST",
  58568. // "id": "compute.licenses.setIamPolicy",
  58569. // "parameterOrder": [
  58570. // "project",
  58571. // "resource"
  58572. // ],
  58573. // "parameters": {
  58574. // "project": {
  58575. // "description": "Project ID for this request.",
  58576. // "location": "path",
  58577. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58578. // "required": true,
  58579. // "type": "string"
  58580. // },
  58581. // "resource": {
  58582. // "description": "Name or id of the resource for this request.",
  58583. // "location": "path",
  58584. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58585. // "required": true,
  58586. // "type": "string"
  58587. // }
  58588. // },
  58589. // "path": "{project}/global/licenses/{resource}/setIamPolicy",
  58590. // "request": {
  58591. // "$ref": "GlobalSetPolicyRequest"
  58592. // },
  58593. // "response": {
  58594. // "$ref": "Policy"
  58595. // },
  58596. // "scopes": [
  58597. // "https://www.googleapis.com/auth/cloud-platform",
  58598. // "https://www.googleapis.com/auth/compute"
  58599. // ]
  58600. // }
  58601. }
  58602. // method id "compute.licenses.testIamPermissions":
  58603. type LicensesTestIamPermissionsCall struct {
  58604. s *Service
  58605. project string
  58606. resource string
  58607. testpermissionsrequest *TestPermissionsRequest
  58608. urlParams_ gensupport.URLParams
  58609. ctx_ context.Context
  58610. header_ http.Header
  58611. }
  58612. // TestIamPermissions: Returns permissions that a caller has on the
  58613. // specified resource.
  58614. func (r *LicensesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicensesTestIamPermissionsCall {
  58615. c := &LicensesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58616. c.project = project
  58617. c.resource = resource
  58618. c.testpermissionsrequest = testpermissionsrequest
  58619. return c
  58620. }
  58621. // Fields allows partial responses to be retrieved. See
  58622. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58623. // for more information.
  58624. func (c *LicensesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicensesTestIamPermissionsCall {
  58625. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58626. return c
  58627. }
  58628. // Context sets the context to be used in this call's Do method. Any
  58629. // pending HTTP request will be aborted if the provided context is
  58630. // canceled.
  58631. func (c *LicensesTestIamPermissionsCall) Context(ctx context.Context) *LicensesTestIamPermissionsCall {
  58632. c.ctx_ = ctx
  58633. return c
  58634. }
  58635. // Header returns an http.Header that can be modified by the caller to
  58636. // add HTTP headers to the request.
  58637. func (c *LicensesTestIamPermissionsCall) Header() http.Header {
  58638. if c.header_ == nil {
  58639. c.header_ = make(http.Header)
  58640. }
  58641. return c.header_
  58642. }
  58643. func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  58644. reqHeaders := make(http.Header)
  58645. for k, v := range c.header_ {
  58646. reqHeaders[k] = v
  58647. }
  58648. reqHeaders.Set("User-Agent", c.s.userAgent())
  58649. var body io.Reader = nil
  58650. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  58651. if err != nil {
  58652. return nil, err
  58653. }
  58654. reqHeaders.Set("Content-Type", "application/json")
  58655. c.urlParams_.Set("alt", alt)
  58656. c.urlParams_.Set("prettyPrint", "false")
  58657. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/testIamPermissions")
  58658. urls += "?" + c.urlParams_.Encode()
  58659. req, err := http.NewRequest("POST", urls, body)
  58660. if err != nil {
  58661. return nil, err
  58662. }
  58663. req.Header = reqHeaders
  58664. googleapi.Expand(req.URL, map[string]string{
  58665. "project": c.project,
  58666. "resource": c.resource,
  58667. })
  58668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58669. }
  58670. // Do executes the "compute.licenses.testIamPermissions" call.
  58671. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  58672. // non-2xx status code is an error. Response headers are in either
  58673. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  58674. // returned at all) in error.(*googleapi.Error).Header. Use
  58675. // googleapi.IsNotModified to check whether the returned error was
  58676. // because http.StatusNotModified was returned.
  58677. func (c *LicensesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  58678. gensupport.SetOptions(c.urlParams_, opts...)
  58679. res, err := c.doRequest("json")
  58680. if res != nil && res.StatusCode == http.StatusNotModified {
  58681. if res.Body != nil {
  58682. res.Body.Close()
  58683. }
  58684. return nil, &googleapi.Error{
  58685. Code: res.StatusCode,
  58686. Header: res.Header,
  58687. }
  58688. }
  58689. if err != nil {
  58690. return nil, err
  58691. }
  58692. defer googleapi.CloseBody(res)
  58693. if err := googleapi.CheckResponse(res); err != nil {
  58694. return nil, err
  58695. }
  58696. ret := &TestPermissionsResponse{
  58697. ServerResponse: googleapi.ServerResponse{
  58698. Header: res.Header,
  58699. HTTPStatusCode: res.StatusCode,
  58700. },
  58701. }
  58702. target := &ret
  58703. if err := gensupport.DecodeResponse(target, res); err != nil {
  58704. return nil, err
  58705. }
  58706. return ret, nil
  58707. // {
  58708. // "description": "Returns permissions that a caller has on the specified resource.",
  58709. // "httpMethod": "POST",
  58710. // "id": "compute.licenses.testIamPermissions",
  58711. // "parameterOrder": [
  58712. // "project",
  58713. // "resource"
  58714. // ],
  58715. // "parameters": {
  58716. // "project": {
  58717. // "description": "Project ID for this request.",
  58718. // "location": "path",
  58719. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58720. // "required": true,
  58721. // "type": "string"
  58722. // },
  58723. // "resource": {
  58724. // "description": "Name or id of the resource for this request.",
  58725. // "location": "path",
  58726. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58727. // "required": true,
  58728. // "type": "string"
  58729. // }
  58730. // },
  58731. // "path": "{project}/global/licenses/{resource}/testIamPermissions",
  58732. // "request": {
  58733. // "$ref": "TestPermissionsRequest"
  58734. // },
  58735. // "response": {
  58736. // "$ref": "TestPermissionsResponse"
  58737. // },
  58738. // "scopes": [
  58739. // "https://www.googleapis.com/auth/cloud-platform",
  58740. // "https://www.googleapis.com/auth/compute",
  58741. // "https://www.googleapis.com/auth/compute.readonly"
  58742. // ]
  58743. // }
  58744. }
  58745. // method id "compute.machineTypes.aggregatedList":
  58746. type MachineTypesAggregatedListCall struct {
  58747. s *Service
  58748. project string
  58749. urlParams_ gensupport.URLParams
  58750. ifNoneMatch_ string
  58751. ctx_ context.Context
  58752. header_ http.Header
  58753. }
  58754. // AggregatedList: Retrieves an aggregated list of machine types.
  58755. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList
  58756. func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall {
  58757. c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58758. c.project = project
  58759. return c
  58760. }
  58761. // Filter sets the optional parameter "filter": A filter expression that
  58762. // filters resources listed in the response. The expression must specify
  58763. // the field name, a comparison operator, and the value that you want to
  58764. // use for filtering. The value must be a string, a number, or a
  58765. // boolean. The comparison operator must be either =, !=, >, or <.
  58766. //
  58767. // For example, if you are filtering Compute Engine instances, you can
  58768. // exclude instances named example-instance by specifying name !=
  58769. // example-instance.
  58770. //
  58771. // You can also filter nested fields. For example, you could specify
  58772. // scheduling.automaticRestart = false to include instances only if they
  58773. // are not scheduled for automatic restarts. You can use filtering on
  58774. // nested fields to filter based on resource labels.
  58775. //
  58776. // To filter on multiple expressions, provide each separate expression
  58777. // within parentheses. For example, (scheduling.automaticRestart = true)
  58778. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  58779. // AND expression. However, you can include AND and OR expressions
  58780. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  58781. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  58782. // true).
  58783. func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall {
  58784. c.urlParams_.Set("filter", filter)
  58785. return c
  58786. }
  58787. // MaxResults sets the optional parameter "maxResults": The maximum
  58788. // number of results per page that should be returned. If the number of
  58789. // available results is larger than maxResults, Compute Engine returns a
  58790. // nextPageToken that can be used to get the next page of results in
  58791. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  58792. // (Default: 500)
  58793. func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall {
  58794. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  58795. return c
  58796. }
  58797. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  58798. // a certain order. By default, results are returned in alphanumerical
  58799. // order based on the resource name.
  58800. //
  58801. // You can also sort results in descending order based on the creation
  58802. // timestamp using orderBy="creationTimestamp desc". This sorts results
  58803. // based on the creationTimestamp field in reverse chronological order
  58804. // (newest result first). Use this to sort resources like operations so
  58805. // that the newest operation is returned first.
  58806. //
  58807. // Currently, only sorting by name or creationTimestamp desc is
  58808. // supported.
  58809. func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall {
  58810. c.urlParams_.Set("orderBy", orderBy)
  58811. return c
  58812. }
  58813. // PageToken sets the optional parameter "pageToken": Specifies a page
  58814. // token to use. Set pageToken to the nextPageToken returned by a
  58815. // previous list request to get the next page of results.
  58816. func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall {
  58817. c.urlParams_.Set("pageToken", pageToken)
  58818. return c
  58819. }
  58820. // Fields allows partial responses to be retrieved. See
  58821. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58822. // for more information.
  58823. func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall {
  58824. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58825. return c
  58826. }
  58827. // IfNoneMatch sets the optional parameter which makes the operation
  58828. // fail if the object's ETag matches the given value. This is useful for
  58829. // getting updates only after the object has changed since the last
  58830. // request. Use googleapi.IsNotModified to check whether the response
  58831. // error from Do is the result of In-None-Match.
  58832. func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall {
  58833. c.ifNoneMatch_ = entityTag
  58834. return c
  58835. }
  58836. // Context sets the context to be used in this call's Do method. Any
  58837. // pending HTTP request will be aborted if the provided context is
  58838. // canceled.
  58839. func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall {
  58840. c.ctx_ = ctx
  58841. return c
  58842. }
  58843. // Header returns an http.Header that can be modified by the caller to
  58844. // add HTTP headers to the request.
  58845. func (c *MachineTypesAggregatedListCall) Header() http.Header {
  58846. if c.header_ == nil {
  58847. c.header_ = make(http.Header)
  58848. }
  58849. return c.header_
  58850. }
  58851. func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  58852. reqHeaders := make(http.Header)
  58853. for k, v := range c.header_ {
  58854. reqHeaders[k] = v
  58855. }
  58856. reqHeaders.Set("User-Agent", c.s.userAgent())
  58857. if c.ifNoneMatch_ != "" {
  58858. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58859. }
  58860. var body io.Reader = nil
  58861. c.urlParams_.Set("alt", alt)
  58862. c.urlParams_.Set("prettyPrint", "false")
  58863. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes")
  58864. urls += "?" + c.urlParams_.Encode()
  58865. req, err := http.NewRequest("GET", urls, body)
  58866. if err != nil {
  58867. return nil, err
  58868. }
  58869. req.Header = reqHeaders
  58870. googleapi.Expand(req.URL, map[string]string{
  58871. "project": c.project,
  58872. })
  58873. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58874. }
  58875. // Do executes the "compute.machineTypes.aggregatedList" call.
  58876. // Exactly one of *MachineTypeAggregatedList or error will be non-nil.
  58877. // Any non-2xx status code is an error. Response headers are in either
  58878. // *MachineTypeAggregatedList.ServerResponse.Header or (if a response
  58879. // was returned at all) in error.(*googleapi.Error).Header. Use
  58880. // googleapi.IsNotModified to check whether the returned error was
  58881. // because http.StatusNotModified was returned.
  58882. func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) {
  58883. gensupport.SetOptions(c.urlParams_, opts...)
  58884. res, err := c.doRequest("json")
  58885. if res != nil && res.StatusCode == http.StatusNotModified {
  58886. if res.Body != nil {
  58887. res.Body.Close()
  58888. }
  58889. return nil, &googleapi.Error{
  58890. Code: res.StatusCode,
  58891. Header: res.Header,
  58892. }
  58893. }
  58894. if err != nil {
  58895. return nil, err
  58896. }
  58897. defer googleapi.CloseBody(res)
  58898. if err := googleapi.CheckResponse(res); err != nil {
  58899. return nil, err
  58900. }
  58901. ret := &MachineTypeAggregatedList{
  58902. ServerResponse: googleapi.ServerResponse{
  58903. Header: res.Header,
  58904. HTTPStatusCode: res.StatusCode,
  58905. },
  58906. }
  58907. target := &ret
  58908. if err := gensupport.DecodeResponse(target, res); err != nil {
  58909. return nil, err
  58910. }
  58911. return ret, nil
  58912. // {
  58913. // "description": "Retrieves an aggregated list of machine types.",
  58914. // "httpMethod": "GET",
  58915. // "id": "compute.machineTypes.aggregatedList",
  58916. // "parameterOrder": [
  58917. // "project"
  58918. // ],
  58919. // "parameters": {
  58920. // "filter": {
  58921. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  58922. // "location": "query",
  58923. // "type": "string"
  58924. // },
  58925. // "maxResults": {
  58926. // "default": "500",
  58927. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  58928. // "format": "uint32",
  58929. // "location": "query",
  58930. // "minimum": "0",
  58931. // "type": "integer"
  58932. // },
  58933. // "orderBy": {
  58934. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  58935. // "location": "query",
  58936. // "type": "string"
  58937. // },
  58938. // "pageToken": {
  58939. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  58940. // "location": "query",
  58941. // "type": "string"
  58942. // },
  58943. // "project": {
  58944. // "description": "Project ID for this request.",
  58945. // "location": "path",
  58946. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58947. // "required": true,
  58948. // "type": "string"
  58949. // }
  58950. // },
  58951. // "path": "{project}/aggregated/machineTypes",
  58952. // "response": {
  58953. // "$ref": "MachineTypeAggregatedList"
  58954. // },
  58955. // "scopes": [
  58956. // "https://www.googleapis.com/auth/cloud-platform",
  58957. // "https://www.googleapis.com/auth/compute",
  58958. // "https://www.googleapis.com/auth/compute.readonly"
  58959. // ]
  58960. // }
  58961. }
  58962. // Pages invokes f for each page of results.
  58963. // A non-nil error returned from f will halt the iteration.
  58964. // The provided context supersedes any context provided to the Context method.
  58965. func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error {
  58966. c.ctx_ = ctx
  58967. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  58968. for {
  58969. x, err := c.Do()
  58970. if err != nil {
  58971. return err
  58972. }
  58973. if err := f(x); err != nil {
  58974. return err
  58975. }
  58976. if x.NextPageToken == "" {
  58977. return nil
  58978. }
  58979. c.PageToken(x.NextPageToken)
  58980. }
  58981. }
  58982. // method id "compute.machineTypes.get":
  58983. type MachineTypesGetCall struct {
  58984. s *Service
  58985. project string
  58986. zone string
  58987. machineType string
  58988. urlParams_ gensupport.URLParams
  58989. ifNoneMatch_ string
  58990. ctx_ context.Context
  58991. header_ http.Header
  58992. }
  58993. // Get: Returns the specified machine type. Gets a list of available
  58994. // machine types by making a list() request.
  58995. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get
  58996. func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall {
  58997. c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58998. c.project = project
  58999. c.zone = zone
  59000. c.machineType = machineType
  59001. return c
  59002. }
  59003. // Fields allows partial responses to be retrieved. See
  59004. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59005. // for more information.
  59006. func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall {
  59007. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59008. return c
  59009. }
  59010. // IfNoneMatch sets the optional parameter which makes the operation
  59011. // fail if the object's ETag matches the given value. This is useful for
  59012. // getting updates only after the object has changed since the last
  59013. // request. Use googleapi.IsNotModified to check whether the response
  59014. // error from Do is the result of In-None-Match.
  59015. func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall {
  59016. c.ifNoneMatch_ = entityTag
  59017. return c
  59018. }
  59019. // Context sets the context to be used in this call's Do method. Any
  59020. // pending HTTP request will be aborted if the provided context is
  59021. // canceled.
  59022. func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall {
  59023. c.ctx_ = ctx
  59024. return c
  59025. }
  59026. // Header returns an http.Header that can be modified by the caller to
  59027. // add HTTP headers to the request.
  59028. func (c *MachineTypesGetCall) Header() http.Header {
  59029. if c.header_ == nil {
  59030. c.header_ = make(http.Header)
  59031. }
  59032. return c.header_
  59033. }
  59034. func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) {
  59035. reqHeaders := make(http.Header)
  59036. for k, v := range c.header_ {
  59037. reqHeaders[k] = v
  59038. }
  59039. reqHeaders.Set("User-Agent", c.s.userAgent())
  59040. if c.ifNoneMatch_ != "" {
  59041. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59042. }
  59043. var body io.Reader = nil
  59044. c.urlParams_.Set("alt", alt)
  59045. c.urlParams_.Set("prettyPrint", "false")
  59046. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}")
  59047. urls += "?" + c.urlParams_.Encode()
  59048. req, err := http.NewRequest("GET", urls, body)
  59049. if err != nil {
  59050. return nil, err
  59051. }
  59052. req.Header = reqHeaders
  59053. googleapi.Expand(req.URL, map[string]string{
  59054. "project": c.project,
  59055. "zone": c.zone,
  59056. "machineType": c.machineType,
  59057. })
  59058. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59059. }
  59060. // Do executes the "compute.machineTypes.get" call.
  59061. // Exactly one of *MachineType or error will be non-nil. Any non-2xx
  59062. // status code is an error. Response headers are in either
  59063. // *MachineType.ServerResponse.Header or (if a response was returned at
  59064. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59065. // to check whether the returned error was because
  59066. // http.StatusNotModified was returned.
  59067. func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) {
  59068. gensupport.SetOptions(c.urlParams_, opts...)
  59069. res, err := c.doRequest("json")
  59070. if res != nil && res.StatusCode == http.StatusNotModified {
  59071. if res.Body != nil {
  59072. res.Body.Close()
  59073. }
  59074. return nil, &googleapi.Error{
  59075. Code: res.StatusCode,
  59076. Header: res.Header,
  59077. }
  59078. }
  59079. if err != nil {
  59080. return nil, err
  59081. }
  59082. defer googleapi.CloseBody(res)
  59083. if err := googleapi.CheckResponse(res); err != nil {
  59084. return nil, err
  59085. }
  59086. ret := &MachineType{
  59087. ServerResponse: googleapi.ServerResponse{
  59088. Header: res.Header,
  59089. HTTPStatusCode: res.StatusCode,
  59090. },
  59091. }
  59092. target := &ret
  59093. if err := gensupport.DecodeResponse(target, res); err != nil {
  59094. return nil, err
  59095. }
  59096. return ret, nil
  59097. // {
  59098. // "description": "Returns the specified machine type. Gets a list of available machine types by making a list() request.",
  59099. // "httpMethod": "GET",
  59100. // "id": "compute.machineTypes.get",
  59101. // "parameterOrder": [
  59102. // "project",
  59103. // "zone",
  59104. // "machineType"
  59105. // ],
  59106. // "parameters": {
  59107. // "machineType": {
  59108. // "description": "Name of the machine type to return.",
  59109. // "location": "path",
  59110. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59111. // "required": true,
  59112. // "type": "string"
  59113. // },
  59114. // "project": {
  59115. // "description": "Project ID for this request.",
  59116. // "location": "path",
  59117. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59118. // "required": true,
  59119. // "type": "string"
  59120. // },
  59121. // "zone": {
  59122. // "description": "The name of the zone for this request.",
  59123. // "location": "path",
  59124. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  59125. // "required": true,
  59126. // "type": "string"
  59127. // }
  59128. // },
  59129. // "path": "{project}/zones/{zone}/machineTypes/{machineType}",
  59130. // "response": {
  59131. // "$ref": "MachineType"
  59132. // },
  59133. // "scopes": [
  59134. // "https://www.googleapis.com/auth/cloud-platform",
  59135. // "https://www.googleapis.com/auth/compute",
  59136. // "https://www.googleapis.com/auth/compute.readonly"
  59137. // ]
  59138. // }
  59139. }
  59140. // method id "compute.machineTypes.list":
  59141. type MachineTypesListCall struct {
  59142. s *Service
  59143. project string
  59144. zone string
  59145. urlParams_ gensupport.URLParams
  59146. ifNoneMatch_ string
  59147. ctx_ context.Context
  59148. header_ http.Header
  59149. }
  59150. // List: Retrieves a list of machine types available to the specified
  59151. // project.
  59152. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list
  59153. func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall {
  59154. c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59155. c.project = project
  59156. c.zone = zone
  59157. return c
  59158. }
  59159. // Filter sets the optional parameter "filter": A filter expression that
  59160. // filters resources listed in the response. The expression must specify
  59161. // the field name, a comparison operator, and the value that you want to
  59162. // use for filtering. The value must be a string, a number, or a
  59163. // boolean. The comparison operator must be either =, !=, >, or <.
  59164. //
  59165. // For example, if you are filtering Compute Engine instances, you can
  59166. // exclude instances named example-instance by specifying name !=
  59167. // example-instance.
  59168. //
  59169. // You can also filter nested fields. For example, you could specify
  59170. // scheduling.automaticRestart = false to include instances only if they
  59171. // are not scheduled for automatic restarts. You can use filtering on
  59172. // nested fields to filter based on resource labels.
  59173. //
  59174. // To filter on multiple expressions, provide each separate expression
  59175. // within parentheses. For example, (scheduling.automaticRestart = true)
  59176. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  59177. // AND expression. However, you can include AND and OR expressions
  59178. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  59179. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  59180. // true).
  59181. func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall {
  59182. c.urlParams_.Set("filter", filter)
  59183. return c
  59184. }
  59185. // MaxResults sets the optional parameter "maxResults": The maximum
  59186. // number of results per page that should be returned. If the number of
  59187. // available results is larger than maxResults, Compute Engine returns a
  59188. // nextPageToken that can be used to get the next page of results in
  59189. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  59190. // (Default: 500)
  59191. func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall {
  59192. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  59193. return c
  59194. }
  59195. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  59196. // a certain order. By default, results are returned in alphanumerical
  59197. // order based on the resource name.
  59198. //
  59199. // You can also sort results in descending order based on the creation
  59200. // timestamp using orderBy="creationTimestamp desc". This sorts results
  59201. // based on the creationTimestamp field in reverse chronological order
  59202. // (newest result first). Use this to sort resources like operations so
  59203. // that the newest operation is returned first.
  59204. //
  59205. // Currently, only sorting by name or creationTimestamp desc is
  59206. // supported.
  59207. func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall {
  59208. c.urlParams_.Set("orderBy", orderBy)
  59209. return c
  59210. }
  59211. // PageToken sets the optional parameter "pageToken": Specifies a page
  59212. // token to use. Set pageToken to the nextPageToken returned by a
  59213. // previous list request to get the next page of results.
  59214. func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall {
  59215. c.urlParams_.Set("pageToken", pageToken)
  59216. return c
  59217. }
  59218. // Fields allows partial responses to be retrieved. See
  59219. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59220. // for more information.
  59221. func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall {
  59222. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59223. return c
  59224. }
  59225. // IfNoneMatch sets the optional parameter which makes the operation
  59226. // fail if the object's ETag matches the given value. This is useful for
  59227. // getting updates only after the object has changed since the last
  59228. // request. Use googleapi.IsNotModified to check whether the response
  59229. // error from Do is the result of In-None-Match.
  59230. func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall {
  59231. c.ifNoneMatch_ = entityTag
  59232. return c
  59233. }
  59234. // Context sets the context to be used in this call's Do method. Any
  59235. // pending HTTP request will be aborted if the provided context is
  59236. // canceled.
  59237. func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall {
  59238. c.ctx_ = ctx
  59239. return c
  59240. }
  59241. // Header returns an http.Header that can be modified by the caller to
  59242. // add HTTP headers to the request.
  59243. func (c *MachineTypesListCall) Header() http.Header {
  59244. if c.header_ == nil {
  59245. c.header_ = make(http.Header)
  59246. }
  59247. return c.header_
  59248. }
  59249. func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) {
  59250. reqHeaders := make(http.Header)
  59251. for k, v := range c.header_ {
  59252. reqHeaders[k] = v
  59253. }
  59254. reqHeaders.Set("User-Agent", c.s.userAgent())
  59255. if c.ifNoneMatch_ != "" {
  59256. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59257. }
  59258. var body io.Reader = nil
  59259. c.urlParams_.Set("alt", alt)
  59260. c.urlParams_.Set("prettyPrint", "false")
  59261. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes")
  59262. urls += "?" + c.urlParams_.Encode()
  59263. req, err := http.NewRequest("GET", urls, body)
  59264. if err != nil {
  59265. return nil, err
  59266. }
  59267. req.Header = reqHeaders
  59268. googleapi.Expand(req.URL, map[string]string{
  59269. "project": c.project,
  59270. "zone": c.zone,
  59271. })
  59272. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59273. }
  59274. // Do executes the "compute.machineTypes.list" call.
  59275. // Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx
  59276. // status code is an error. Response headers are in either
  59277. // *MachineTypeList.ServerResponse.Header or (if a response was returned
  59278. // at all) in error.(*googleapi.Error).Header. Use
  59279. // googleapi.IsNotModified to check whether the returned error was
  59280. // because http.StatusNotModified was returned.
  59281. func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) {
  59282. gensupport.SetOptions(c.urlParams_, opts...)
  59283. res, err := c.doRequest("json")
  59284. if res != nil && res.StatusCode == http.StatusNotModified {
  59285. if res.Body != nil {
  59286. res.Body.Close()
  59287. }
  59288. return nil, &googleapi.Error{
  59289. Code: res.StatusCode,
  59290. Header: res.Header,
  59291. }
  59292. }
  59293. if err != nil {
  59294. return nil, err
  59295. }
  59296. defer googleapi.CloseBody(res)
  59297. if err := googleapi.CheckResponse(res); err != nil {
  59298. return nil, err
  59299. }
  59300. ret := &MachineTypeList{
  59301. ServerResponse: googleapi.ServerResponse{
  59302. Header: res.Header,
  59303. HTTPStatusCode: res.StatusCode,
  59304. },
  59305. }
  59306. target := &ret
  59307. if err := gensupport.DecodeResponse(target, res); err != nil {
  59308. return nil, err
  59309. }
  59310. return ret, nil
  59311. // {
  59312. // "description": "Retrieves a list of machine types available to the specified project.",
  59313. // "httpMethod": "GET",
  59314. // "id": "compute.machineTypes.list",
  59315. // "parameterOrder": [
  59316. // "project",
  59317. // "zone"
  59318. // ],
  59319. // "parameters": {
  59320. // "filter": {
  59321. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  59322. // "location": "query",
  59323. // "type": "string"
  59324. // },
  59325. // "maxResults": {
  59326. // "default": "500",
  59327. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  59328. // "format": "uint32",
  59329. // "location": "query",
  59330. // "minimum": "0",
  59331. // "type": "integer"
  59332. // },
  59333. // "orderBy": {
  59334. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  59335. // "location": "query",
  59336. // "type": "string"
  59337. // },
  59338. // "pageToken": {
  59339. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  59340. // "location": "query",
  59341. // "type": "string"
  59342. // },
  59343. // "project": {
  59344. // "description": "Project ID for this request.",
  59345. // "location": "path",
  59346. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59347. // "required": true,
  59348. // "type": "string"
  59349. // },
  59350. // "zone": {
  59351. // "description": "The name of the zone for this request.",
  59352. // "location": "path",
  59353. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  59354. // "required": true,
  59355. // "type": "string"
  59356. // }
  59357. // },
  59358. // "path": "{project}/zones/{zone}/machineTypes",
  59359. // "response": {
  59360. // "$ref": "MachineTypeList"
  59361. // },
  59362. // "scopes": [
  59363. // "https://www.googleapis.com/auth/cloud-platform",
  59364. // "https://www.googleapis.com/auth/compute",
  59365. // "https://www.googleapis.com/auth/compute.readonly"
  59366. // ]
  59367. // }
  59368. }
  59369. // Pages invokes f for each page of results.
  59370. // A non-nil error returned from f will halt the iteration.
  59371. // The provided context supersedes any context provided to the Context method.
  59372. func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error {
  59373. c.ctx_ = ctx
  59374. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  59375. for {
  59376. x, err := c.Do()
  59377. if err != nil {
  59378. return err
  59379. }
  59380. if err := f(x); err != nil {
  59381. return err
  59382. }
  59383. if x.NextPageToken == "" {
  59384. return nil
  59385. }
  59386. c.PageToken(x.NextPageToken)
  59387. }
  59388. }
  59389. // method id "compute.networks.addPeering":
  59390. type NetworksAddPeeringCall struct {
  59391. s *Service
  59392. project string
  59393. network string
  59394. networksaddpeeringrequest *NetworksAddPeeringRequest
  59395. urlParams_ gensupport.URLParams
  59396. ctx_ context.Context
  59397. header_ http.Header
  59398. }
  59399. // AddPeering: Adds a peering to the specified network.
  59400. func (r *NetworksService) AddPeering(project string, network string, networksaddpeeringrequest *NetworksAddPeeringRequest) *NetworksAddPeeringCall {
  59401. c := &NetworksAddPeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59402. c.project = project
  59403. c.network = network
  59404. c.networksaddpeeringrequest = networksaddpeeringrequest
  59405. return c
  59406. }
  59407. // RequestId sets the optional parameter "requestId": An optional
  59408. // request ID to identify requests. Specify a unique request ID so that
  59409. // if you must retry your request, the server will know to ignore the
  59410. // request if it has already been completed.
  59411. //
  59412. // For example, consider a situation where you make an initial request
  59413. // and the request times out. If you make the request again with the
  59414. // same request ID, the server can check if original operation with the
  59415. // same request ID was received, and if so, will ignore the second
  59416. // request. This prevents clients from accidentally creating duplicate
  59417. // commitments.
  59418. //
  59419. // The request ID must be a valid UUID with the exception that zero UUID
  59420. // is not supported (00000000-0000-0000-0000-000000000000).
  59421. func (c *NetworksAddPeeringCall) RequestId(requestId string) *NetworksAddPeeringCall {
  59422. c.urlParams_.Set("requestId", requestId)
  59423. return c
  59424. }
  59425. // Fields allows partial responses to be retrieved. See
  59426. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59427. // for more information.
  59428. func (c *NetworksAddPeeringCall) Fields(s ...googleapi.Field) *NetworksAddPeeringCall {
  59429. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59430. return c
  59431. }
  59432. // Context sets the context to be used in this call's Do method. Any
  59433. // pending HTTP request will be aborted if the provided context is
  59434. // canceled.
  59435. func (c *NetworksAddPeeringCall) Context(ctx context.Context) *NetworksAddPeeringCall {
  59436. c.ctx_ = ctx
  59437. return c
  59438. }
  59439. // Header returns an http.Header that can be modified by the caller to
  59440. // add HTTP headers to the request.
  59441. func (c *NetworksAddPeeringCall) Header() http.Header {
  59442. if c.header_ == nil {
  59443. c.header_ = make(http.Header)
  59444. }
  59445. return c.header_
  59446. }
  59447. func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) {
  59448. reqHeaders := make(http.Header)
  59449. for k, v := range c.header_ {
  59450. reqHeaders[k] = v
  59451. }
  59452. reqHeaders.Set("User-Agent", c.s.userAgent())
  59453. var body io.Reader = nil
  59454. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest)
  59455. if err != nil {
  59456. return nil, err
  59457. }
  59458. reqHeaders.Set("Content-Type", "application/json")
  59459. c.urlParams_.Set("alt", alt)
  59460. c.urlParams_.Set("prettyPrint", "false")
  59461. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/addPeering")
  59462. urls += "?" + c.urlParams_.Encode()
  59463. req, err := http.NewRequest("POST", urls, body)
  59464. if err != nil {
  59465. return nil, err
  59466. }
  59467. req.Header = reqHeaders
  59468. googleapi.Expand(req.URL, map[string]string{
  59469. "project": c.project,
  59470. "network": c.network,
  59471. })
  59472. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59473. }
  59474. // Do executes the "compute.networks.addPeering" call.
  59475. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59476. // status code is an error. Response headers are in either
  59477. // *Operation.ServerResponse.Header or (if a response was returned at
  59478. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59479. // to check whether the returned error was because
  59480. // http.StatusNotModified was returned.
  59481. func (c *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59482. gensupport.SetOptions(c.urlParams_, opts...)
  59483. res, err := c.doRequest("json")
  59484. if res != nil && res.StatusCode == http.StatusNotModified {
  59485. if res.Body != nil {
  59486. res.Body.Close()
  59487. }
  59488. return nil, &googleapi.Error{
  59489. Code: res.StatusCode,
  59490. Header: res.Header,
  59491. }
  59492. }
  59493. if err != nil {
  59494. return nil, err
  59495. }
  59496. defer googleapi.CloseBody(res)
  59497. if err := googleapi.CheckResponse(res); err != nil {
  59498. return nil, err
  59499. }
  59500. ret := &Operation{
  59501. ServerResponse: googleapi.ServerResponse{
  59502. Header: res.Header,
  59503. HTTPStatusCode: res.StatusCode,
  59504. },
  59505. }
  59506. target := &ret
  59507. if err := gensupport.DecodeResponse(target, res); err != nil {
  59508. return nil, err
  59509. }
  59510. return ret, nil
  59511. // {
  59512. // "description": "Adds a peering to the specified network.",
  59513. // "httpMethod": "POST",
  59514. // "id": "compute.networks.addPeering",
  59515. // "parameterOrder": [
  59516. // "project",
  59517. // "network"
  59518. // ],
  59519. // "parameters": {
  59520. // "network": {
  59521. // "description": "Name of the network resource to add peering to.",
  59522. // "location": "path",
  59523. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59524. // "required": true,
  59525. // "type": "string"
  59526. // },
  59527. // "project": {
  59528. // "description": "Project ID for this request.",
  59529. // "location": "path",
  59530. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59531. // "required": true,
  59532. // "type": "string"
  59533. // },
  59534. // "requestId": {
  59535. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59536. // "location": "query",
  59537. // "type": "string"
  59538. // }
  59539. // },
  59540. // "path": "{project}/global/networks/{network}/addPeering",
  59541. // "request": {
  59542. // "$ref": "NetworksAddPeeringRequest"
  59543. // },
  59544. // "response": {
  59545. // "$ref": "Operation"
  59546. // },
  59547. // "scopes": [
  59548. // "https://www.googleapis.com/auth/cloud-platform",
  59549. // "https://www.googleapis.com/auth/compute"
  59550. // ]
  59551. // }
  59552. }
  59553. // method id "compute.networks.delete":
  59554. type NetworksDeleteCall struct {
  59555. s *Service
  59556. project string
  59557. network string
  59558. urlParams_ gensupport.URLParams
  59559. ctx_ context.Context
  59560. header_ http.Header
  59561. }
  59562. // Delete: Deletes the specified network.
  59563. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete
  59564. func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall {
  59565. c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59566. c.project = project
  59567. c.network = network
  59568. return c
  59569. }
  59570. // RequestId sets the optional parameter "requestId": An optional
  59571. // request ID to identify requests. Specify a unique request ID so that
  59572. // if you must retry your request, the server will know to ignore the
  59573. // request if it has already been completed.
  59574. //
  59575. // For example, consider a situation where you make an initial request
  59576. // and the request times out. If you make the request again with the
  59577. // same request ID, the server can check if original operation with the
  59578. // same request ID was received, and if so, will ignore the second
  59579. // request. This prevents clients from accidentally creating duplicate
  59580. // commitments.
  59581. //
  59582. // The request ID must be a valid UUID with the exception that zero UUID
  59583. // is not supported (00000000-0000-0000-0000-000000000000).
  59584. func (c *NetworksDeleteCall) RequestId(requestId string) *NetworksDeleteCall {
  59585. c.urlParams_.Set("requestId", requestId)
  59586. return c
  59587. }
  59588. // Fields allows partial responses to be retrieved. See
  59589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59590. // for more information.
  59591. func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall {
  59592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59593. return c
  59594. }
  59595. // Context sets the context to be used in this call's Do method. Any
  59596. // pending HTTP request will be aborted if the provided context is
  59597. // canceled.
  59598. func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall {
  59599. c.ctx_ = ctx
  59600. return c
  59601. }
  59602. // Header returns an http.Header that can be modified by the caller to
  59603. // add HTTP headers to the request.
  59604. func (c *NetworksDeleteCall) Header() http.Header {
  59605. if c.header_ == nil {
  59606. c.header_ = make(http.Header)
  59607. }
  59608. return c.header_
  59609. }
  59610. func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  59611. reqHeaders := make(http.Header)
  59612. for k, v := range c.header_ {
  59613. reqHeaders[k] = v
  59614. }
  59615. reqHeaders.Set("User-Agent", c.s.userAgent())
  59616. var body io.Reader = nil
  59617. c.urlParams_.Set("alt", alt)
  59618. c.urlParams_.Set("prettyPrint", "false")
  59619. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  59620. urls += "?" + c.urlParams_.Encode()
  59621. req, err := http.NewRequest("DELETE", urls, body)
  59622. if err != nil {
  59623. return nil, err
  59624. }
  59625. req.Header = reqHeaders
  59626. googleapi.Expand(req.URL, map[string]string{
  59627. "project": c.project,
  59628. "network": c.network,
  59629. })
  59630. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59631. }
  59632. // Do executes the "compute.networks.delete" call.
  59633. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59634. // status code is an error. Response headers are in either
  59635. // *Operation.ServerResponse.Header or (if a response was returned at
  59636. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59637. // to check whether the returned error was because
  59638. // http.StatusNotModified was returned.
  59639. func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59640. gensupport.SetOptions(c.urlParams_, opts...)
  59641. res, err := c.doRequest("json")
  59642. if res != nil && res.StatusCode == http.StatusNotModified {
  59643. if res.Body != nil {
  59644. res.Body.Close()
  59645. }
  59646. return nil, &googleapi.Error{
  59647. Code: res.StatusCode,
  59648. Header: res.Header,
  59649. }
  59650. }
  59651. if err != nil {
  59652. return nil, err
  59653. }
  59654. defer googleapi.CloseBody(res)
  59655. if err := googleapi.CheckResponse(res); err != nil {
  59656. return nil, err
  59657. }
  59658. ret := &Operation{
  59659. ServerResponse: googleapi.ServerResponse{
  59660. Header: res.Header,
  59661. HTTPStatusCode: res.StatusCode,
  59662. },
  59663. }
  59664. target := &ret
  59665. if err := gensupport.DecodeResponse(target, res); err != nil {
  59666. return nil, err
  59667. }
  59668. return ret, nil
  59669. // {
  59670. // "description": "Deletes the specified network.",
  59671. // "httpMethod": "DELETE",
  59672. // "id": "compute.networks.delete",
  59673. // "parameterOrder": [
  59674. // "project",
  59675. // "network"
  59676. // ],
  59677. // "parameters": {
  59678. // "network": {
  59679. // "description": "Name of the network to delete.",
  59680. // "location": "path",
  59681. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59682. // "required": true,
  59683. // "type": "string"
  59684. // },
  59685. // "project": {
  59686. // "description": "Project ID for this request.",
  59687. // "location": "path",
  59688. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59689. // "required": true,
  59690. // "type": "string"
  59691. // },
  59692. // "requestId": {
  59693. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59694. // "location": "query",
  59695. // "type": "string"
  59696. // }
  59697. // },
  59698. // "path": "{project}/global/networks/{network}",
  59699. // "response": {
  59700. // "$ref": "Operation"
  59701. // },
  59702. // "scopes": [
  59703. // "https://www.googleapis.com/auth/cloud-platform",
  59704. // "https://www.googleapis.com/auth/compute"
  59705. // ]
  59706. // }
  59707. }
  59708. // method id "compute.networks.get":
  59709. type NetworksGetCall struct {
  59710. s *Service
  59711. project string
  59712. network string
  59713. urlParams_ gensupport.URLParams
  59714. ifNoneMatch_ string
  59715. ctx_ context.Context
  59716. header_ http.Header
  59717. }
  59718. // Get: Returns the specified network. Gets a list of available networks
  59719. // by making a list() request.
  59720. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get
  59721. func (r *NetworksService) Get(project string, network string) *NetworksGetCall {
  59722. c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59723. c.project = project
  59724. c.network = network
  59725. return c
  59726. }
  59727. // Fields allows partial responses to be retrieved. See
  59728. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59729. // for more information.
  59730. func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall {
  59731. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59732. return c
  59733. }
  59734. // IfNoneMatch sets the optional parameter which makes the operation
  59735. // fail if the object's ETag matches the given value. This is useful for
  59736. // getting updates only after the object has changed since the last
  59737. // request. Use googleapi.IsNotModified to check whether the response
  59738. // error from Do is the result of In-None-Match.
  59739. func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall {
  59740. c.ifNoneMatch_ = entityTag
  59741. return c
  59742. }
  59743. // Context sets the context to be used in this call's Do method. Any
  59744. // pending HTTP request will be aborted if the provided context is
  59745. // canceled.
  59746. func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall {
  59747. c.ctx_ = ctx
  59748. return c
  59749. }
  59750. // Header returns an http.Header that can be modified by the caller to
  59751. // add HTTP headers to the request.
  59752. func (c *NetworksGetCall) Header() http.Header {
  59753. if c.header_ == nil {
  59754. c.header_ = make(http.Header)
  59755. }
  59756. return c.header_
  59757. }
  59758. func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) {
  59759. reqHeaders := make(http.Header)
  59760. for k, v := range c.header_ {
  59761. reqHeaders[k] = v
  59762. }
  59763. reqHeaders.Set("User-Agent", c.s.userAgent())
  59764. if c.ifNoneMatch_ != "" {
  59765. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59766. }
  59767. var body io.Reader = nil
  59768. c.urlParams_.Set("alt", alt)
  59769. c.urlParams_.Set("prettyPrint", "false")
  59770. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  59771. urls += "?" + c.urlParams_.Encode()
  59772. req, err := http.NewRequest("GET", urls, body)
  59773. if err != nil {
  59774. return nil, err
  59775. }
  59776. req.Header = reqHeaders
  59777. googleapi.Expand(req.URL, map[string]string{
  59778. "project": c.project,
  59779. "network": c.network,
  59780. })
  59781. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59782. }
  59783. // Do executes the "compute.networks.get" call.
  59784. // Exactly one of *Network or error will be non-nil. Any non-2xx status
  59785. // code is an error. Response headers are in either
  59786. // *Network.ServerResponse.Header or (if a response was returned at all)
  59787. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  59788. // check whether the returned error was because http.StatusNotModified
  59789. // was returned.
  59790. func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) {
  59791. gensupport.SetOptions(c.urlParams_, opts...)
  59792. res, err := c.doRequest("json")
  59793. if res != nil && res.StatusCode == http.StatusNotModified {
  59794. if res.Body != nil {
  59795. res.Body.Close()
  59796. }
  59797. return nil, &googleapi.Error{
  59798. Code: res.StatusCode,
  59799. Header: res.Header,
  59800. }
  59801. }
  59802. if err != nil {
  59803. return nil, err
  59804. }
  59805. defer googleapi.CloseBody(res)
  59806. if err := googleapi.CheckResponse(res); err != nil {
  59807. return nil, err
  59808. }
  59809. ret := &Network{
  59810. ServerResponse: googleapi.ServerResponse{
  59811. Header: res.Header,
  59812. HTTPStatusCode: res.StatusCode,
  59813. },
  59814. }
  59815. target := &ret
  59816. if err := gensupport.DecodeResponse(target, res); err != nil {
  59817. return nil, err
  59818. }
  59819. return ret, nil
  59820. // {
  59821. // "description": "Returns the specified network. Gets a list of available networks by making a list() request.",
  59822. // "httpMethod": "GET",
  59823. // "id": "compute.networks.get",
  59824. // "parameterOrder": [
  59825. // "project",
  59826. // "network"
  59827. // ],
  59828. // "parameters": {
  59829. // "network": {
  59830. // "description": "Name of the network to return.",
  59831. // "location": "path",
  59832. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59833. // "required": true,
  59834. // "type": "string"
  59835. // },
  59836. // "project": {
  59837. // "description": "Project ID for this request.",
  59838. // "location": "path",
  59839. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59840. // "required": true,
  59841. // "type": "string"
  59842. // }
  59843. // },
  59844. // "path": "{project}/global/networks/{network}",
  59845. // "response": {
  59846. // "$ref": "Network"
  59847. // },
  59848. // "scopes": [
  59849. // "https://www.googleapis.com/auth/cloud-platform",
  59850. // "https://www.googleapis.com/auth/compute",
  59851. // "https://www.googleapis.com/auth/compute.readonly"
  59852. // ]
  59853. // }
  59854. }
  59855. // method id "compute.networks.insert":
  59856. type NetworksInsertCall struct {
  59857. s *Service
  59858. project string
  59859. network *Network
  59860. urlParams_ gensupport.URLParams
  59861. ctx_ context.Context
  59862. header_ http.Header
  59863. }
  59864. // Insert: Creates a network in the specified project using the data
  59865. // included in the request.
  59866. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert
  59867. func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall {
  59868. c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59869. c.project = project
  59870. c.network = network
  59871. return c
  59872. }
  59873. // RequestId sets the optional parameter "requestId": An optional
  59874. // request ID to identify requests. Specify a unique request ID so that
  59875. // if you must retry your request, the server will know to ignore the
  59876. // request if it has already been completed.
  59877. //
  59878. // For example, consider a situation where you make an initial request
  59879. // and the request times out. If you make the request again with the
  59880. // same request ID, the server can check if original operation with the
  59881. // same request ID was received, and if so, will ignore the second
  59882. // request. This prevents clients from accidentally creating duplicate
  59883. // commitments.
  59884. //
  59885. // The request ID must be a valid UUID with the exception that zero UUID
  59886. // is not supported (00000000-0000-0000-0000-000000000000).
  59887. func (c *NetworksInsertCall) RequestId(requestId string) *NetworksInsertCall {
  59888. c.urlParams_.Set("requestId", requestId)
  59889. return c
  59890. }
  59891. // Fields allows partial responses to be retrieved. See
  59892. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59893. // for more information.
  59894. func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall {
  59895. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59896. return c
  59897. }
  59898. // Context sets the context to be used in this call's Do method. Any
  59899. // pending HTTP request will be aborted if the provided context is
  59900. // canceled.
  59901. func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall {
  59902. c.ctx_ = ctx
  59903. return c
  59904. }
  59905. // Header returns an http.Header that can be modified by the caller to
  59906. // add HTTP headers to the request.
  59907. func (c *NetworksInsertCall) Header() http.Header {
  59908. if c.header_ == nil {
  59909. c.header_ = make(http.Header)
  59910. }
  59911. return c.header_
  59912. }
  59913. func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  59914. reqHeaders := make(http.Header)
  59915. for k, v := range c.header_ {
  59916. reqHeaders[k] = v
  59917. }
  59918. reqHeaders.Set("User-Agent", c.s.userAgent())
  59919. var body io.Reader = nil
  59920. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network)
  59921. if err != nil {
  59922. return nil, err
  59923. }
  59924. reqHeaders.Set("Content-Type", "application/json")
  59925. c.urlParams_.Set("alt", alt)
  59926. c.urlParams_.Set("prettyPrint", "false")
  59927. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  59928. urls += "?" + c.urlParams_.Encode()
  59929. req, err := http.NewRequest("POST", urls, body)
  59930. if err != nil {
  59931. return nil, err
  59932. }
  59933. req.Header = reqHeaders
  59934. googleapi.Expand(req.URL, map[string]string{
  59935. "project": c.project,
  59936. })
  59937. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59938. }
  59939. // Do executes the "compute.networks.insert" call.
  59940. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59941. // status code is an error. Response headers are in either
  59942. // *Operation.ServerResponse.Header or (if a response was returned at
  59943. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59944. // to check whether the returned error was because
  59945. // http.StatusNotModified was returned.
  59946. func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59947. gensupport.SetOptions(c.urlParams_, opts...)
  59948. res, err := c.doRequest("json")
  59949. if res != nil && res.StatusCode == http.StatusNotModified {
  59950. if res.Body != nil {
  59951. res.Body.Close()
  59952. }
  59953. return nil, &googleapi.Error{
  59954. Code: res.StatusCode,
  59955. Header: res.Header,
  59956. }
  59957. }
  59958. if err != nil {
  59959. return nil, err
  59960. }
  59961. defer googleapi.CloseBody(res)
  59962. if err := googleapi.CheckResponse(res); err != nil {
  59963. return nil, err
  59964. }
  59965. ret := &Operation{
  59966. ServerResponse: googleapi.ServerResponse{
  59967. Header: res.Header,
  59968. HTTPStatusCode: res.StatusCode,
  59969. },
  59970. }
  59971. target := &ret
  59972. if err := gensupport.DecodeResponse(target, res); err != nil {
  59973. return nil, err
  59974. }
  59975. return ret, nil
  59976. // {
  59977. // "description": "Creates a network in the specified project using the data included in the request.",
  59978. // "httpMethod": "POST",
  59979. // "id": "compute.networks.insert",
  59980. // "parameterOrder": [
  59981. // "project"
  59982. // ],
  59983. // "parameters": {
  59984. // "project": {
  59985. // "description": "Project ID for this request.",
  59986. // "location": "path",
  59987. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59988. // "required": true,
  59989. // "type": "string"
  59990. // },
  59991. // "requestId": {
  59992. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59993. // "location": "query",
  59994. // "type": "string"
  59995. // }
  59996. // },
  59997. // "path": "{project}/global/networks",
  59998. // "request": {
  59999. // "$ref": "Network"
  60000. // },
  60001. // "response": {
  60002. // "$ref": "Operation"
  60003. // },
  60004. // "scopes": [
  60005. // "https://www.googleapis.com/auth/cloud-platform",
  60006. // "https://www.googleapis.com/auth/compute"
  60007. // ]
  60008. // }
  60009. }
  60010. // method id "compute.networks.list":
  60011. type NetworksListCall struct {
  60012. s *Service
  60013. project string
  60014. urlParams_ gensupport.URLParams
  60015. ifNoneMatch_ string
  60016. ctx_ context.Context
  60017. header_ http.Header
  60018. }
  60019. // List: Retrieves the list of networks available to the specified
  60020. // project.
  60021. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list
  60022. func (r *NetworksService) List(project string) *NetworksListCall {
  60023. c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60024. c.project = project
  60025. return c
  60026. }
  60027. // Filter sets the optional parameter "filter": A filter expression that
  60028. // filters resources listed in the response. The expression must specify
  60029. // the field name, a comparison operator, and the value that you want to
  60030. // use for filtering. The value must be a string, a number, or a
  60031. // boolean. The comparison operator must be either =, !=, >, or <.
  60032. //
  60033. // For example, if you are filtering Compute Engine instances, you can
  60034. // exclude instances named example-instance by specifying name !=
  60035. // example-instance.
  60036. //
  60037. // You can also filter nested fields. For example, you could specify
  60038. // scheduling.automaticRestart = false to include instances only if they
  60039. // are not scheduled for automatic restarts. You can use filtering on
  60040. // nested fields to filter based on resource labels.
  60041. //
  60042. // To filter on multiple expressions, provide each separate expression
  60043. // within parentheses. For example, (scheduling.automaticRestart = true)
  60044. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  60045. // AND expression. However, you can include AND and OR expressions
  60046. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  60047. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  60048. // true).
  60049. func (c *NetworksListCall) Filter(filter string) *NetworksListCall {
  60050. c.urlParams_.Set("filter", filter)
  60051. return c
  60052. }
  60053. // MaxResults sets the optional parameter "maxResults": The maximum
  60054. // number of results per page that should be returned. If the number of
  60055. // available results is larger than maxResults, Compute Engine returns a
  60056. // nextPageToken that can be used to get the next page of results in
  60057. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  60058. // (Default: 500)
  60059. func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall {
  60060. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  60061. return c
  60062. }
  60063. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  60064. // a certain order. By default, results are returned in alphanumerical
  60065. // order based on the resource name.
  60066. //
  60067. // You can also sort results in descending order based on the creation
  60068. // timestamp using orderBy="creationTimestamp desc". This sorts results
  60069. // based on the creationTimestamp field in reverse chronological order
  60070. // (newest result first). Use this to sort resources like operations so
  60071. // that the newest operation is returned first.
  60072. //
  60073. // Currently, only sorting by name or creationTimestamp desc is
  60074. // supported.
  60075. func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall {
  60076. c.urlParams_.Set("orderBy", orderBy)
  60077. return c
  60078. }
  60079. // PageToken sets the optional parameter "pageToken": Specifies a page
  60080. // token to use. Set pageToken to the nextPageToken returned by a
  60081. // previous list request to get the next page of results.
  60082. func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall {
  60083. c.urlParams_.Set("pageToken", pageToken)
  60084. return c
  60085. }
  60086. // Fields allows partial responses to be retrieved. See
  60087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60088. // for more information.
  60089. func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall {
  60090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60091. return c
  60092. }
  60093. // IfNoneMatch sets the optional parameter which makes the operation
  60094. // fail if the object's ETag matches the given value. This is useful for
  60095. // getting updates only after the object has changed since the last
  60096. // request. Use googleapi.IsNotModified to check whether the response
  60097. // error from Do is the result of In-None-Match.
  60098. func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall {
  60099. c.ifNoneMatch_ = entityTag
  60100. return c
  60101. }
  60102. // Context sets the context to be used in this call's Do method. Any
  60103. // pending HTTP request will be aborted if the provided context is
  60104. // canceled.
  60105. func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall {
  60106. c.ctx_ = ctx
  60107. return c
  60108. }
  60109. // Header returns an http.Header that can be modified by the caller to
  60110. // add HTTP headers to the request.
  60111. func (c *NetworksListCall) Header() http.Header {
  60112. if c.header_ == nil {
  60113. c.header_ = make(http.Header)
  60114. }
  60115. return c.header_
  60116. }
  60117. func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) {
  60118. reqHeaders := make(http.Header)
  60119. for k, v := range c.header_ {
  60120. reqHeaders[k] = v
  60121. }
  60122. reqHeaders.Set("User-Agent", c.s.userAgent())
  60123. if c.ifNoneMatch_ != "" {
  60124. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  60125. }
  60126. var body io.Reader = nil
  60127. c.urlParams_.Set("alt", alt)
  60128. c.urlParams_.Set("prettyPrint", "false")
  60129. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  60130. urls += "?" + c.urlParams_.Encode()
  60131. req, err := http.NewRequest("GET", urls, body)
  60132. if err != nil {
  60133. return nil, err
  60134. }
  60135. req.Header = reqHeaders
  60136. googleapi.Expand(req.URL, map[string]string{
  60137. "project": c.project,
  60138. })
  60139. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60140. }
  60141. // Do executes the "compute.networks.list" call.
  60142. // Exactly one of *NetworkList or error will be non-nil. Any non-2xx
  60143. // status code is an error. Response headers are in either
  60144. // *NetworkList.ServerResponse.Header or (if a response was returned at
  60145. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60146. // to check whether the returned error was because
  60147. // http.StatusNotModified was returned.
  60148. func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) {
  60149. gensupport.SetOptions(c.urlParams_, opts...)
  60150. res, err := c.doRequest("json")
  60151. if res != nil && res.StatusCode == http.StatusNotModified {
  60152. if res.Body != nil {
  60153. res.Body.Close()
  60154. }
  60155. return nil, &googleapi.Error{
  60156. Code: res.StatusCode,
  60157. Header: res.Header,
  60158. }
  60159. }
  60160. if err != nil {
  60161. return nil, err
  60162. }
  60163. defer googleapi.CloseBody(res)
  60164. if err := googleapi.CheckResponse(res); err != nil {
  60165. return nil, err
  60166. }
  60167. ret := &NetworkList{
  60168. ServerResponse: googleapi.ServerResponse{
  60169. Header: res.Header,
  60170. HTTPStatusCode: res.StatusCode,
  60171. },
  60172. }
  60173. target := &ret
  60174. if err := gensupport.DecodeResponse(target, res); err != nil {
  60175. return nil, err
  60176. }
  60177. return ret, nil
  60178. // {
  60179. // "description": "Retrieves the list of networks available to the specified project.",
  60180. // "httpMethod": "GET",
  60181. // "id": "compute.networks.list",
  60182. // "parameterOrder": [
  60183. // "project"
  60184. // ],
  60185. // "parameters": {
  60186. // "filter": {
  60187. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  60188. // "location": "query",
  60189. // "type": "string"
  60190. // },
  60191. // "maxResults": {
  60192. // "default": "500",
  60193. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  60194. // "format": "uint32",
  60195. // "location": "query",
  60196. // "minimum": "0",
  60197. // "type": "integer"
  60198. // },
  60199. // "orderBy": {
  60200. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  60201. // "location": "query",
  60202. // "type": "string"
  60203. // },
  60204. // "pageToken": {
  60205. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  60206. // "location": "query",
  60207. // "type": "string"
  60208. // },
  60209. // "project": {
  60210. // "description": "Project ID for this request.",
  60211. // "location": "path",
  60212. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60213. // "required": true,
  60214. // "type": "string"
  60215. // }
  60216. // },
  60217. // "path": "{project}/global/networks",
  60218. // "response": {
  60219. // "$ref": "NetworkList"
  60220. // },
  60221. // "scopes": [
  60222. // "https://www.googleapis.com/auth/cloud-platform",
  60223. // "https://www.googleapis.com/auth/compute",
  60224. // "https://www.googleapis.com/auth/compute.readonly"
  60225. // ]
  60226. // }
  60227. }
  60228. // Pages invokes f for each page of results.
  60229. // A non-nil error returned from f will halt the iteration.
  60230. // The provided context supersedes any context provided to the Context method.
  60231. func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error {
  60232. c.ctx_ = ctx
  60233. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  60234. for {
  60235. x, err := c.Do()
  60236. if err != nil {
  60237. return err
  60238. }
  60239. if err := f(x); err != nil {
  60240. return err
  60241. }
  60242. if x.NextPageToken == "" {
  60243. return nil
  60244. }
  60245. c.PageToken(x.NextPageToken)
  60246. }
  60247. }
  60248. // method id "compute.networks.patch":
  60249. type NetworksPatchCall struct {
  60250. s *Service
  60251. project string
  60252. network string
  60253. network2 *Network
  60254. urlParams_ gensupport.URLParams
  60255. ctx_ context.Context
  60256. header_ http.Header
  60257. }
  60258. // Patch: Patches the specified network with the data included in the
  60259. // request. Only the following fields can be modified:
  60260. // routingConfig.routingMode.
  60261. func (r *NetworksService) Patch(project string, network string, network2 *Network) *NetworksPatchCall {
  60262. c := &NetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60263. c.project = project
  60264. c.network = network
  60265. c.network2 = network2
  60266. return c
  60267. }
  60268. // RequestId sets the optional parameter "requestId": An optional
  60269. // request ID to identify requests. Specify a unique request ID so that
  60270. // if you must retry your request, the server will know to ignore the
  60271. // request if it has already been completed.
  60272. //
  60273. // For example, consider a situation where you make an initial request
  60274. // and the request times out. If you make the request again with the
  60275. // same request ID, the server can check if original operation with the
  60276. // same request ID was received, and if so, will ignore the second
  60277. // request. This prevents clients from accidentally creating duplicate
  60278. // commitments.
  60279. //
  60280. // The request ID must be a valid UUID with the exception that zero UUID
  60281. // is not supported (00000000-0000-0000-0000-000000000000).
  60282. func (c *NetworksPatchCall) RequestId(requestId string) *NetworksPatchCall {
  60283. c.urlParams_.Set("requestId", requestId)
  60284. return c
  60285. }
  60286. // Fields allows partial responses to be retrieved. See
  60287. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60288. // for more information.
  60289. func (c *NetworksPatchCall) Fields(s ...googleapi.Field) *NetworksPatchCall {
  60290. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60291. return c
  60292. }
  60293. // Context sets the context to be used in this call's Do method. Any
  60294. // pending HTTP request will be aborted if the provided context is
  60295. // canceled.
  60296. func (c *NetworksPatchCall) Context(ctx context.Context) *NetworksPatchCall {
  60297. c.ctx_ = ctx
  60298. return c
  60299. }
  60300. // Header returns an http.Header that can be modified by the caller to
  60301. // add HTTP headers to the request.
  60302. func (c *NetworksPatchCall) Header() http.Header {
  60303. if c.header_ == nil {
  60304. c.header_ = make(http.Header)
  60305. }
  60306. return c.header_
  60307. }
  60308. func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  60309. reqHeaders := make(http.Header)
  60310. for k, v := range c.header_ {
  60311. reqHeaders[k] = v
  60312. }
  60313. reqHeaders.Set("User-Agent", c.s.userAgent())
  60314. var body io.Reader = nil
  60315. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2)
  60316. if err != nil {
  60317. return nil, err
  60318. }
  60319. reqHeaders.Set("Content-Type", "application/json")
  60320. c.urlParams_.Set("alt", alt)
  60321. c.urlParams_.Set("prettyPrint", "false")
  60322. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  60323. urls += "?" + c.urlParams_.Encode()
  60324. req, err := http.NewRequest("PATCH", urls, body)
  60325. if err != nil {
  60326. return nil, err
  60327. }
  60328. req.Header = reqHeaders
  60329. googleapi.Expand(req.URL, map[string]string{
  60330. "project": c.project,
  60331. "network": c.network,
  60332. })
  60333. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60334. }
  60335. // Do executes the "compute.networks.patch" call.
  60336. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60337. // status code is an error. Response headers are in either
  60338. // *Operation.ServerResponse.Header or (if a response was returned at
  60339. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60340. // to check whether the returned error was because
  60341. // http.StatusNotModified was returned.
  60342. func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60343. gensupport.SetOptions(c.urlParams_, opts...)
  60344. res, err := c.doRequest("json")
  60345. if res != nil && res.StatusCode == http.StatusNotModified {
  60346. if res.Body != nil {
  60347. res.Body.Close()
  60348. }
  60349. return nil, &googleapi.Error{
  60350. Code: res.StatusCode,
  60351. Header: res.Header,
  60352. }
  60353. }
  60354. if err != nil {
  60355. return nil, err
  60356. }
  60357. defer googleapi.CloseBody(res)
  60358. if err := googleapi.CheckResponse(res); err != nil {
  60359. return nil, err
  60360. }
  60361. ret := &Operation{
  60362. ServerResponse: googleapi.ServerResponse{
  60363. Header: res.Header,
  60364. HTTPStatusCode: res.StatusCode,
  60365. },
  60366. }
  60367. target := &ret
  60368. if err := gensupport.DecodeResponse(target, res); err != nil {
  60369. return nil, err
  60370. }
  60371. return ret, nil
  60372. // {
  60373. // "description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.",
  60374. // "httpMethod": "PATCH",
  60375. // "id": "compute.networks.patch",
  60376. // "parameterOrder": [
  60377. // "project",
  60378. // "network"
  60379. // ],
  60380. // "parameters": {
  60381. // "network": {
  60382. // "description": "Name of the network to update.",
  60383. // "location": "path",
  60384. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60385. // "required": true,
  60386. // "type": "string"
  60387. // },
  60388. // "project": {
  60389. // "description": "Project ID for this request.",
  60390. // "location": "path",
  60391. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60392. // "required": true,
  60393. // "type": "string"
  60394. // },
  60395. // "requestId": {
  60396. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60397. // "location": "query",
  60398. // "type": "string"
  60399. // }
  60400. // },
  60401. // "path": "{project}/global/networks/{network}",
  60402. // "request": {
  60403. // "$ref": "Network"
  60404. // },
  60405. // "response": {
  60406. // "$ref": "Operation"
  60407. // },
  60408. // "scopes": [
  60409. // "https://www.googleapis.com/auth/cloud-platform",
  60410. // "https://www.googleapis.com/auth/compute"
  60411. // ]
  60412. // }
  60413. }
  60414. // method id "compute.networks.removePeering":
  60415. type NetworksRemovePeeringCall struct {
  60416. s *Service
  60417. project string
  60418. network string
  60419. networksremovepeeringrequest *NetworksRemovePeeringRequest
  60420. urlParams_ gensupport.URLParams
  60421. ctx_ context.Context
  60422. header_ http.Header
  60423. }
  60424. // RemovePeering: Removes a peering from the specified network.
  60425. func (r *NetworksService) RemovePeering(project string, network string, networksremovepeeringrequest *NetworksRemovePeeringRequest) *NetworksRemovePeeringCall {
  60426. c := &NetworksRemovePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60427. c.project = project
  60428. c.network = network
  60429. c.networksremovepeeringrequest = networksremovepeeringrequest
  60430. return c
  60431. }
  60432. // RequestId sets the optional parameter "requestId": An optional
  60433. // request ID to identify requests. Specify a unique request ID so that
  60434. // if you must retry your request, the server will know to ignore the
  60435. // request if it has already been completed.
  60436. //
  60437. // For example, consider a situation where you make an initial request
  60438. // and the request times out. If you make the request again with the
  60439. // same request ID, the server can check if original operation with the
  60440. // same request ID was received, and if so, will ignore the second
  60441. // request. This prevents clients from accidentally creating duplicate
  60442. // commitments.
  60443. //
  60444. // The request ID must be a valid UUID with the exception that zero UUID
  60445. // is not supported (00000000-0000-0000-0000-000000000000).
  60446. func (c *NetworksRemovePeeringCall) RequestId(requestId string) *NetworksRemovePeeringCall {
  60447. c.urlParams_.Set("requestId", requestId)
  60448. return c
  60449. }
  60450. // Fields allows partial responses to be retrieved. See
  60451. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60452. // for more information.
  60453. func (c *NetworksRemovePeeringCall) Fields(s ...googleapi.Field) *NetworksRemovePeeringCall {
  60454. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60455. return c
  60456. }
  60457. // Context sets the context to be used in this call's Do method. Any
  60458. // pending HTTP request will be aborted if the provided context is
  60459. // canceled.
  60460. func (c *NetworksRemovePeeringCall) Context(ctx context.Context) *NetworksRemovePeeringCall {
  60461. c.ctx_ = ctx
  60462. return c
  60463. }
  60464. // Header returns an http.Header that can be modified by the caller to
  60465. // add HTTP headers to the request.
  60466. func (c *NetworksRemovePeeringCall) Header() http.Header {
  60467. if c.header_ == nil {
  60468. c.header_ = make(http.Header)
  60469. }
  60470. return c.header_
  60471. }
  60472. func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) {
  60473. reqHeaders := make(http.Header)
  60474. for k, v := range c.header_ {
  60475. reqHeaders[k] = v
  60476. }
  60477. reqHeaders.Set("User-Agent", c.s.userAgent())
  60478. var body io.Reader = nil
  60479. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest)
  60480. if err != nil {
  60481. return nil, err
  60482. }
  60483. reqHeaders.Set("Content-Type", "application/json")
  60484. c.urlParams_.Set("alt", alt)
  60485. c.urlParams_.Set("prettyPrint", "false")
  60486. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/removePeering")
  60487. urls += "?" + c.urlParams_.Encode()
  60488. req, err := http.NewRequest("POST", urls, body)
  60489. if err != nil {
  60490. return nil, err
  60491. }
  60492. req.Header = reqHeaders
  60493. googleapi.Expand(req.URL, map[string]string{
  60494. "project": c.project,
  60495. "network": c.network,
  60496. })
  60497. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60498. }
  60499. // Do executes the "compute.networks.removePeering" call.
  60500. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60501. // status code is an error. Response headers are in either
  60502. // *Operation.ServerResponse.Header or (if a response was returned at
  60503. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60504. // to check whether the returned error was because
  60505. // http.StatusNotModified was returned.
  60506. func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60507. gensupport.SetOptions(c.urlParams_, opts...)
  60508. res, err := c.doRequest("json")
  60509. if res != nil && res.StatusCode == http.StatusNotModified {
  60510. if res.Body != nil {
  60511. res.Body.Close()
  60512. }
  60513. return nil, &googleapi.Error{
  60514. Code: res.StatusCode,
  60515. Header: res.Header,
  60516. }
  60517. }
  60518. if err != nil {
  60519. return nil, err
  60520. }
  60521. defer googleapi.CloseBody(res)
  60522. if err := googleapi.CheckResponse(res); err != nil {
  60523. return nil, err
  60524. }
  60525. ret := &Operation{
  60526. ServerResponse: googleapi.ServerResponse{
  60527. Header: res.Header,
  60528. HTTPStatusCode: res.StatusCode,
  60529. },
  60530. }
  60531. target := &ret
  60532. if err := gensupport.DecodeResponse(target, res); err != nil {
  60533. return nil, err
  60534. }
  60535. return ret, nil
  60536. // {
  60537. // "description": "Removes a peering from the specified network.",
  60538. // "httpMethod": "POST",
  60539. // "id": "compute.networks.removePeering",
  60540. // "parameterOrder": [
  60541. // "project",
  60542. // "network"
  60543. // ],
  60544. // "parameters": {
  60545. // "network": {
  60546. // "description": "Name of the network resource to remove peering from.",
  60547. // "location": "path",
  60548. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60549. // "required": true,
  60550. // "type": "string"
  60551. // },
  60552. // "project": {
  60553. // "description": "Project ID for this request.",
  60554. // "location": "path",
  60555. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60556. // "required": true,
  60557. // "type": "string"
  60558. // },
  60559. // "requestId": {
  60560. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60561. // "location": "query",
  60562. // "type": "string"
  60563. // }
  60564. // },
  60565. // "path": "{project}/global/networks/{network}/removePeering",
  60566. // "request": {
  60567. // "$ref": "NetworksRemovePeeringRequest"
  60568. // },
  60569. // "response": {
  60570. // "$ref": "Operation"
  60571. // },
  60572. // "scopes": [
  60573. // "https://www.googleapis.com/auth/cloud-platform",
  60574. // "https://www.googleapis.com/auth/compute"
  60575. // ]
  60576. // }
  60577. }
  60578. // method id "compute.networks.switchToCustomMode":
  60579. type NetworksSwitchToCustomModeCall struct {
  60580. s *Service
  60581. project string
  60582. network string
  60583. urlParams_ gensupport.URLParams
  60584. ctx_ context.Context
  60585. header_ http.Header
  60586. }
  60587. // SwitchToCustomMode: Switches the network mode from auto subnet mode
  60588. // to custom subnet mode.
  60589. func (r *NetworksService) SwitchToCustomMode(project string, network string) *NetworksSwitchToCustomModeCall {
  60590. c := &NetworksSwitchToCustomModeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60591. c.project = project
  60592. c.network = network
  60593. return c
  60594. }
  60595. // RequestId sets the optional parameter "requestId": An optional
  60596. // request ID to identify requests. Specify a unique request ID so that
  60597. // if you must retry your request, the server will know to ignore the
  60598. // request if it has already been completed.
  60599. //
  60600. // For example, consider a situation where you make an initial request
  60601. // and the request times out. If you make the request again with the
  60602. // same request ID, the server can check if original operation with the
  60603. // same request ID was received, and if so, will ignore the second
  60604. // request. This prevents clients from accidentally creating duplicate
  60605. // commitments.
  60606. //
  60607. // The request ID must be a valid UUID with the exception that zero UUID
  60608. // is not supported (00000000-0000-0000-0000-000000000000).
  60609. func (c *NetworksSwitchToCustomModeCall) RequestId(requestId string) *NetworksSwitchToCustomModeCall {
  60610. c.urlParams_.Set("requestId", requestId)
  60611. return c
  60612. }
  60613. // Fields allows partial responses to be retrieved. See
  60614. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60615. // for more information.
  60616. func (c *NetworksSwitchToCustomModeCall) Fields(s ...googleapi.Field) *NetworksSwitchToCustomModeCall {
  60617. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60618. return c
  60619. }
  60620. // Context sets the context to be used in this call's Do method. Any
  60621. // pending HTTP request will be aborted if the provided context is
  60622. // canceled.
  60623. func (c *NetworksSwitchToCustomModeCall) Context(ctx context.Context) *NetworksSwitchToCustomModeCall {
  60624. c.ctx_ = ctx
  60625. return c
  60626. }
  60627. // Header returns an http.Header that can be modified by the caller to
  60628. // add HTTP headers to the request.
  60629. func (c *NetworksSwitchToCustomModeCall) Header() http.Header {
  60630. if c.header_ == nil {
  60631. c.header_ = make(http.Header)
  60632. }
  60633. return c.header_
  60634. }
  60635. func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) {
  60636. reqHeaders := make(http.Header)
  60637. for k, v := range c.header_ {
  60638. reqHeaders[k] = v
  60639. }
  60640. reqHeaders.Set("User-Agent", c.s.userAgent())
  60641. var body io.Reader = nil
  60642. c.urlParams_.Set("alt", alt)
  60643. c.urlParams_.Set("prettyPrint", "false")
  60644. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/switchToCustomMode")
  60645. urls += "?" + c.urlParams_.Encode()
  60646. req, err := http.NewRequest("POST", urls, body)
  60647. if err != nil {
  60648. return nil, err
  60649. }
  60650. req.Header = reqHeaders
  60651. googleapi.Expand(req.URL, map[string]string{
  60652. "project": c.project,
  60653. "network": c.network,
  60654. })
  60655. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60656. }
  60657. // Do executes the "compute.networks.switchToCustomMode" call.
  60658. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60659. // status code is an error. Response headers are in either
  60660. // *Operation.ServerResponse.Header or (if a response was returned at
  60661. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60662. // to check whether the returned error was because
  60663. // http.StatusNotModified was returned.
  60664. func (c *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60665. gensupport.SetOptions(c.urlParams_, opts...)
  60666. res, err := c.doRequest("json")
  60667. if res != nil && res.StatusCode == http.StatusNotModified {
  60668. if res.Body != nil {
  60669. res.Body.Close()
  60670. }
  60671. return nil, &googleapi.Error{
  60672. Code: res.StatusCode,
  60673. Header: res.Header,
  60674. }
  60675. }
  60676. if err != nil {
  60677. return nil, err
  60678. }
  60679. defer googleapi.CloseBody(res)
  60680. if err := googleapi.CheckResponse(res); err != nil {
  60681. return nil, err
  60682. }
  60683. ret := &Operation{
  60684. ServerResponse: googleapi.ServerResponse{
  60685. Header: res.Header,
  60686. HTTPStatusCode: res.StatusCode,
  60687. },
  60688. }
  60689. target := &ret
  60690. if err := gensupport.DecodeResponse(target, res); err != nil {
  60691. return nil, err
  60692. }
  60693. return ret, nil
  60694. // {
  60695. // "description": "Switches the network mode from auto subnet mode to custom subnet mode.",
  60696. // "httpMethod": "POST",
  60697. // "id": "compute.networks.switchToCustomMode",
  60698. // "parameterOrder": [
  60699. // "project",
  60700. // "network"
  60701. // ],
  60702. // "parameters": {
  60703. // "network": {
  60704. // "description": "Name of the network to be updated.",
  60705. // "location": "path",
  60706. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60707. // "required": true,
  60708. // "type": "string"
  60709. // },
  60710. // "project": {
  60711. // "description": "Project ID for this request.",
  60712. // "location": "path",
  60713. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60714. // "required": true,
  60715. // "type": "string"
  60716. // },
  60717. // "requestId": {
  60718. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60719. // "location": "query",
  60720. // "type": "string"
  60721. // }
  60722. // },
  60723. // "path": "{project}/global/networks/{network}/switchToCustomMode",
  60724. // "response": {
  60725. // "$ref": "Operation"
  60726. // },
  60727. // "scopes": [
  60728. // "https://www.googleapis.com/auth/cloud-platform",
  60729. // "https://www.googleapis.com/auth/compute"
  60730. // ]
  60731. // }
  60732. }
  60733. // method id "compute.nodeGroups.addNodes":
  60734. type NodeGroupsAddNodesCall struct {
  60735. s *Service
  60736. project string
  60737. zone string
  60738. nodeGroup string
  60739. nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest
  60740. urlParams_ gensupport.URLParams
  60741. ctx_ context.Context
  60742. header_ http.Header
  60743. }
  60744. // AddNodes: Adds specified number of nodes to the node group.
  60745. func (r *NodeGroupsService) AddNodes(project string, zone string, nodeGroup string, nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest) *NodeGroupsAddNodesCall {
  60746. c := &NodeGroupsAddNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60747. c.project = project
  60748. c.zone = zone
  60749. c.nodeGroup = nodeGroup
  60750. c.nodegroupsaddnodesrequest = nodegroupsaddnodesrequest
  60751. return c
  60752. }
  60753. // RequestId sets the optional parameter "requestId": An optional
  60754. // request ID to identify requests. Specify a unique request ID so that
  60755. // if you must retry your request, the server will know to ignore the
  60756. // request if it has already been completed.
  60757. //
  60758. // For example, consider a situation where you make an initial request
  60759. // and the request times out. If you make the request again with the
  60760. // same request ID, the server can check if original operation with the
  60761. // same request ID was received, and if so, will ignore the second
  60762. // request. This prevents clients from accidentally creating duplicate
  60763. // commitments.
  60764. //
  60765. // The request ID must be a valid UUID with the exception that zero UUID
  60766. // is not supported (00000000-0000-0000-0000-000000000000).
  60767. func (c *NodeGroupsAddNodesCall) RequestId(requestId string) *NodeGroupsAddNodesCall {
  60768. c.urlParams_.Set("requestId", requestId)
  60769. return c
  60770. }
  60771. // Fields allows partial responses to be retrieved. See
  60772. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60773. // for more information.
  60774. func (c *NodeGroupsAddNodesCall) Fields(s ...googleapi.Field) *NodeGroupsAddNodesCall {
  60775. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60776. return c
  60777. }
  60778. // Context sets the context to be used in this call's Do method. Any
  60779. // pending HTTP request will be aborted if the provided context is
  60780. // canceled.
  60781. func (c *NodeGroupsAddNodesCall) Context(ctx context.Context) *NodeGroupsAddNodesCall {
  60782. c.ctx_ = ctx
  60783. return c
  60784. }
  60785. // Header returns an http.Header that can be modified by the caller to
  60786. // add HTTP headers to the request.
  60787. func (c *NodeGroupsAddNodesCall) Header() http.Header {
  60788. if c.header_ == nil {
  60789. c.header_ = make(http.Header)
  60790. }
  60791. return c.header_
  60792. }
  60793. func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) {
  60794. reqHeaders := make(http.Header)
  60795. for k, v := range c.header_ {
  60796. reqHeaders[k] = v
  60797. }
  60798. reqHeaders.Set("User-Agent", c.s.userAgent())
  60799. var body io.Reader = nil
  60800. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest)
  60801. if err != nil {
  60802. return nil, err
  60803. }
  60804. reqHeaders.Set("Content-Type", "application/json")
  60805. c.urlParams_.Set("alt", alt)
  60806. c.urlParams_.Set("prettyPrint", "false")
  60807. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes")
  60808. urls += "?" + c.urlParams_.Encode()
  60809. req, err := http.NewRequest("POST", urls, body)
  60810. if err != nil {
  60811. return nil, err
  60812. }
  60813. req.Header = reqHeaders
  60814. googleapi.Expand(req.URL, map[string]string{
  60815. "project": c.project,
  60816. "zone": c.zone,
  60817. "nodeGroup": c.nodeGroup,
  60818. })
  60819. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60820. }
  60821. // Do executes the "compute.nodeGroups.addNodes" call.
  60822. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60823. // status code is an error. Response headers are in either
  60824. // *Operation.ServerResponse.Header or (if a response was returned at
  60825. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60826. // to check whether the returned error was because
  60827. // http.StatusNotModified was returned.
  60828. func (c *NodeGroupsAddNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60829. gensupport.SetOptions(c.urlParams_, opts...)
  60830. res, err := c.doRequest("json")
  60831. if res != nil && res.StatusCode == http.StatusNotModified {
  60832. if res.Body != nil {
  60833. res.Body.Close()
  60834. }
  60835. return nil, &googleapi.Error{
  60836. Code: res.StatusCode,
  60837. Header: res.Header,
  60838. }
  60839. }
  60840. if err != nil {
  60841. return nil, err
  60842. }
  60843. defer googleapi.CloseBody(res)
  60844. if err := googleapi.CheckResponse(res); err != nil {
  60845. return nil, err
  60846. }
  60847. ret := &Operation{
  60848. ServerResponse: googleapi.ServerResponse{
  60849. Header: res.Header,
  60850. HTTPStatusCode: res.StatusCode,
  60851. },
  60852. }
  60853. target := &ret
  60854. if err := gensupport.DecodeResponse(target, res); err != nil {
  60855. return nil, err
  60856. }
  60857. return ret, nil
  60858. // {
  60859. // "description": "Adds specified number of nodes to the node group.",
  60860. // "httpMethod": "POST",
  60861. // "id": "compute.nodeGroups.addNodes",
  60862. // "parameterOrder": [
  60863. // "project",
  60864. // "zone",
  60865. // "nodeGroup"
  60866. // ],
  60867. // "parameters": {
  60868. // "nodeGroup": {
  60869. // "description": "Name of the NodeGroup resource.",
  60870. // "location": "path",
  60871. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60872. // "required": true,
  60873. // "type": "string"
  60874. // },
  60875. // "project": {
  60876. // "description": "Project ID for this request.",
  60877. // "location": "path",
  60878. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60879. // "required": true,
  60880. // "type": "string"
  60881. // },
  60882. // "requestId": {
  60883. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60884. // "location": "query",
  60885. // "type": "string"
  60886. // },
  60887. // "zone": {
  60888. // "description": "The name of the zone for this request.",
  60889. // "location": "path",
  60890. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60891. // "required": true,
  60892. // "type": "string"
  60893. // }
  60894. // },
  60895. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes",
  60896. // "request": {
  60897. // "$ref": "NodeGroupsAddNodesRequest"
  60898. // },
  60899. // "response": {
  60900. // "$ref": "Operation"
  60901. // },
  60902. // "scopes": [
  60903. // "https://www.googleapis.com/auth/cloud-platform",
  60904. // "https://www.googleapis.com/auth/compute"
  60905. // ]
  60906. // }
  60907. }
  60908. // method id "compute.nodeGroups.aggregatedList":
  60909. type NodeGroupsAggregatedListCall struct {
  60910. s *Service
  60911. project string
  60912. urlParams_ gensupport.URLParams
  60913. ifNoneMatch_ string
  60914. ctx_ context.Context
  60915. header_ http.Header
  60916. }
  60917. // AggregatedList: Retrieves an aggregated list of node groups. Note:
  60918. // use nodeGroups.listNodes for more details about each group.
  60919. func (r *NodeGroupsService) AggregatedList(project string) *NodeGroupsAggregatedListCall {
  60920. c := &NodeGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60921. c.project = project
  60922. return c
  60923. }
  60924. // Filter sets the optional parameter "filter": A filter expression that
  60925. // filters resources listed in the response. The expression must specify
  60926. // the field name, a comparison operator, and the value that you want to
  60927. // use for filtering. The value must be a string, a number, or a
  60928. // boolean. The comparison operator must be either =, !=, >, or <.
  60929. //
  60930. // For example, if you are filtering Compute Engine instances, you can
  60931. // exclude instances named example-instance by specifying name !=
  60932. // example-instance.
  60933. //
  60934. // You can also filter nested fields. For example, you could specify
  60935. // scheduling.automaticRestart = false to include instances only if they
  60936. // are not scheduled for automatic restarts. You can use filtering on
  60937. // nested fields to filter based on resource labels.
  60938. //
  60939. // To filter on multiple expressions, provide each separate expression
  60940. // within parentheses. For example, (scheduling.automaticRestart = true)
  60941. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  60942. // AND expression. However, you can include AND and OR expressions
  60943. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  60944. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  60945. // true).
  60946. func (c *NodeGroupsAggregatedListCall) Filter(filter string) *NodeGroupsAggregatedListCall {
  60947. c.urlParams_.Set("filter", filter)
  60948. return c
  60949. }
  60950. // MaxResults sets the optional parameter "maxResults": The maximum
  60951. // number of results per page that should be returned. If the number of
  60952. // available results is larger than maxResults, Compute Engine returns a
  60953. // nextPageToken that can be used to get the next page of results in
  60954. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  60955. // (Default: 500)
  60956. func (c *NodeGroupsAggregatedListCall) MaxResults(maxResults int64) *NodeGroupsAggregatedListCall {
  60957. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  60958. return c
  60959. }
  60960. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  60961. // a certain order. By default, results are returned in alphanumerical
  60962. // order based on the resource name.
  60963. //
  60964. // You can also sort results in descending order based on the creation
  60965. // timestamp using orderBy="creationTimestamp desc". This sorts results
  60966. // based on the creationTimestamp field in reverse chronological order
  60967. // (newest result first). Use this to sort resources like operations so
  60968. // that the newest operation is returned first.
  60969. //
  60970. // Currently, only sorting by name or creationTimestamp desc is
  60971. // supported.
  60972. func (c *NodeGroupsAggregatedListCall) OrderBy(orderBy string) *NodeGroupsAggregatedListCall {
  60973. c.urlParams_.Set("orderBy", orderBy)
  60974. return c
  60975. }
  60976. // PageToken sets the optional parameter "pageToken": Specifies a page
  60977. // token to use. Set pageToken to the nextPageToken returned by a
  60978. // previous list request to get the next page of results.
  60979. func (c *NodeGroupsAggregatedListCall) PageToken(pageToken string) *NodeGroupsAggregatedListCall {
  60980. c.urlParams_.Set("pageToken", pageToken)
  60981. return c
  60982. }
  60983. // Fields allows partial responses to be retrieved. See
  60984. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60985. // for more information.
  60986. func (c *NodeGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NodeGroupsAggregatedListCall {
  60987. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60988. return c
  60989. }
  60990. // IfNoneMatch sets the optional parameter which makes the operation
  60991. // fail if the object's ETag matches the given value. This is useful for
  60992. // getting updates only after the object has changed since the last
  60993. // request. Use googleapi.IsNotModified to check whether the response
  60994. // error from Do is the result of In-None-Match.
  60995. func (c *NodeGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NodeGroupsAggregatedListCall {
  60996. c.ifNoneMatch_ = entityTag
  60997. return c
  60998. }
  60999. // Context sets the context to be used in this call's Do method. Any
  61000. // pending HTTP request will be aborted if the provided context is
  61001. // canceled.
  61002. func (c *NodeGroupsAggregatedListCall) Context(ctx context.Context) *NodeGroupsAggregatedListCall {
  61003. c.ctx_ = ctx
  61004. return c
  61005. }
  61006. // Header returns an http.Header that can be modified by the caller to
  61007. // add HTTP headers to the request.
  61008. func (c *NodeGroupsAggregatedListCall) Header() http.Header {
  61009. if c.header_ == nil {
  61010. c.header_ = make(http.Header)
  61011. }
  61012. return c.header_
  61013. }
  61014. func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  61015. reqHeaders := make(http.Header)
  61016. for k, v := range c.header_ {
  61017. reqHeaders[k] = v
  61018. }
  61019. reqHeaders.Set("User-Agent", c.s.userAgent())
  61020. if c.ifNoneMatch_ != "" {
  61021. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61022. }
  61023. var body io.Reader = nil
  61024. c.urlParams_.Set("alt", alt)
  61025. c.urlParams_.Set("prettyPrint", "false")
  61026. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeGroups")
  61027. urls += "?" + c.urlParams_.Encode()
  61028. req, err := http.NewRequest("GET", urls, body)
  61029. if err != nil {
  61030. return nil, err
  61031. }
  61032. req.Header = reqHeaders
  61033. googleapi.Expand(req.URL, map[string]string{
  61034. "project": c.project,
  61035. })
  61036. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61037. }
  61038. // Do executes the "compute.nodeGroups.aggregatedList" call.
  61039. // Exactly one of *NodeGroupAggregatedList or error will be non-nil. Any
  61040. // non-2xx status code is an error. Response headers are in either
  61041. // *NodeGroupAggregatedList.ServerResponse.Header or (if a response was
  61042. // returned at all) in error.(*googleapi.Error).Header. Use
  61043. // googleapi.IsNotModified to check whether the returned error was
  61044. // because http.StatusNotModified was returned.
  61045. func (c *NodeGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeGroupAggregatedList, error) {
  61046. gensupport.SetOptions(c.urlParams_, opts...)
  61047. res, err := c.doRequest("json")
  61048. if res != nil && res.StatusCode == http.StatusNotModified {
  61049. if res.Body != nil {
  61050. res.Body.Close()
  61051. }
  61052. return nil, &googleapi.Error{
  61053. Code: res.StatusCode,
  61054. Header: res.Header,
  61055. }
  61056. }
  61057. if err != nil {
  61058. return nil, err
  61059. }
  61060. defer googleapi.CloseBody(res)
  61061. if err := googleapi.CheckResponse(res); err != nil {
  61062. return nil, err
  61063. }
  61064. ret := &NodeGroupAggregatedList{
  61065. ServerResponse: googleapi.ServerResponse{
  61066. Header: res.Header,
  61067. HTTPStatusCode: res.StatusCode,
  61068. },
  61069. }
  61070. target := &ret
  61071. if err := gensupport.DecodeResponse(target, res); err != nil {
  61072. return nil, err
  61073. }
  61074. return ret, nil
  61075. // {
  61076. // "description": "Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group.",
  61077. // "httpMethod": "GET",
  61078. // "id": "compute.nodeGroups.aggregatedList",
  61079. // "parameterOrder": [
  61080. // "project"
  61081. // ],
  61082. // "parameters": {
  61083. // "filter": {
  61084. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  61085. // "location": "query",
  61086. // "type": "string"
  61087. // },
  61088. // "maxResults": {
  61089. // "default": "500",
  61090. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  61091. // "format": "uint32",
  61092. // "location": "query",
  61093. // "minimum": "0",
  61094. // "type": "integer"
  61095. // },
  61096. // "orderBy": {
  61097. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  61098. // "location": "query",
  61099. // "type": "string"
  61100. // },
  61101. // "pageToken": {
  61102. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  61103. // "location": "query",
  61104. // "type": "string"
  61105. // },
  61106. // "project": {
  61107. // "description": "Project ID for this request.",
  61108. // "location": "path",
  61109. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61110. // "required": true,
  61111. // "type": "string"
  61112. // }
  61113. // },
  61114. // "path": "{project}/aggregated/nodeGroups",
  61115. // "response": {
  61116. // "$ref": "NodeGroupAggregatedList"
  61117. // },
  61118. // "scopes": [
  61119. // "https://www.googleapis.com/auth/cloud-platform",
  61120. // "https://www.googleapis.com/auth/compute",
  61121. // "https://www.googleapis.com/auth/compute.readonly"
  61122. // ]
  61123. // }
  61124. }
  61125. // Pages invokes f for each page of results.
  61126. // A non-nil error returned from f will halt the iteration.
  61127. // The provided context supersedes any context provided to the Context method.
  61128. func (c *NodeGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NodeGroupAggregatedList) error) error {
  61129. c.ctx_ = ctx
  61130. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  61131. for {
  61132. x, err := c.Do()
  61133. if err != nil {
  61134. return err
  61135. }
  61136. if err := f(x); err != nil {
  61137. return err
  61138. }
  61139. if x.NextPageToken == "" {
  61140. return nil
  61141. }
  61142. c.PageToken(x.NextPageToken)
  61143. }
  61144. }
  61145. // method id "compute.nodeGroups.delete":
  61146. type NodeGroupsDeleteCall struct {
  61147. s *Service
  61148. project string
  61149. zone string
  61150. nodeGroup string
  61151. urlParams_ gensupport.URLParams
  61152. ctx_ context.Context
  61153. header_ http.Header
  61154. }
  61155. // Delete: Deletes the specified NodeGroup resource.
  61156. func (r *NodeGroupsService) Delete(project string, zone string, nodeGroup string) *NodeGroupsDeleteCall {
  61157. c := &NodeGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61158. c.project = project
  61159. c.zone = zone
  61160. c.nodeGroup = nodeGroup
  61161. return c
  61162. }
  61163. // RequestId sets the optional parameter "requestId": An optional
  61164. // request ID to identify requests. Specify a unique request ID so that
  61165. // if you must retry your request, the server will know to ignore the
  61166. // request if it has already been completed.
  61167. //
  61168. // For example, consider a situation where you make an initial request
  61169. // and the request times out. If you make the request again with the
  61170. // same request ID, the server can check if original operation with the
  61171. // same request ID was received, and if so, will ignore the second
  61172. // request. This prevents clients from accidentally creating duplicate
  61173. // commitments.
  61174. //
  61175. // The request ID must be a valid UUID with the exception that zero UUID
  61176. // is not supported (00000000-0000-0000-0000-000000000000).
  61177. func (c *NodeGroupsDeleteCall) RequestId(requestId string) *NodeGroupsDeleteCall {
  61178. c.urlParams_.Set("requestId", requestId)
  61179. return c
  61180. }
  61181. // Fields allows partial responses to be retrieved. See
  61182. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61183. // for more information.
  61184. func (c *NodeGroupsDeleteCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteCall {
  61185. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61186. return c
  61187. }
  61188. // Context sets the context to be used in this call's Do method. Any
  61189. // pending HTTP request will be aborted if the provided context is
  61190. // canceled.
  61191. func (c *NodeGroupsDeleteCall) Context(ctx context.Context) *NodeGroupsDeleteCall {
  61192. c.ctx_ = ctx
  61193. return c
  61194. }
  61195. // Header returns an http.Header that can be modified by the caller to
  61196. // add HTTP headers to the request.
  61197. func (c *NodeGroupsDeleteCall) Header() http.Header {
  61198. if c.header_ == nil {
  61199. c.header_ = make(http.Header)
  61200. }
  61201. return c.header_
  61202. }
  61203. func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  61204. reqHeaders := make(http.Header)
  61205. for k, v := range c.header_ {
  61206. reqHeaders[k] = v
  61207. }
  61208. reqHeaders.Set("User-Agent", c.s.userAgent())
  61209. var body io.Reader = nil
  61210. c.urlParams_.Set("alt", alt)
  61211. c.urlParams_.Set("prettyPrint", "false")
  61212. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  61213. urls += "?" + c.urlParams_.Encode()
  61214. req, err := http.NewRequest("DELETE", urls, body)
  61215. if err != nil {
  61216. return nil, err
  61217. }
  61218. req.Header = reqHeaders
  61219. googleapi.Expand(req.URL, map[string]string{
  61220. "project": c.project,
  61221. "zone": c.zone,
  61222. "nodeGroup": c.nodeGroup,
  61223. })
  61224. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61225. }
  61226. // Do executes the "compute.nodeGroups.delete" call.
  61227. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61228. // status code is an error. Response headers are in either
  61229. // *Operation.ServerResponse.Header or (if a response was returned at
  61230. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61231. // to check whether the returned error was because
  61232. // http.StatusNotModified was returned.
  61233. func (c *NodeGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61234. gensupport.SetOptions(c.urlParams_, opts...)
  61235. res, err := c.doRequest("json")
  61236. if res != nil && res.StatusCode == http.StatusNotModified {
  61237. if res.Body != nil {
  61238. res.Body.Close()
  61239. }
  61240. return nil, &googleapi.Error{
  61241. Code: res.StatusCode,
  61242. Header: res.Header,
  61243. }
  61244. }
  61245. if err != nil {
  61246. return nil, err
  61247. }
  61248. defer googleapi.CloseBody(res)
  61249. if err := googleapi.CheckResponse(res); err != nil {
  61250. return nil, err
  61251. }
  61252. ret := &Operation{
  61253. ServerResponse: googleapi.ServerResponse{
  61254. Header: res.Header,
  61255. HTTPStatusCode: res.StatusCode,
  61256. },
  61257. }
  61258. target := &ret
  61259. if err := gensupport.DecodeResponse(target, res); err != nil {
  61260. return nil, err
  61261. }
  61262. return ret, nil
  61263. // {
  61264. // "description": "Deletes the specified NodeGroup resource.",
  61265. // "httpMethod": "DELETE",
  61266. // "id": "compute.nodeGroups.delete",
  61267. // "parameterOrder": [
  61268. // "project",
  61269. // "zone",
  61270. // "nodeGroup"
  61271. // ],
  61272. // "parameters": {
  61273. // "nodeGroup": {
  61274. // "description": "Name of the NodeGroup resource to delete.",
  61275. // "location": "path",
  61276. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61277. // "required": true,
  61278. // "type": "string"
  61279. // },
  61280. // "project": {
  61281. // "description": "Project ID for this request.",
  61282. // "location": "path",
  61283. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61284. // "required": true,
  61285. // "type": "string"
  61286. // },
  61287. // "requestId": {
  61288. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61289. // "location": "query",
  61290. // "type": "string"
  61291. // },
  61292. // "zone": {
  61293. // "description": "The name of the zone for this request.",
  61294. // "location": "path",
  61295. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61296. // "required": true,
  61297. // "type": "string"
  61298. // }
  61299. // },
  61300. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  61301. // "response": {
  61302. // "$ref": "Operation"
  61303. // },
  61304. // "scopes": [
  61305. // "https://www.googleapis.com/auth/cloud-platform",
  61306. // "https://www.googleapis.com/auth/compute"
  61307. // ]
  61308. // }
  61309. }
  61310. // method id "compute.nodeGroups.deleteNodes":
  61311. type NodeGroupsDeleteNodesCall struct {
  61312. s *Service
  61313. project string
  61314. zone string
  61315. nodeGroup string
  61316. nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest
  61317. urlParams_ gensupport.URLParams
  61318. ctx_ context.Context
  61319. header_ http.Header
  61320. }
  61321. // DeleteNodes: Deletes specified nodes from the node group.
  61322. func (r *NodeGroupsService) DeleteNodes(project string, zone string, nodeGroup string, nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest) *NodeGroupsDeleteNodesCall {
  61323. c := &NodeGroupsDeleteNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61324. c.project = project
  61325. c.zone = zone
  61326. c.nodeGroup = nodeGroup
  61327. c.nodegroupsdeletenodesrequest = nodegroupsdeletenodesrequest
  61328. return c
  61329. }
  61330. // RequestId sets the optional parameter "requestId": An optional
  61331. // request ID to identify requests. Specify a unique request ID so that
  61332. // if you must retry your request, the server will know to ignore the
  61333. // request if it has already been completed.
  61334. //
  61335. // For example, consider a situation where you make an initial request
  61336. // and the request times out. If you make the request again with the
  61337. // same request ID, the server can check if original operation with the
  61338. // same request ID was received, and if so, will ignore the second
  61339. // request. This prevents clients from accidentally creating duplicate
  61340. // commitments.
  61341. //
  61342. // The request ID must be a valid UUID with the exception that zero UUID
  61343. // is not supported (00000000-0000-0000-0000-000000000000).
  61344. func (c *NodeGroupsDeleteNodesCall) RequestId(requestId string) *NodeGroupsDeleteNodesCall {
  61345. c.urlParams_.Set("requestId", requestId)
  61346. return c
  61347. }
  61348. // Fields allows partial responses to be retrieved. See
  61349. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61350. // for more information.
  61351. func (c *NodeGroupsDeleteNodesCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteNodesCall {
  61352. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61353. return c
  61354. }
  61355. // Context sets the context to be used in this call's Do method. Any
  61356. // pending HTTP request will be aborted if the provided context is
  61357. // canceled.
  61358. func (c *NodeGroupsDeleteNodesCall) Context(ctx context.Context) *NodeGroupsDeleteNodesCall {
  61359. c.ctx_ = ctx
  61360. return c
  61361. }
  61362. // Header returns an http.Header that can be modified by the caller to
  61363. // add HTTP headers to the request.
  61364. func (c *NodeGroupsDeleteNodesCall) Header() http.Header {
  61365. if c.header_ == nil {
  61366. c.header_ = make(http.Header)
  61367. }
  61368. return c.header_
  61369. }
  61370. func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) {
  61371. reqHeaders := make(http.Header)
  61372. for k, v := range c.header_ {
  61373. reqHeaders[k] = v
  61374. }
  61375. reqHeaders.Set("User-Agent", c.s.userAgent())
  61376. var body io.Reader = nil
  61377. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest)
  61378. if err != nil {
  61379. return nil, err
  61380. }
  61381. reqHeaders.Set("Content-Type", "application/json")
  61382. c.urlParams_.Set("alt", alt)
  61383. c.urlParams_.Set("prettyPrint", "false")
  61384. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes")
  61385. urls += "?" + c.urlParams_.Encode()
  61386. req, err := http.NewRequest("POST", urls, body)
  61387. if err != nil {
  61388. return nil, err
  61389. }
  61390. req.Header = reqHeaders
  61391. googleapi.Expand(req.URL, map[string]string{
  61392. "project": c.project,
  61393. "zone": c.zone,
  61394. "nodeGroup": c.nodeGroup,
  61395. })
  61396. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61397. }
  61398. // Do executes the "compute.nodeGroups.deleteNodes" call.
  61399. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61400. // status code is an error. Response headers are in either
  61401. // *Operation.ServerResponse.Header or (if a response was returned at
  61402. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61403. // to check whether the returned error was because
  61404. // http.StatusNotModified was returned.
  61405. func (c *NodeGroupsDeleteNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61406. gensupport.SetOptions(c.urlParams_, opts...)
  61407. res, err := c.doRequest("json")
  61408. if res != nil && res.StatusCode == http.StatusNotModified {
  61409. if res.Body != nil {
  61410. res.Body.Close()
  61411. }
  61412. return nil, &googleapi.Error{
  61413. Code: res.StatusCode,
  61414. Header: res.Header,
  61415. }
  61416. }
  61417. if err != nil {
  61418. return nil, err
  61419. }
  61420. defer googleapi.CloseBody(res)
  61421. if err := googleapi.CheckResponse(res); err != nil {
  61422. return nil, err
  61423. }
  61424. ret := &Operation{
  61425. ServerResponse: googleapi.ServerResponse{
  61426. Header: res.Header,
  61427. HTTPStatusCode: res.StatusCode,
  61428. },
  61429. }
  61430. target := &ret
  61431. if err := gensupport.DecodeResponse(target, res); err != nil {
  61432. return nil, err
  61433. }
  61434. return ret, nil
  61435. // {
  61436. // "description": "Deletes specified nodes from the node group.",
  61437. // "httpMethod": "POST",
  61438. // "id": "compute.nodeGroups.deleteNodes",
  61439. // "parameterOrder": [
  61440. // "project",
  61441. // "zone",
  61442. // "nodeGroup"
  61443. // ],
  61444. // "parameters": {
  61445. // "nodeGroup": {
  61446. // "description": "Name of the NodeGroup resource to delete.",
  61447. // "location": "path",
  61448. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61449. // "required": true,
  61450. // "type": "string"
  61451. // },
  61452. // "project": {
  61453. // "description": "Project ID for this request.",
  61454. // "location": "path",
  61455. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61456. // "required": true,
  61457. // "type": "string"
  61458. // },
  61459. // "requestId": {
  61460. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61461. // "location": "query",
  61462. // "type": "string"
  61463. // },
  61464. // "zone": {
  61465. // "description": "The name of the zone for this request.",
  61466. // "location": "path",
  61467. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61468. // "required": true,
  61469. // "type": "string"
  61470. // }
  61471. // },
  61472. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes",
  61473. // "request": {
  61474. // "$ref": "NodeGroupsDeleteNodesRequest"
  61475. // },
  61476. // "response": {
  61477. // "$ref": "Operation"
  61478. // },
  61479. // "scopes": [
  61480. // "https://www.googleapis.com/auth/cloud-platform",
  61481. // "https://www.googleapis.com/auth/compute"
  61482. // ]
  61483. // }
  61484. }
  61485. // method id "compute.nodeGroups.get":
  61486. type NodeGroupsGetCall struct {
  61487. s *Service
  61488. project string
  61489. zone string
  61490. nodeGroup string
  61491. urlParams_ gensupport.URLParams
  61492. ifNoneMatch_ string
  61493. ctx_ context.Context
  61494. header_ http.Header
  61495. }
  61496. // Get: Returns the specified NodeGroup. Get a list of available
  61497. // NodeGroups by making a list() request. Note: the "nodes" field should
  61498. // not be used. Use nodeGroups.listNodes instead.
  61499. func (r *NodeGroupsService) Get(project string, zone string, nodeGroup string) *NodeGroupsGetCall {
  61500. c := &NodeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61501. c.project = project
  61502. c.zone = zone
  61503. c.nodeGroup = nodeGroup
  61504. return c
  61505. }
  61506. // Fields allows partial responses to be retrieved. See
  61507. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61508. // for more information.
  61509. func (c *NodeGroupsGetCall) Fields(s ...googleapi.Field) *NodeGroupsGetCall {
  61510. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61511. return c
  61512. }
  61513. // IfNoneMatch sets the optional parameter which makes the operation
  61514. // fail if the object's ETag matches the given value. This is useful for
  61515. // getting updates only after the object has changed since the last
  61516. // request. Use googleapi.IsNotModified to check whether the response
  61517. // error from Do is the result of In-None-Match.
  61518. func (c *NodeGroupsGetCall) IfNoneMatch(entityTag string) *NodeGroupsGetCall {
  61519. c.ifNoneMatch_ = entityTag
  61520. return c
  61521. }
  61522. // Context sets the context to be used in this call's Do method. Any
  61523. // pending HTTP request will be aborted if the provided context is
  61524. // canceled.
  61525. func (c *NodeGroupsGetCall) Context(ctx context.Context) *NodeGroupsGetCall {
  61526. c.ctx_ = ctx
  61527. return c
  61528. }
  61529. // Header returns an http.Header that can be modified by the caller to
  61530. // add HTTP headers to the request.
  61531. func (c *NodeGroupsGetCall) Header() http.Header {
  61532. if c.header_ == nil {
  61533. c.header_ = make(http.Header)
  61534. }
  61535. return c.header_
  61536. }
  61537. func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  61538. reqHeaders := make(http.Header)
  61539. for k, v := range c.header_ {
  61540. reqHeaders[k] = v
  61541. }
  61542. reqHeaders.Set("User-Agent", c.s.userAgent())
  61543. if c.ifNoneMatch_ != "" {
  61544. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61545. }
  61546. var body io.Reader = nil
  61547. c.urlParams_.Set("alt", alt)
  61548. c.urlParams_.Set("prettyPrint", "false")
  61549. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  61550. urls += "?" + c.urlParams_.Encode()
  61551. req, err := http.NewRequest("GET", urls, body)
  61552. if err != nil {
  61553. return nil, err
  61554. }
  61555. req.Header = reqHeaders
  61556. googleapi.Expand(req.URL, map[string]string{
  61557. "project": c.project,
  61558. "zone": c.zone,
  61559. "nodeGroup": c.nodeGroup,
  61560. })
  61561. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61562. }
  61563. // Do executes the "compute.nodeGroups.get" call.
  61564. // Exactly one of *NodeGroup or error will be non-nil. Any non-2xx
  61565. // status code is an error. Response headers are in either
  61566. // *NodeGroup.ServerResponse.Header or (if a response was returned at
  61567. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61568. // to check whether the returned error was because
  61569. // http.StatusNotModified was returned.
  61570. func (c *NodeGroupsGetCall) Do(opts ...googleapi.CallOption) (*NodeGroup, error) {
  61571. gensupport.SetOptions(c.urlParams_, opts...)
  61572. res, err := c.doRequest("json")
  61573. if res != nil && res.StatusCode == http.StatusNotModified {
  61574. if res.Body != nil {
  61575. res.Body.Close()
  61576. }
  61577. return nil, &googleapi.Error{
  61578. Code: res.StatusCode,
  61579. Header: res.Header,
  61580. }
  61581. }
  61582. if err != nil {
  61583. return nil, err
  61584. }
  61585. defer googleapi.CloseBody(res)
  61586. if err := googleapi.CheckResponse(res); err != nil {
  61587. return nil, err
  61588. }
  61589. ret := &NodeGroup{
  61590. ServerResponse: googleapi.ServerResponse{
  61591. Header: res.Header,
  61592. HTTPStatusCode: res.StatusCode,
  61593. },
  61594. }
  61595. target := &ret
  61596. if err := gensupport.DecodeResponse(target, res); err != nil {
  61597. return nil, err
  61598. }
  61599. return ret, nil
  61600. // {
  61601. // "description": "Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the \"nodes\" field should not be used. Use nodeGroups.listNodes instead.",
  61602. // "httpMethod": "GET",
  61603. // "id": "compute.nodeGroups.get",
  61604. // "parameterOrder": [
  61605. // "project",
  61606. // "zone",
  61607. // "nodeGroup"
  61608. // ],
  61609. // "parameters": {
  61610. // "nodeGroup": {
  61611. // "description": "Name of the node group to return.",
  61612. // "location": "path",
  61613. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61614. // "required": true,
  61615. // "type": "string"
  61616. // },
  61617. // "project": {
  61618. // "description": "Project ID for this request.",
  61619. // "location": "path",
  61620. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61621. // "required": true,
  61622. // "type": "string"
  61623. // },
  61624. // "zone": {
  61625. // "description": "The name of the zone for this request.",
  61626. // "location": "path",
  61627. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61628. // "required": true,
  61629. // "type": "string"
  61630. // }
  61631. // },
  61632. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  61633. // "response": {
  61634. // "$ref": "NodeGroup"
  61635. // },
  61636. // "scopes": [
  61637. // "https://www.googleapis.com/auth/cloud-platform",
  61638. // "https://www.googleapis.com/auth/compute",
  61639. // "https://www.googleapis.com/auth/compute.readonly"
  61640. // ]
  61641. // }
  61642. }
  61643. // method id "compute.nodeGroups.getIamPolicy":
  61644. type NodeGroupsGetIamPolicyCall struct {
  61645. s *Service
  61646. project string
  61647. zone string
  61648. resource string
  61649. urlParams_ gensupport.URLParams
  61650. ifNoneMatch_ string
  61651. ctx_ context.Context
  61652. header_ http.Header
  61653. }
  61654. // GetIamPolicy: Gets the access control policy for a resource. May be
  61655. // empty if no such policy or resource exists.
  61656. func (r *NodeGroupsService) GetIamPolicy(project string, zone string, resource string) *NodeGroupsGetIamPolicyCall {
  61657. c := &NodeGroupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61658. c.project = project
  61659. c.zone = zone
  61660. c.resource = resource
  61661. return c
  61662. }
  61663. // Fields allows partial responses to be retrieved. See
  61664. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61665. // for more information.
  61666. func (c *NodeGroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsGetIamPolicyCall {
  61667. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61668. return c
  61669. }
  61670. // IfNoneMatch sets the optional parameter which makes the operation
  61671. // fail if the object's ETag matches the given value. This is useful for
  61672. // getting updates only after the object has changed since the last
  61673. // request. Use googleapi.IsNotModified to check whether the response
  61674. // error from Do is the result of In-None-Match.
  61675. func (c *NodeGroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeGroupsGetIamPolicyCall {
  61676. c.ifNoneMatch_ = entityTag
  61677. return c
  61678. }
  61679. // Context sets the context to be used in this call's Do method. Any
  61680. // pending HTTP request will be aborted if the provided context is
  61681. // canceled.
  61682. func (c *NodeGroupsGetIamPolicyCall) Context(ctx context.Context) *NodeGroupsGetIamPolicyCall {
  61683. c.ctx_ = ctx
  61684. return c
  61685. }
  61686. // Header returns an http.Header that can be modified by the caller to
  61687. // add HTTP headers to the request.
  61688. func (c *NodeGroupsGetIamPolicyCall) Header() http.Header {
  61689. if c.header_ == nil {
  61690. c.header_ = make(http.Header)
  61691. }
  61692. return c.header_
  61693. }
  61694. func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  61695. reqHeaders := make(http.Header)
  61696. for k, v := range c.header_ {
  61697. reqHeaders[k] = v
  61698. }
  61699. reqHeaders.Set("User-Agent", c.s.userAgent())
  61700. if c.ifNoneMatch_ != "" {
  61701. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61702. }
  61703. var body io.Reader = nil
  61704. c.urlParams_.Set("alt", alt)
  61705. c.urlParams_.Set("prettyPrint", "false")
  61706. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy")
  61707. urls += "?" + c.urlParams_.Encode()
  61708. req, err := http.NewRequest("GET", urls, body)
  61709. if err != nil {
  61710. return nil, err
  61711. }
  61712. req.Header = reqHeaders
  61713. googleapi.Expand(req.URL, map[string]string{
  61714. "project": c.project,
  61715. "zone": c.zone,
  61716. "resource": c.resource,
  61717. })
  61718. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61719. }
  61720. // Do executes the "compute.nodeGroups.getIamPolicy" call.
  61721. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  61722. // code is an error. Response headers are in either
  61723. // *Policy.ServerResponse.Header or (if a response was returned at all)
  61724. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  61725. // check whether the returned error was because http.StatusNotModified
  61726. // was returned.
  61727. func (c *NodeGroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  61728. gensupport.SetOptions(c.urlParams_, opts...)
  61729. res, err := c.doRequest("json")
  61730. if res != nil && res.StatusCode == http.StatusNotModified {
  61731. if res.Body != nil {
  61732. res.Body.Close()
  61733. }
  61734. return nil, &googleapi.Error{
  61735. Code: res.StatusCode,
  61736. Header: res.Header,
  61737. }
  61738. }
  61739. if err != nil {
  61740. return nil, err
  61741. }
  61742. defer googleapi.CloseBody(res)
  61743. if err := googleapi.CheckResponse(res); err != nil {
  61744. return nil, err
  61745. }
  61746. ret := &Policy{
  61747. ServerResponse: googleapi.ServerResponse{
  61748. Header: res.Header,
  61749. HTTPStatusCode: res.StatusCode,
  61750. },
  61751. }
  61752. target := &ret
  61753. if err := gensupport.DecodeResponse(target, res); err != nil {
  61754. return nil, err
  61755. }
  61756. return ret, nil
  61757. // {
  61758. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  61759. // "httpMethod": "GET",
  61760. // "id": "compute.nodeGroups.getIamPolicy",
  61761. // "parameterOrder": [
  61762. // "project",
  61763. // "zone",
  61764. // "resource"
  61765. // ],
  61766. // "parameters": {
  61767. // "project": {
  61768. // "description": "Project ID for this request.",
  61769. // "location": "path",
  61770. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61771. // "required": true,
  61772. // "type": "string"
  61773. // },
  61774. // "resource": {
  61775. // "description": "Name or id of the resource for this request.",
  61776. // "location": "path",
  61777. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61778. // "required": true,
  61779. // "type": "string"
  61780. // },
  61781. // "zone": {
  61782. // "description": "The name of the zone for this request.",
  61783. // "location": "path",
  61784. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61785. // "required": true,
  61786. // "type": "string"
  61787. // }
  61788. // },
  61789. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy",
  61790. // "response": {
  61791. // "$ref": "Policy"
  61792. // },
  61793. // "scopes": [
  61794. // "https://www.googleapis.com/auth/cloud-platform",
  61795. // "https://www.googleapis.com/auth/compute",
  61796. // "https://www.googleapis.com/auth/compute.readonly"
  61797. // ]
  61798. // }
  61799. }
  61800. // method id "compute.nodeGroups.insert":
  61801. type NodeGroupsInsertCall struct {
  61802. s *Service
  61803. project string
  61804. zone string
  61805. nodegroup *NodeGroup
  61806. urlParams_ gensupport.URLParams
  61807. ctx_ context.Context
  61808. header_ http.Header
  61809. }
  61810. // Insert: Creates a NodeGroup resource in the specified project using
  61811. // the data included in the request.
  61812. func (r *NodeGroupsService) Insert(project string, zone string, initialNodeCount int64, nodegroup *NodeGroup) *NodeGroupsInsertCall {
  61813. c := &NodeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61814. c.project = project
  61815. c.zone = zone
  61816. c.urlParams_.Set("initialNodeCount", fmt.Sprint(initialNodeCount))
  61817. c.nodegroup = nodegroup
  61818. return c
  61819. }
  61820. // RequestId sets the optional parameter "requestId": An optional
  61821. // request ID to identify requests. Specify a unique request ID so that
  61822. // if you must retry your request, the server will know to ignore the
  61823. // request if it has already been completed.
  61824. //
  61825. // For example, consider a situation where you make an initial request
  61826. // and the request times out. If you make the request again with the
  61827. // same request ID, the server can check if original operation with the
  61828. // same request ID was received, and if so, will ignore the second
  61829. // request. This prevents clients from accidentally creating duplicate
  61830. // commitments.
  61831. //
  61832. // The request ID must be a valid UUID with the exception that zero UUID
  61833. // is not supported (00000000-0000-0000-0000-000000000000).
  61834. func (c *NodeGroupsInsertCall) RequestId(requestId string) *NodeGroupsInsertCall {
  61835. c.urlParams_.Set("requestId", requestId)
  61836. return c
  61837. }
  61838. // Fields allows partial responses to be retrieved. See
  61839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61840. // for more information.
  61841. func (c *NodeGroupsInsertCall) Fields(s ...googleapi.Field) *NodeGroupsInsertCall {
  61842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61843. return c
  61844. }
  61845. // Context sets the context to be used in this call's Do method. Any
  61846. // pending HTTP request will be aborted if the provided context is
  61847. // canceled.
  61848. func (c *NodeGroupsInsertCall) Context(ctx context.Context) *NodeGroupsInsertCall {
  61849. c.ctx_ = ctx
  61850. return c
  61851. }
  61852. // Header returns an http.Header that can be modified by the caller to
  61853. // add HTTP headers to the request.
  61854. func (c *NodeGroupsInsertCall) Header() http.Header {
  61855. if c.header_ == nil {
  61856. c.header_ = make(http.Header)
  61857. }
  61858. return c.header_
  61859. }
  61860. func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  61861. reqHeaders := make(http.Header)
  61862. for k, v := range c.header_ {
  61863. reqHeaders[k] = v
  61864. }
  61865. reqHeaders.Set("User-Agent", c.s.userAgent())
  61866. var body io.Reader = nil
  61867. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup)
  61868. if err != nil {
  61869. return nil, err
  61870. }
  61871. reqHeaders.Set("Content-Type", "application/json")
  61872. c.urlParams_.Set("alt", alt)
  61873. c.urlParams_.Set("prettyPrint", "false")
  61874. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  61875. urls += "?" + c.urlParams_.Encode()
  61876. req, err := http.NewRequest("POST", urls, body)
  61877. if err != nil {
  61878. return nil, err
  61879. }
  61880. req.Header = reqHeaders
  61881. googleapi.Expand(req.URL, map[string]string{
  61882. "project": c.project,
  61883. "zone": c.zone,
  61884. })
  61885. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61886. }
  61887. // Do executes the "compute.nodeGroups.insert" call.
  61888. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61889. // status code is an error. Response headers are in either
  61890. // *Operation.ServerResponse.Header or (if a response was returned at
  61891. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61892. // to check whether the returned error was because
  61893. // http.StatusNotModified was returned.
  61894. func (c *NodeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61895. gensupport.SetOptions(c.urlParams_, opts...)
  61896. res, err := c.doRequest("json")
  61897. if res != nil && res.StatusCode == http.StatusNotModified {
  61898. if res.Body != nil {
  61899. res.Body.Close()
  61900. }
  61901. return nil, &googleapi.Error{
  61902. Code: res.StatusCode,
  61903. Header: res.Header,
  61904. }
  61905. }
  61906. if err != nil {
  61907. return nil, err
  61908. }
  61909. defer googleapi.CloseBody(res)
  61910. if err := googleapi.CheckResponse(res); err != nil {
  61911. return nil, err
  61912. }
  61913. ret := &Operation{
  61914. ServerResponse: googleapi.ServerResponse{
  61915. Header: res.Header,
  61916. HTTPStatusCode: res.StatusCode,
  61917. },
  61918. }
  61919. target := &ret
  61920. if err := gensupport.DecodeResponse(target, res); err != nil {
  61921. return nil, err
  61922. }
  61923. return ret, nil
  61924. // {
  61925. // "description": "Creates a NodeGroup resource in the specified project using the data included in the request.",
  61926. // "httpMethod": "POST",
  61927. // "id": "compute.nodeGroups.insert",
  61928. // "parameterOrder": [
  61929. // "project",
  61930. // "zone",
  61931. // "initialNodeCount"
  61932. // ],
  61933. // "parameters": {
  61934. // "initialNodeCount": {
  61935. // "description": "Initial count of nodes in the node group.",
  61936. // "format": "int32",
  61937. // "location": "query",
  61938. // "required": true,
  61939. // "type": "integer"
  61940. // },
  61941. // "project": {
  61942. // "description": "Project ID for this request.",
  61943. // "location": "path",
  61944. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61945. // "required": true,
  61946. // "type": "string"
  61947. // },
  61948. // "requestId": {
  61949. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61950. // "location": "query",
  61951. // "type": "string"
  61952. // },
  61953. // "zone": {
  61954. // "description": "The name of the zone for this request.",
  61955. // "location": "path",
  61956. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61957. // "required": true,
  61958. // "type": "string"
  61959. // }
  61960. // },
  61961. // "path": "{project}/zones/{zone}/nodeGroups",
  61962. // "request": {
  61963. // "$ref": "NodeGroup"
  61964. // },
  61965. // "response": {
  61966. // "$ref": "Operation"
  61967. // },
  61968. // "scopes": [
  61969. // "https://www.googleapis.com/auth/cloud-platform",
  61970. // "https://www.googleapis.com/auth/compute"
  61971. // ]
  61972. // }
  61973. }
  61974. // method id "compute.nodeGroups.list":
  61975. type NodeGroupsListCall struct {
  61976. s *Service
  61977. project string
  61978. zone string
  61979. urlParams_ gensupport.URLParams
  61980. ifNoneMatch_ string
  61981. ctx_ context.Context
  61982. header_ http.Header
  61983. }
  61984. // List: Retrieves a list of node groups available to the specified
  61985. // project. Note: use nodeGroups.listNodes for more details about each
  61986. // group.
  61987. func (r *NodeGroupsService) List(project string, zone string) *NodeGroupsListCall {
  61988. c := &NodeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61989. c.project = project
  61990. c.zone = zone
  61991. return c
  61992. }
  61993. // Filter sets the optional parameter "filter": A filter expression that
  61994. // filters resources listed in the response. The expression must specify
  61995. // the field name, a comparison operator, and the value that you want to
  61996. // use for filtering. The value must be a string, a number, or a
  61997. // boolean. The comparison operator must be either =, !=, >, or <.
  61998. //
  61999. // For example, if you are filtering Compute Engine instances, you can
  62000. // exclude instances named example-instance by specifying name !=
  62001. // example-instance.
  62002. //
  62003. // You can also filter nested fields. For example, you could specify
  62004. // scheduling.automaticRestart = false to include instances only if they
  62005. // are not scheduled for automatic restarts. You can use filtering on
  62006. // nested fields to filter based on resource labels.
  62007. //
  62008. // To filter on multiple expressions, provide each separate expression
  62009. // within parentheses. For example, (scheduling.automaticRestart = true)
  62010. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62011. // AND expression. However, you can include AND and OR expressions
  62012. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62013. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62014. // true).
  62015. func (c *NodeGroupsListCall) Filter(filter string) *NodeGroupsListCall {
  62016. c.urlParams_.Set("filter", filter)
  62017. return c
  62018. }
  62019. // MaxResults sets the optional parameter "maxResults": The maximum
  62020. // number of results per page that should be returned. If the number of
  62021. // available results is larger than maxResults, Compute Engine returns a
  62022. // nextPageToken that can be used to get the next page of results in
  62023. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62024. // (Default: 500)
  62025. func (c *NodeGroupsListCall) MaxResults(maxResults int64) *NodeGroupsListCall {
  62026. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62027. return c
  62028. }
  62029. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62030. // a certain order. By default, results are returned in alphanumerical
  62031. // order based on the resource name.
  62032. //
  62033. // You can also sort results in descending order based on the creation
  62034. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62035. // based on the creationTimestamp field in reverse chronological order
  62036. // (newest result first). Use this to sort resources like operations so
  62037. // that the newest operation is returned first.
  62038. //
  62039. // Currently, only sorting by name or creationTimestamp desc is
  62040. // supported.
  62041. func (c *NodeGroupsListCall) OrderBy(orderBy string) *NodeGroupsListCall {
  62042. c.urlParams_.Set("orderBy", orderBy)
  62043. return c
  62044. }
  62045. // PageToken sets the optional parameter "pageToken": Specifies a page
  62046. // token to use. Set pageToken to the nextPageToken returned by a
  62047. // previous list request to get the next page of results.
  62048. func (c *NodeGroupsListCall) PageToken(pageToken string) *NodeGroupsListCall {
  62049. c.urlParams_.Set("pageToken", pageToken)
  62050. return c
  62051. }
  62052. // Fields allows partial responses to be retrieved. See
  62053. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62054. // for more information.
  62055. func (c *NodeGroupsListCall) Fields(s ...googleapi.Field) *NodeGroupsListCall {
  62056. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62057. return c
  62058. }
  62059. // IfNoneMatch sets the optional parameter which makes the operation
  62060. // fail if the object's ETag matches the given value. This is useful for
  62061. // getting updates only after the object has changed since the last
  62062. // request. Use googleapi.IsNotModified to check whether the response
  62063. // error from Do is the result of In-None-Match.
  62064. func (c *NodeGroupsListCall) IfNoneMatch(entityTag string) *NodeGroupsListCall {
  62065. c.ifNoneMatch_ = entityTag
  62066. return c
  62067. }
  62068. // Context sets the context to be used in this call's Do method. Any
  62069. // pending HTTP request will be aborted if the provided context is
  62070. // canceled.
  62071. func (c *NodeGroupsListCall) Context(ctx context.Context) *NodeGroupsListCall {
  62072. c.ctx_ = ctx
  62073. return c
  62074. }
  62075. // Header returns an http.Header that can be modified by the caller to
  62076. // add HTTP headers to the request.
  62077. func (c *NodeGroupsListCall) Header() http.Header {
  62078. if c.header_ == nil {
  62079. c.header_ = make(http.Header)
  62080. }
  62081. return c.header_
  62082. }
  62083. func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  62084. reqHeaders := make(http.Header)
  62085. for k, v := range c.header_ {
  62086. reqHeaders[k] = v
  62087. }
  62088. reqHeaders.Set("User-Agent", c.s.userAgent())
  62089. if c.ifNoneMatch_ != "" {
  62090. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62091. }
  62092. var body io.Reader = nil
  62093. c.urlParams_.Set("alt", alt)
  62094. c.urlParams_.Set("prettyPrint", "false")
  62095. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  62096. urls += "?" + c.urlParams_.Encode()
  62097. req, err := http.NewRequest("GET", urls, body)
  62098. if err != nil {
  62099. return nil, err
  62100. }
  62101. req.Header = reqHeaders
  62102. googleapi.Expand(req.URL, map[string]string{
  62103. "project": c.project,
  62104. "zone": c.zone,
  62105. })
  62106. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62107. }
  62108. // Do executes the "compute.nodeGroups.list" call.
  62109. // Exactly one of *NodeGroupList or error will be non-nil. Any non-2xx
  62110. // status code is an error. Response headers are in either
  62111. // *NodeGroupList.ServerResponse.Header or (if a response was returned
  62112. // at all) in error.(*googleapi.Error).Header. Use
  62113. // googleapi.IsNotModified to check whether the returned error was
  62114. // because http.StatusNotModified was returned.
  62115. func (c *NodeGroupsListCall) Do(opts ...googleapi.CallOption) (*NodeGroupList, error) {
  62116. gensupport.SetOptions(c.urlParams_, opts...)
  62117. res, err := c.doRequest("json")
  62118. if res != nil && res.StatusCode == http.StatusNotModified {
  62119. if res.Body != nil {
  62120. res.Body.Close()
  62121. }
  62122. return nil, &googleapi.Error{
  62123. Code: res.StatusCode,
  62124. Header: res.Header,
  62125. }
  62126. }
  62127. if err != nil {
  62128. return nil, err
  62129. }
  62130. defer googleapi.CloseBody(res)
  62131. if err := googleapi.CheckResponse(res); err != nil {
  62132. return nil, err
  62133. }
  62134. ret := &NodeGroupList{
  62135. ServerResponse: googleapi.ServerResponse{
  62136. Header: res.Header,
  62137. HTTPStatusCode: res.StatusCode,
  62138. },
  62139. }
  62140. target := &ret
  62141. if err := gensupport.DecodeResponse(target, res); err != nil {
  62142. return nil, err
  62143. }
  62144. return ret, nil
  62145. // {
  62146. // "description": "Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group.",
  62147. // "httpMethod": "GET",
  62148. // "id": "compute.nodeGroups.list",
  62149. // "parameterOrder": [
  62150. // "project",
  62151. // "zone"
  62152. // ],
  62153. // "parameters": {
  62154. // "filter": {
  62155. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  62156. // "location": "query",
  62157. // "type": "string"
  62158. // },
  62159. // "maxResults": {
  62160. // "default": "500",
  62161. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  62162. // "format": "uint32",
  62163. // "location": "query",
  62164. // "minimum": "0",
  62165. // "type": "integer"
  62166. // },
  62167. // "orderBy": {
  62168. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  62169. // "location": "query",
  62170. // "type": "string"
  62171. // },
  62172. // "pageToken": {
  62173. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  62174. // "location": "query",
  62175. // "type": "string"
  62176. // },
  62177. // "project": {
  62178. // "description": "Project ID for this request.",
  62179. // "location": "path",
  62180. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62181. // "required": true,
  62182. // "type": "string"
  62183. // },
  62184. // "zone": {
  62185. // "description": "The name of the zone for this request.",
  62186. // "location": "path",
  62187. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62188. // "required": true,
  62189. // "type": "string"
  62190. // }
  62191. // },
  62192. // "path": "{project}/zones/{zone}/nodeGroups",
  62193. // "response": {
  62194. // "$ref": "NodeGroupList"
  62195. // },
  62196. // "scopes": [
  62197. // "https://www.googleapis.com/auth/cloud-platform",
  62198. // "https://www.googleapis.com/auth/compute",
  62199. // "https://www.googleapis.com/auth/compute.readonly"
  62200. // ]
  62201. // }
  62202. }
  62203. // Pages invokes f for each page of results.
  62204. // A non-nil error returned from f will halt the iteration.
  62205. // The provided context supersedes any context provided to the Context method.
  62206. func (c *NodeGroupsListCall) Pages(ctx context.Context, f func(*NodeGroupList) error) error {
  62207. c.ctx_ = ctx
  62208. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62209. for {
  62210. x, err := c.Do()
  62211. if err != nil {
  62212. return err
  62213. }
  62214. if err := f(x); err != nil {
  62215. return err
  62216. }
  62217. if x.NextPageToken == "" {
  62218. return nil
  62219. }
  62220. c.PageToken(x.NextPageToken)
  62221. }
  62222. }
  62223. // method id "compute.nodeGroups.listNodes":
  62224. type NodeGroupsListNodesCall struct {
  62225. s *Service
  62226. project string
  62227. zone string
  62228. nodeGroup string
  62229. urlParams_ gensupport.URLParams
  62230. ctx_ context.Context
  62231. header_ http.Header
  62232. }
  62233. // ListNodes: Lists nodes in the node group.
  62234. func (r *NodeGroupsService) ListNodes(project string, zone string, nodeGroup string) *NodeGroupsListNodesCall {
  62235. c := &NodeGroupsListNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62236. c.project = project
  62237. c.zone = zone
  62238. c.nodeGroup = nodeGroup
  62239. return c
  62240. }
  62241. // Filter sets the optional parameter "filter": A filter expression that
  62242. // filters resources listed in the response. The expression must specify
  62243. // the field name, a comparison operator, and the value that you want to
  62244. // use for filtering. The value must be a string, a number, or a
  62245. // boolean. The comparison operator must be either =, !=, >, or <.
  62246. //
  62247. // For example, if you are filtering Compute Engine instances, you can
  62248. // exclude instances named example-instance by specifying name !=
  62249. // example-instance.
  62250. //
  62251. // You can also filter nested fields. For example, you could specify
  62252. // scheduling.automaticRestart = false to include instances only if they
  62253. // are not scheduled for automatic restarts. You can use filtering on
  62254. // nested fields to filter based on resource labels.
  62255. //
  62256. // To filter on multiple expressions, provide each separate expression
  62257. // within parentheses. For example, (scheduling.automaticRestart = true)
  62258. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62259. // AND expression. However, you can include AND and OR expressions
  62260. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62261. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62262. // true).
  62263. func (c *NodeGroupsListNodesCall) Filter(filter string) *NodeGroupsListNodesCall {
  62264. c.urlParams_.Set("filter", filter)
  62265. return c
  62266. }
  62267. // MaxResults sets the optional parameter "maxResults": The maximum
  62268. // number of results per page that should be returned. If the number of
  62269. // available results is larger than maxResults, Compute Engine returns a
  62270. // nextPageToken that can be used to get the next page of results in
  62271. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62272. // (Default: 500)
  62273. func (c *NodeGroupsListNodesCall) MaxResults(maxResults int64) *NodeGroupsListNodesCall {
  62274. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62275. return c
  62276. }
  62277. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62278. // a certain order. By default, results are returned in alphanumerical
  62279. // order based on the resource name.
  62280. //
  62281. // You can also sort results in descending order based on the creation
  62282. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62283. // based on the creationTimestamp field in reverse chronological order
  62284. // (newest result first). Use this to sort resources like operations so
  62285. // that the newest operation is returned first.
  62286. //
  62287. // Currently, only sorting by name or creationTimestamp desc is
  62288. // supported.
  62289. func (c *NodeGroupsListNodesCall) OrderBy(orderBy string) *NodeGroupsListNodesCall {
  62290. c.urlParams_.Set("orderBy", orderBy)
  62291. return c
  62292. }
  62293. // PageToken sets the optional parameter "pageToken": Specifies a page
  62294. // token to use. Set pageToken to the nextPageToken returned by a
  62295. // previous list request to get the next page of results.
  62296. func (c *NodeGroupsListNodesCall) PageToken(pageToken string) *NodeGroupsListNodesCall {
  62297. c.urlParams_.Set("pageToken", pageToken)
  62298. return c
  62299. }
  62300. // Fields allows partial responses to be retrieved. See
  62301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62302. // for more information.
  62303. func (c *NodeGroupsListNodesCall) Fields(s ...googleapi.Field) *NodeGroupsListNodesCall {
  62304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62305. return c
  62306. }
  62307. // Context sets the context to be used in this call's Do method. Any
  62308. // pending HTTP request will be aborted if the provided context is
  62309. // canceled.
  62310. func (c *NodeGroupsListNodesCall) Context(ctx context.Context) *NodeGroupsListNodesCall {
  62311. c.ctx_ = ctx
  62312. return c
  62313. }
  62314. // Header returns an http.Header that can be modified by the caller to
  62315. // add HTTP headers to the request.
  62316. func (c *NodeGroupsListNodesCall) Header() http.Header {
  62317. if c.header_ == nil {
  62318. c.header_ = make(http.Header)
  62319. }
  62320. return c.header_
  62321. }
  62322. func (c *NodeGroupsListNodesCall) doRequest(alt string) (*http.Response, error) {
  62323. reqHeaders := make(http.Header)
  62324. for k, v := range c.header_ {
  62325. reqHeaders[k] = v
  62326. }
  62327. reqHeaders.Set("User-Agent", c.s.userAgent())
  62328. var body io.Reader = nil
  62329. c.urlParams_.Set("alt", alt)
  62330. c.urlParams_.Set("prettyPrint", "false")
  62331. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes")
  62332. urls += "?" + c.urlParams_.Encode()
  62333. req, err := http.NewRequest("POST", urls, body)
  62334. if err != nil {
  62335. return nil, err
  62336. }
  62337. req.Header = reqHeaders
  62338. googleapi.Expand(req.URL, map[string]string{
  62339. "project": c.project,
  62340. "zone": c.zone,
  62341. "nodeGroup": c.nodeGroup,
  62342. })
  62343. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62344. }
  62345. // Do executes the "compute.nodeGroups.listNodes" call.
  62346. // Exactly one of *NodeGroupsListNodes or error will be non-nil. Any
  62347. // non-2xx status code is an error. Response headers are in either
  62348. // *NodeGroupsListNodes.ServerResponse.Header or (if a response was
  62349. // returned at all) in error.(*googleapi.Error).Header. Use
  62350. // googleapi.IsNotModified to check whether the returned error was
  62351. // because http.StatusNotModified was returned.
  62352. func (c *NodeGroupsListNodesCall) Do(opts ...googleapi.CallOption) (*NodeGroupsListNodes, error) {
  62353. gensupport.SetOptions(c.urlParams_, opts...)
  62354. res, err := c.doRequest("json")
  62355. if res != nil && res.StatusCode == http.StatusNotModified {
  62356. if res.Body != nil {
  62357. res.Body.Close()
  62358. }
  62359. return nil, &googleapi.Error{
  62360. Code: res.StatusCode,
  62361. Header: res.Header,
  62362. }
  62363. }
  62364. if err != nil {
  62365. return nil, err
  62366. }
  62367. defer googleapi.CloseBody(res)
  62368. if err := googleapi.CheckResponse(res); err != nil {
  62369. return nil, err
  62370. }
  62371. ret := &NodeGroupsListNodes{
  62372. ServerResponse: googleapi.ServerResponse{
  62373. Header: res.Header,
  62374. HTTPStatusCode: res.StatusCode,
  62375. },
  62376. }
  62377. target := &ret
  62378. if err := gensupport.DecodeResponse(target, res); err != nil {
  62379. return nil, err
  62380. }
  62381. return ret, nil
  62382. // {
  62383. // "description": "Lists nodes in the node group.",
  62384. // "httpMethod": "POST",
  62385. // "id": "compute.nodeGroups.listNodes",
  62386. // "parameterOrder": [
  62387. // "project",
  62388. // "zone",
  62389. // "nodeGroup"
  62390. // ],
  62391. // "parameters": {
  62392. // "filter": {
  62393. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  62394. // "location": "query",
  62395. // "type": "string"
  62396. // },
  62397. // "maxResults": {
  62398. // "default": "500",
  62399. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  62400. // "format": "uint32",
  62401. // "location": "query",
  62402. // "minimum": "0",
  62403. // "type": "integer"
  62404. // },
  62405. // "nodeGroup": {
  62406. // "description": "Name of the NodeGroup resource whose nodes you want to list.",
  62407. // "location": "path",
  62408. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62409. // "required": true,
  62410. // "type": "string"
  62411. // },
  62412. // "orderBy": {
  62413. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  62414. // "location": "query",
  62415. // "type": "string"
  62416. // },
  62417. // "pageToken": {
  62418. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  62419. // "location": "query",
  62420. // "type": "string"
  62421. // },
  62422. // "project": {
  62423. // "description": "Project ID for this request.",
  62424. // "location": "path",
  62425. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62426. // "required": true,
  62427. // "type": "string"
  62428. // },
  62429. // "zone": {
  62430. // "description": "The name of the zone for this request.",
  62431. // "location": "path",
  62432. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62433. // "required": true,
  62434. // "type": "string"
  62435. // }
  62436. // },
  62437. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes",
  62438. // "response": {
  62439. // "$ref": "NodeGroupsListNodes"
  62440. // },
  62441. // "scopes": [
  62442. // "https://www.googleapis.com/auth/cloud-platform",
  62443. // "https://www.googleapis.com/auth/compute",
  62444. // "https://www.googleapis.com/auth/compute.readonly"
  62445. // ]
  62446. // }
  62447. }
  62448. // Pages invokes f for each page of results.
  62449. // A non-nil error returned from f will halt the iteration.
  62450. // The provided context supersedes any context provided to the Context method.
  62451. func (c *NodeGroupsListNodesCall) Pages(ctx context.Context, f func(*NodeGroupsListNodes) error) error {
  62452. c.ctx_ = ctx
  62453. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62454. for {
  62455. x, err := c.Do()
  62456. if err != nil {
  62457. return err
  62458. }
  62459. if err := f(x); err != nil {
  62460. return err
  62461. }
  62462. if x.NextPageToken == "" {
  62463. return nil
  62464. }
  62465. c.PageToken(x.NextPageToken)
  62466. }
  62467. }
  62468. // method id "compute.nodeGroups.setIamPolicy":
  62469. type NodeGroupsSetIamPolicyCall struct {
  62470. s *Service
  62471. project string
  62472. zone string
  62473. resource string
  62474. zonesetpolicyrequest *ZoneSetPolicyRequest
  62475. urlParams_ gensupport.URLParams
  62476. ctx_ context.Context
  62477. header_ http.Header
  62478. }
  62479. // SetIamPolicy: Sets the access control policy on the specified
  62480. // resource. Replaces any existing policy.
  62481. func (r *NodeGroupsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *NodeGroupsSetIamPolicyCall {
  62482. c := &NodeGroupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62483. c.project = project
  62484. c.zone = zone
  62485. c.resource = resource
  62486. c.zonesetpolicyrequest = zonesetpolicyrequest
  62487. return c
  62488. }
  62489. // Fields allows partial responses to be retrieved. See
  62490. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62491. // for more information.
  62492. func (c *NodeGroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsSetIamPolicyCall {
  62493. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62494. return c
  62495. }
  62496. // Context sets the context to be used in this call's Do method. Any
  62497. // pending HTTP request will be aborted if the provided context is
  62498. // canceled.
  62499. func (c *NodeGroupsSetIamPolicyCall) Context(ctx context.Context) *NodeGroupsSetIamPolicyCall {
  62500. c.ctx_ = ctx
  62501. return c
  62502. }
  62503. // Header returns an http.Header that can be modified by the caller to
  62504. // add HTTP headers to the request.
  62505. func (c *NodeGroupsSetIamPolicyCall) Header() http.Header {
  62506. if c.header_ == nil {
  62507. c.header_ = make(http.Header)
  62508. }
  62509. return c.header_
  62510. }
  62511. func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  62512. reqHeaders := make(http.Header)
  62513. for k, v := range c.header_ {
  62514. reqHeaders[k] = v
  62515. }
  62516. reqHeaders.Set("User-Agent", c.s.userAgent())
  62517. var body io.Reader = nil
  62518. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  62519. if err != nil {
  62520. return nil, err
  62521. }
  62522. reqHeaders.Set("Content-Type", "application/json")
  62523. c.urlParams_.Set("alt", alt)
  62524. c.urlParams_.Set("prettyPrint", "false")
  62525. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy")
  62526. urls += "?" + c.urlParams_.Encode()
  62527. req, err := http.NewRequest("POST", urls, body)
  62528. if err != nil {
  62529. return nil, err
  62530. }
  62531. req.Header = reqHeaders
  62532. googleapi.Expand(req.URL, map[string]string{
  62533. "project": c.project,
  62534. "zone": c.zone,
  62535. "resource": c.resource,
  62536. })
  62537. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62538. }
  62539. // Do executes the "compute.nodeGroups.setIamPolicy" call.
  62540. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  62541. // code is an error. Response headers are in either
  62542. // *Policy.ServerResponse.Header or (if a response was returned at all)
  62543. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  62544. // check whether the returned error was because http.StatusNotModified
  62545. // was returned.
  62546. func (c *NodeGroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  62547. gensupport.SetOptions(c.urlParams_, opts...)
  62548. res, err := c.doRequest("json")
  62549. if res != nil && res.StatusCode == http.StatusNotModified {
  62550. if res.Body != nil {
  62551. res.Body.Close()
  62552. }
  62553. return nil, &googleapi.Error{
  62554. Code: res.StatusCode,
  62555. Header: res.Header,
  62556. }
  62557. }
  62558. if err != nil {
  62559. return nil, err
  62560. }
  62561. defer googleapi.CloseBody(res)
  62562. if err := googleapi.CheckResponse(res); err != nil {
  62563. return nil, err
  62564. }
  62565. ret := &Policy{
  62566. ServerResponse: googleapi.ServerResponse{
  62567. Header: res.Header,
  62568. HTTPStatusCode: res.StatusCode,
  62569. },
  62570. }
  62571. target := &ret
  62572. if err := gensupport.DecodeResponse(target, res); err != nil {
  62573. return nil, err
  62574. }
  62575. return ret, nil
  62576. // {
  62577. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  62578. // "httpMethod": "POST",
  62579. // "id": "compute.nodeGroups.setIamPolicy",
  62580. // "parameterOrder": [
  62581. // "project",
  62582. // "zone",
  62583. // "resource"
  62584. // ],
  62585. // "parameters": {
  62586. // "project": {
  62587. // "description": "Project ID for this request.",
  62588. // "location": "path",
  62589. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62590. // "required": true,
  62591. // "type": "string"
  62592. // },
  62593. // "resource": {
  62594. // "description": "Name or id of the resource for this request.",
  62595. // "location": "path",
  62596. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62597. // "required": true,
  62598. // "type": "string"
  62599. // },
  62600. // "zone": {
  62601. // "description": "The name of the zone for this request.",
  62602. // "location": "path",
  62603. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62604. // "required": true,
  62605. // "type": "string"
  62606. // }
  62607. // },
  62608. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy",
  62609. // "request": {
  62610. // "$ref": "ZoneSetPolicyRequest"
  62611. // },
  62612. // "response": {
  62613. // "$ref": "Policy"
  62614. // },
  62615. // "scopes": [
  62616. // "https://www.googleapis.com/auth/cloud-platform",
  62617. // "https://www.googleapis.com/auth/compute"
  62618. // ]
  62619. // }
  62620. }
  62621. // method id "compute.nodeGroups.setNodeTemplate":
  62622. type NodeGroupsSetNodeTemplateCall struct {
  62623. s *Service
  62624. project string
  62625. zone string
  62626. nodeGroup string
  62627. nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest
  62628. urlParams_ gensupport.URLParams
  62629. ctx_ context.Context
  62630. header_ http.Header
  62631. }
  62632. // SetNodeTemplate: Updates the node template of the node group.
  62633. func (r *NodeGroupsService) SetNodeTemplate(project string, zone string, nodeGroup string, nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest) *NodeGroupsSetNodeTemplateCall {
  62634. c := &NodeGroupsSetNodeTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62635. c.project = project
  62636. c.zone = zone
  62637. c.nodeGroup = nodeGroup
  62638. c.nodegroupssetnodetemplaterequest = nodegroupssetnodetemplaterequest
  62639. return c
  62640. }
  62641. // RequestId sets the optional parameter "requestId": An optional
  62642. // request ID to identify requests. Specify a unique request ID so that
  62643. // if you must retry your request, the server will know to ignore the
  62644. // request if it has already been completed.
  62645. //
  62646. // For example, consider a situation where you make an initial request
  62647. // and the request times out. If you make the request again with the
  62648. // same request ID, the server can check if original operation with the
  62649. // same request ID was received, and if so, will ignore the second
  62650. // request. This prevents clients from accidentally creating duplicate
  62651. // commitments.
  62652. //
  62653. // The request ID must be a valid UUID with the exception that zero UUID
  62654. // is not supported (00000000-0000-0000-0000-000000000000).
  62655. func (c *NodeGroupsSetNodeTemplateCall) RequestId(requestId string) *NodeGroupsSetNodeTemplateCall {
  62656. c.urlParams_.Set("requestId", requestId)
  62657. return c
  62658. }
  62659. // Fields allows partial responses to be retrieved. See
  62660. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62661. // for more information.
  62662. func (c *NodeGroupsSetNodeTemplateCall) Fields(s ...googleapi.Field) *NodeGroupsSetNodeTemplateCall {
  62663. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62664. return c
  62665. }
  62666. // Context sets the context to be used in this call's Do method. Any
  62667. // pending HTTP request will be aborted if the provided context is
  62668. // canceled.
  62669. func (c *NodeGroupsSetNodeTemplateCall) Context(ctx context.Context) *NodeGroupsSetNodeTemplateCall {
  62670. c.ctx_ = ctx
  62671. return c
  62672. }
  62673. // Header returns an http.Header that can be modified by the caller to
  62674. // add HTTP headers to the request.
  62675. func (c *NodeGroupsSetNodeTemplateCall) Header() http.Header {
  62676. if c.header_ == nil {
  62677. c.header_ = make(http.Header)
  62678. }
  62679. return c.header_
  62680. }
  62681. func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) {
  62682. reqHeaders := make(http.Header)
  62683. for k, v := range c.header_ {
  62684. reqHeaders[k] = v
  62685. }
  62686. reqHeaders.Set("User-Agent", c.s.userAgent())
  62687. var body io.Reader = nil
  62688. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest)
  62689. if err != nil {
  62690. return nil, err
  62691. }
  62692. reqHeaders.Set("Content-Type", "application/json")
  62693. c.urlParams_.Set("alt", alt)
  62694. c.urlParams_.Set("prettyPrint", "false")
  62695. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate")
  62696. urls += "?" + c.urlParams_.Encode()
  62697. req, err := http.NewRequest("POST", urls, body)
  62698. if err != nil {
  62699. return nil, err
  62700. }
  62701. req.Header = reqHeaders
  62702. googleapi.Expand(req.URL, map[string]string{
  62703. "project": c.project,
  62704. "zone": c.zone,
  62705. "nodeGroup": c.nodeGroup,
  62706. })
  62707. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62708. }
  62709. // Do executes the "compute.nodeGroups.setNodeTemplate" call.
  62710. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62711. // status code is an error. Response headers are in either
  62712. // *Operation.ServerResponse.Header or (if a response was returned at
  62713. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62714. // to check whether the returned error was because
  62715. // http.StatusNotModified was returned.
  62716. func (c *NodeGroupsSetNodeTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62717. gensupport.SetOptions(c.urlParams_, opts...)
  62718. res, err := c.doRequest("json")
  62719. if res != nil && res.StatusCode == http.StatusNotModified {
  62720. if res.Body != nil {
  62721. res.Body.Close()
  62722. }
  62723. return nil, &googleapi.Error{
  62724. Code: res.StatusCode,
  62725. Header: res.Header,
  62726. }
  62727. }
  62728. if err != nil {
  62729. return nil, err
  62730. }
  62731. defer googleapi.CloseBody(res)
  62732. if err := googleapi.CheckResponse(res); err != nil {
  62733. return nil, err
  62734. }
  62735. ret := &Operation{
  62736. ServerResponse: googleapi.ServerResponse{
  62737. Header: res.Header,
  62738. HTTPStatusCode: res.StatusCode,
  62739. },
  62740. }
  62741. target := &ret
  62742. if err := gensupport.DecodeResponse(target, res); err != nil {
  62743. return nil, err
  62744. }
  62745. return ret, nil
  62746. // {
  62747. // "description": "Updates the node template of the node group.",
  62748. // "httpMethod": "POST",
  62749. // "id": "compute.nodeGroups.setNodeTemplate",
  62750. // "parameterOrder": [
  62751. // "project",
  62752. // "zone",
  62753. // "nodeGroup"
  62754. // ],
  62755. // "parameters": {
  62756. // "nodeGroup": {
  62757. // "description": "Name of the NodeGroup resource to update.",
  62758. // "location": "path",
  62759. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62760. // "required": true,
  62761. // "type": "string"
  62762. // },
  62763. // "project": {
  62764. // "description": "Project ID for this request.",
  62765. // "location": "path",
  62766. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62767. // "required": true,
  62768. // "type": "string"
  62769. // },
  62770. // "requestId": {
  62771. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62772. // "location": "query",
  62773. // "type": "string"
  62774. // },
  62775. // "zone": {
  62776. // "description": "The name of the zone for this request.",
  62777. // "location": "path",
  62778. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62779. // "required": true,
  62780. // "type": "string"
  62781. // }
  62782. // },
  62783. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate",
  62784. // "request": {
  62785. // "$ref": "NodeGroupsSetNodeTemplateRequest"
  62786. // },
  62787. // "response": {
  62788. // "$ref": "Operation"
  62789. // },
  62790. // "scopes": [
  62791. // "https://www.googleapis.com/auth/cloud-platform",
  62792. // "https://www.googleapis.com/auth/compute"
  62793. // ]
  62794. // }
  62795. }
  62796. // method id "compute.nodeGroups.testIamPermissions":
  62797. type NodeGroupsTestIamPermissionsCall struct {
  62798. s *Service
  62799. project string
  62800. zone string
  62801. resource string
  62802. testpermissionsrequest *TestPermissionsRequest
  62803. urlParams_ gensupport.URLParams
  62804. ctx_ context.Context
  62805. header_ http.Header
  62806. }
  62807. // TestIamPermissions: Returns permissions that a caller has on the
  62808. // specified resource.
  62809. func (r *NodeGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeGroupsTestIamPermissionsCall {
  62810. c := &NodeGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62811. c.project = project
  62812. c.zone = zone
  62813. c.resource = resource
  62814. c.testpermissionsrequest = testpermissionsrequest
  62815. return c
  62816. }
  62817. // Fields allows partial responses to be retrieved. See
  62818. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62819. // for more information.
  62820. func (c *NodeGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeGroupsTestIamPermissionsCall {
  62821. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62822. return c
  62823. }
  62824. // Context sets the context to be used in this call's Do method. Any
  62825. // pending HTTP request will be aborted if the provided context is
  62826. // canceled.
  62827. func (c *NodeGroupsTestIamPermissionsCall) Context(ctx context.Context) *NodeGroupsTestIamPermissionsCall {
  62828. c.ctx_ = ctx
  62829. return c
  62830. }
  62831. // Header returns an http.Header that can be modified by the caller to
  62832. // add HTTP headers to the request.
  62833. func (c *NodeGroupsTestIamPermissionsCall) Header() http.Header {
  62834. if c.header_ == nil {
  62835. c.header_ = make(http.Header)
  62836. }
  62837. return c.header_
  62838. }
  62839. func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  62840. reqHeaders := make(http.Header)
  62841. for k, v := range c.header_ {
  62842. reqHeaders[k] = v
  62843. }
  62844. reqHeaders.Set("User-Agent", c.s.userAgent())
  62845. var body io.Reader = nil
  62846. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  62847. if err != nil {
  62848. return nil, err
  62849. }
  62850. reqHeaders.Set("Content-Type", "application/json")
  62851. c.urlParams_.Set("alt", alt)
  62852. c.urlParams_.Set("prettyPrint", "false")
  62853. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions")
  62854. urls += "?" + c.urlParams_.Encode()
  62855. req, err := http.NewRequest("POST", urls, body)
  62856. if err != nil {
  62857. return nil, err
  62858. }
  62859. req.Header = reqHeaders
  62860. googleapi.Expand(req.URL, map[string]string{
  62861. "project": c.project,
  62862. "zone": c.zone,
  62863. "resource": c.resource,
  62864. })
  62865. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62866. }
  62867. // Do executes the "compute.nodeGroups.testIamPermissions" call.
  62868. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  62869. // non-2xx status code is an error. Response headers are in either
  62870. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  62871. // returned at all) in error.(*googleapi.Error).Header. Use
  62872. // googleapi.IsNotModified to check whether the returned error was
  62873. // because http.StatusNotModified was returned.
  62874. func (c *NodeGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  62875. gensupport.SetOptions(c.urlParams_, opts...)
  62876. res, err := c.doRequest("json")
  62877. if res != nil && res.StatusCode == http.StatusNotModified {
  62878. if res.Body != nil {
  62879. res.Body.Close()
  62880. }
  62881. return nil, &googleapi.Error{
  62882. Code: res.StatusCode,
  62883. Header: res.Header,
  62884. }
  62885. }
  62886. if err != nil {
  62887. return nil, err
  62888. }
  62889. defer googleapi.CloseBody(res)
  62890. if err := googleapi.CheckResponse(res); err != nil {
  62891. return nil, err
  62892. }
  62893. ret := &TestPermissionsResponse{
  62894. ServerResponse: googleapi.ServerResponse{
  62895. Header: res.Header,
  62896. HTTPStatusCode: res.StatusCode,
  62897. },
  62898. }
  62899. target := &ret
  62900. if err := gensupport.DecodeResponse(target, res); err != nil {
  62901. return nil, err
  62902. }
  62903. return ret, nil
  62904. // {
  62905. // "description": "Returns permissions that a caller has on the specified resource.",
  62906. // "httpMethod": "POST",
  62907. // "id": "compute.nodeGroups.testIamPermissions",
  62908. // "parameterOrder": [
  62909. // "project",
  62910. // "zone",
  62911. // "resource"
  62912. // ],
  62913. // "parameters": {
  62914. // "project": {
  62915. // "description": "Project ID for this request.",
  62916. // "location": "path",
  62917. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62918. // "required": true,
  62919. // "type": "string"
  62920. // },
  62921. // "resource": {
  62922. // "description": "Name or id of the resource for this request.",
  62923. // "location": "path",
  62924. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62925. // "required": true,
  62926. // "type": "string"
  62927. // },
  62928. // "zone": {
  62929. // "description": "The name of the zone for this request.",
  62930. // "location": "path",
  62931. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62932. // "required": true,
  62933. // "type": "string"
  62934. // }
  62935. // },
  62936. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions",
  62937. // "request": {
  62938. // "$ref": "TestPermissionsRequest"
  62939. // },
  62940. // "response": {
  62941. // "$ref": "TestPermissionsResponse"
  62942. // },
  62943. // "scopes": [
  62944. // "https://www.googleapis.com/auth/cloud-platform",
  62945. // "https://www.googleapis.com/auth/compute",
  62946. // "https://www.googleapis.com/auth/compute.readonly"
  62947. // ]
  62948. // }
  62949. }
  62950. // method id "compute.nodeTemplates.aggregatedList":
  62951. type NodeTemplatesAggregatedListCall struct {
  62952. s *Service
  62953. project string
  62954. urlParams_ gensupport.URLParams
  62955. ifNoneMatch_ string
  62956. ctx_ context.Context
  62957. header_ http.Header
  62958. }
  62959. // AggregatedList: Retrieves an aggregated list of node templates.
  62960. func (r *NodeTemplatesService) AggregatedList(project string) *NodeTemplatesAggregatedListCall {
  62961. c := &NodeTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62962. c.project = project
  62963. return c
  62964. }
  62965. // Filter sets the optional parameter "filter": A filter expression that
  62966. // filters resources listed in the response. The expression must specify
  62967. // the field name, a comparison operator, and the value that you want to
  62968. // use for filtering. The value must be a string, a number, or a
  62969. // boolean. The comparison operator must be either =, !=, >, or <.
  62970. //
  62971. // For example, if you are filtering Compute Engine instances, you can
  62972. // exclude instances named example-instance by specifying name !=
  62973. // example-instance.
  62974. //
  62975. // You can also filter nested fields. For example, you could specify
  62976. // scheduling.automaticRestart = false to include instances only if they
  62977. // are not scheduled for automatic restarts. You can use filtering on
  62978. // nested fields to filter based on resource labels.
  62979. //
  62980. // To filter on multiple expressions, provide each separate expression
  62981. // within parentheses. For example, (scheduling.automaticRestart = true)
  62982. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62983. // AND expression. However, you can include AND and OR expressions
  62984. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62985. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62986. // true).
  62987. func (c *NodeTemplatesAggregatedListCall) Filter(filter string) *NodeTemplatesAggregatedListCall {
  62988. c.urlParams_.Set("filter", filter)
  62989. return c
  62990. }
  62991. // MaxResults sets the optional parameter "maxResults": The maximum
  62992. // number of results per page that should be returned. If the number of
  62993. // available results is larger than maxResults, Compute Engine returns a
  62994. // nextPageToken that can be used to get the next page of results in
  62995. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62996. // (Default: 500)
  62997. func (c *NodeTemplatesAggregatedListCall) MaxResults(maxResults int64) *NodeTemplatesAggregatedListCall {
  62998. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62999. return c
  63000. }
  63001. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  63002. // a certain order. By default, results are returned in alphanumerical
  63003. // order based on the resource name.
  63004. //
  63005. // You can also sort results in descending order based on the creation
  63006. // timestamp using orderBy="creationTimestamp desc". This sorts results
  63007. // based on the creationTimestamp field in reverse chronological order
  63008. // (newest result first). Use this to sort resources like operations so
  63009. // that the newest operation is returned first.
  63010. //
  63011. // Currently, only sorting by name or creationTimestamp desc is
  63012. // supported.
  63013. func (c *NodeTemplatesAggregatedListCall) OrderBy(orderBy string) *NodeTemplatesAggregatedListCall {
  63014. c.urlParams_.Set("orderBy", orderBy)
  63015. return c
  63016. }
  63017. // PageToken sets the optional parameter "pageToken": Specifies a page
  63018. // token to use. Set pageToken to the nextPageToken returned by a
  63019. // previous list request to get the next page of results.
  63020. func (c *NodeTemplatesAggregatedListCall) PageToken(pageToken string) *NodeTemplatesAggregatedListCall {
  63021. c.urlParams_.Set("pageToken", pageToken)
  63022. return c
  63023. }
  63024. // Fields allows partial responses to be retrieved. See
  63025. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63026. // for more information.
  63027. func (c *NodeTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTemplatesAggregatedListCall {
  63028. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63029. return c
  63030. }
  63031. // IfNoneMatch sets the optional parameter which makes the operation
  63032. // fail if the object's ETag matches the given value. This is useful for
  63033. // getting updates only after the object has changed since the last
  63034. // request. Use googleapi.IsNotModified to check whether the response
  63035. // error from Do is the result of In-None-Match.
  63036. func (c *NodeTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTemplatesAggregatedListCall {
  63037. c.ifNoneMatch_ = entityTag
  63038. return c
  63039. }
  63040. // Context sets the context to be used in this call's Do method. Any
  63041. // pending HTTP request will be aborted if the provided context is
  63042. // canceled.
  63043. func (c *NodeTemplatesAggregatedListCall) Context(ctx context.Context) *NodeTemplatesAggregatedListCall {
  63044. c.ctx_ = ctx
  63045. return c
  63046. }
  63047. // Header returns an http.Header that can be modified by the caller to
  63048. // add HTTP headers to the request.
  63049. func (c *NodeTemplatesAggregatedListCall) Header() http.Header {
  63050. if c.header_ == nil {
  63051. c.header_ = make(http.Header)
  63052. }
  63053. return c.header_
  63054. }
  63055. func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  63056. reqHeaders := make(http.Header)
  63057. for k, v := range c.header_ {
  63058. reqHeaders[k] = v
  63059. }
  63060. reqHeaders.Set("User-Agent", c.s.userAgent())
  63061. if c.ifNoneMatch_ != "" {
  63062. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63063. }
  63064. var body io.Reader = nil
  63065. c.urlParams_.Set("alt", alt)
  63066. c.urlParams_.Set("prettyPrint", "false")
  63067. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTemplates")
  63068. urls += "?" + c.urlParams_.Encode()
  63069. req, err := http.NewRequest("GET", urls, body)
  63070. if err != nil {
  63071. return nil, err
  63072. }
  63073. req.Header = reqHeaders
  63074. googleapi.Expand(req.URL, map[string]string{
  63075. "project": c.project,
  63076. })
  63077. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63078. }
  63079. // Do executes the "compute.nodeTemplates.aggregatedList" call.
  63080. // Exactly one of *NodeTemplateAggregatedList or error will be non-nil.
  63081. // Any non-2xx status code is an error. Response headers are in either
  63082. // *NodeTemplateAggregatedList.ServerResponse.Header or (if a response
  63083. // was returned at all) in error.(*googleapi.Error).Header. Use
  63084. // googleapi.IsNotModified to check whether the returned error was
  63085. // because http.StatusNotModified was returned.
  63086. func (c *NodeTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateAggregatedList, error) {
  63087. gensupport.SetOptions(c.urlParams_, opts...)
  63088. res, err := c.doRequest("json")
  63089. if res != nil && res.StatusCode == http.StatusNotModified {
  63090. if res.Body != nil {
  63091. res.Body.Close()
  63092. }
  63093. return nil, &googleapi.Error{
  63094. Code: res.StatusCode,
  63095. Header: res.Header,
  63096. }
  63097. }
  63098. if err != nil {
  63099. return nil, err
  63100. }
  63101. defer googleapi.CloseBody(res)
  63102. if err := googleapi.CheckResponse(res); err != nil {
  63103. return nil, err
  63104. }
  63105. ret := &NodeTemplateAggregatedList{
  63106. ServerResponse: googleapi.ServerResponse{
  63107. Header: res.Header,
  63108. HTTPStatusCode: res.StatusCode,
  63109. },
  63110. }
  63111. target := &ret
  63112. if err := gensupport.DecodeResponse(target, res); err != nil {
  63113. return nil, err
  63114. }
  63115. return ret, nil
  63116. // {
  63117. // "description": "Retrieves an aggregated list of node templates.",
  63118. // "httpMethod": "GET",
  63119. // "id": "compute.nodeTemplates.aggregatedList",
  63120. // "parameterOrder": [
  63121. // "project"
  63122. // ],
  63123. // "parameters": {
  63124. // "filter": {
  63125. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  63126. // "location": "query",
  63127. // "type": "string"
  63128. // },
  63129. // "maxResults": {
  63130. // "default": "500",
  63131. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  63132. // "format": "uint32",
  63133. // "location": "query",
  63134. // "minimum": "0",
  63135. // "type": "integer"
  63136. // },
  63137. // "orderBy": {
  63138. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  63139. // "location": "query",
  63140. // "type": "string"
  63141. // },
  63142. // "pageToken": {
  63143. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  63144. // "location": "query",
  63145. // "type": "string"
  63146. // },
  63147. // "project": {
  63148. // "description": "Project ID for this request.",
  63149. // "location": "path",
  63150. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63151. // "required": true,
  63152. // "type": "string"
  63153. // }
  63154. // },
  63155. // "path": "{project}/aggregated/nodeTemplates",
  63156. // "response": {
  63157. // "$ref": "NodeTemplateAggregatedList"
  63158. // },
  63159. // "scopes": [
  63160. // "https://www.googleapis.com/auth/cloud-platform",
  63161. // "https://www.googleapis.com/auth/compute",
  63162. // "https://www.googleapis.com/auth/compute.readonly"
  63163. // ]
  63164. // }
  63165. }
  63166. // Pages invokes f for each page of results.
  63167. // A non-nil error returned from f will halt the iteration.
  63168. // The provided context supersedes any context provided to the Context method.
  63169. func (c *NodeTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTemplateAggregatedList) error) error {
  63170. c.ctx_ = ctx
  63171. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  63172. for {
  63173. x, err := c.Do()
  63174. if err != nil {
  63175. return err
  63176. }
  63177. if err := f(x); err != nil {
  63178. return err
  63179. }
  63180. if x.NextPageToken == "" {
  63181. return nil
  63182. }
  63183. c.PageToken(x.NextPageToken)
  63184. }
  63185. }
  63186. // method id "compute.nodeTemplates.delete":
  63187. type NodeTemplatesDeleteCall struct {
  63188. s *Service
  63189. project string
  63190. region string
  63191. nodeTemplate string
  63192. urlParams_ gensupport.URLParams
  63193. ctx_ context.Context
  63194. header_ http.Header
  63195. }
  63196. // Delete: Deletes the specified NodeTemplate resource.
  63197. func (r *NodeTemplatesService) Delete(project string, region string, nodeTemplate string) *NodeTemplatesDeleteCall {
  63198. c := &NodeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63199. c.project = project
  63200. c.region = region
  63201. c.nodeTemplate = nodeTemplate
  63202. return c
  63203. }
  63204. // RequestId sets the optional parameter "requestId": An optional
  63205. // request ID to identify requests. Specify a unique request ID so that
  63206. // if you must retry your request, the server will know to ignore the
  63207. // request if it has already been completed.
  63208. //
  63209. // For example, consider a situation where you make an initial request
  63210. // and the request times out. If you make the request again with the
  63211. // same request ID, the server can check if original operation with the
  63212. // same request ID was received, and if so, will ignore the second
  63213. // request. This prevents clients from accidentally creating duplicate
  63214. // commitments.
  63215. //
  63216. // The request ID must be a valid UUID with the exception that zero UUID
  63217. // is not supported (00000000-0000-0000-0000-000000000000).
  63218. func (c *NodeTemplatesDeleteCall) RequestId(requestId string) *NodeTemplatesDeleteCall {
  63219. c.urlParams_.Set("requestId", requestId)
  63220. return c
  63221. }
  63222. // Fields allows partial responses to be retrieved. See
  63223. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63224. // for more information.
  63225. func (c *NodeTemplatesDeleteCall) Fields(s ...googleapi.Field) *NodeTemplatesDeleteCall {
  63226. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63227. return c
  63228. }
  63229. // Context sets the context to be used in this call's Do method. Any
  63230. // pending HTTP request will be aborted if the provided context is
  63231. // canceled.
  63232. func (c *NodeTemplatesDeleteCall) Context(ctx context.Context) *NodeTemplatesDeleteCall {
  63233. c.ctx_ = ctx
  63234. return c
  63235. }
  63236. // Header returns an http.Header that can be modified by the caller to
  63237. // add HTTP headers to the request.
  63238. func (c *NodeTemplatesDeleteCall) Header() http.Header {
  63239. if c.header_ == nil {
  63240. c.header_ = make(http.Header)
  63241. }
  63242. return c.header_
  63243. }
  63244. func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  63245. reqHeaders := make(http.Header)
  63246. for k, v := range c.header_ {
  63247. reqHeaders[k] = v
  63248. }
  63249. reqHeaders.Set("User-Agent", c.s.userAgent())
  63250. var body io.Reader = nil
  63251. c.urlParams_.Set("alt", alt)
  63252. c.urlParams_.Set("prettyPrint", "false")
  63253. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  63254. urls += "?" + c.urlParams_.Encode()
  63255. req, err := http.NewRequest("DELETE", urls, body)
  63256. if err != nil {
  63257. return nil, err
  63258. }
  63259. req.Header = reqHeaders
  63260. googleapi.Expand(req.URL, map[string]string{
  63261. "project": c.project,
  63262. "region": c.region,
  63263. "nodeTemplate": c.nodeTemplate,
  63264. })
  63265. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63266. }
  63267. // Do executes the "compute.nodeTemplates.delete" call.
  63268. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63269. // status code is an error. Response headers are in either
  63270. // *Operation.ServerResponse.Header or (if a response was returned at
  63271. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63272. // to check whether the returned error was because
  63273. // http.StatusNotModified was returned.
  63274. func (c *NodeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63275. gensupport.SetOptions(c.urlParams_, opts...)
  63276. res, err := c.doRequest("json")
  63277. if res != nil && res.StatusCode == http.StatusNotModified {
  63278. if res.Body != nil {
  63279. res.Body.Close()
  63280. }
  63281. return nil, &googleapi.Error{
  63282. Code: res.StatusCode,
  63283. Header: res.Header,
  63284. }
  63285. }
  63286. if err != nil {
  63287. return nil, err
  63288. }
  63289. defer googleapi.CloseBody(res)
  63290. if err := googleapi.CheckResponse(res); err != nil {
  63291. return nil, err
  63292. }
  63293. ret := &Operation{
  63294. ServerResponse: googleapi.ServerResponse{
  63295. Header: res.Header,
  63296. HTTPStatusCode: res.StatusCode,
  63297. },
  63298. }
  63299. target := &ret
  63300. if err := gensupport.DecodeResponse(target, res); err != nil {
  63301. return nil, err
  63302. }
  63303. return ret, nil
  63304. // {
  63305. // "description": "Deletes the specified NodeTemplate resource.",
  63306. // "httpMethod": "DELETE",
  63307. // "id": "compute.nodeTemplates.delete",
  63308. // "parameterOrder": [
  63309. // "project",
  63310. // "region",
  63311. // "nodeTemplate"
  63312. // ],
  63313. // "parameters": {
  63314. // "nodeTemplate": {
  63315. // "description": "Name of the NodeTemplate resource to delete.",
  63316. // "location": "path",
  63317. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63318. // "required": true,
  63319. // "type": "string"
  63320. // },
  63321. // "project": {
  63322. // "description": "Project ID for this request.",
  63323. // "location": "path",
  63324. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63325. // "required": true,
  63326. // "type": "string"
  63327. // },
  63328. // "region": {
  63329. // "description": "The name of the region for this request.",
  63330. // "location": "path",
  63331. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63332. // "required": true,
  63333. // "type": "string"
  63334. // },
  63335. // "requestId": {
  63336. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63337. // "location": "query",
  63338. // "type": "string"
  63339. // }
  63340. // },
  63341. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  63342. // "response": {
  63343. // "$ref": "Operation"
  63344. // },
  63345. // "scopes": [
  63346. // "https://www.googleapis.com/auth/cloud-platform",
  63347. // "https://www.googleapis.com/auth/compute"
  63348. // ]
  63349. // }
  63350. }
  63351. // method id "compute.nodeTemplates.get":
  63352. type NodeTemplatesGetCall struct {
  63353. s *Service
  63354. project string
  63355. region string
  63356. nodeTemplate string
  63357. urlParams_ gensupport.URLParams
  63358. ifNoneMatch_ string
  63359. ctx_ context.Context
  63360. header_ http.Header
  63361. }
  63362. // Get: Returns the specified node template. Gets a list of available
  63363. // node templates by making a list() request.
  63364. func (r *NodeTemplatesService) Get(project string, region string, nodeTemplate string) *NodeTemplatesGetCall {
  63365. c := &NodeTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63366. c.project = project
  63367. c.region = region
  63368. c.nodeTemplate = nodeTemplate
  63369. return c
  63370. }
  63371. // Fields allows partial responses to be retrieved. See
  63372. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63373. // for more information.
  63374. func (c *NodeTemplatesGetCall) Fields(s ...googleapi.Field) *NodeTemplatesGetCall {
  63375. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63376. return c
  63377. }
  63378. // IfNoneMatch sets the optional parameter which makes the operation
  63379. // fail if the object's ETag matches the given value. This is useful for
  63380. // getting updates only after the object has changed since the last
  63381. // request. Use googleapi.IsNotModified to check whether the response
  63382. // error from Do is the result of In-None-Match.
  63383. func (c *NodeTemplatesGetCall) IfNoneMatch(entityTag string) *NodeTemplatesGetCall {
  63384. c.ifNoneMatch_ = entityTag
  63385. return c
  63386. }
  63387. // Context sets the context to be used in this call's Do method. Any
  63388. // pending HTTP request will be aborted if the provided context is
  63389. // canceled.
  63390. func (c *NodeTemplatesGetCall) Context(ctx context.Context) *NodeTemplatesGetCall {
  63391. c.ctx_ = ctx
  63392. return c
  63393. }
  63394. // Header returns an http.Header that can be modified by the caller to
  63395. // add HTTP headers to the request.
  63396. func (c *NodeTemplatesGetCall) Header() http.Header {
  63397. if c.header_ == nil {
  63398. c.header_ = make(http.Header)
  63399. }
  63400. return c.header_
  63401. }
  63402. func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  63403. reqHeaders := make(http.Header)
  63404. for k, v := range c.header_ {
  63405. reqHeaders[k] = v
  63406. }
  63407. reqHeaders.Set("User-Agent", c.s.userAgent())
  63408. if c.ifNoneMatch_ != "" {
  63409. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63410. }
  63411. var body io.Reader = nil
  63412. c.urlParams_.Set("alt", alt)
  63413. c.urlParams_.Set("prettyPrint", "false")
  63414. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  63415. urls += "?" + c.urlParams_.Encode()
  63416. req, err := http.NewRequest("GET", urls, body)
  63417. if err != nil {
  63418. return nil, err
  63419. }
  63420. req.Header = reqHeaders
  63421. googleapi.Expand(req.URL, map[string]string{
  63422. "project": c.project,
  63423. "region": c.region,
  63424. "nodeTemplate": c.nodeTemplate,
  63425. })
  63426. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63427. }
  63428. // Do executes the "compute.nodeTemplates.get" call.
  63429. // Exactly one of *NodeTemplate or error will be non-nil. Any non-2xx
  63430. // status code is an error. Response headers are in either
  63431. // *NodeTemplate.ServerResponse.Header or (if a response was returned at
  63432. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63433. // to check whether the returned error was because
  63434. // http.StatusNotModified was returned.
  63435. func (c *NodeTemplatesGetCall) Do(opts ...googleapi.CallOption) (*NodeTemplate, error) {
  63436. gensupport.SetOptions(c.urlParams_, opts...)
  63437. res, err := c.doRequest("json")
  63438. if res != nil && res.StatusCode == http.StatusNotModified {
  63439. if res.Body != nil {
  63440. res.Body.Close()
  63441. }
  63442. return nil, &googleapi.Error{
  63443. Code: res.StatusCode,
  63444. Header: res.Header,
  63445. }
  63446. }
  63447. if err != nil {
  63448. return nil, err
  63449. }
  63450. defer googleapi.CloseBody(res)
  63451. if err := googleapi.CheckResponse(res); err != nil {
  63452. return nil, err
  63453. }
  63454. ret := &NodeTemplate{
  63455. ServerResponse: googleapi.ServerResponse{
  63456. Header: res.Header,
  63457. HTTPStatusCode: res.StatusCode,
  63458. },
  63459. }
  63460. target := &ret
  63461. if err := gensupport.DecodeResponse(target, res); err != nil {
  63462. return nil, err
  63463. }
  63464. return ret, nil
  63465. // {
  63466. // "description": "Returns the specified node template. Gets a list of available node templates by making a list() request.",
  63467. // "httpMethod": "GET",
  63468. // "id": "compute.nodeTemplates.get",
  63469. // "parameterOrder": [
  63470. // "project",
  63471. // "region",
  63472. // "nodeTemplate"
  63473. // ],
  63474. // "parameters": {
  63475. // "nodeTemplate": {
  63476. // "description": "Name of the node template to return.",
  63477. // "location": "path",
  63478. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63479. // "required": true,
  63480. // "type": "string"
  63481. // },
  63482. // "project": {
  63483. // "description": "Project ID for this request.",
  63484. // "location": "path",
  63485. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63486. // "required": true,
  63487. // "type": "string"
  63488. // },
  63489. // "region": {
  63490. // "description": "The name of the region for this request.",
  63491. // "location": "path",
  63492. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63493. // "required": true,
  63494. // "type": "string"
  63495. // }
  63496. // },
  63497. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  63498. // "response": {
  63499. // "$ref": "NodeTemplate"
  63500. // },
  63501. // "scopes": [
  63502. // "https://www.googleapis.com/auth/cloud-platform",
  63503. // "https://www.googleapis.com/auth/compute",
  63504. // "https://www.googleapis.com/auth/compute.readonly"
  63505. // ]
  63506. // }
  63507. }
  63508. // method id "compute.nodeTemplates.getIamPolicy":
  63509. type NodeTemplatesGetIamPolicyCall struct {
  63510. s *Service
  63511. project string
  63512. region string
  63513. resource string
  63514. urlParams_ gensupport.URLParams
  63515. ifNoneMatch_ string
  63516. ctx_ context.Context
  63517. header_ http.Header
  63518. }
  63519. // GetIamPolicy: Gets the access control policy for a resource. May be
  63520. // empty if no such policy or resource exists.
  63521. func (r *NodeTemplatesService) GetIamPolicy(project string, region string, resource string) *NodeTemplatesGetIamPolicyCall {
  63522. c := &NodeTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63523. c.project = project
  63524. c.region = region
  63525. c.resource = resource
  63526. return c
  63527. }
  63528. // Fields allows partial responses to be retrieved. See
  63529. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63530. // for more information.
  63531. func (c *NodeTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesGetIamPolicyCall {
  63532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63533. return c
  63534. }
  63535. // IfNoneMatch sets the optional parameter which makes the operation
  63536. // fail if the object's ETag matches the given value. This is useful for
  63537. // getting updates only after the object has changed since the last
  63538. // request. Use googleapi.IsNotModified to check whether the response
  63539. // error from Do is the result of In-None-Match.
  63540. func (c *NodeTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeTemplatesGetIamPolicyCall {
  63541. c.ifNoneMatch_ = entityTag
  63542. return c
  63543. }
  63544. // Context sets the context to be used in this call's Do method. Any
  63545. // pending HTTP request will be aborted if the provided context is
  63546. // canceled.
  63547. func (c *NodeTemplatesGetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesGetIamPolicyCall {
  63548. c.ctx_ = ctx
  63549. return c
  63550. }
  63551. // Header returns an http.Header that can be modified by the caller to
  63552. // add HTTP headers to the request.
  63553. func (c *NodeTemplatesGetIamPolicyCall) Header() http.Header {
  63554. if c.header_ == nil {
  63555. c.header_ = make(http.Header)
  63556. }
  63557. return c.header_
  63558. }
  63559. func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  63560. reqHeaders := make(http.Header)
  63561. for k, v := range c.header_ {
  63562. reqHeaders[k] = v
  63563. }
  63564. reqHeaders.Set("User-Agent", c.s.userAgent())
  63565. if c.ifNoneMatch_ != "" {
  63566. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63567. }
  63568. var body io.Reader = nil
  63569. c.urlParams_.Set("alt", alt)
  63570. c.urlParams_.Set("prettyPrint", "false")
  63571. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy")
  63572. urls += "?" + c.urlParams_.Encode()
  63573. req, err := http.NewRequest("GET", urls, body)
  63574. if err != nil {
  63575. return nil, err
  63576. }
  63577. req.Header = reqHeaders
  63578. googleapi.Expand(req.URL, map[string]string{
  63579. "project": c.project,
  63580. "region": c.region,
  63581. "resource": c.resource,
  63582. })
  63583. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63584. }
  63585. // Do executes the "compute.nodeTemplates.getIamPolicy" call.
  63586. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  63587. // code is an error. Response headers are in either
  63588. // *Policy.ServerResponse.Header or (if a response was returned at all)
  63589. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  63590. // check whether the returned error was because http.StatusNotModified
  63591. // was returned.
  63592. func (c *NodeTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  63593. gensupport.SetOptions(c.urlParams_, opts...)
  63594. res, err := c.doRequest("json")
  63595. if res != nil && res.StatusCode == http.StatusNotModified {
  63596. if res.Body != nil {
  63597. res.Body.Close()
  63598. }
  63599. return nil, &googleapi.Error{
  63600. Code: res.StatusCode,
  63601. Header: res.Header,
  63602. }
  63603. }
  63604. if err != nil {
  63605. return nil, err
  63606. }
  63607. defer googleapi.CloseBody(res)
  63608. if err := googleapi.CheckResponse(res); err != nil {
  63609. return nil, err
  63610. }
  63611. ret := &Policy{
  63612. ServerResponse: googleapi.ServerResponse{
  63613. Header: res.Header,
  63614. HTTPStatusCode: res.StatusCode,
  63615. },
  63616. }
  63617. target := &ret
  63618. if err := gensupport.DecodeResponse(target, res); err != nil {
  63619. return nil, err
  63620. }
  63621. return ret, nil
  63622. // {
  63623. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  63624. // "httpMethod": "GET",
  63625. // "id": "compute.nodeTemplates.getIamPolicy",
  63626. // "parameterOrder": [
  63627. // "project",
  63628. // "region",
  63629. // "resource"
  63630. // ],
  63631. // "parameters": {
  63632. // "project": {
  63633. // "description": "Project ID for this request.",
  63634. // "location": "path",
  63635. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63636. // "required": true,
  63637. // "type": "string"
  63638. // },
  63639. // "region": {
  63640. // "description": "The name of the region for this request.",
  63641. // "location": "path",
  63642. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63643. // "required": true,
  63644. // "type": "string"
  63645. // },
  63646. // "resource": {
  63647. // "description": "Name or id of the resource for this request.",
  63648. // "location": "path",
  63649. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63650. // "required": true,
  63651. // "type": "string"
  63652. // }
  63653. // },
  63654. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy",
  63655. // "response": {
  63656. // "$ref": "Policy"
  63657. // },
  63658. // "scopes": [
  63659. // "https://www.googleapis.com/auth/cloud-platform",
  63660. // "https://www.googleapis.com/auth/compute",
  63661. // "https://www.googleapis.com/auth/compute.readonly"
  63662. // ]
  63663. // }
  63664. }
  63665. // method id "compute.nodeTemplates.insert":
  63666. type NodeTemplatesInsertCall struct {
  63667. s *Service
  63668. project string
  63669. region string
  63670. nodetemplate *NodeTemplate
  63671. urlParams_ gensupport.URLParams
  63672. ctx_ context.Context
  63673. header_ http.Header
  63674. }
  63675. // Insert: Creates a NodeTemplate resource in the specified project
  63676. // using the data included in the request.
  63677. func (r *NodeTemplatesService) Insert(project string, region string, nodetemplate *NodeTemplate) *NodeTemplatesInsertCall {
  63678. c := &NodeTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63679. c.project = project
  63680. c.region = region
  63681. c.nodetemplate = nodetemplate
  63682. return c
  63683. }
  63684. // RequestId sets the optional parameter "requestId": An optional
  63685. // request ID to identify requests. Specify a unique request ID so that
  63686. // if you must retry your request, the server will know to ignore the
  63687. // request if it has already been completed.
  63688. //
  63689. // For example, consider a situation where you make an initial request
  63690. // and the request times out. If you make the request again with the
  63691. // same request ID, the server can check if original operation with the
  63692. // same request ID was received, and if so, will ignore the second
  63693. // request. This prevents clients from accidentally creating duplicate
  63694. // commitments.
  63695. //
  63696. // The request ID must be a valid UUID with the exception that zero UUID
  63697. // is not supported (00000000-0000-0000-0000-000000000000).
  63698. func (c *NodeTemplatesInsertCall) RequestId(requestId string) *NodeTemplatesInsertCall {
  63699. c.urlParams_.Set("requestId", requestId)
  63700. return c
  63701. }
  63702. // Fields allows partial responses to be retrieved. See
  63703. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63704. // for more information.
  63705. func (c *NodeTemplatesInsertCall) Fields(s ...googleapi.Field) *NodeTemplatesInsertCall {
  63706. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63707. return c
  63708. }
  63709. // Context sets the context to be used in this call's Do method. Any
  63710. // pending HTTP request will be aborted if the provided context is
  63711. // canceled.
  63712. func (c *NodeTemplatesInsertCall) Context(ctx context.Context) *NodeTemplatesInsertCall {
  63713. c.ctx_ = ctx
  63714. return c
  63715. }
  63716. // Header returns an http.Header that can be modified by the caller to
  63717. // add HTTP headers to the request.
  63718. func (c *NodeTemplatesInsertCall) Header() http.Header {
  63719. if c.header_ == nil {
  63720. c.header_ = make(http.Header)
  63721. }
  63722. return c.header_
  63723. }
  63724. func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  63725. reqHeaders := make(http.Header)
  63726. for k, v := range c.header_ {
  63727. reqHeaders[k] = v
  63728. }
  63729. reqHeaders.Set("User-Agent", c.s.userAgent())
  63730. var body io.Reader = nil
  63731. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate)
  63732. if err != nil {
  63733. return nil, err
  63734. }
  63735. reqHeaders.Set("Content-Type", "application/json")
  63736. c.urlParams_.Set("alt", alt)
  63737. c.urlParams_.Set("prettyPrint", "false")
  63738. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  63739. urls += "?" + c.urlParams_.Encode()
  63740. req, err := http.NewRequest("POST", urls, body)
  63741. if err != nil {
  63742. return nil, err
  63743. }
  63744. req.Header = reqHeaders
  63745. googleapi.Expand(req.URL, map[string]string{
  63746. "project": c.project,
  63747. "region": c.region,
  63748. })
  63749. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63750. }
  63751. // Do executes the "compute.nodeTemplates.insert" call.
  63752. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63753. // status code is an error. Response headers are in either
  63754. // *Operation.ServerResponse.Header or (if a response was returned at
  63755. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63756. // to check whether the returned error was because
  63757. // http.StatusNotModified was returned.
  63758. func (c *NodeTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63759. gensupport.SetOptions(c.urlParams_, opts...)
  63760. res, err := c.doRequest("json")
  63761. if res != nil && res.StatusCode == http.StatusNotModified {
  63762. if res.Body != nil {
  63763. res.Body.Close()
  63764. }
  63765. return nil, &googleapi.Error{
  63766. Code: res.StatusCode,
  63767. Header: res.Header,
  63768. }
  63769. }
  63770. if err != nil {
  63771. return nil, err
  63772. }
  63773. defer googleapi.CloseBody(res)
  63774. if err := googleapi.CheckResponse(res); err != nil {
  63775. return nil, err
  63776. }
  63777. ret := &Operation{
  63778. ServerResponse: googleapi.ServerResponse{
  63779. Header: res.Header,
  63780. HTTPStatusCode: res.StatusCode,
  63781. },
  63782. }
  63783. target := &ret
  63784. if err := gensupport.DecodeResponse(target, res); err != nil {
  63785. return nil, err
  63786. }
  63787. return ret, nil
  63788. // {
  63789. // "description": "Creates a NodeTemplate resource in the specified project using the data included in the request.",
  63790. // "httpMethod": "POST",
  63791. // "id": "compute.nodeTemplates.insert",
  63792. // "parameterOrder": [
  63793. // "project",
  63794. // "region"
  63795. // ],
  63796. // "parameters": {
  63797. // "project": {
  63798. // "description": "Project ID for this request.",
  63799. // "location": "path",
  63800. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63801. // "required": true,
  63802. // "type": "string"
  63803. // },
  63804. // "region": {
  63805. // "description": "The name of the region for this request.",
  63806. // "location": "path",
  63807. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63808. // "required": true,
  63809. // "type": "string"
  63810. // },
  63811. // "requestId": {
  63812. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63813. // "location": "query",
  63814. // "type": "string"
  63815. // }
  63816. // },
  63817. // "path": "{project}/regions/{region}/nodeTemplates",
  63818. // "request": {
  63819. // "$ref": "NodeTemplate"
  63820. // },
  63821. // "response": {
  63822. // "$ref": "Operation"
  63823. // },
  63824. // "scopes": [
  63825. // "https://www.googleapis.com/auth/cloud-platform",
  63826. // "https://www.googleapis.com/auth/compute"
  63827. // ]
  63828. // }
  63829. }
  63830. // method id "compute.nodeTemplates.list":
  63831. type NodeTemplatesListCall struct {
  63832. s *Service
  63833. project string
  63834. region string
  63835. urlParams_ gensupport.URLParams
  63836. ifNoneMatch_ string
  63837. ctx_ context.Context
  63838. header_ http.Header
  63839. }
  63840. // List: Retrieves a list of node templates available to the specified
  63841. // project.
  63842. func (r *NodeTemplatesService) List(project string, region string) *NodeTemplatesListCall {
  63843. c := &NodeTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63844. c.project = project
  63845. c.region = region
  63846. return c
  63847. }
  63848. // Filter sets the optional parameter "filter": A filter expression that
  63849. // filters resources listed in the response. The expression must specify
  63850. // the field name, a comparison operator, and the value that you want to
  63851. // use for filtering. The value must be a string, a number, or a
  63852. // boolean. The comparison operator must be either =, !=, >, or <.
  63853. //
  63854. // For example, if you are filtering Compute Engine instances, you can
  63855. // exclude instances named example-instance by specifying name !=
  63856. // example-instance.
  63857. //
  63858. // You can also filter nested fields. For example, you could specify
  63859. // scheduling.automaticRestart = false to include instances only if they
  63860. // are not scheduled for automatic restarts. You can use filtering on
  63861. // nested fields to filter based on resource labels.
  63862. //
  63863. // To filter on multiple expressions, provide each separate expression
  63864. // within parentheses. For example, (scheduling.automaticRestart = true)
  63865. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  63866. // AND expression. However, you can include AND and OR expressions
  63867. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  63868. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  63869. // true).
  63870. func (c *NodeTemplatesListCall) Filter(filter string) *NodeTemplatesListCall {
  63871. c.urlParams_.Set("filter", filter)
  63872. return c
  63873. }
  63874. // MaxResults sets the optional parameter "maxResults": The maximum
  63875. // number of results per page that should be returned. If the number of
  63876. // available results is larger than maxResults, Compute Engine returns a
  63877. // nextPageToken that can be used to get the next page of results in
  63878. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  63879. // (Default: 500)
  63880. func (c *NodeTemplatesListCall) MaxResults(maxResults int64) *NodeTemplatesListCall {
  63881. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  63882. return c
  63883. }
  63884. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  63885. // a certain order. By default, results are returned in alphanumerical
  63886. // order based on the resource name.
  63887. //
  63888. // You can also sort results in descending order based on the creation
  63889. // timestamp using orderBy="creationTimestamp desc". This sorts results
  63890. // based on the creationTimestamp field in reverse chronological order
  63891. // (newest result first). Use this to sort resources like operations so
  63892. // that the newest operation is returned first.
  63893. //
  63894. // Currently, only sorting by name or creationTimestamp desc is
  63895. // supported.
  63896. func (c *NodeTemplatesListCall) OrderBy(orderBy string) *NodeTemplatesListCall {
  63897. c.urlParams_.Set("orderBy", orderBy)
  63898. return c
  63899. }
  63900. // PageToken sets the optional parameter "pageToken": Specifies a page
  63901. // token to use. Set pageToken to the nextPageToken returned by a
  63902. // previous list request to get the next page of results.
  63903. func (c *NodeTemplatesListCall) PageToken(pageToken string) *NodeTemplatesListCall {
  63904. c.urlParams_.Set("pageToken", pageToken)
  63905. return c
  63906. }
  63907. // Fields allows partial responses to be retrieved. See
  63908. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63909. // for more information.
  63910. func (c *NodeTemplatesListCall) Fields(s ...googleapi.Field) *NodeTemplatesListCall {
  63911. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63912. return c
  63913. }
  63914. // IfNoneMatch sets the optional parameter which makes the operation
  63915. // fail if the object's ETag matches the given value. This is useful for
  63916. // getting updates only after the object has changed since the last
  63917. // request. Use googleapi.IsNotModified to check whether the response
  63918. // error from Do is the result of In-None-Match.
  63919. func (c *NodeTemplatesListCall) IfNoneMatch(entityTag string) *NodeTemplatesListCall {
  63920. c.ifNoneMatch_ = entityTag
  63921. return c
  63922. }
  63923. // Context sets the context to be used in this call's Do method. Any
  63924. // pending HTTP request will be aborted if the provided context is
  63925. // canceled.
  63926. func (c *NodeTemplatesListCall) Context(ctx context.Context) *NodeTemplatesListCall {
  63927. c.ctx_ = ctx
  63928. return c
  63929. }
  63930. // Header returns an http.Header that can be modified by the caller to
  63931. // add HTTP headers to the request.
  63932. func (c *NodeTemplatesListCall) Header() http.Header {
  63933. if c.header_ == nil {
  63934. c.header_ = make(http.Header)
  63935. }
  63936. return c.header_
  63937. }
  63938. func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  63939. reqHeaders := make(http.Header)
  63940. for k, v := range c.header_ {
  63941. reqHeaders[k] = v
  63942. }
  63943. reqHeaders.Set("User-Agent", c.s.userAgent())
  63944. if c.ifNoneMatch_ != "" {
  63945. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63946. }
  63947. var body io.Reader = nil
  63948. c.urlParams_.Set("alt", alt)
  63949. c.urlParams_.Set("prettyPrint", "false")
  63950. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  63951. urls += "?" + c.urlParams_.Encode()
  63952. req, err := http.NewRequest("GET", urls, body)
  63953. if err != nil {
  63954. return nil, err
  63955. }
  63956. req.Header = reqHeaders
  63957. googleapi.Expand(req.URL, map[string]string{
  63958. "project": c.project,
  63959. "region": c.region,
  63960. })
  63961. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63962. }
  63963. // Do executes the "compute.nodeTemplates.list" call.
  63964. // Exactly one of *NodeTemplateList or error will be non-nil. Any
  63965. // non-2xx status code is an error. Response headers are in either
  63966. // *NodeTemplateList.ServerResponse.Header or (if a response was
  63967. // returned at all) in error.(*googleapi.Error).Header. Use
  63968. // googleapi.IsNotModified to check whether the returned error was
  63969. // because http.StatusNotModified was returned.
  63970. func (c *NodeTemplatesListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateList, error) {
  63971. gensupport.SetOptions(c.urlParams_, opts...)
  63972. res, err := c.doRequest("json")
  63973. if res != nil && res.StatusCode == http.StatusNotModified {
  63974. if res.Body != nil {
  63975. res.Body.Close()
  63976. }
  63977. return nil, &googleapi.Error{
  63978. Code: res.StatusCode,
  63979. Header: res.Header,
  63980. }
  63981. }
  63982. if err != nil {
  63983. return nil, err
  63984. }
  63985. defer googleapi.CloseBody(res)
  63986. if err := googleapi.CheckResponse(res); err != nil {
  63987. return nil, err
  63988. }
  63989. ret := &NodeTemplateList{
  63990. ServerResponse: googleapi.ServerResponse{
  63991. Header: res.Header,
  63992. HTTPStatusCode: res.StatusCode,
  63993. },
  63994. }
  63995. target := &ret
  63996. if err := gensupport.DecodeResponse(target, res); err != nil {
  63997. return nil, err
  63998. }
  63999. return ret, nil
  64000. // {
  64001. // "description": "Retrieves a list of node templates available to the specified project.",
  64002. // "httpMethod": "GET",
  64003. // "id": "compute.nodeTemplates.list",
  64004. // "parameterOrder": [
  64005. // "project",
  64006. // "region"
  64007. // ],
  64008. // "parameters": {
  64009. // "filter": {
  64010. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  64011. // "location": "query",
  64012. // "type": "string"
  64013. // },
  64014. // "maxResults": {
  64015. // "default": "500",
  64016. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  64017. // "format": "uint32",
  64018. // "location": "query",
  64019. // "minimum": "0",
  64020. // "type": "integer"
  64021. // },
  64022. // "orderBy": {
  64023. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  64024. // "location": "query",
  64025. // "type": "string"
  64026. // },
  64027. // "pageToken": {
  64028. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  64029. // "location": "query",
  64030. // "type": "string"
  64031. // },
  64032. // "project": {
  64033. // "description": "Project ID for this request.",
  64034. // "location": "path",
  64035. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64036. // "required": true,
  64037. // "type": "string"
  64038. // },
  64039. // "region": {
  64040. // "description": "The name of the region for this request.",
  64041. // "location": "path",
  64042. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64043. // "required": true,
  64044. // "type": "string"
  64045. // }
  64046. // },
  64047. // "path": "{project}/regions/{region}/nodeTemplates",
  64048. // "response": {
  64049. // "$ref": "NodeTemplateList"
  64050. // },
  64051. // "scopes": [
  64052. // "https://www.googleapis.com/auth/cloud-platform",
  64053. // "https://www.googleapis.com/auth/compute",
  64054. // "https://www.googleapis.com/auth/compute.readonly"
  64055. // ]
  64056. // }
  64057. }
  64058. // Pages invokes f for each page of results.
  64059. // A non-nil error returned from f will halt the iteration.
  64060. // The provided context supersedes any context provided to the Context method.
  64061. func (c *NodeTemplatesListCall) Pages(ctx context.Context, f func(*NodeTemplateList) error) error {
  64062. c.ctx_ = ctx
  64063. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  64064. for {
  64065. x, err := c.Do()
  64066. if err != nil {
  64067. return err
  64068. }
  64069. if err := f(x); err != nil {
  64070. return err
  64071. }
  64072. if x.NextPageToken == "" {
  64073. return nil
  64074. }
  64075. c.PageToken(x.NextPageToken)
  64076. }
  64077. }
  64078. // method id "compute.nodeTemplates.setIamPolicy":
  64079. type NodeTemplatesSetIamPolicyCall struct {
  64080. s *Service
  64081. project string
  64082. region string
  64083. resource string
  64084. regionsetpolicyrequest *RegionSetPolicyRequest
  64085. urlParams_ gensupport.URLParams
  64086. ctx_ context.Context
  64087. header_ http.Header
  64088. }
  64089. // SetIamPolicy: Sets the access control policy on the specified
  64090. // resource. Replaces any existing policy.
  64091. func (r *NodeTemplatesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NodeTemplatesSetIamPolicyCall {
  64092. c := &NodeTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64093. c.project = project
  64094. c.region = region
  64095. c.resource = resource
  64096. c.regionsetpolicyrequest = regionsetpolicyrequest
  64097. return c
  64098. }
  64099. // Fields allows partial responses to be retrieved. See
  64100. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64101. // for more information.
  64102. func (c *NodeTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesSetIamPolicyCall {
  64103. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64104. return c
  64105. }
  64106. // Context sets the context to be used in this call's Do method. Any
  64107. // pending HTTP request will be aborted if the provided context is
  64108. // canceled.
  64109. func (c *NodeTemplatesSetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesSetIamPolicyCall {
  64110. c.ctx_ = ctx
  64111. return c
  64112. }
  64113. // Header returns an http.Header that can be modified by the caller to
  64114. // add HTTP headers to the request.
  64115. func (c *NodeTemplatesSetIamPolicyCall) Header() http.Header {
  64116. if c.header_ == nil {
  64117. c.header_ = make(http.Header)
  64118. }
  64119. return c.header_
  64120. }
  64121. func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  64122. reqHeaders := make(http.Header)
  64123. for k, v := range c.header_ {
  64124. reqHeaders[k] = v
  64125. }
  64126. reqHeaders.Set("User-Agent", c.s.userAgent())
  64127. var body io.Reader = nil
  64128. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  64129. if err != nil {
  64130. return nil, err
  64131. }
  64132. reqHeaders.Set("Content-Type", "application/json")
  64133. c.urlParams_.Set("alt", alt)
  64134. c.urlParams_.Set("prettyPrint", "false")
  64135. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy")
  64136. urls += "?" + c.urlParams_.Encode()
  64137. req, err := http.NewRequest("POST", urls, body)
  64138. if err != nil {
  64139. return nil, err
  64140. }
  64141. req.Header = reqHeaders
  64142. googleapi.Expand(req.URL, map[string]string{
  64143. "project": c.project,
  64144. "region": c.region,
  64145. "resource": c.resource,
  64146. })
  64147. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64148. }
  64149. // Do executes the "compute.nodeTemplates.setIamPolicy" call.
  64150. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  64151. // code is an error. Response headers are in either
  64152. // *Policy.ServerResponse.Header or (if a response was returned at all)
  64153. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  64154. // check whether the returned error was because http.StatusNotModified
  64155. // was returned.
  64156. func (c *NodeTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  64157. gensupport.SetOptions(c.urlParams_, opts...)
  64158. res, err := c.doRequest("json")
  64159. if res != nil && res.StatusCode == http.StatusNotModified {
  64160. if res.Body != nil {
  64161. res.Body.Close()
  64162. }
  64163. return nil, &googleapi.Error{
  64164. Code: res.StatusCode,
  64165. Header: res.Header,
  64166. }
  64167. }
  64168. if err != nil {
  64169. return nil, err
  64170. }
  64171. defer googleapi.CloseBody(res)
  64172. if err := googleapi.CheckResponse(res); err != nil {
  64173. return nil, err
  64174. }
  64175. ret := &Policy{
  64176. ServerResponse: googleapi.ServerResponse{
  64177. Header: res.Header,
  64178. HTTPStatusCode: res.StatusCode,
  64179. },
  64180. }
  64181. target := &ret
  64182. if err := gensupport.DecodeResponse(target, res); err != nil {
  64183. return nil, err
  64184. }
  64185. return ret, nil
  64186. // {
  64187. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  64188. // "httpMethod": "POST",
  64189. // "id": "compute.nodeTemplates.setIamPolicy",
  64190. // "parameterOrder": [
  64191. // "project",
  64192. // "region",
  64193. // "resource"
  64194. // ],
  64195. // "parameters": {
  64196. // "project": {
  64197. // "description": "Project ID for this request.",
  64198. // "location": "path",
  64199. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64200. // "required": true,
  64201. // "type": "string"
  64202. // },
  64203. // "region": {
  64204. // "description": "The name of the region for this request.",
  64205. // "location": "path",
  64206. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64207. // "required": true,
  64208. // "type": "string"
  64209. // },
  64210. // "resource": {
  64211. // "description": "Name or id of the resource for this request.",
  64212. // "location": "path",
  64213. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64214. // "required": true,
  64215. // "type": "string"
  64216. // }
  64217. // },
  64218. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy",
  64219. // "request": {
  64220. // "$ref": "RegionSetPolicyRequest"
  64221. // },
  64222. // "response": {
  64223. // "$ref": "Policy"
  64224. // },
  64225. // "scopes": [
  64226. // "https://www.googleapis.com/auth/cloud-platform",
  64227. // "https://www.googleapis.com/auth/compute"
  64228. // ]
  64229. // }
  64230. }
  64231. // method id "compute.nodeTemplates.testIamPermissions":
  64232. type NodeTemplatesTestIamPermissionsCall struct {
  64233. s *Service
  64234. project string
  64235. region string
  64236. resource string
  64237. testpermissionsrequest *TestPermissionsRequest
  64238. urlParams_ gensupport.URLParams
  64239. ctx_ context.Context
  64240. header_ http.Header
  64241. }
  64242. // TestIamPermissions: Returns permissions that a caller has on the
  64243. // specified resource.
  64244. func (r *NodeTemplatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeTemplatesTestIamPermissionsCall {
  64245. c := &NodeTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64246. c.project = project
  64247. c.region = region
  64248. c.resource = resource
  64249. c.testpermissionsrequest = testpermissionsrequest
  64250. return c
  64251. }
  64252. // Fields allows partial responses to be retrieved. See
  64253. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64254. // for more information.
  64255. func (c *NodeTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeTemplatesTestIamPermissionsCall {
  64256. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64257. return c
  64258. }
  64259. // Context sets the context to be used in this call's Do method. Any
  64260. // pending HTTP request will be aborted if the provided context is
  64261. // canceled.
  64262. func (c *NodeTemplatesTestIamPermissionsCall) Context(ctx context.Context) *NodeTemplatesTestIamPermissionsCall {
  64263. c.ctx_ = ctx
  64264. return c
  64265. }
  64266. // Header returns an http.Header that can be modified by the caller to
  64267. // add HTTP headers to the request.
  64268. func (c *NodeTemplatesTestIamPermissionsCall) Header() http.Header {
  64269. if c.header_ == nil {
  64270. c.header_ = make(http.Header)
  64271. }
  64272. return c.header_
  64273. }
  64274. func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  64275. reqHeaders := make(http.Header)
  64276. for k, v := range c.header_ {
  64277. reqHeaders[k] = v
  64278. }
  64279. reqHeaders.Set("User-Agent", c.s.userAgent())
  64280. var body io.Reader = nil
  64281. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  64282. if err != nil {
  64283. return nil, err
  64284. }
  64285. reqHeaders.Set("Content-Type", "application/json")
  64286. c.urlParams_.Set("alt", alt)
  64287. c.urlParams_.Set("prettyPrint", "false")
  64288. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions")
  64289. urls += "?" + c.urlParams_.Encode()
  64290. req, err := http.NewRequest("POST", urls, body)
  64291. if err != nil {
  64292. return nil, err
  64293. }
  64294. req.Header = reqHeaders
  64295. googleapi.Expand(req.URL, map[string]string{
  64296. "project": c.project,
  64297. "region": c.region,
  64298. "resource": c.resource,
  64299. })
  64300. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64301. }
  64302. // Do executes the "compute.nodeTemplates.testIamPermissions" call.
  64303. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  64304. // non-2xx status code is an error. Response headers are in either
  64305. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  64306. // returned at all) in error.(*googleapi.Error).Header. Use
  64307. // googleapi.IsNotModified to check whether the returned error was
  64308. // because http.StatusNotModified was returned.
  64309. func (c *NodeTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  64310. gensupport.SetOptions(c.urlParams_, opts...)
  64311. res, err := c.doRequest("json")
  64312. if res != nil && res.StatusCode == http.StatusNotModified {
  64313. if res.Body != nil {
  64314. res.Body.Close()
  64315. }
  64316. return nil, &googleapi.Error{
  64317. Code: res.StatusCode,
  64318. Header: res.Header,
  64319. }
  64320. }
  64321. if err != nil {
  64322. return nil, err
  64323. }
  64324. defer googleapi.CloseBody(res)
  64325. if err := googleapi.CheckResponse(res); err != nil {
  64326. return nil, err
  64327. }
  64328. ret := &TestPermissionsResponse{
  64329. ServerResponse: googleapi.ServerResponse{
  64330. Header: res.Header,
  64331. HTTPStatusCode: res.StatusCode,
  64332. },
  64333. }
  64334. target := &ret
  64335. if err := gensupport.DecodeResponse(target, res); err != nil {
  64336. return nil, err
  64337. }
  64338. return ret, nil
  64339. // {
  64340. // "description": "Returns permissions that a caller has on the specified resource.",
  64341. // "httpMethod": "POST",
  64342. // "id": "compute.nodeTemplates.testIamPermissions",
  64343. // "parameterOrder": [
  64344. // "project",
  64345. // "region",
  64346. // "resource"
  64347. // ],
  64348. // "parameters": {
  64349. // "project": {
  64350. // "description": "Project ID for this request.",
  64351. // "location": "path",
  64352. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64353. // "required": true,
  64354. // "type": "string"
  64355. // },
  64356. // "region": {
  64357. // "description": "The name of the region for this request.",
  64358. // "location": "path",
  64359. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64360. // "required": true,
  64361. // "type": "string"
  64362. // },
  64363. // "resource": {
  64364. // "description": "Name or id of the resource for this request.",
  64365. // "location": "path",
  64366. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64367. // "required": true,
  64368. // "type": "string"
  64369. // }
  64370. // },
  64371. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions",
  64372. // "request": {
  64373. // "$ref": "TestPermissionsRequest"
  64374. // },
  64375. // "response": {
  64376. // "$ref": "TestPermissionsResponse"
  64377. // },
  64378. // "scopes": [
  64379. // "https://www.googleapis.com/auth/cloud-platform",
  64380. // "https://www.googleapis.com/auth/compute",
  64381. // "https://www.googleapis.com/auth/compute.readonly"
  64382. // ]
  64383. // }
  64384. }
  64385. // method id "compute.nodeTypes.aggregatedList":
  64386. type NodeTypesAggregatedListCall struct {
  64387. s *Service
  64388. project string
  64389. urlParams_ gensupport.URLParams
  64390. ifNoneMatch_ string
  64391. ctx_ context.Context
  64392. header_ http.Header
  64393. }
  64394. // AggregatedList: Retrieves an aggregated list of node types.
  64395. func (r *NodeTypesService) AggregatedList(project string) *NodeTypesAggregatedListCall {
  64396. c := &NodeTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64397. c.project = project
  64398. return c
  64399. }
  64400. // Filter sets the optional parameter "filter": A filter expression that
  64401. // filters resources listed in the response. The expression must specify
  64402. // the field name, a comparison operator, and the value that you want to
  64403. // use for filtering. The value must be a string, a number, or a
  64404. // boolean. The comparison operator must be either =, !=, >, or <.
  64405. //
  64406. // For example, if you are filtering Compute Engine instances, you can
  64407. // exclude instances named example-instance by specifying name !=
  64408. // example-instance.
  64409. //
  64410. // You can also filter nested fields. For example, you could specify
  64411. // scheduling.automaticRestart = false to include instances only if they
  64412. // are not scheduled for automatic restarts. You can use filtering on
  64413. // nested fields to filter based on resource labels.
  64414. //
  64415. // To filter on multiple expressions, provide each separate expression
  64416. // within parentheses. For example, (scheduling.automaticRestart = true)
  64417. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  64418. // AND expression. However, you can include AND and OR expressions
  64419. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  64420. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  64421. // true).
  64422. func (c *NodeTypesAggregatedListCall) Filter(filter string) *NodeTypesAggregatedListCall {
  64423. c.urlParams_.Set("filter", filter)
  64424. return c
  64425. }
  64426. // MaxResults sets the optional parameter "maxResults": The maximum
  64427. // number of results per page that should be returned. If the number of
  64428. // available results is larger than maxResults, Compute Engine returns a
  64429. // nextPageToken that can be used to get the next page of results in
  64430. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  64431. // (Default: 500)
  64432. func (c *NodeTypesAggregatedListCall) MaxResults(maxResults int64) *NodeTypesAggregatedListCall {
  64433. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  64434. return c
  64435. }
  64436. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  64437. // a certain order. By default, results are returned in alphanumerical
  64438. // order based on the resource name.
  64439. //
  64440. // You can also sort results in descending order based on the creation
  64441. // timestamp using orderBy="creationTimestamp desc". This sorts results
  64442. // based on the creationTimestamp field in reverse chronological order
  64443. // (newest result first). Use this to sort resources like operations so
  64444. // that the newest operation is returned first.
  64445. //
  64446. // Currently, only sorting by name or creationTimestamp desc is
  64447. // supported.
  64448. func (c *NodeTypesAggregatedListCall) OrderBy(orderBy string) *NodeTypesAggregatedListCall {
  64449. c.urlParams_.Set("orderBy", orderBy)
  64450. return c
  64451. }
  64452. // PageToken sets the optional parameter "pageToken": Specifies a page
  64453. // token to use. Set pageToken to the nextPageToken returned by a
  64454. // previous list request to get the next page of results.
  64455. func (c *NodeTypesAggregatedListCall) PageToken(pageToken string) *NodeTypesAggregatedListCall {
  64456. c.urlParams_.Set("pageToken", pageToken)
  64457. return c
  64458. }
  64459. // Fields allows partial responses to be retrieved. See
  64460. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64461. // for more information.
  64462. func (c *NodeTypesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTypesAggregatedListCall {
  64463. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64464. return c
  64465. }
  64466. // IfNoneMatch sets the optional parameter which makes the operation
  64467. // fail if the object's ETag matches the given value. This is useful for
  64468. // getting updates only after the object has changed since the last
  64469. // request. Use googleapi.IsNotModified to check whether the response
  64470. // error from Do is the result of In-None-Match.
  64471. func (c *NodeTypesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTypesAggregatedListCall {
  64472. c.ifNoneMatch_ = entityTag
  64473. return c
  64474. }
  64475. // Context sets the context to be used in this call's Do method. Any
  64476. // pending HTTP request will be aborted if the provided context is
  64477. // canceled.
  64478. func (c *NodeTypesAggregatedListCall) Context(ctx context.Context) *NodeTypesAggregatedListCall {
  64479. c.ctx_ = ctx
  64480. return c
  64481. }
  64482. // Header returns an http.Header that can be modified by the caller to
  64483. // add HTTP headers to the request.
  64484. func (c *NodeTypesAggregatedListCall) Header() http.Header {
  64485. if c.header_ == nil {
  64486. c.header_ = make(http.Header)
  64487. }
  64488. return c.header_
  64489. }
  64490. func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  64491. reqHeaders := make(http.Header)
  64492. for k, v := range c.header_ {
  64493. reqHeaders[k] = v
  64494. }
  64495. reqHeaders.Set("User-Agent", c.s.userAgent())
  64496. if c.ifNoneMatch_ != "" {
  64497. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64498. }
  64499. var body io.Reader = nil
  64500. c.urlParams_.Set("alt", alt)
  64501. c.urlParams_.Set("prettyPrint", "false")
  64502. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTypes")
  64503. urls += "?" + c.urlParams_.Encode()
  64504. req, err := http.NewRequest("GET", urls, body)
  64505. if err != nil {
  64506. return nil, err
  64507. }
  64508. req.Header = reqHeaders
  64509. googleapi.Expand(req.URL, map[string]string{
  64510. "project": c.project,
  64511. })
  64512. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64513. }
  64514. // Do executes the "compute.nodeTypes.aggregatedList" call.
  64515. // Exactly one of *NodeTypeAggregatedList or error will be non-nil. Any
  64516. // non-2xx status code is an error. Response headers are in either
  64517. // *NodeTypeAggregatedList.ServerResponse.Header or (if a response was
  64518. // returned at all) in error.(*googleapi.Error).Header. Use
  64519. // googleapi.IsNotModified to check whether the returned error was
  64520. // because http.StatusNotModified was returned.
  64521. func (c *NodeTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTypeAggregatedList, error) {
  64522. gensupport.SetOptions(c.urlParams_, opts...)
  64523. res, err := c.doRequest("json")
  64524. if res != nil && res.StatusCode == http.StatusNotModified {
  64525. if res.Body != nil {
  64526. res.Body.Close()
  64527. }
  64528. return nil, &googleapi.Error{
  64529. Code: res.StatusCode,
  64530. Header: res.Header,
  64531. }
  64532. }
  64533. if err != nil {
  64534. return nil, err
  64535. }
  64536. defer googleapi.CloseBody(res)
  64537. if err := googleapi.CheckResponse(res); err != nil {
  64538. return nil, err
  64539. }
  64540. ret := &NodeTypeAggregatedList{
  64541. ServerResponse: googleapi.ServerResponse{
  64542. Header: res.Header,
  64543. HTTPStatusCode: res.StatusCode,
  64544. },
  64545. }
  64546. target := &ret
  64547. if err := gensupport.DecodeResponse(target, res); err != nil {
  64548. return nil, err
  64549. }
  64550. return ret, nil
  64551. // {
  64552. // "description": "Retrieves an aggregated list of node types.",
  64553. // "httpMethod": "GET",
  64554. // "id": "compute.nodeTypes.aggregatedList",
  64555. // "parameterOrder": [
  64556. // "project"
  64557. // ],
  64558. // "parameters": {
  64559. // "filter": {
  64560. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  64561. // "location": "query",
  64562. // "type": "string"
  64563. // },
  64564. // "maxResults": {
  64565. // "default": "500",
  64566. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  64567. // "format": "uint32",
  64568. // "location": "query",
  64569. // "minimum": "0",
  64570. // "type": "integer"
  64571. // },
  64572. // "orderBy": {
  64573. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  64574. // "location": "query",
  64575. // "type": "string"
  64576. // },
  64577. // "pageToken": {
  64578. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  64579. // "location": "query",
  64580. // "type": "string"
  64581. // },
  64582. // "project": {
  64583. // "description": "Project ID for this request.",
  64584. // "location": "path",
  64585. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64586. // "required": true,
  64587. // "type": "string"
  64588. // }
  64589. // },
  64590. // "path": "{project}/aggregated/nodeTypes",
  64591. // "response": {
  64592. // "$ref": "NodeTypeAggregatedList"
  64593. // },
  64594. // "scopes": [
  64595. // "https://www.googleapis.com/auth/cloud-platform",
  64596. // "https://www.googleapis.com/auth/compute",
  64597. // "https://www.googleapis.com/auth/compute.readonly"
  64598. // ]
  64599. // }
  64600. }
  64601. // Pages invokes f for each page of results.
  64602. // A non-nil error returned from f will halt the iteration.
  64603. // The provided context supersedes any context provided to the Context method.
  64604. func (c *NodeTypesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTypeAggregatedList) error) error {
  64605. c.ctx_ = ctx
  64606. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  64607. for {
  64608. x, err := c.Do()
  64609. if err != nil {
  64610. return err
  64611. }
  64612. if err := f(x); err != nil {
  64613. return err
  64614. }
  64615. if x.NextPageToken == "" {
  64616. return nil
  64617. }
  64618. c.PageToken(x.NextPageToken)
  64619. }
  64620. }
  64621. // method id "compute.nodeTypes.get":
  64622. type NodeTypesGetCall struct {
  64623. s *Service
  64624. project string
  64625. zone string
  64626. nodeType string
  64627. urlParams_ gensupport.URLParams
  64628. ifNoneMatch_ string
  64629. ctx_ context.Context
  64630. header_ http.Header
  64631. }
  64632. // Get: Returns the specified node type. Gets a list of available node
  64633. // types by making a list() request.
  64634. func (r *NodeTypesService) Get(project string, zone string, nodeType string) *NodeTypesGetCall {
  64635. c := &NodeTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64636. c.project = project
  64637. c.zone = zone
  64638. c.nodeType = nodeType
  64639. return c
  64640. }
  64641. // Fields allows partial responses to be retrieved. See
  64642. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64643. // for more information.
  64644. func (c *NodeTypesGetCall) Fields(s ...googleapi.Field) *NodeTypesGetCall {
  64645. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64646. return c
  64647. }
  64648. // IfNoneMatch sets the optional parameter which makes the operation
  64649. // fail if the object's ETag matches the given value. This is useful for
  64650. // getting updates only after the object has changed since the last
  64651. // request. Use googleapi.IsNotModified to check whether the response
  64652. // error from Do is the result of In-None-Match.
  64653. func (c *NodeTypesGetCall) IfNoneMatch(entityTag string) *NodeTypesGetCall {
  64654. c.ifNoneMatch_ = entityTag
  64655. return c
  64656. }
  64657. // Context sets the context to be used in this call's Do method. Any
  64658. // pending HTTP request will be aborted if the provided context is
  64659. // canceled.
  64660. func (c *NodeTypesGetCall) Context(ctx context.Context) *NodeTypesGetCall {
  64661. c.ctx_ = ctx
  64662. return c
  64663. }
  64664. // Header returns an http.Header that can be modified by the caller to
  64665. // add HTTP headers to the request.
  64666. func (c *NodeTypesGetCall) Header() http.Header {
  64667. if c.header_ == nil {
  64668. c.header_ = make(http.Header)
  64669. }
  64670. return c.header_
  64671. }
  64672. func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) {
  64673. reqHeaders := make(http.Header)
  64674. for k, v := range c.header_ {
  64675. reqHeaders[k] = v
  64676. }
  64677. reqHeaders.Set("User-Agent", c.s.userAgent())
  64678. if c.ifNoneMatch_ != "" {
  64679. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64680. }
  64681. var body io.Reader = nil
  64682. c.urlParams_.Set("alt", alt)
  64683. c.urlParams_.Set("prettyPrint", "false")
  64684. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes/{nodeType}")
  64685. urls += "?" + c.urlParams_.Encode()
  64686. req, err := http.NewRequest("GET", urls, body)
  64687. if err != nil {
  64688. return nil, err
  64689. }
  64690. req.Header = reqHeaders
  64691. googleapi.Expand(req.URL, map[string]string{
  64692. "project": c.project,
  64693. "zone": c.zone,
  64694. "nodeType": c.nodeType,
  64695. })
  64696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64697. }
  64698. // Do executes the "compute.nodeTypes.get" call.
  64699. // Exactly one of *NodeType or error will be non-nil. Any non-2xx status
  64700. // code is an error. Response headers are in either
  64701. // *NodeType.ServerResponse.Header or (if a response was returned at
  64702. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64703. // to check whether the returned error was because
  64704. // http.StatusNotModified was returned.
  64705. func (c *NodeTypesGetCall) Do(opts ...googleapi.CallOption) (*NodeType, error) {
  64706. gensupport.SetOptions(c.urlParams_, opts...)
  64707. res, err := c.doRequest("json")
  64708. if res != nil && res.StatusCode == http.StatusNotModified {
  64709. if res.Body != nil {
  64710. res.Body.Close()
  64711. }
  64712. return nil, &googleapi.Error{
  64713. Code: res.StatusCode,
  64714. Header: res.Header,
  64715. }
  64716. }
  64717. if err != nil {
  64718. return nil, err
  64719. }
  64720. defer googleapi.CloseBody(res)
  64721. if err := googleapi.CheckResponse(res); err != nil {
  64722. return nil, err
  64723. }
  64724. ret := &NodeType{
  64725. ServerResponse: googleapi.ServerResponse{
  64726. Header: res.Header,
  64727. HTTPStatusCode: res.StatusCode,
  64728. },
  64729. }
  64730. target := &ret
  64731. if err := gensupport.DecodeResponse(target, res); err != nil {
  64732. return nil, err
  64733. }
  64734. return ret, nil
  64735. // {
  64736. // "description": "Returns the specified node type. Gets a list of available node types by making a list() request.",
  64737. // "httpMethod": "GET",
  64738. // "id": "compute.nodeTypes.get",
  64739. // "parameterOrder": [
  64740. // "project",
  64741. // "zone",
  64742. // "nodeType"
  64743. // ],
  64744. // "parameters": {
  64745. // "nodeType": {
  64746. // "description": "Name of the node type to return.",
  64747. // "location": "path",
  64748. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64749. // "required": true,
  64750. // "type": "string"
  64751. // },
  64752. // "project": {
  64753. // "description": "Project ID for this request.",
  64754. // "location": "path",
  64755. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64756. // "required": true,
  64757. // "type": "string"
  64758. // },
  64759. // "zone": {
  64760. // "description": "The name of the zone for this request.",
  64761. // "location": "path",
  64762. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64763. // "required": true,
  64764. // "type": "string"
  64765. // }
  64766. // },
  64767. // "path": "{project}/zones/{zone}/nodeTypes/{nodeType}",
  64768. // "response": {
  64769. // "$ref": "NodeType"
  64770. // },
  64771. // "scopes": [
  64772. // "https://www.googleapis.com/auth/cloud-platform",
  64773. // "https://www.googleapis.com/auth/compute",
  64774. // "https://www.googleapis.com/auth/compute.readonly"
  64775. // ]
  64776. // }
  64777. }
  64778. // method id "compute.nodeTypes.list":
  64779. type NodeTypesListCall struct {
  64780. s *Service
  64781. project string
  64782. zone string
  64783. urlParams_ gensupport.URLParams
  64784. ifNoneMatch_ string
  64785. ctx_ context.Context
  64786. header_ http.Header
  64787. }
  64788. // List: Retrieves a list of node types available to the specified
  64789. // project.
  64790. func (r *NodeTypesService) List(project string, zone string) *NodeTypesListCall {
  64791. c := &NodeTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64792. c.project = project
  64793. c.zone = zone
  64794. return c
  64795. }
  64796. // Filter sets the optional parameter "filter": A filter expression that
  64797. // filters resources listed in the response. The expression must specify
  64798. // the field name, a comparison operator, and the value that you want to
  64799. // use for filtering. The value must be a string, a number, or a
  64800. // boolean. The comparison operator must be either =, !=, >, or <.
  64801. //
  64802. // For example, if you are filtering Compute Engine instances, you can
  64803. // exclude instances named example-instance by specifying name !=
  64804. // example-instance.
  64805. //
  64806. // You can also filter nested fields. For example, you could specify
  64807. // scheduling.automaticRestart = false to include instances only if they
  64808. // are not scheduled for automatic restarts. You can use filtering on
  64809. // nested fields to filter based on resource labels.
  64810. //
  64811. // To filter on multiple expressions, provide each separate expression
  64812. // within parentheses. For example, (scheduling.automaticRestart = true)
  64813. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  64814. // AND expression. However, you can include AND and OR expressions
  64815. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  64816. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  64817. // true).
  64818. func (c *NodeTypesListCall) Filter(filter string) *NodeTypesListCall {
  64819. c.urlParams_.Set("filter", filter)
  64820. return c
  64821. }
  64822. // MaxResults sets the optional parameter "maxResults": The maximum
  64823. // number of results per page that should be returned. If the number of
  64824. // available results is larger than maxResults, Compute Engine returns a
  64825. // nextPageToken that can be used to get the next page of results in
  64826. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  64827. // (Default: 500)
  64828. func (c *NodeTypesListCall) MaxResults(maxResults int64) *NodeTypesListCall {
  64829. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  64830. return c
  64831. }
  64832. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  64833. // a certain order. By default, results are returned in alphanumerical
  64834. // order based on the resource name.
  64835. //
  64836. // You can also sort results in descending order based on the creation
  64837. // timestamp using orderBy="creationTimestamp desc". This sorts results
  64838. // based on the creationTimestamp field in reverse chronological order
  64839. // (newest result first). Use this to sort resources like operations so
  64840. // that the newest operation is returned first.
  64841. //
  64842. // Currently, only sorting by name or creationTimestamp desc is
  64843. // supported.
  64844. func (c *NodeTypesListCall) OrderBy(orderBy string) *NodeTypesListCall {
  64845. c.urlParams_.Set("orderBy", orderBy)
  64846. return c
  64847. }
  64848. // PageToken sets the optional parameter "pageToken": Specifies a page
  64849. // token to use. Set pageToken to the nextPageToken returned by a
  64850. // previous list request to get the next page of results.
  64851. func (c *NodeTypesListCall) PageToken(pageToken string) *NodeTypesListCall {
  64852. c.urlParams_.Set("pageToken", pageToken)
  64853. return c
  64854. }
  64855. // Fields allows partial responses to be retrieved. See
  64856. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64857. // for more information.
  64858. func (c *NodeTypesListCall) Fields(s ...googleapi.Field) *NodeTypesListCall {
  64859. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64860. return c
  64861. }
  64862. // IfNoneMatch sets the optional parameter which makes the operation
  64863. // fail if the object's ETag matches the given value. This is useful for
  64864. // getting updates only after the object has changed since the last
  64865. // request. Use googleapi.IsNotModified to check whether the response
  64866. // error from Do is the result of In-None-Match.
  64867. func (c *NodeTypesListCall) IfNoneMatch(entityTag string) *NodeTypesListCall {
  64868. c.ifNoneMatch_ = entityTag
  64869. return c
  64870. }
  64871. // Context sets the context to be used in this call's Do method. Any
  64872. // pending HTTP request will be aborted if the provided context is
  64873. // canceled.
  64874. func (c *NodeTypesListCall) Context(ctx context.Context) *NodeTypesListCall {
  64875. c.ctx_ = ctx
  64876. return c
  64877. }
  64878. // Header returns an http.Header that can be modified by the caller to
  64879. // add HTTP headers to the request.
  64880. func (c *NodeTypesListCall) Header() http.Header {
  64881. if c.header_ == nil {
  64882. c.header_ = make(http.Header)
  64883. }
  64884. return c.header_
  64885. }
  64886. func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) {
  64887. reqHeaders := make(http.Header)
  64888. for k, v := range c.header_ {
  64889. reqHeaders[k] = v
  64890. }
  64891. reqHeaders.Set("User-Agent", c.s.userAgent())
  64892. if c.ifNoneMatch_ != "" {
  64893. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64894. }
  64895. var body io.Reader = nil
  64896. c.urlParams_.Set("alt", alt)
  64897. c.urlParams_.Set("prettyPrint", "false")
  64898. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes")
  64899. urls += "?" + c.urlParams_.Encode()
  64900. req, err := http.NewRequest("GET", urls, body)
  64901. if err != nil {
  64902. return nil, err
  64903. }
  64904. req.Header = reqHeaders
  64905. googleapi.Expand(req.URL, map[string]string{
  64906. "project": c.project,
  64907. "zone": c.zone,
  64908. })
  64909. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64910. }
  64911. // Do executes the "compute.nodeTypes.list" call.
  64912. // Exactly one of *NodeTypeList or error will be non-nil. Any non-2xx
  64913. // status code is an error. Response headers are in either
  64914. // *NodeTypeList.ServerResponse.Header or (if a response was returned at
  64915. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64916. // to check whether the returned error was because
  64917. // http.StatusNotModified was returned.
  64918. func (c *NodeTypesListCall) Do(opts ...googleapi.CallOption) (*NodeTypeList, error) {
  64919. gensupport.SetOptions(c.urlParams_, opts...)
  64920. res, err := c.doRequest("json")
  64921. if res != nil && res.StatusCode == http.StatusNotModified {
  64922. if res.Body != nil {
  64923. res.Body.Close()
  64924. }
  64925. return nil, &googleapi.Error{
  64926. Code: res.StatusCode,
  64927. Header: res.Header,
  64928. }
  64929. }
  64930. if err != nil {
  64931. return nil, err
  64932. }
  64933. defer googleapi.CloseBody(res)
  64934. if err := googleapi.CheckResponse(res); err != nil {
  64935. return nil, err
  64936. }
  64937. ret := &NodeTypeList{
  64938. ServerResponse: googleapi.ServerResponse{
  64939. Header: res.Header,
  64940. HTTPStatusCode: res.StatusCode,
  64941. },
  64942. }
  64943. target := &ret
  64944. if err := gensupport.DecodeResponse(target, res); err != nil {
  64945. return nil, err
  64946. }
  64947. return ret, nil
  64948. // {
  64949. // "description": "Retrieves a list of node types available to the specified project.",
  64950. // "httpMethod": "GET",
  64951. // "id": "compute.nodeTypes.list",
  64952. // "parameterOrder": [
  64953. // "project",
  64954. // "zone"
  64955. // ],
  64956. // "parameters": {
  64957. // "filter": {
  64958. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  64959. // "location": "query",
  64960. // "type": "string"
  64961. // },
  64962. // "maxResults": {
  64963. // "default": "500",
  64964. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  64965. // "format": "uint32",
  64966. // "location": "query",
  64967. // "minimum": "0",
  64968. // "type": "integer"
  64969. // },
  64970. // "orderBy": {
  64971. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  64972. // "location": "query",
  64973. // "type": "string"
  64974. // },
  64975. // "pageToken": {
  64976. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  64977. // "location": "query",
  64978. // "type": "string"
  64979. // },
  64980. // "project": {
  64981. // "description": "Project ID for this request.",
  64982. // "location": "path",
  64983. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64984. // "required": true,
  64985. // "type": "string"
  64986. // },
  64987. // "zone": {
  64988. // "description": "The name of the zone for this request.",
  64989. // "location": "path",
  64990. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64991. // "required": true,
  64992. // "type": "string"
  64993. // }
  64994. // },
  64995. // "path": "{project}/zones/{zone}/nodeTypes",
  64996. // "response": {
  64997. // "$ref": "NodeTypeList"
  64998. // },
  64999. // "scopes": [
  65000. // "https://www.googleapis.com/auth/cloud-platform",
  65001. // "https://www.googleapis.com/auth/compute",
  65002. // "https://www.googleapis.com/auth/compute.readonly"
  65003. // ]
  65004. // }
  65005. }
  65006. // Pages invokes f for each page of results.
  65007. // A non-nil error returned from f will halt the iteration.
  65008. // The provided context supersedes any context provided to the Context method.
  65009. func (c *NodeTypesListCall) Pages(ctx context.Context, f func(*NodeTypeList) error) error {
  65010. c.ctx_ = ctx
  65011. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  65012. for {
  65013. x, err := c.Do()
  65014. if err != nil {
  65015. return err
  65016. }
  65017. if err := f(x); err != nil {
  65018. return err
  65019. }
  65020. if x.NextPageToken == "" {
  65021. return nil
  65022. }
  65023. c.PageToken(x.NextPageToken)
  65024. }
  65025. }
  65026. // method id "compute.projects.disableXpnHost":
  65027. type ProjectsDisableXpnHostCall struct {
  65028. s *Service
  65029. project string
  65030. urlParams_ gensupport.URLParams
  65031. ctx_ context.Context
  65032. header_ http.Header
  65033. }
  65034. // DisableXpnHost: Disable this project as a shared VPC host project.
  65035. func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHostCall {
  65036. c := &ProjectsDisableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65037. c.project = project
  65038. return c
  65039. }
  65040. // RequestId sets the optional parameter "requestId": An optional
  65041. // request ID to identify requests. Specify a unique request ID so that
  65042. // if you must retry your request, the server will know to ignore the
  65043. // request if it has already been completed.
  65044. //
  65045. // For example, consider a situation where you make an initial request
  65046. // and the request times out. If you make the request again with the
  65047. // same request ID, the server can check if original operation with the
  65048. // same request ID was received, and if so, will ignore the second
  65049. // request. This prevents clients from accidentally creating duplicate
  65050. // commitments.
  65051. //
  65052. // The request ID must be a valid UUID with the exception that zero UUID
  65053. // is not supported (00000000-0000-0000-0000-000000000000).
  65054. func (c *ProjectsDisableXpnHostCall) RequestId(requestId string) *ProjectsDisableXpnHostCall {
  65055. c.urlParams_.Set("requestId", requestId)
  65056. return c
  65057. }
  65058. // Fields allows partial responses to be retrieved. See
  65059. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65060. // for more information.
  65061. func (c *ProjectsDisableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnHostCall {
  65062. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65063. return c
  65064. }
  65065. // Context sets the context to be used in this call's Do method. Any
  65066. // pending HTTP request will be aborted if the provided context is
  65067. // canceled.
  65068. func (c *ProjectsDisableXpnHostCall) Context(ctx context.Context) *ProjectsDisableXpnHostCall {
  65069. c.ctx_ = ctx
  65070. return c
  65071. }
  65072. // Header returns an http.Header that can be modified by the caller to
  65073. // add HTTP headers to the request.
  65074. func (c *ProjectsDisableXpnHostCall) Header() http.Header {
  65075. if c.header_ == nil {
  65076. c.header_ = make(http.Header)
  65077. }
  65078. return c.header_
  65079. }
  65080. func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  65081. reqHeaders := make(http.Header)
  65082. for k, v := range c.header_ {
  65083. reqHeaders[k] = v
  65084. }
  65085. reqHeaders.Set("User-Agent", c.s.userAgent())
  65086. var body io.Reader = nil
  65087. c.urlParams_.Set("alt", alt)
  65088. c.urlParams_.Set("prettyPrint", "false")
  65089. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnHost")
  65090. urls += "?" + c.urlParams_.Encode()
  65091. req, err := http.NewRequest("POST", urls, body)
  65092. if err != nil {
  65093. return nil, err
  65094. }
  65095. req.Header = reqHeaders
  65096. googleapi.Expand(req.URL, map[string]string{
  65097. "project": c.project,
  65098. })
  65099. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65100. }
  65101. // Do executes the "compute.projects.disableXpnHost" call.
  65102. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65103. // status code is an error. Response headers are in either
  65104. // *Operation.ServerResponse.Header or (if a response was returned at
  65105. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65106. // to check whether the returned error was because
  65107. // http.StatusNotModified was returned.
  65108. func (c *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65109. gensupport.SetOptions(c.urlParams_, opts...)
  65110. res, err := c.doRequest("json")
  65111. if res != nil && res.StatusCode == http.StatusNotModified {
  65112. if res.Body != nil {
  65113. res.Body.Close()
  65114. }
  65115. return nil, &googleapi.Error{
  65116. Code: res.StatusCode,
  65117. Header: res.Header,
  65118. }
  65119. }
  65120. if err != nil {
  65121. return nil, err
  65122. }
  65123. defer googleapi.CloseBody(res)
  65124. if err := googleapi.CheckResponse(res); err != nil {
  65125. return nil, err
  65126. }
  65127. ret := &Operation{
  65128. ServerResponse: googleapi.ServerResponse{
  65129. Header: res.Header,
  65130. HTTPStatusCode: res.StatusCode,
  65131. },
  65132. }
  65133. target := &ret
  65134. if err := gensupport.DecodeResponse(target, res); err != nil {
  65135. return nil, err
  65136. }
  65137. return ret, nil
  65138. // {
  65139. // "description": "Disable this project as a shared VPC host project.",
  65140. // "httpMethod": "POST",
  65141. // "id": "compute.projects.disableXpnHost",
  65142. // "parameterOrder": [
  65143. // "project"
  65144. // ],
  65145. // "parameters": {
  65146. // "project": {
  65147. // "description": "Project ID for this request.",
  65148. // "location": "path",
  65149. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65150. // "required": true,
  65151. // "type": "string"
  65152. // },
  65153. // "requestId": {
  65154. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65155. // "location": "query",
  65156. // "type": "string"
  65157. // }
  65158. // },
  65159. // "path": "{project}/disableXpnHost",
  65160. // "response": {
  65161. // "$ref": "Operation"
  65162. // },
  65163. // "scopes": [
  65164. // "https://www.googleapis.com/auth/cloud-platform",
  65165. // "https://www.googleapis.com/auth/compute"
  65166. // ]
  65167. // }
  65168. }
  65169. // method id "compute.projects.disableXpnResource":
  65170. type ProjectsDisableXpnResourceCall struct {
  65171. s *Service
  65172. project string
  65173. projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest
  65174. urlParams_ gensupport.URLParams
  65175. ctx_ context.Context
  65176. header_ http.Header
  65177. }
  65178. // DisableXpnResource: Disable a serivce resource (a.k.a service
  65179. // project) associated with this host project.
  65180. func (r *ProjectsService) DisableXpnResource(project string, projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest) *ProjectsDisableXpnResourceCall {
  65181. c := &ProjectsDisableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65182. c.project = project
  65183. c.projectsdisablexpnresourcerequest = projectsdisablexpnresourcerequest
  65184. return c
  65185. }
  65186. // RequestId sets the optional parameter "requestId": An optional
  65187. // request ID to identify requests. Specify a unique request ID so that
  65188. // if you must retry your request, the server will know to ignore the
  65189. // request if it has already been completed.
  65190. //
  65191. // For example, consider a situation where you make an initial request
  65192. // and the request times out. If you make the request again with the
  65193. // same request ID, the server can check if original operation with the
  65194. // same request ID was received, and if so, will ignore the second
  65195. // request. This prevents clients from accidentally creating duplicate
  65196. // commitments.
  65197. //
  65198. // The request ID must be a valid UUID with the exception that zero UUID
  65199. // is not supported (00000000-0000-0000-0000-000000000000).
  65200. func (c *ProjectsDisableXpnResourceCall) RequestId(requestId string) *ProjectsDisableXpnResourceCall {
  65201. c.urlParams_.Set("requestId", requestId)
  65202. return c
  65203. }
  65204. // Fields allows partial responses to be retrieved. See
  65205. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65206. // for more information.
  65207. func (c *ProjectsDisableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnResourceCall {
  65208. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65209. return c
  65210. }
  65211. // Context sets the context to be used in this call's Do method. Any
  65212. // pending HTTP request will be aborted if the provided context is
  65213. // canceled.
  65214. func (c *ProjectsDisableXpnResourceCall) Context(ctx context.Context) *ProjectsDisableXpnResourceCall {
  65215. c.ctx_ = ctx
  65216. return c
  65217. }
  65218. // Header returns an http.Header that can be modified by the caller to
  65219. // add HTTP headers to the request.
  65220. func (c *ProjectsDisableXpnResourceCall) Header() http.Header {
  65221. if c.header_ == nil {
  65222. c.header_ = make(http.Header)
  65223. }
  65224. return c.header_
  65225. }
  65226. func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  65227. reqHeaders := make(http.Header)
  65228. for k, v := range c.header_ {
  65229. reqHeaders[k] = v
  65230. }
  65231. reqHeaders.Set("User-Agent", c.s.userAgent())
  65232. var body io.Reader = nil
  65233. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest)
  65234. if err != nil {
  65235. return nil, err
  65236. }
  65237. reqHeaders.Set("Content-Type", "application/json")
  65238. c.urlParams_.Set("alt", alt)
  65239. c.urlParams_.Set("prettyPrint", "false")
  65240. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnResource")
  65241. urls += "?" + c.urlParams_.Encode()
  65242. req, err := http.NewRequest("POST", urls, body)
  65243. if err != nil {
  65244. return nil, err
  65245. }
  65246. req.Header = reqHeaders
  65247. googleapi.Expand(req.URL, map[string]string{
  65248. "project": c.project,
  65249. })
  65250. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65251. }
  65252. // Do executes the "compute.projects.disableXpnResource" call.
  65253. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65254. // status code is an error. Response headers are in either
  65255. // *Operation.ServerResponse.Header or (if a response was returned at
  65256. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65257. // to check whether the returned error was because
  65258. // http.StatusNotModified was returned.
  65259. func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65260. gensupport.SetOptions(c.urlParams_, opts...)
  65261. res, err := c.doRequest("json")
  65262. if res != nil && res.StatusCode == http.StatusNotModified {
  65263. if res.Body != nil {
  65264. res.Body.Close()
  65265. }
  65266. return nil, &googleapi.Error{
  65267. Code: res.StatusCode,
  65268. Header: res.Header,
  65269. }
  65270. }
  65271. if err != nil {
  65272. return nil, err
  65273. }
  65274. defer googleapi.CloseBody(res)
  65275. if err := googleapi.CheckResponse(res); err != nil {
  65276. return nil, err
  65277. }
  65278. ret := &Operation{
  65279. ServerResponse: googleapi.ServerResponse{
  65280. Header: res.Header,
  65281. HTTPStatusCode: res.StatusCode,
  65282. },
  65283. }
  65284. target := &ret
  65285. if err := gensupport.DecodeResponse(target, res); err != nil {
  65286. return nil, err
  65287. }
  65288. return ret, nil
  65289. // {
  65290. // "description": "Disable a serivce resource (a.k.a service project) associated with this host project.",
  65291. // "httpMethod": "POST",
  65292. // "id": "compute.projects.disableXpnResource",
  65293. // "parameterOrder": [
  65294. // "project"
  65295. // ],
  65296. // "parameters": {
  65297. // "project": {
  65298. // "description": "Project ID for this request.",
  65299. // "location": "path",
  65300. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65301. // "required": true,
  65302. // "type": "string"
  65303. // },
  65304. // "requestId": {
  65305. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65306. // "location": "query",
  65307. // "type": "string"
  65308. // }
  65309. // },
  65310. // "path": "{project}/disableXpnResource",
  65311. // "request": {
  65312. // "$ref": "ProjectsDisableXpnResourceRequest"
  65313. // },
  65314. // "response": {
  65315. // "$ref": "Operation"
  65316. // },
  65317. // "scopes": [
  65318. // "https://www.googleapis.com/auth/cloud-platform",
  65319. // "https://www.googleapis.com/auth/compute"
  65320. // ]
  65321. // }
  65322. }
  65323. // method id "compute.projects.enableXpnHost":
  65324. type ProjectsEnableXpnHostCall struct {
  65325. s *Service
  65326. project string
  65327. urlParams_ gensupport.URLParams
  65328. ctx_ context.Context
  65329. header_ http.Header
  65330. }
  65331. // EnableXpnHost: Enable this project as a shared VPC host project.
  65332. func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCall {
  65333. c := &ProjectsEnableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65334. c.project = project
  65335. return c
  65336. }
  65337. // RequestId sets the optional parameter "requestId": An optional
  65338. // request ID to identify requests. Specify a unique request ID so that
  65339. // if you must retry your request, the server will know to ignore the
  65340. // request if it has already been completed.
  65341. //
  65342. // For example, consider a situation where you make an initial request
  65343. // and the request times out. If you make the request again with the
  65344. // same request ID, the server can check if original operation with the
  65345. // same request ID was received, and if so, will ignore the second
  65346. // request. This prevents clients from accidentally creating duplicate
  65347. // commitments.
  65348. //
  65349. // The request ID must be a valid UUID with the exception that zero UUID
  65350. // is not supported (00000000-0000-0000-0000-000000000000).
  65351. func (c *ProjectsEnableXpnHostCall) RequestId(requestId string) *ProjectsEnableXpnHostCall {
  65352. c.urlParams_.Set("requestId", requestId)
  65353. return c
  65354. }
  65355. // Fields allows partial responses to be retrieved. See
  65356. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65357. // for more information.
  65358. func (c *ProjectsEnableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnHostCall {
  65359. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65360. return c
  65361. }
  65362. // Context sets the context to be used in this call's Do method. Any
  65363. // pending HTTP request will be aborted if the provided context is
  65364. // canceled.
  65365. func (c *ProjectsEnableXpnHostCall) Context(ctx context.Context) *ProjectsEnableXpnHostCall {
  65366. c.ctx_ = ctx
  65367. return c
  65368. }
  65369. // Header returns an http.Header that can be modified by the caller to
  65370. // add HTTP headers to the request.
  65371. func (c *ProjectsEnableXpnHostCall) Header() http.Header {
  65372. if c.header_ == nil {
  65373. c.header_ = make(http.Header)
  65374. }
  65375. return c.header_
  65376. }
  65377. func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  65378. reqHeaders := make(http.Header)
  65379. for k, v := range c.header_ {
  65380. reqHeaders[k] = v
  65381. }
  65382. reqHeaders.Set("User-Agent", c.s.userAgent())
  65383. var body io.Reader = nil
  65384. c.urlParams_.Set("alt", alt)
  65385. c.urlParams_.Set("prettyPrint", "false")
  65386. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnHost")
  65387. urls += "?" + c.urlParams_.Encode()
  65388. req, err := http.NewRequest("POST", urls, body)
  65389. if err != nil {
  65390. return nil, err
  65391. }
  65392. req.Header = reqHeaders
  65393. googleapi.Expand(req.URL, map[string]string{
  65394. "project": c.project,
  65395. })
  65396. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65397. }
  65398. // Do executes the "compute.projects.enableXpnHost" call.
  65399. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65400. // status code is an error. Response headers are in either
  65401. // *Operation.ServerResponse.Header or (if a response was returned at
  65402. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65403. // to check whether the returned error was because
  65404. // http.StatusNotModified was returned.
  65405. func (c *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65406. gensupport.SetOptions(c.urlParams_, opts...)
  65407. res, err := c.doRequest("json")
  65408. if res != nil && res.StatusCode == http.StatusNotModified {
  65409. if res.Body != nil {
  65410. res.Body.Close()
  65411. }
  65412. return nil, &googleapi.Error{
  65413. Code: res.StatusCode,
  65414. Header: res.Header,
  65415. }
  65416. }
  65417. if err != nil {
  65418. return nil, err
  65419. }
  65420. defer googleapi.CloseBody(res)
  65421. if err := googleapi.CheckResponse(res); err != nil {
  65422. return nil, err
  65423. }
  65424. ret := &Operation{
  65425. ServerResponse: googleapi.ServerResponse{
  65426. Header: res.Header,
  65427. HTTPStatusCode: res.StatusCode,
  65428. },
  65429. }
  65430. target := &ret
  65431. if err := gensupport.DecodeResponse(target, res); err != nil {
  65432. return nil, err
  65433. }
  65434. return ret, nil
  65435. // {
  65436. // "description": "Enable this project as a shared VPC host project.",
  65437. // "httpMethod": "POST",
  65438. // "id": "compute.projects.enableXpnHost",
  65439. // "parameterOrder": [
  65440. // "project"
  65441. // ],
  65442. // "parameters": {
  65443. // "project": {
  65444. // "description": "Project ID for this request.",
  65445. // "location": "path",
  65446. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65447. // "required": true,
  65448. // "type": "string"
  65449. // },
  65450. // "requestId": {
  65451. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65452. // "location": "query",
  65453. // "type": "string"
  65454. // }
  65455. // },
  65456. // "path": "{project}/enableXpnHost",
  65457. // "response": {
  65458. // "$ref": "Operation"
  65459. // },
  65460. // "scopes": [
  65461. // "https://www.googleapis.com/auth/cloud-platform",
  65462. // "https://www.googleapis.com/auth/compute"
  65463. // ]
  65464. // }
  65465. }
  65466. // method id "compute.projects.enableXpnResource":
  65467. type ProjectsEnableXpnResourceCall struct {
  65468. s *Service
  65469. project string
  65470. projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest
  65471. urlParams_ gensupport.URLParams
  65472. ctx_ context.Context
  65473. header_ http.Header
  65474. }
  65475. // EnableXpnResource: Enable service resource (a.k.a service project)
  65476. // for a host project, so that subnets in the host project can be used
  65477. // by instances in the service project.
  65478. func (r *ProjectsService) EnableXpnResource(project string, projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest) *ProjectsEnableXpnResourceCall {
  65479. c := &ProjectsEnableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65480. c.project = project
  65481. c.projectsenablexpnresourcerequest = projectsenablexpnresourcerequest
  65482. return c
  65483. }
  65484. // RequestId sets the optional parameter "requestId": An optional
  65485. // request ID to identify requests. Specify a unique request ID so that
  65486. // if you must retry your request, the server will know to ignore the
  65487. // request if it has already been completed.
  65488. //
  65489. // For example, consider a situation where you make an initial request
  65490. // and the request times out. If you make the request again with the
  65491. // same request ID, the server can check if original operation with the
  65492. // same request ID was received, and if so, will ignore the second
  65493. // request. This prevents clients from accidentally creating duplicate
  65494. // commitments.
  65495. //
  65496. // The request ID must be a valid UUID with the exception that zero UUID
  65497. // is not supported (00000000-0000-0000-0000-000000000000).
  65498. func (c *ProjectsEnableXpnResourceCall) RequestId(requestId string) *ProjectsEnableXpnResourceCall {
  65499. c.urlParams_.Set("requestId", requestId)
  65500. return c
  65501. }
  65502. // Fields allows partial responses to be retrieved. See
  65503. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65504. // for more information.
  65505. func (c *ProjectsEnableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnResourceCall {
  65506. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65507. return c
  65508. }
  65509. // Context sets the context to be used in this call's Do method. Any
  65510. // pending HTTP request will be aborted if the provided context is
  65511. // canceled.
  65512. func (c *ProjectsEnableXpnResourceCall) Context(ctx context.Context) *ProjectsEnableXpnResourceCall {
  65513. c.ctx_ = ctx
  65514. return c
  65515. }
  65516. // Header returns an http.Header that can be modified by the caller to
  65517. // add HTTP headers to the request.
  65518. func (c *ProjectsEnableXpnResourceCall) Header() http.Header {
  65519. if c.header_ == nil {
  65520. c.header_ = make(http.Header)
  65521. }
  65522. return c.header_
  65523. }
  65524. func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  65525. reqHeaders := make(http.Header)
  65526. for k, v := range c.header_ {
  65527. reqHeaders[k] = v
  65528. }
  65529. reqHeaders.Set("User-Agent", c.s.userAgent())
  65530. var body io.Reader = nil
  65531. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest)
  65532. if err != nil {
  65533. return nil, err
  65534. }
  65535. reqHeaders.Set("Content-Type", "application/json")
  65536. c.urlParams_.Set("alt", alt)
  65537. c.urlParams_.Set("prettyPrint", "false")
  65538. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnResource")
  65539. urls += "?" + c.urlParams_.Encode()
  65540. req, err := http.NewRequest("POST", urls, body)
  65541. if err != nil {
  65542. return nil, err
  65543. }
  65544. req.Header = reqHeaders
  65545. googleapi.Expand(req.URL, map[string]string{
  65546. "project": c.project,
  65547. })
  65548. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65549. }
  65550. // Do executes the "compute.projects.enableXpnResource" call.
  65551. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65552. // status code is an error. Response headers are in either
  65553. // *Operation.ServerResponse.Header or (if a response was returned at
  65554. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65555. // to check whether the returned error was because
  65556. // http.StatusNotModified was returned.
  65557. func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65558. gensupport.SetOptions(c.urlParams_, opts...)
  65559. res, err := c.doRequest("json")
  65560. if res != nil && res.StatusCode == http.StatusNotModified {
  65561. if res.Body != nil {
  65562. res.Body.Close()
  65563. }
  65564. return nil, &googleapi.Error{
  65565. Code: res.StatusCode,
  65566. Header: res.Header,
  65567. }
  65568. }
  65569. if err != nil {
  65570. return nil, err
  65571. }
  65572. defer googleapi.CloseBody(res)
  65573. if err := googleapi.CheckResponse(res); err != nil {
  65574. return nil, err
  65575. }
  65576. ret := &Operation{
  65577. ServerResponse: googleapi.ServerResponse{
  65578. Header: res.Header,
  65579. HTTPStatusCode: res.StatusCode,
  65580. },
  65581. }
  65582. target := &ret
  65583. if err := gensupport.DecodeResponse(target, res); err != nil {
  65584. return nil, err
  65585. }
  65586. return ret, nil
  65587. // {
  65588. // "description": "Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.",
  65589. // "httpMethod": "POST",
  65590. // "id": "compute.projects.enableXpnResource",
  65591. // "parameterOrder": [
  65592. // "project"
  65593. // ],
  65594. // "parameters": {
  65595. // "project": {
  65596. // "description": "Project ID for this request.",
  65597. // "location": "path",
  65598. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65599. // "required": true,
  65600. // "type": "string"
  65601. // },
  65602. // "requestId": {
  65603. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65604. // "location": "query",
  65605. // "type": "string"
  65606. // }
  65607. // },
  65608. // "path": "{project}/enableXpnResource",
  65609. // "request": {
  65610. // "$ref": "ProjectsEnableXpnResourceRequest"
  65611. // },
  65612. // "response": {
  65613. // "$ref": "Operation"
  65614. // },
  65615. // "scopes": [
  65616. // "https://www.googleapis.com/auth/cloud-platform",
  65617. // "https://www.googleapis.com/auth/compute"
  65618. // ]
  65619. // }
  65620. }
  65621. // method id "compute.projects.get":
  65622. type ProjectsGetCall struct {
  65623. s *Service
  65624. project string
  65625. urlParams_ gensupport.URLParams
  65626. ifNoneMatch_ string
  65627. ctx_ context.Context
  65628. header_ http.Header
  65629. }
  65630. // Get: Returns the specified Project resource.
  65631. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get
  65632. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  65633. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65634. c.project = project
  65635. return c
  65636. }
  65637. // Fields allows partial responses to be retrieved. See
  65638. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65639. // for more information.
  65640. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  65641. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65642. return c
  65643. }
  65644. // IfNoneMatch sets the optional parameter which makes the operation
  65645. // fail if the object's ETag matches the given value. This is useful for
  65646. // getting updates only after the object has changed since the last
  65647. // request. Use googleapi.IsNotModified to check whether the response
  65648. // error from Do is the result of In-None-Match.
  65649. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  65650. c.ifNoneMatch_ = entityTag
  65651. return c
  65652. }
  65653. // Context sets the context to be used in this call's Do method. Any
  65654. // pending HTTP request will be aborted if the provided context is
  65655. // canceled.
  65656. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  65657. c.ctx_ = ctx
  65658. return c
  65659. }
  65660. // Header returns an http.Header that can be modified by the caller to
  65661. // add HTTP headers to the request.
  65662. func (c *ProjectsGetCall) Header() http.Header {
  65663. if c.header_ == nil {
  65664. c.header_ = make(http.Header)
  65665. }
  65666. return c.header_
  65667. }
  65668. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  65669. reqHeaders := make(http.Header)
  65670. for k, v := range c.header_ {
  65671. reqHeaders[k] = v
  65672. }
  65673. reqHeaders.Set("User-Agent", c.s.userAgent())
  65674. if c.ifNoneMatch_ != "" {
  65675. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65676. }
  65677. var body io.Reader = nil
  65678. c.urlParams_.Set("alt", alt)
  65679. c.urlParams_.Set("prettyPrint", "false")
  65680. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  65681. urls += "?" + c.urlParams_.Encode()
  65682. req, err := http.NewRequest("GET", urls, body)
  65683. if err != nil {
  65684. return nil, err
  65685. }
  65686. req.Header = reqHeaders
  65687. googleapi.Expand(req.URL, map[string]string{
  65688. "project": c.project,
  65689. })
  65690. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65691. }
  65692. // Do executes the "compute.projects.get" call.
  65693. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  65694. // code is an error. Response headers are in either
  65695. // *Project.ServerResponse.Header or (if a response was returned at all)
  65696. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  65697. // check whether the returned error was because http.StatusNotModified
  65698. // was returned.
  65699. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  65700. gensupport.SetOptions(c.urlParams_, opts...)
  65701. res, err := c.doRequest("json")
  65702. if res != nil && res.StatusCode == http.StatusNotModified {
  65703. if res.Body != nil {
  65704. res.Body.Close()
  65705. }
  65706. return nil, &googleapi.Error{
  65707. Code: res.StatusCode,
  65708. Header: res.Header,
  65709. }
  65710. }
  65711. if err != nil {
  65712. return nil, err
  65713. }
  65714. defer googleapi.CloseBody(res)
  65715. if err := googleapi.CheckResponse(res); err != nil {
  65716. return nil, err
  65717. }
  65718. ret := &Project{
  65719. ServerResponse: googleapi.ServerResponse{
  65720. Header: res.Header,
  65721. HTTPStatusCode: res.StatusCode,
  65722. },
  65723. }
  65724. target := &ret
  65725. if err := gensupport.DecodeResponse(target, res); err != nil {
  65726. return nil, err
  65727. }
  65728. return ret, nil
  65729. // {
  65730. // "description": "Returns the specified Project resource.",
  65731. // "httpMethod": "GET",
  65732. // "id": "compute.projects.get",
  65733. // "parameterOrder": [
  65734. // "project"
  65735. // ],
  65736. // "parameters": {
  65737. // "project": {
  65738. // "description": "Project ID for this request.",
  65739. // "location": "path",
  65740. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65741. // "required": true,
  65742. // "type": "string"
  65743. // }
  65744. // },
  65745. // "path": "{project}",
  65746. // "response": {
  65747. // "$ref": "Project"
  65748. // },
  65749. // "scopes": [
  65750. // "https://www.googleapis.com/auth/cloud-platform",
  65751. // "https://www.googleapis.com/auth/compute",
  65752. // "https://www.googleapis.com/auth/compute.readonly"
  65753. // ]
  65754. // }
  65755. }
  65756. // method id "compute.projects.getXpnHost":
  65757. type ProjectsGetXpnHostCall struct {
  65758. s *Service
  65759. project string
  65760. urlParams_ gensupport.URLParams
  65761. ifNoneMatch_ string
  65762. ctx_ context.Context
  65763. header_ http.Header
  65764. }
  65765. // GetXpnHost: Gets the shared VPC host project that this project links
  65766. // to. May be empty if no link exists.
  65767. func (r *ProjectsService) GetXpnHost(project string) *ProjectsGetXpnHostCall {
  65768. c := &ProjectsGetXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65769. c.project = project
  65770. return c
  65771. }
  65772. // Fields allows partial responses to be retrieved. See
  65773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65774. // for more information.
  65775. func (c *ProjectsGetXpnHostCall) Fields(s ...googleapi.Field) *ProjectsGetXpnHostCall {
  65776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65777. return c
  65778. }
  65779. // IfNoneMatch sets the optional parameter which makes the operation
  65780. // fail if the object's ETag matches the given value. This is useful for
  65781. // getting updates only after the object has changed since the last
  65782. // request. Use googleapi.IsNotModified to check whether the response
  65783. // error from Do is the result of In-None-Match.
  65784. func (c *ProjectsGetXpnHostCall) IfNoneMatch(entityTag string) *ProjectsGetXpnHostCall {
  65785. c.ifNoneMatch_ = entityTag
  65786. return c
  65787. }
  65788. // Context sets the context to be used in this call's Do method. Any
  65789. // pending HTTP request will be aborted if the provided context is
  65790. // canceled.
  65791. func (c *ProjectsGetXpnHostCall) Context(ctx context.Context) *ProjectsGetXpnHostCall {
  65792. c.ctx_ = ctx
  65793. return c
  65794. }
  65795. // Header returns an http.Header that can be modified by the caller to
  65796. // add HTTP headers to the request.
  65797. func (c *ProjectsGetXpnHostCall) Header() http.Header {
  65798. if c.header_ == nil {
  65799. c.header_ = make(http.Header)
  65800. }
  65801. return c.header_
  65802. }
  65803. func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) {
  65804. reqHeaders := make(http.Header)
  65805. for k, v := range c.header_ {
  65806. reqHeaders[k] = v
  65807. }
  65808. reqHeaders.Set("User-Agent", c.s.userAgent())
  65809. if c.ifNoneMatch_ != "" {
  65810. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65811. }
  65812. var body io.Reader = nil
  65813. c.urlParams_.Set("alt", alt)
  65814. c.urlParams_.Set("prettyPrint", "false")
  65815. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnHost")
  65816. urls += "?" + c.urlParams_.Encode()
  65817. req, err := http.NewRequest("GET", urls, body)
  65818. if err != nil {
  65819. return nil, err
  65820. }
  65821. req.Header = reqHeaders
  65822. googleapi.Expand(req.URL, map[string]string{
  65823. "project": c.project,
  65824. })
  65825. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65826. }
  65827. // Do executes the "compute.projects.getXpnHost" call.
  65828. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  65829. // code is an error. Response headers are in either
  65830. // *Project.ServerResponse.Header or (if a response was returned at all)
  65831. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  65832. // check whether the returned error was because http.StatusNotModified
  65833. // was returned.
  65834. func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  65835. gensupport.SetOptions(c.urlParams_, opts...)
  65836. res, err := c.doRequest("json")
  65837. if res != nil && res.StatusCode == http.StatusNotModified {
  65838. if res.Body != nil {
  65839. res.Body.Close()
  65840. }
  65841. return nil, &googleapi.Error{
  65842. Code: res.StatusCode,
  65843. Header: res.Header,
  65844. }
  65845. }
  65846. if err != nil {
  65847. return nil, err
  65848. }
  65849. defer googleapi.CloseBody(res)
  65850. if err := googleapi.CheckResponse(res); err != nil {
  65851. return nil, err
  65852. }
  65853. ret := &Project{
  65854. ServerResponse: googleapi.ServerResponse{
  65855. Header: res.Header,
  65856. HTTPStatusCode: res.StatusCode,
  65857. },
  65858. }
  65859. target := &ret
  65860. if err := gensupport.DecodeResponse(target, res); err != nil {
  65861. return nil, err
  65862. }
  65863. return ret, nil
  65864. // {
  65865. // "description": "Gets the shared VPC host project that this project links to. May be empty if no link exists.",
  65866. // "httpMethod": "GET",
  65867. // "id": "compute.projects.getXpnHost",
  65868. // "parameterOrder": [
  65869. // "project"
  65870. // ],
  65871. // "parameters": {
  65872. // "project": {
  65873. // "description": "Project ID for this request.",
  65874. // "location": "path",
  65875. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65876. // "required": true,
  65877. // "type": "string"
  65878. // }
  65879. // },
  65880. // "path": "{project}/getXpnHost",
  65881. // "response": {
  65882. // "$ref": "Project"
  65883. // },
  65884. // "scopes": [
  65885. // "https://www.googleapis.com/auth/cloud-platform",
  65886. // "https://www.googleapis.com/auth/compute"
  65887. // ]
  65888. // }
  65889. }
  65890. // method id "compute.projects.getXpnResources":
  65891. type ProjectsGetXpnResourcesCall struct {
  65892. s *Service
  65893. project string
  65894. urlParams_ gensupport.URLParams
  65895. ifNoneMatch_ string
  65896. ctx_ context.Context
  65897. header_ http.Header
  65898. }
  65899. // GetXpnResources: Gets service resources (a.k.a service project)
  65900. // associated with this host project.
  65901. func (r *ProjectsService) GetXpnResources(project string) *ProjectsGetXpnResourcesCall {
  65902. c := &ProjectsGetXpnResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65903. c.project = project
  65904. return c
  65905. }
  65906. // Filter sets the optional parameter "filter": A filter expression that
  65907. // filters resources listed in the response. The expression must specify
  65908. // the field name, a comparison operator, and the value that you want to
  65909. // use for filtering. The value must be a string, a number, or a
  65910. // boolean. The comparison operator must be either =, !=, >, or <.
  65911. //
  65912. // For example, if you are filtering Compute Engine instances, you can
  65913. // exclude instances named example-instance by specifying name !=
  65914. // example-instance.
  65915. //
  65916. // You can also filter nested fields. For example, you could specify
  65917. // scheduling.automaticRestart = false to include instances only if they
  65918. // are not scheduled for automatic restarts. You can use filtering on
  65919. // nested fields to filter based on resource labels.
  65920. //
  65921. // To filter on multiple expressions, provide each separate expression
  65922. // within parentheses. For example, (scheduling.automaticRestart = true)
  65923. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  65924. // AND expression. However, you can include AND and OR expressions
  65925. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  65926. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  65927. // true).
  65928. func (c *ProjectsGetXpnResourcesCall) Filter(filter string) *ProjectsGetXpnResourcesCall {
  65929. c.urlParams_.Set("filter", filter)
  65930. return c
  65931. }
  65932. // MaxResults sets the optional parameter "maxResults": The maximum
  65933. // number of results per page that should be returned. If the number of
  65934. // available results is larger than maxResults, Compute Engine returns a
  65935. // nextPageToken that can be used to get the next page of results in
  65936. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  65937. // (Default: 500)
  65938. func (c *ProjectsGetXpnResourcesCall) MaxResults(maxResults int64) *ProjectsGetXpnResourcesCall {
  65939. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  65940. return c
  65941. }
  65942. // OrderBy sets the optional parameter "order_by": Sorts list results by
  65943. // a certain order. By default, results are returned in alphanumerical
  65944. // order based on the resource name.
  65945. //
  65946. // You can also sort results in descending order based on the creation
  65947. // timestamp using orderBy="creationTimestamp desc". This sorts results
  65948. // based on the creationTimestamp field in reverse chronological order
  65949. // (newest result first). Use this to sort resources like operations so
  65950. // that the newest operation is returned first.
  65951. //
  65952. // Currently, only sorting by name or creationTimestamp desc is
  65953. // supported.
  65954. func (c *ProjectsGetXpnResourcesCall) OrderBy(orderBy string) *ProjectsGetXpnResourcesCall {
  65955. c.urlParams_.Set("order_by", orderBy)
  65956. return c
  65957. }
  65958. // PageToken sets the optional parameter "pageToken": Specifies a page
  65959. // token to use. Set pageToken to the nextPageToken returned by a
  65960. // previous list request to get the next page of results.
  65961. func (c *ProjectsGetXpnResourcesCall) PageToken(pageToken string) *ProjectsGetXpnResourcesCall {
  65962. c.urlParams_.Set("pageToken", pageToken)
  65963. return c
  65964. }
  65965. // Fields allows partial responses to be retrieved. See
  65966. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65967. // for more information.
  65968. func (c *ProjectsGetXpnResourcesCall) Fields(s ...googleapi.Field) *ProjectsGetXpnResourcesCall {
  65969. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65970. return c
  65971. }
  65972. // IfNoneMatch sets the optional parameter which makes the operation
  65973. // fail if the object's ETag matches the given value. This is useful for
  65974. // getting updates only after the object has changed since the last
  65975. // request. Use googleapi.IsNotModified to check whether the response
  65976. // error from Do is the result of In-None-Match.
  65977. func (c *ProjectsGetXpnResourcesCall) IfNoneMatch(entityTag string) *ProjectsGetXpnResourcesCall {
  65978. c.ifNoneMatch_ = entityTag
  65979. return c
  65980. }
  65981. // Context sets the context to be used in this call's Do method. Any
  65982. // pending HTTP request will be aborted if the provided context is
  65983. // canceled.
  65984. func (c *ProjectsGetXpnResourcesCall) Context(ctx context.Context) *ProjectsGetXpnResourcesCall {
  65985. c.ctx_ = ctx
  65986. return c
  65987. }
  65988. // Header returns an http.Header that can be modified by the caller to
  65989. // add HTTP headers to the request.
  65990. func (c *ProjectsGetXpnResourcesCall) Header() http.Header {
  65991. if c.header_ == nil {
  65992. c.header_ = make(http.Header)
  65993. }
  65994. return c.header_
  65995. }
  65996. func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, error) {
  65997. reqHeaders := make(http.Header)
  65998. for k, v := range c.header_ {
  65999. reqHeaders[k] = v
  66000. }
  66001. reqHeaders.Set("User-Agent", c.s.userAgent())
  66002. if c.ifNoneMatch_ != "" {
  66003. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66004. }
  66005. var body io.Reader = nil
  66006. c.urlParams_.Set("alt", alt)
  66007. c.urlParams_.Set("prettyPrint", "false")
  66008. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnResources")
  66009. urls += "?" + c.urlParams_.Encode()
  66010. req, err := http.NewRequest("GET", urls, body)
  66011. if err != nil {
  66012. return nil, err
  66013. }
  66014. req.Header = reqHeaders
  66015. googleapi.Expand(req.URL, map[string]string{
  66016. "project": c.project,
  66017. })
  66018. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66019. }
  66020. // Do executes the "compute.projects.getXpnResources" call.
  66021. // Exactly one of *ProjectsGetXpnResources or error will be non-nil. Any
  66022. // non-2xx status code is an error. Response headers are in either
  66023. // *ProjectsGetXpnResources.ServerResponse.Header or (if a response was
  66024. // returned at all) in error.(*googleapi.Error).Header. Use
  66025. // googleapi.IsNotModified to check whether the returned error was
  66026. // because http.StatusNotModified was returned.
  66027. func (c *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*ProjectsGetXpnResources, error) {
  66028. gensupport.SetOptions(c.urlParams_, opts...)
  66029. res, err := c.doRequest("json")
  66030. if res != nil && res.StatusCode == http.StatusNotModified {
  66031. if res.Body != nil {
  66032. res.Body.Close()
  66033. }
  66034. return nil, &googleapi.Error{
  66035. Code: res.StatusCode,
  66036. Header: res.Header,
  66037. }
  66038. }
  66039. if err != nil {
  66040. return nil, err
  66041. }
  66042. defer googleapi.CloseBody(res)
  66043. if err := googleapi.CheckResponse(res); err != nil {
  66044. return nil, err
  66045. }
  66046. ret := &ProjectsGetXpnResources{
  66047. ServerResponse: googleapi.ServerResponse{
  66048. Header: res.Header,
  66049. HTTPStatusCode: res.StatusCode,
  66050. },
  66051. }
  66052. target := &ret
  66053. if err := gensupport.DecodeResponse(target, res); err != nil {
  66054. return nil, err
  66055. }
  66056. return ret, nil
  66057. // {
  66058. // "description": "Gets service resources (a.k.a service project) associated with this host project.",
  66059. // "httpMethod": "GET",
  66060. // "id": "compute.projects.getXpnResources",
  66061. // "parameterOrder": [
  66062. // "project"
  66063. // ],
  66064. // "parameters": {
  66065. // "filter": {
  66066. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  66067. // "location": "query",
  66068. // "type": "string"
  66069. // },
  66070. // "maxResults": {
  66071. // "default": "500",
  66072. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  66073. // "format": "uint32",
  66074. // "location": "query",
  66075. // "minimum": "0",
  66076. // "type": "integer"
  66077. // },
  66078. // "order_by": {
  66079. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  66080. // "location": "query",
  66081. // "type": "string"
  66082. // },
  66083. // "pageToken": {
  66084. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  66085. // "location": "query",
  66086. // "type": "string"
  66087. // },
  66088. // "project": {
  66089. // "description": "Project ID for this request.",
  66090. // "location": "path",
  66091. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66092. // "required": true,
  66093. // "type": "string"
  66094. // }
  66095. // },
  66096. // "path": "{project}/getXpnResources",
  66097. // "response": {
  66098. // "$ref": "ProjectsGetXpnResources"
  66099. // },
  66100. // "scopes": [
  66101. // "https://www.googleapis.com/auth/cloud-platform",
  66102. // "https://www.googleapis.com/auth/compute"
  66103. // ]
  66104. // }
  66105. }
  66106. // Pages invokes f for each page of results.
  66107. // A non-nil error returned from f will halt the iteration.
  66108. // The provided context supersedes any context provided to the Context method.
  66109. func (c *ProjectsGetXpnResourcesCall) Pages(ctx context.Context, f func(*ProjectsGetXpnResources) error) error {
  66110. c.ctx_ = ctx
  66111. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  66112. for {
  66113. x, err := c.Do()
  66114. if err != nil {
  66115. return err
  66116. }
  66117. if err := f(x); err != nil {
  66118. return err
  66119. }
  66120. if x.NextPageToken == "" {
  66121. return nil
  66122. }
  66123. c.PageToken(x.NextPageToken)
  66124. }
  66125. }
  66126. // method id "compute.projects.listXpnHosts":
  66127. type ProjectsListXpnHostsCall struct {
  66128. s *Service
  66129. project string
  66130. projectslistxpnhostsrequest *ProjectsListXpnHostsRequest
  66131. urlParams_ gensupport.URLParams
  66132. ctx_ context.Context
  66133. header_ http.Header
  66134. }
  66135. // ListXpnHosts: Lists all shared VPC host projects visible to the user
  66136. // in an organization.
  66137. func (r *ProjectsService) ListXpnHosts(project string, projectslistxpnhostsrequest *ProjectsListXpnHostsRequest) *ProjectsListXpnHostsCall {
  66138. c := &ProjectsListXpnHostsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66139. c.project = project
  66140. c.projectslistxpnhostsrequest = projectslistxpnhostsrequest
  66141. return c
  66142. }
  66143. // Filter sets the optional parameter "filter": A filter expression that
  66144. // filters resources listed in the response. The expression must specify
  66145. // the field name, a comparison operator, and the value that you want to
  66146. // use for filtering. The value must be a string, a number, or a
  66147. // boolean. The comparison operator must be either =, !=, >, or <.
  66148. //
  66149. // For example, if you are filtering Compute Engine instances, you can
  66150. // exclude instances named example-instance by specifying name !=
  66151. // example-instance.
  66152. //
  66153. // You can also filter nested fields. For example, you could specify
  66154. // scheduling.automaticRestart = false to include instances only if they
  66155. // are not scheduled for automatic restarts. You can use filtering on
  66156. // nested fields to filter based on resource labels.
  66157. //
  66158. // To filter on multiple expressions, provide each separate expression
  66159. // within parentheses. For example, (scheduling.automaticRestart = true)
  66160. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  66161. // AND expression. However, you can include AND and OR expressions
  66162. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  66163. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  66164. // true).
  66165. func (c *ProjectsListXpnHostsCall) Filter(filter string) *ProjectsListXpnHostsCall {
  66166. c.urlParams_.Set("filter", filter)
  66167. return c
  66168. }
  66169. // MaxResults sets the optional parameter "maxResults": The maximum
  66170. // number of results per page that should be returned. If the number of
  66171. // available results is larger than maxResults, Compute Engine returns a
  66172. // nextPageToken that can be used to get the next page of results in
  66173. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  66174. // (Default: 500)
  66175. func (c *ProjectsListXpnHostsCall) MaxResults(maxResults int64) *ProjectsListXpnHostsCall {
  66176. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  66177. return c
  66178. }
  66179. // OrderBy sets the optional parameter "order_by": Sorts list results by
  66180. // a certain order. By default, results are returned in alphanumerical
  66181. // order based on the resource name.
  66182. //
  66183. // You can also sort results in descending order based on the creation
  66184. // timestamp using orderBy="creationTimestamp desc". This sorts results
  66185. // based on the creationTimestamp field in reverse chronological order
  66186. // (newest result first). Use this to sort resources like operations so
  66187. // that the newest operation is returned first.
  66188. //
  66189. // Currently, only sorting by name or creationTimestamp desc is
  66190. // supported.
  66191. func (c *ProjectsListXpnHostsCall) OrderBy(orderBy string) *ProjectsListXpnHostsCall {
  66192. c.urlParams_.Set("order_by", orderBy)
  66193. return c
  66194. }
  66195. // PageToken sets the optional parameter "pageToken": Specifies a page
  66196. // token to use. Set pageToken to the nextPageToken returned by a
  66197. // previous list request to get the next page of results.
  66198. func (c *ProjectsListXpnHostsCall) PageToken(pageToken string) *ProjectsListXpnHostsCall {
  66199. c.urlParams_.Set("pageToken", pageToken)
  66200. return c
  66201. }
  66202. // Fields allows partial responses to be retrieved. See
  66203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66204. // for more information.
  66205. func (c *ProjectsListXpnHostsCall) Fields(s ...googleapi.Field) *ProjectsListXpnHostsCall {
  66206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66207. return c
  66208. }
  66209. // Context sets the context to be used in this call's Do method. Any
  66210. // pending HTTP request will be aborted if the provided context is
  66211. // canceled.
  66212. func (c *ProjectsListXpnHostsCall) Context(ctx context.Context) *ProjectsListXpnHostsCall {
  66213. c.ctx_ = ctx
  66214. return c
  66215. }
  66216. // Header returns an http.Header that can be modified by the caller to
  66217. // add HTTP headers to the request.
  66218. func (c *ProjectsListXpnHostsCall) Header() http.Header {
  66219. if c.header_ == nil {
  66220. c.header_ = make(http.Header)
  66221. }
  66222. return c.header_
  66223. }
  66224. func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) {
  66225. reqHeaders := make(http.Header)
  66226. for k, v := range c.header_ {
  66227. reqHeaders[k] = v
  66228. }
  66229. reqHeaders.Set("User-Agent", c.s.userAgent())
  66230. var body io.Reader = nil
  66231. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest)
  66232. if err != nil {
  66233. return nil, err
  66234. }
  66235. reqHeaders.Set("Content-Type", "application/json")
  66236. c.urlParams_.Set("alt", alt)
  66237. c.urlParams_.Set("prettyPrint", "false")
  66238. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/listXpnHosts")
  66239. urls += "?" + c.urlParams_.Encode()
  66240. req, err := http.NewRequest("POST", urls, body)
  66241. if err != nil {
  66242. return nil, err
  66243. }
  66244. req.Header = reqHeaders
  66245. googleapi.Expand(req.URL, map[string]string{
  66246. "project": c.project,
  66247. })
  66248. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66249. }
  66250. // Do executes the "compute.projects.listXpnHosts" call.
  66251. // Exactly one of *XpnHostList or error will be non-nil. Any non-2xx
  66252. // status code is an error. Response headers are in either
  66253. // *XpnHostList.ServerResponse.Header or (if a response was returned at
  66254. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66255. // to check whether the returned error was because
  66256. // http.StatusNotModified was returned.
  66257. func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostList, error) {
  66258. gensupport.SetOptions(c.urlParams_, opts...)
  66259. res, err := c.doRequest("json")
  66260. if res != nil && res.StatusCode == http.StatusNotModified {
  66261. if res.Body != nil {
  66262. res.Body.Close()
  66263. }
  66264. return nil, &googleapi.Error{
  66265. Code: res.StatusCode,
  66266. Header: res.Header,
  66267. }
  66268. }
  66269. if err != nil {
  66270. return nil, err
  66271. }
  66272. defer googleapi.CloseBody(res)
  66273. if err := googleapi.CheckResponse(res); err != nil {
  66274. return nil, err
  66275. }
  66276. ret := &XpnHostList{
  66277. ServerResponse: googleapi.ServerResponse{
  66278. Header: res.Header,
  66279. HTTPStatusCode: res.StatusCode,
  66280. },
  66281. }
  66282. target := &ret
  66283. if err := gensupport.DecodeResponse(target, res); err != nil {
  66284. return nil, err
  66285. }
  66286. return ret, nil
  66287. // {
  66288. // "description": "Lists all shared VPC host projects visible to the user in an organization.",
  66289. // "httpMethod": "POST",
  66290. // "id": "compute.projects.listXpnHosts",
  66291. // "parameterOrder": [
  66292. // "project"
  66293. // ],
  66294. // "parameters": {
  66295. // "filter": {
  66296. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  66297. // "location": "query",
  66298. // "type": "string"
  66299. // },
  66300. // "maxResults": {
  66301. // "default": "500",
  66302. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  66303. // "format": "uint32",
  66304. // "location": "query",
  66305. // "minimum": "0",
  66306. // "type": "integer"
  66307. // },
  66308. // "order_by": {
  66309. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  66310. // "location": "query",
  66311. // "type": "string"
  66312. // },
  66313. // "pageToken": {
  66314. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  66315. // "location": "query",
  66316. // "type": "string"
  66317. // },
  66318. // "project": {
  66319. // "description": "Project ID for this request.",
  66320. // "location": "path",
  66321. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66322. // "required": true,
  66323. // "type": "string"
  66324. // }
  66325. // },
  66326. // "path": "{project}/listXpnHosts",
  66327. // "request": {
  66328. // "$ref": "ProjectsListXpnHostsRequest"
  66329. // },
  66330. // "response": {
  66331. // "$ref": "XpnHostList"
  66332. // },
  66333. // "scopes": [
  66334. // "https://www.googleapis.com/auth/cloud-platform",
  66335. // "https://www.googleapis.com/auth/compute"
  66336. // ]
  66337. // }
  66338. }
  66339. // Pages invokes f for each page of results.
  66340. // A non-nil error returned from f will halt the iteration.
  66341. // The provided context supersedes any context provided to the Context method.
  66342. func (c *ProjectsListXpnHostsCall) Pages(ctx context.Context, f func(*XpnHostList) error) error {
  66343. c.ctx_ = ctx
  66344. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  66345. for {
  66346. x, err := c.Do()
  66347. if err != nil {
  66348. return err
  66349. }
  66350. if err := f(x); err != nil {
  66351. return err
  66352. }
  66353. if x.NextPageToken == "" {
  66354. return nil
  66355. }
  66356. c.PageToken(x.NextPageToken)
  66357. }
  66358. }
  66359. // method id "compute.projects.moveDisk":
  66360. type ProjectsMoveDiskCall struct {
  66361. s *Service
  66362. project string
  66363. diskmoverequest *DiskMoveRequest
  66364. urlParams_ gensupport.URLParams
  66365. ctx_ context.Context
  66366. header_ http.Header
  66367. }
  66368. // MoveDisk: Moves a persistent disk from one zone to another.
  66369. func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall {
  66370. c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66371. c.project = project
  66372. c.diskmoverequest = diskmoverequest
  66373. return c
  66374. }
  66375. // RequestId sets the optional parameter "requestId": An optional
  66376. // request ID to identify requests. Specify a unique request ID so that
  66377. // if you must retry your request, the server will know to ignore the
  66378. // request if it has already been completed.
  66379. //
  66380. // For example, consider a situation where you make an initial request
  66381. // and the request times out. If you make the request again with the
  66382. // same request ID, the server can check if original operation with the
  66383. // same request ID was received, and if so, will ignore the second
  66384. // request. This prevents clients from accidentally creating duplicate
  66385. // commitments.
  66386. //
  66387. // The request ID must be a valid UUID with the exception that zero UUID
  66388. // is not supported (00000000-0000-0000-0000-000000000000).
  66389. func (c *ProjectsMoveDiskCall) RequestId(requestId string) *ProjectsMoveDiskCall {
  66390. c.urlParams_.Set("requestId", requestId)
  66391. return c
  66392. }
  66393. // Fields allows partial responses to be retrieved. See
  66394. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66395. // for more information.
  66396. func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall {
  66397. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66398. return c
  66399. }
  66400. // Context sets the context to be used in this call's Do method. Any
  66401. // pending HTTP request will be aborted if the provided context is
  66402. // canceled.
  66403. func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall {
  66404. c.ctx_ = ctx
  66405. return c
  66406. }
  66407. // Header returns an http.Header that can be modified by the caller to
  66408. // add HTTP headers to the request.
  66409. func (c *ProjectsMoveDiskCall) Header() http.Header {
  66410. if c.header_ == nil {
  66411. c.header_ = make(http.Header)
  66412. }
  66413. return c.header_
  66414. }
  66415. func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) {
  66416. reqHeaders := make(http.Header)
  66417. for k, v := range c.header_ {
  66418. reqHeaders[k] = v
  66419. }
  66420. reqHeaders.Set("User-Agent", c.s.userAgent())
  66421. var body io.Reader = nil
  66422. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest)
  66423. if err != nil {
  66424. return nil, err
  66425. }
  66426. reqHeaders.Set("Content-Type", "application/json")
  66427. c.urlParams_.Set("alt", alt)
  66428. c.urlParams_.Set("prettyPrint", "false")
  66429. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveDisk")
  66430. urls += "?" + c.urlParams_.Encode()
  66431. req, err := http.NewRequest("POST", urls, body)
  66432. if err != nil {
  66433. return nil, err
  66434. }
  66435. req.Header = reqHeaders
  66436. googleapi.Expand(req.URL, map[string]string{
  66437. "project": c.project,
  66438. })
  66439. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66440. }
  66441. // Do executes the "compute.projects.moveDisk" call.
  66442. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66443. // status code is an error. Response headers are in either
  66444. // *Operation.ServerResponse.Header or (if a response was returned at
  66445. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66446. // to check whether the returned error was because
  66447. // http.StatusNotModified was returned.
  66448. func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66449. gensupport.SetOptions(c.urlParams_, opts...)
  66450. res, err := c.doRequest("json")
  66451. if res != nil && res.StatusCode == http.StatusNotModified {
  66452. if res.Body != nil {
  66453. res.Body.Close()
  66454. }
  66455. return nil, &googleapi.Error{
  66456. Code: res.StatusCode,
  66457. Header: res.Header,
  66458. }
  66459. }
  66460. if err != nil {
  66461. return nil, err
  66462. }
  66463. defer googleapi.CloseBody(res)
  66464. if err := googleapi.CheckResponse(res); err != nil {
  66465. return nil, err
  66466. }
  66467. ret := &Operation{
  66468. ServerResponse: googleapi.ServerResponse{
  66469. Header: res.Header,
  66470. HTTPStatusCode: res.StatusCode,
  66471. },
  66472. }
  66473. target := &ret
  66474. if err := gensupport.DecodeResponse(target, res); err != nil {
  66475. return nil, err
  66476. }
  66477. return ret, nil
  66478. // {
  66479. // "description": "Moves a persistent disk from one zone to another.",
  66480. // "httpMethod": "POST",
  66481. // "id": "compute.projects.moveDisk",
  66482. // "parameterOrder": [
  66483. // "project"
  66484. // ],
  66485. // "parameters": {
  66486. // "project": {
  66487. // "description": "Project ID for this request.",
  66488. // "location": "path",
  66489. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66490. // "required": true,
  66491. // "type": "string"
  66492. // },
  66493. // "requestId": {
  66494. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66495. // "location": "query",
  66496. // "type": "string"
  66497. // }
  66498. // },
  66499. // "path": "{project}/moveDisk",
  66500. // "request": {
  66501. // "$ref": "DiskMoveRequest"
  66502. // },
  66503. // "response": {
  66504. // "$ref": "Operation"
  66505. // },
  66506. // "scopes": [
  66507. // "https://www.googleapis.com/auth/cloud-platform",
  66508. // "https://www.googleapis.com/auth/compute"
  66509. // ]
  66510. // }
  66511. }
  66512. // method id "compute.projects.moveInstance":
  66513. type ProjectsMoveInstanceCall struct {
  66514. s *Service
  66515. project string
  66516. instancemoverequest *InstanceMoveRequest
  66517. urlParams_ gensupport.URLParams
  66518. ctx_ context.Context
  66519. header_ http.Header
  66520. }
  66521. // MoveInstance: Moves an instance and its attached persistent disks
  66522. // from one zone to another.
  66523. func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall {
  66524. c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66525. c.project = project
  66526. c.instancemoverequest = instancemoverequest
  66527. return c
  66528. }
  66529. // RequestId sets the optional parameter "requestId": An optional
  66530. // request ID to identify requests. Specify a unique request ID so that
  66531. // if you must retry your request, the server will know to ignore the
  66532. // request if it has already been completed.
  66533. //
  66534. // For example, consider a situation where you make an initial request
  66535. // and the request times out. If you make the request again with the
  66536. // same request ID, the server can check if original operation with the
  66537. // same request ID was received, and if so, will ignore the second
  66538. // request. This prevents clients from accidentally creating duplicate
  66539. // commitments.
  66540. //
  66541. // The request ID must be a valid UUID with the exception that zero UUID
  66542. // is not supported (00000000-0000-0000-0000-000000000000).
  66543. func (c *ProjectsMoveInstanceCall) RequestId(requestId string) *ProjectsMoveInstanceCall {
  66544. c.urlParams_.Set("requestId", requestId)
  66545. return c
  66546. }
  66547. // Fields allows partial responses to be retrieved. See
  66548. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66549. // for more information.
  66550. func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall {
  66551. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66552. return c
  66553. }
  66554. // Context sets the context to be used in this call's Do method. Any
  66555. // pending HTTP request will be aborted if the provided context is
  66556. // canceled.
  66557. func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall {
  66558. c.ctx_ = ctx
  66559. return c
  66560. }
  66561. // Header returns an http.Header that can be modified by the caller to
  66562. // add HTTP headers to the request.
  66563. func (c *ProjectsMoveInstanceCall) Header() http.Header {
  66564. if c.header_ == nil {
  66565. c.header_ = make(http.Header)
  66566. }
  66567. return c.header_
  66568. }
  66569. func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  66570. reqHeaders := make(http.Header)
  66571. for k, v := range c.header_ {
  66572. reqHeaders[k] = v
  66573. }
  66574. reqHeaders.Set("User-Agent", c.s.userAgent())
  66575. var body io.Reader = nil
  66576. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest)
  66577. if err != nil {
  66578. return nil, err
  66579. }
  66580. reqHeaders.Set("Content-Type", "application/json")
  66581. c.urlParams_.Set("alt", alt)
  66582. c.urlParams_.Set("prettyPrint", "false")
  66583. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveInstance")
  66584. urls += "?" + c.urlParams_.Encode()
  66585. req, err := http.NewRequest("POST", urls, body)
  66586. if err != nil {
  66587. return nil, err
  66588. }
  66589. req.Header = reqHeaders
  66590. googleapi.Expand(req.URL, map[string]string{
  66591. "project": c.project,
  66592. })
  66593. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66594. }
  66595. // Do executes the "compute.projects.moveInstance" call.
  66596. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66597. // status code is an error. Response headers are in either
  66598. // *Operation.ServerResponse.Header or (if a response was returned at
  66599. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66600. // to check whether the returned error was because
  66601. // http.StatusNotModified was returned.
  66602. func (c *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66603. gensupport.SetOptions(c.urlParams_, opts...)
  66604. res, err := c.doRequest("json")
  66605. if res != nil && res.StatusCode == http.StatusNotModified {
  66606. if res.Body != nil {
  66607. res.Body.Close()
  66608. }
  66609. return nil, &googleapi.Error{
  66610. Code: res.StatusCode,
  66611. Header: res.Header,
  66612. }
  66613. }
  66614. if err != nil {
  66615. return nil, err
  66616. }
  66617. defer googleapi.CloseBody(res)
  66618. if err := googleapi.CheckResponse(res); err != nil {
  66619. return nil, err
  66620. }
  66621. ret := &Operation{
  66622. ServerResponse: googleapi.ServerResponse{
  66623. Header: res.Header,
  66624. HTTPStatusCode: res.StatusCode,
  66625. },
  66626. }
  66627. target := &ret
  66628. if err := gensupport.DecodeResponse(target, res); err != nil {
  66629. return nil, err
  66630. }
  66631. return ret, nil
  66632. // {
  66633. // "description": "Moves an instance and its attached persistent disks from one zone to another.",
  66634. // "httpMethod": "POST",
  66635. // "id": "compute.projects.moveInstance",
  66636. // "parameterOrder": [
  66637. // "project"
  66638. // ],
  66639. // "parameters": {
  66640. // "project": {
  66641. // "description": "Project ID for this request.",
  66642. // "location": "path",
  66643. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66644. // "required": true,
  66645. // "type": "string"
  66646. // },
  66647. // "requestId": {
  66648. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66649. // "location": "query",
  66650. // "type": "string"
  66651. // }
  66652. // },
  66653. // "path": "{project}/moveInstance",
  66654. // "request": {
  66655. // "$ref": "InstanceMoveRequest"
  66656. // },
  66657. // "response": {
  66658. // "$ref": "Operation"
  66659. // },
  66660. // "scopes": [
  66661. // "https://www.googleapis.com/auth/cloud-platform",
  66662. // "https://www.googleapis.com/auth/compute"
  66663. // ]
  66664. // }
  66665. }
  66666. // method id "compute.projects.setCommonInstanceMetadata":
  66667. type ProjectsSetCommonInstanceMetadataCall struct {
  66668. s *Service
  66669. project string
  66670. metadata *Metadata
  66671. urlParams_ gensupport.URLParams
  66672. ctx_ context.Context
  66673. header_ http.Header
  66674. }
  66675. // SetCommonInstanceMetadata: Sets metadata common to all instances
  66676. // within the specified project using the data included in the request.
  66677. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata
  66678. func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall {
  66679. c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66680. c.project = project
  66681. c.metadata = metadata
  66682. return c
  66683. }
  66684. // RequestId sets the optional parameter "requestId": An optional
  66685. // request ID to identify requests. Specify a unique request ID so that
  66686. // if you must retry your request, the server will know to ignore the
  66687. // request if it has already been completed.
  66688. //
  66689. // For example, consider a situation where you make an initial request
  66690. // and the request times out. If you make the request again with the
  66691. // same request ID, the server can check if original operation with the
  66692. // same request ID was received, and if so, will ignore the second
  66693. // request. This prevents clients from accidentally creating duplicate
  66694. // commitments.
  66695. //
  66696. // The request ID must be a valid UUID with the exception that zero UUID
  66697. // is not supported (00000000-0000-0000-0000-000000000000).
  66698. func (c *ProjectsSetCommonInstanceMetadataCall) RequestId(requestId string) *ProjectsSetCommonInstanceMetadataCall {
  66699. c.urlParams_.Set("requestId", requestId)
  66700. return c
  66701. }
  66702. // Fields allows partial responses to be retrieved. See
  66703. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66704. // for more information.
  66705. func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall {
  66706. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66707. return c
  66708. }
  66709. // Context sets the context to be used in this call's Do method. Any
  66710. // pending HTTP request will be aborted if the provided context is
  66711. // canceled.
  66712. func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall {
  66713. c.ctx_ = ctx
  66714. return c
  66715. }
  66716. // Header returns an http.Header that can be modified by the caller to
  66717. // add HTTP headers to the request.
  66718. func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header {
  66719. if c.header_ == nil {
  66720. c.header_ = make(http.Header)
  66721. }
  66722. return c.header_
  66723. }
  66724. func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) {
  66725. reqHeaders := make(http.Header)
  66726. for k, v := range c.header_ {
  66727. reqHeaders[k] = v
  66728. }
  66729. reqHeaders.Set("User-Agent", c.s.userAgent())
  66730. var body io.Reader = nil
  66731. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  66732. if err != nil {
  66733. return nil, err
  66734. }
  66735. reqHeaders.Set("Content-Type", "application/json")
  66736. c.urlParams_.Set("alt", alt)
  66737. c.urlParams_.Set("prettyPrint", "false")
  66738. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata")
  66739. urls += "?" + c.urlParams_.Encode()
  66740. req, err := http.NewRequest("POST", urls, body)
  66741. if err != nil {
  66742. return nil, err
  66743. }
  66744. req.Header = reqHeaders
  66745. googleapi.Expand(req.URL, map[string]string{
  66746. "project": c.project,
  66747. })
  66748. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66749. }
  66750. // Do executes the "compute.projects.setCommonInstanceMetadata" call.
  66751. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66752. // status code is an error. Response headers are in either
  66753. // *Operation.ServerResponse.Header or (if a response was returned at
  66754. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66755. // to check whether the returned error was because
  66756. // http.StatusNotModified was returned.
  66757. func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66758. gensupport.SetOptions(c.urlParams_, opts...)
  66759. res, err := c.doRequest("json")
  66760. if res != nil && res.StatusCode == http.StatusNotModified {
  66761. if res.Body != nil {
  66762. res.Body.Close()
  66763. }
  66764. return nil, &googleapi.Error{
  66765. Code: res.StatusCode,
  66766. Header: res.Header,
  66767. }
  66768. }
  66769. if err != nil {
  66770. return nil, err
  66771. }
  66772. defer googleapi.CloseBody(res)
  66773. if err := googleapi.CheckResponse(res); err != nil {
  66774. return nil, err
  66775. }
  66776. ret := &Operation{
  66777. ServerResponse: googleapi.ServerResponse{
  66778. Header: res.Header,
  66779. HTTPStatusCode: res.StatusCode,
  66780. },
  66781. }
  66782. target := &ret
  66783. if err := gensupport.DecodeResponse(target, res); err != nil {
  66784. return nil, err
  66785. }
  66786. return ret, nil
  66787. // {
  66788. // "description": "Sets metadata common to all instances within the specified project using the data included in the request.",
  66789. // "httpMethod": "POST",
  66790. // "id": "compute.projects.setCommonInstanceMetadata",
  66791. // "parameterOrder": [
  66792. // "project"
  66793. // ],
  66794. // "parameters": {
  66795. // "project": {
  66796. // "description": "Project ID for this request.",
  66797. // "location": "path",
  66798. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66799. // "required": true,
  66800. // "type": "string"
  66801. // },
  66802. // "requestId": {
  66803. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66804. // "location": "query",
  66805. // "type": "string"
  66806. // }
  66807. // },
  66808. // "path": "{project}/setCommonInstanceMetadata",
  66809. // "request": {
  66810. // "$ref": "Metadata"
  66811. // },
  66812. // "response": {
  66813. // "$ref": "Operation"
  66814. // },
  66815. // "scopes": [
  66816. // "https://www.googleapis.com/auth/cloud-platform",
  66817. // "https://www.googleapis.com/auth/compute"
  66818. // ]
  66819. // }
  66820. }
  66821. // method id "compute.projects.setDefaultNetworkTier":
  66822. type ProjectsSetDefaultNetworkTierCall struct {
  66823. s *Service
  66824. project string
  66825. projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest
  66826. urlParams_ gensupport.URLParams
  66827. ctx_ context.Context
  66828. header_ http.Header
  66829. }
  66830. // SetDefaultNetworkTier: Sets the default network tier of the project.
  66831. // The default network tier is used when an
  66832. // address/forwardingRule/instance is created without specifying the
  66833. // network tier field.
  66834. func (r *ProjectsService) SetDefaultNetworkTier(project string, projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest) *ProjectsSetDefaultNetworkTierCall {
  66835. c := &ProjectsSetDefaultNetworkTierCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66836. c.project = project
  66837. c.projectssetdefaultnetworktierrequest = projectssetdefaultnetworktierrequest
  66838. return c
  66839. }
  66840. // RequestId sets the optional parameter "requestId": An optional
  66841. // request ID to identify requests. Specify a unique request ID so that
  66842. // if you must retry your request, the server will know to ignore the
  66843. // request if it has already been completed.
  66844. //
  66845. // For example, consider a situation where you make an initial request
  66846. // and the request times out. If you make the request again with the
  66847. // same request ID, the server can check if original operation with the
  66848. // same request ID was received, and if so, will ignore the second
  66849. // request. This prevents clients from accidentally creating duplicate
  66850. // commitments.
  66851. //
  66852. // The request ID must be a valid UUID with the exception that zero UUID
  66853. // is not supported (00000000-0000-0000-0000-000000000000).
  66854. func (c *ProjectsSetDefaultNetworkTierCall) RequestId(requestId string) *ProjectsSetDefaultNetworkTierCall {
  66855. c.urlParams_.Set("requestId", requestId)
  66856. return c
  66857. }
  66858. // Fields allows partial responses to be retrieved. See
  66859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66860. // for more information.
  66861. func (c *ProjectsSetDefaultNetworkTierCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultNetworkTierCall {
  66862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66863. return c
  66864. }
  66865. // Context sets the context to be used in this call's Do method. Any
  66866. // pending HTTP request will be aborted if the provided context is
  66867. // canceled.
  66868. func (c *ProjectsSetDefaultNetworkTierCall) Context(ctx context.Context) *ProjectsSetDefaultNetworkTierCall {
  66869. c.ctx_ = ctx
  66870. return c
  66871. }
  66872. // Header returns an http.Header that can be modified by the caller to
  66873. // add HTTP headers to the request.
  66874. func (c *ProjectsSetDefaultNetworkTierCall) Header() http.Header {
  66875. if c.header_ == nil {
  66876. c.header_ = make(http.Header)
  66877. }
  66878. return c.header_
  66879. }
  66880. func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) {
  66881. reqHeaders := make(http.Header)
  66882. for k, v := range c.header_ {
  66883. reqHeaders[k] = v
  66884. }
  66885. reqHeaders.Set("User-Agent", c.s.userAgent())
  66886. var body io.Reader = nil
  66887. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest)
  66888. if err != nil {
  66889. return nil, err
  66890. }
  66891. reqHeaders.Set("Content-Type", "application/json")
  66892. c.urlParams_.Set("alt", alt)
  66893. c.urlParams_.Set("prettyPrint", "false")
  66894. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setDefaultNetworkTier")
  66895. urls += "?" + c.urlParams_.Encode()
  66896. req, err := http.NewRequest("POST", urls, body)
  66897. if err != nil {
  66898. return nil, err
  66899. }
  66900. req.Header = reqHeaders
  66901. googleapi.Expand(req.URL, map[string]string{
  66902. "project": c.project,
  66903. })
  66904. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66905. }
  66906. // Do executes the "compute.projects.setDefaultNetworkTier" call.
  66907. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66908. // status code is an error. Response headers are in either
  66909. // *Operation.ServerResponse.Header or (if a response was returned at
  66910. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66911. // to check whether the returned error was because
  66912. // http.StatusNotModified was returned.
  66913. func (c *ProjectsSetDefaultNetworkTierCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66914. gensupport.SetOptions(c.urlParams_, opts...)
  66915. res, err := c.doRequest("json")
  66916. if res != nil && res.StatusCode == http.StatusNotModified {
  66917. if res.Body != nil {
  66918. res.Body.Close()
  66919. }
  66920. return nil, &googleapi.Error{
  66921. Code: res.StatusCode,
  66922. Header: res.Header,
  66923. }
  66924. }
  66925. if err != nil {
  66926. return nil, err
  66927. }
  66928. defer googleapi.CloseBody(res)
  66929. if err := googleapi.CheckResponse(res); err != nil {
  66930. return nil, err
  66931. }
  66932. ret := &Operation{
  66933. ServerResponse: googleapi.ServerResponse{
  66934. Header: res.Header,
  66935. HTTPStatusCode: res.StatusCode,
  66936. },
  66937. }
  66938. target := &ret
  66939. if err := gensupport.DecodeResponse(target, res); err != nil {
  66940. return nil, err
  66941. }
  66942. return ret, nil
  66943. // {
  66944. // "description": "Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field.",
  66945. // "httpMethod": "POST",
  66946. // "id": "compute.projects.setDefaultNetworkTier",
  66947. // "parameterOrder": [
  66948. // "project"
  66949. // ],
  66950. // "parameters": {
  66951. // "project": {
  66952. // "description": "Project ID for this request.",
  66953. // "location": "path",
  66954. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66955. // "required": true,
  66956. // "type": "string"
  66957. // },
  66958. // "requestId": {
  66959. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66960. // "location": "query",
  66961. // "type": "string"
  66962. // }
  66963. // },
  66964. // "path": "{project}/setDefaultNetworkTier",
  66965. // "request": {
  66966. // "$ref": "ProjectsSetDefaultNetworkTierRequest"
  66967. // },
  66968. // "response": {
  66969. // "$ref": "Operation"
  66970. // },
  66971. // "scopes": [
  66972. // "https://www.googleapis.com/auth/cloud-platform",
  66973. // "https://www.googleapis.com/auth/compute"
  66974. // ]
  66975. // }
  66976. }
  66977. // method id "compute.projects.setUsageExportBucket":
  66978. type ProjectsSetUsageExportBucketCall struct {
  66979. s *Service
  66980. project string
  66981. usageexportlocation *UsageExportLocation
  66982. urlParams_ gensupport.URLParams
  66983. ctx_ context.Context
  66984. header_ http.Header
  66985. }
  66986. // SetUsageExportBucket: Enables the usage export feature and sets the
  66987. // usage export bucket where reports are stored. If you provide an empty
  66988. // request body using this method, the usage export feature will be
  66989. // disabled.
  66990. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket
  66991. func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall {
  66992. c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66993. c.project = project
  66994. c.usageexportlocation = usageexportlocation
  66995. return c
  66996. }
  66997. // RequestId sets the optional parameter "requestId": An optional
  66998. // request ID to identify requests. Specify a unique request ID so that
  66999. // if you must retry your request, the server will know to ignore the
  67000. // request if it has already been completed.
  67001. //
  67002. // For example, consider a situation where you make an initial request
  67003. // and the request times out. If you make the request again with the
  67004. // same request ID, the server can check if original operation with the
  67005. // same request ID was received, and if so, will ignore the second
  67006. // request. This prevents clients from accidentally creating duplicate
  67007. // commitments.
  67008. //
  67009. // The request ID must be a valid UUID with the exception that zero UUID
  67010. // is not supported (00000000-0000-0000-0000-000000000000).
  67011. func (c *ProjectsSetUsageExportBucketCall) RequestId(requestId string) *ProjectsSetUsageExportBucketCall {
  67012. c.urlParams_.Set("requestId", requestId)
  67013. return c
  67014. }
  67015. // Fields allows partial responses to be retrieved. See
  67016. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67017. // for more information.
  67018. func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall {
  67019. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67020. return c
  67021. }
  67022. // Context sets the context to be used in this call's Do method. Any
  67023. // pending HTTP request will be aborted if the provided context is
  67024. // canceled.
  67025. func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall {
  67026. c.ctx_ = ctx
  67027. return c
  67028. }
  67029. // Header returns an http.Header that can be modified by the caller to
  67030. // add HTTP headers to the request.
  67031. func (c *ProjectsSetUsageExportBucketCall) Header() http.Header {
  67032. if c.header_ == nil {
  67033. c.header_ = make(http.Header)
  67034. }
  67035. return c.header_
  67036. }
  67037. func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) {
  67038. reqHeaders := make(http.Header)
  67039. for k, v := range c.header_ {
  67040. reqHeaders[k] = v
  67041. }
  67042. reqHeaders.Set("User-Agent", c.s.userAgent())
  67043. var body io.Reader = nil
  67044. body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation)
  67045. if err != nil {
  67046. return nil, err
  67047. }
  67048. reqHeaders.Set("Content-Type", "application/json")
  67049. c.urlParams_.Set("alt", alt)
  67050. c.urlParams_.Set("prettyPrint", "false")
  67051. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket")
  67052. urls += "?" + c.urlParams_.Encode()
  67053. req, err := http.NewRequest("POST", urls, body)
  67054. if err != nil {
  67055. return nil, err
  67056. }
  67057. req.Header = reqHeaders
  67058. googleapi.Expand(req.URL, map[string]string{
  67059. "project": c.project,
  67060. })
  67061. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67062. }
  67063. // Do executes the "compute.projects.setUsageExportBucket" call.
  67064. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67065. // status code is an error. Response headers are in either
  67066. // *Operation.ServerResponse.Header or (if a response was returned at
  67067. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67068. // to check whether the returned error was because
  67069. // http.StatusNotModified was returned.
  67070. func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67071. gensupport.SetOptions(c.urlParams_, opts...)
  67072. res, err := c.doRequest("json")
  67073. if res != nil && res.StatusCode == http.StatusNotModified {
  67074. if res.Body != nil {
  67075. res.Body.Close()
  67076. }
  67077. return nil, &googleapi.Error{
  67078. Code: res.StatusCode,
  67079. Header: res.Header,
  67080. }
  67081. }
  67082. if err != nil {
  67083. return nil, err
  67084. }
  67085. defer googleapi.CloseBody(res)
  67086. if err := googleapi.CheckResponse(res); err != nil {
  67087. return nil, err
  67088. }
  67089. ret := &Operation{
  67090. ServerResponse: googleapi.ServerResponse{
  67091. Header: res.Header,
  67092. HTTPStatusCode: res.StatusCode,
  67093. },
  67094. }
  67095. target := &ret
  67096. if err := gensupport.DecodeResponse(target, res); err != nil {
  67097. return nil, err
  67098. }
  67099. return ret, nil
  67100. // {
  67101. // "description": "Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.",
  67102. // "httpMethod": "POST",
  67103. // "id": "compute.projects.setUsageExportBucket",
  67104. // "parameterOrder": [
  67105. // "project"
  67106. // ],
  67107. // "parameters": {
  67108. // "project": {
  67109. // "description": "Project ID for this request.",
  67110. // "location": "path",
  67111. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67112. // "required": true,
  67113. // "type": "string"
  67114. // },
  67115. // "requestId": {
  67116. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67117. // "location": "query",
  67118. // "type": "string"
  67119. // }
  67120. // },
  67121. // "path": "{project}/setUsageExportBucket",
  67122. // "request": {
  67123. // "$ref": "UsageExportLocation"
  67124. // },
  67125. // "response": {
  67126. // "$ref": "Operation"
  67127. // },
  67128. // "scopes": [
  67129. // "https://www.googleapis.com/auth/cloud-platform",
  67130. // "https://www.googleapis.com/auth/compute",
  67131. // "https://www.googleapis.com/auth/devstorage.full_control",
  67132. // "https://www.googleapis.com/auth/devstorage.read_only",
  67133. // "https://www.googleapis.com/auth/devstorage.read_write"
  67134. // ]
  67135. // }
  67136. }
  67137. // method id "compute.regionAutoscalers.delete":
  67138. type RegionAutoscalersDeleteCall struct {
  67139. s *Service
  67140. project string
  67141. region string
  67142. autoscaler string
  67143. urlParams_ gensupport.URLParams
  67144. ctx_ context.Context
  67145. header_ http.Header
  67146. }
  67147. // Delete: Deletes the specified autoscaler.
  67148. func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall {
  67149. c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67150. c.project = project
  67151. c.region = region
  67152. c.autoscaler = autoscaler
  67153. return c
  67154. }
  67155. // RequestId sets the optional parameter "requestId": An optional
  67156. // request ID to identify requests. Specify a unique request ID so that
  67157. // if you must retry your request, the server will know to ignore the
  67158. // request if it has already been completed.
  67159. //
  67160. // For example, consider a situation where you make an initial request
  67161. // and the request times out. If you make the request again with the
  67162. // same request ID, the server can check if original operation with the
  67163. // same request ID was received, and if so, will ignore the second
  67164. // request. This prevents clients from accidentally creating duplicate
  67165. // commitments.
  67166. //
  67167. // The request ID must be a valid UUID with the exception that zero UUID
  67168. // is not supported (00000000-0000-0000-0000-000000000000).
  67169. func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall {
  67170. c.urlParams_.Set("requestId", requestId)
  67171. return c
  67172. }
  67173. // Fields allows partial responses to be retrieved. See
  67174. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67175. // for more information.
  67176. func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall {
  67177. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67178. return c
  67179. }
  67180. // Context sets the context to be used in this call's Do method. Any
  67181. // pending HTTP request will be aborted if the provided context is
  67182. // canceled.
  67183. func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall {
  67184. c.ctx_ = ctx
  67185. return c
  67186. }
  67187. // Header returns an http.Header that can be modified by the caller to
  67188. // add HTTP headers to the request.
  67189. func (c *RegionAutoscalersDeleteCall) Header() http.Header {
  67190. if c.header_ == nil {
  67191. c.header_ = make(http.Header)
  67192. }
  67193. return c.header_
  67194. }
  67195. func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  67196. reqHeaders := make(http.Header)
  67197. for k, v := range c.header_ {
  67198. reqHeaders[k] = v
  67199. }
  67200. reqHeaders.Set("User-Agent", c.s.userAgent())
  67201. var body io.Reader = nil
  67202. c.urlParams_.Set("alt", alt)
  67203. c.urlParams_.Set("prettyPrint", "false")
  67204. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  67205. urls += "?" + c.urlParams_.Encode()
  67206. req, err := http.NewRequest("DELETE", urls, body)
  67207. if err != nil {
  67208. return nil, err
  67209. }
  67210. req.Header = reqHeaders
  67211. googleapi.Expand(req.URL, map[string]string{
  67212. "project": c.project,
  67213. "region": c.region,
  67214. "autoscaler": c.autoscaler,
  67215. })
  67216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67217. }
  67218. // Do executes the "compute.regionAutoscalers.delete" call.
  67219. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67220. // status code is an error. Response headers are in either
  67221. // *Operation.ServerResponse.Header or (if a response was returned at
  67222. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67223. // to check whether the returned error was because
  67224. // http.StatusNotModified was returned.
  67225. func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67226. gensupport.SetOptions(c.urlParams_, opts...)
  67227. res, err := c.doRequest("json")
  67228. if res != nil && res.StatusCode == http.StatusNotModified {
  67229. if res.Body != nil {
  67230. res.Body.Close()
  67231. }
  67232. return nil, &googleapi.Error{
  67233. Code: res.StatusCode,
  67234. Header: res.Header,
  67235. }
  67236. }
  67237. if err != nil {
  67238. return nil, err
  67239. }
  67240. defer googleapi.CloseBody(res)
  67241. if err := googleapi.CheckResponse(res); err != nil {
  67242. return nil, err
  67243. }
  67244. ret := &Operation{
  67245. ServerResponse: googleapi.ServerResponse{
  67246. Header: res.Header,
  67247. HTTPStatusCode: res.StatusCode,
  67248. },
  67249. }
  67250. target := &ret
  67251. if err := gensupport.DecodeResponse(target, res); err != nil {
  67252. return nil, err
  67253. }
  67254. return ret, nil
  67255. // {
  67256. // "description": "Deletes the specified autoscaler.",
  67257. // "httpMethod": "DELETE",
  67258. // "id": "compute.regionAutoscalers.delete",
  67259. // "parameterOrder": [
  67260. // "project",
  67261. // "region",
  67262. // "autoscaler"
  67263. // ],
  67264. // "parameters": {
  67265. // "autoscaler": {
  67266. // "description": "Name of the autoscaler to delete.",
  67267. // "location": "path",
  67268. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67269. // "required": true,
  67270. // "type": "string"
  67271. // },
  67272. // "project": {
  67273. // "description": "Project ID for this request.",
  67274. // "location": "path",
  67275. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67276. // "required": true,
  67277. // "type": "string"
  67278. // },
  67279. // "region": {
  67280. // "description": "Name of the region scoping this request.",
  67281. // "location": "path",
  67282. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67283. // "required": true,
  67284. // "type": "string"
  67285. // },
  67286. // "requestId": {
  67287. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67288. // "location": "query",
  67289. // "type": "string"
  67290. // }
  67291. // },
  67292. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  67293. // "response": {
  67294. // "$ref": "Operation"
  67295. // },
  67296. // "scopes": [
  67297. // "https://www.googleapis.com/auth/cloud-platform",
  67298. // "https://www.googleapis.com/auth/compute"
  67299. // ]
  67300. // }
  67301. }
  67302. // method id "compute.regionAutoscalers.get":
  67303. type RegionAutoscalersGetCall struct {
  67304. s *Service
  67305. project string
  67306. region string
  67307. autoscaler string
  67308. urlParams_ gensupport.URLParams
  67309. ifNoneMatch_ string
  67310. ctx_ context.Context
  67311. header_ http.Header
  67312. }
  67313. // Get: Returns the specified autoscaler.
  67314. func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall {
  67315. c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67316. c.project = project
  67317. c.region = region
  67318. c.autoscaler = autoscaler
  67319. return c
  67320. }
  67321. // Fields allows partial responses to be retrieved. See
  67322. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67323. // for more information.
  67324. func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall {
  67325. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67326. return c
  67327. }
  67328. // IfNoneMatch sets the optional parameter which makes the operation
  67329. // fail if the object's ETag matches the given value. This is useful for
  67330. // getting updates only after the object has changed since the last
  67331. // request. Use googleapi.IsNotModified to check whether the response
  67332. // error from Do is the result of In-None-Match.
  67333. func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall {
  67334. c.ifNoneMatch_ = entityTag
  67335. return c
  67336. }
  67337. // Context sets the context to be used in this call's Do method. Any
  67338. // pending HTTP request will be aborted if the provided context is
  67339. // canceled.
  67340. func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall {
  67341. c.ctx_ = ctx
  67342. return c
  67343. }
  67344. // Header returns an http.Header that can be modified by the caller to
  67345. // add HTTP headers to the request.
  67346. func (c *RegionAutoscalersGetCall) Header() http.Header {
  67347. if c.header_ == nil {
  67348. c.header_ = make(http.Header)
  67349. }
  67350. return c.header_
  67351. }
  67352. func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  67353. reqHeaders := make(http.Header)
  67354. for k, v := range c.header_ {
  67355. reqHeaders[k] = v
  67356. }
  67357. reqHeaders.Set("User-Agent", c.s.userAgent())
  67358. if c.ifNoneMatch_ != "" {
  67359. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67360. }
  67361. var body io.Reader = nil
  67362. c.urlParams_.Set("alt", alt)
  67363. c.urlParams_.Set("prettyPrint", "false")
  67364. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  67365. urls += "?" + c.urlParams_.Encode()
  67366. req, err := http.NewRequest("GET", urls, body)
  67367. if err != nil {
  67368. return nil, err
  67369. }
  67370. req.Header = reqHeaders
  67371. googleapi.Expand(req.URL, map[string]string{
  67372. "project": c.project,
  67373. "region": c.region,
  67374. "autoscaler": c.autoscaler,
  67375. })
  67376. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67377. }
  67378. // Do executes the "compute.regionAutoscalers.get" call.
  67379. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  67380. // status code is an error. Response headers are in either
  67381. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  67382. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67383. // to check whether the returned error was because
  67384. // http.StatusNotModified was returned.
  67385. func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  67386. gensupport.SetOptions(c.urlParams_, opts...)
  67387. res, err := c.doRequest("json")
  67388. if res != nil && res.StatusCode == http.StatusNotModified {
  67389. if res.Body != nil {
  67390. res.Body.Close()
  67391. }
  67392. return nil, &googleapi.Error{
  67393. Code: res.StatusCode,
  67394. Header: res.Header,
  67395. }
  67396. }
  67397. if err != nil {
  67398. return nil, err
  67399. }
  67400. defer googleapi.CloseBody(res)
  67401. if err := googleapi.CheckResponse(res); err != nil {
  67402. return nil, err
  67403. }
  67404. ret := &Autoscaler{
  67405. ServerResponse: googleapi.ServerResponse{
  67406. Header: res.Header,
  67407. HTTPStatusCode: res.StatusCode,
  67408. },
  67409. }
  67410. target := &ret
  67411. if err := gensupport.DecodeResponse(target, res); err != nil {
  67412. return nil, err
  67413. }
  67414. return ret, nil
  67415. // {
  67416. // "description": "Returns the specified autoscaler.",
  67417. // "httpMethod": "GET",
  67418. // "id": "compute.regionAutoscalers.get",
  67419. // "parameterOrder": [
  67420. // "project",
  67421. // "region",
  67422. // "autoscaler"
  67423. // ],
  67424. // "parameters": {
  67425. // "autoscaler": {
  67426. // "description": "Name of the autoscaler to return.",
  67427. // "location": "path",
  67428. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67429. // "required": true,
  67430. // "type": "string"
  67431. // },
  67432. // "project": {
  67433. // "description": "Project ID for this request.",
  67434. // "location": "path",
  67435. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67436. // "required": true,
  67437. // "type": "string"
  67438. // },
  67439. // "region": {
  67440. // "description": "Name of the region scoping this request.",
  67441. // "location": "path",
  67442. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67443. // "required": true,
  67444. // "type": "string"
  67445. // }
  67446. // },
  67447. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  67448. // "response": {
  67449. // "$ref": "Autoscaler"
  67450. // },
  67451. // "scopes": [
  67452. // "https://www.googleapis.com/auth/cloud-platform",
  67453. // "https://www.googleapis.com/auth/compute",
  67454. // "https://www.googleapis.com/auth/compute.readonly"
  67455. // ]
  67456. // }
  67457. }
  67458. // method id "compute.regionAutoscalers.insert":
  67459. type RegionAutoscalersInsertCall struct {
  67460. s *Service
  67461. project string
  67462. region string
  67463. autoscaler *Autoscaler
  67464. urlParams_ gensupport.URLParams
  67465. ctx_ context.Context
  67466. header_ http.Header
  67467. }
  67468. // Insert: Creates an autoscaler in the specified project using the data
  67469. // included in the request.
  67470. func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall {
  67471. c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67472. c.project = project
  67473. c.region = region
  67474. c.autoscaler = autoscaler
  67475. return c
  67476. }
  67477. // RequestId sets the optional parameter "requestId": An optional
  67478. // request ID to identify requests. Specify a unique request ID so that
  67479. // if you must retry your request, the server will know to ignore the
  67480. // request if it has already been completed.
  67481. //
  67482. // For example, consider a situation where you make an initial request
  67483. // and the request times out. If you make the request again with the
  67484. // same request ID, the server can check if original operation with the
  67485. // same request ID was received, and if so, will ignore the second
  67486. // request. This prevents clients from accidentally creating duplicate
  67487. // commitments.
  67488. //
  67489. // The request ID must be a valid UUID with the exception that zero UUID
  67490. // is not supported (00000000-0000-0000-0000-000000000000).
  67491. func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall {
  67492. c.urlParams_.Set("requestId", requestId)
  67493. return c
  67494. }
  67495. // Fields allows partial responses to be retrieved. See
  67496. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67497. // for more information.
  67498. func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall {
  67499. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67500. return c
  67501. }
  67502. // Context sets the context to be used in this call's Do method. Any
  67503. // pending HTTP request will be aborted if the provided context is
  67504. // canceled.
  67505. func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall {
  67506. c.ctx_ = ctx
  67507. return c
  67508. }
  67509. // Header returns an http.Header that can be modified by the caller to
  67510. // add HTTP headers to the request.
  67511. func (c *RegionAutoscalersInsertCall) Header() http.Header {
  67512. if c.header_ == nil {
  67513. c.header_ = make(http.Header)
  67514. }
  67515. return c.header_
  67516. }
  67517. func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  67518. reqHeaders := make(http.Header)
  67519. for k, v := range c.header_ {
  67520. reqHeaders[k] = v
  67521. }
  67522. reqHeaders.Set("User-Agent", c.s.userAgent())
  67523. var body io.Reader = nil
  67524. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  67525. if err != nil {
  67526. return nil, err
  67527. }
  67528. reqHeaders.Set("Content-Type", "application/json")
  67529. c.urlParams_.Set("alt", alt)
  67530. c.urlParams_.Set("prettyPrint", "false")
  67531. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  67532. urls += "?" + c.urlParams_.Encode()
  67533. req, err := http.NewRequest("POST", urls, body)
  67534. if err != nil {
  67535. return nil, err
  67536. }
  67537. req.Header = reqHeaders
  67538. googleapi.Expand(req.URL, map[string]string{
  67539. "project": c.project,
  67540. "region": c.region,
  67541. })
  67542. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67543. }
  67544. // Do executes the "compute.regionAutoscalers.insert" call.
  67545. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67546. // status code is an error. Response headers are in either
  67547. // *Operation.ServerResponse.Header or (if a response was returned at
  67548. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67549. // to check whether the returned error was because
  67550. // http.StatusNotModified was returned.
  67551. func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67552. gensupport.SetOptions(c.urlParams_, opts...)
  67553. res, err := c.doRequest("json")
  67554. if res != nil && res.StatusCode == http.StatusNotModified {
  67555. if res.Body != nil {
  67556. res.Body.Close()
  67557. }
  67558. return nil, &googleapi.Error{
  67559. Code: res.StatusCode,
  67560. Header: res.Header,
  67561. }
  67562. }
  67563. if err != nil {
  67564. return nil, err
  67565. }
  67566. defer googleapi.CloseBody(res)
  67567. if err := googleapi.CheckResponse(res); err != nil {
  67568. return nil, err
  67569. }
  67570. ret := &Operation{
  67571. ServerResponse: googleapi.ServerResponse{
  67572. Header: res.Header,
  67573. HTTPStatusCode: res.StatusCode,
  67574. },
  67575. }
  67576. target := &ret
  67577. if err := gensupport.DecodeResponse(target, res); err != nil {
  67578. return nil, err
  67579. }
  67580. return ret, nil
  67581. // {
  67582. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  67583. // "httpMethod": "POST",
  67584. // "id": "compute.regionAutoscalers.insert",
  67585. // "parameterOrder": [
  67586. // "project",
  67587. // "region"
  67588. // ],
  67589. // "parameters": {
  67590. // "project": {
  67591. // "description": "Project ID for this request.",
  67592. // "location": "path",
  67593. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67594. // "required": true,
  67595. // "type": "string"
  67596. // },
  67597. // "region": {
  67598. // "description": "Name of the region scoping this request.",
  67599. // "location": "path",
  67600. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67601. // "required": true,
  67602. // "type": "string"
  67603. // },
  67604. // "requestId": {
  67605. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67606. // "location": "query",
  67607. // "type": "string"
  67608. // }
  67609. // },
  67610. // "path": "{project}/regions/{region}/autoscalers",
  67611. // "request": {
  67612. // "$ref": "Autoscaler"
  67613. // },
  67614. // "response": {
  67615. // "$ref": "Operation"
  67616. // },
  67617. // "scopes": [
  67618. // "https://www.googleapis.com/auth/cloud-platform",
  67619. // "https://www.googleapis.com/auth/compute"
  67620. // ]
  67621. // }
  67622. }
  67623. // method id "compute.regionAutoscalers.list":
  67624. type RegionAutoscalersListCall struct {
  67625. s *Service
  67626. project string
  67627. region string
  67628. urlParams_ gensupport.URLParams
  67629. ifNoneMatch_ string
  67630. ctx_ context.Context
  67631. header_ http.Header
  67632. }
  67633. // List: Retrieves a list of autoscalers contained within the specified
  67634. // region.
  67635. func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall {
  67636. c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67637. c.project = project
  67638. c.region = region
  67639. return c
  67640. }
  67641. // Filter sets the optional parameter "filter": A filter expression that
  67642. // filters resources listed in the response. The expression must specify
  67643. // the field name, a comparison operator, and the value that you want to
  67644. // use for filtering. The value must be a string, a number, or a
  67645. // boolean. The comparison operator must be either =, !=, >, or <.
  67646. //
  67647. // For example, if you are filtering Compute Engine instances, you can
  67648. // exclude instances named example-instance by specifying name !=
  67649. // example-instance.
  67650. //
  67651. // You can also filter nested fields. For example, you could specify
  67652. // scheduling.automaticRestart = false to include instances only if they
  67653. // are not scheduled for automatic restarts. You can use filtering on
  67654. // nested fields to filter based on resource labels.
  67655. //
  67656. // To filter on multiple expressions, provide each separate expression
  67657. // within parentheses. For example, (scheduling.automaticRestart = true)
  67658. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67659. // AND expression. However, you can include AND and OR expressions
  67660. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67661. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67662. // true).
  67663. func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall {
  67664. c.urlParams_.Set("filter", filter)
  67665. return c
  67666. }
  67667. // MaxResults sets the optional parameter "maxResults": The maximum
  67668. // number of results per page that should be returned. If the number of
  67669. // available results is larger than maxResults, Compute Engine returns a
  67670. // nextPageToken that can be used to get the next page of results in
  67671. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67672. // (Default: 500)
  67673. func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall {
  67674. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67675. return c
  67676. }
  67677. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67678. // a certain order. By default, results are returned in alphanumerical
  67679. // order based on the resource name.
  67680. //
  67681. // You can also sort results in descending order based on the creation
  67682. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67683. // based on the creationTimestamp field in reverse chronological order
  67684. // (newest result first). Use this to sort resources like operations so
  67685. // that the newest operation is returned first.
  67686. //
  67687. // Currently, only sorting by name or creationTimestamp desc is
  67688. // supported.
  67689. func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall {
  67690. c.urlParams_.Set("orderBy", orderBy)
  67691. return c
  67692. }
  67693. // PageToken sets the optional parameter "pageToken": Specifies a page
  67694. // token to use. Set pageToken to the nextPageToken returned by a
  67695. // previous list request to get the next page of results.
  67696. func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall {
  67697. c.urlParams_.Set("pageToken", pageToken)
  67698. return c
  67699. }
  67700. // Fields allows partial responses to be retrieved. See
  67701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67702. // for more information.
  67703. func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall {
  67704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67705. return c
  67706. }
  67707. // IfNoneMatch sets the optional parameter which makes the operation
  67708. // fail if the object's ETag matches the given value. This is useful for
  67709. // getting updates only after the object has changed since the last
  67710. // request. Use googleapi.IsNotModified to check whether the response
  67711. // error from Do is the result of In-None-Match.
  67712. func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall {
  67713. c.ifNoneMatch_ = entityTag
  67714. return c
  67715. }
  67716. // Context sets the context to be used in this call's Do method. Any
  67717. // pending HTTP request will be aborted if the provided context is
  67718. // canceled.
  67719. func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall {
  67720. c.ctx_ = ctx
  67721. return c
  67722. }
  67723. // Header returns an http.Header that can be modified by the caller to
  67724. // add HTTP headers to the request.
  67725. func (c *RegionAutoscalersListCall) Header() http.Header {
  67726. if c.header_ == nil {
  67727. c.header_ = make(http.Header)
  67728. }
  67729. return c.header_
  67730. }
  67731. func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  67732. reqHeaders := make(http.Header)
  67733. for k, v := range c.header_ {
  67734. reqHeaders[k] = v
  67735. }
  67736. reqHeaders.Set("User-Agent", c.s.userAgent())
  67737. if c.ifNoneMatch_ != "" {
  67738. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67739. }
  67740. var body io.Reader = nil
  67741. c.urlParams_.Set("alt", alt)
  67742. c.urlParams_.Set("prettyPrint", "false")
  67743. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  67744. urls += "?" + c.urlParams_.Encode()
  67745. req, err := http.NewRequest("GET", urls, body)
  67746. if err != nil {
  67747. return nil, err
  67748. }
  67749. req.Header = reqHeaders
  67750. googleapi.Expand(req.URL, map[string]string{
  67751. "project": c.project,
  67752. "region": c.region,
  67753. })
  67754. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67755. }
  67756. // Do executes the "compute.regionAutoscalers.list" call.
  67757. // Exactly one of *RegionAutoscalerList or error will be non-nil. Any
  67758. // non-2xx status code is an error. Response headers are in either
  67759. // *RegionAutoscalerList.ServerResponse.Header or (if a response was
  67760. // returned at all) in error.(*googleapi.Error).Header. Use
  67761. // googleapi.IsNotModified to check whether the returned error was
  67762. // because http.StatusNotModified was returned.
  67763. func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, error) {
  67764. gensupport.SetOptions(c.urlParams_, opts...)
  67765. res, err := c.doRequest("json")
  67766. if res != nil && res.StatusCode == http.StatusNotModified {
  67767. if res.Body != nil {
  67768. res.Body.Close()
  67769. }
  67770. return nil, &googleapi.Error{
  67771. Code: res.StatusCode,
  67772. Header: res.Header,
  67773. }
  67774. }
  67775. if err != nil {
  67776. return nil, err
  67777. }
  67778. defer googleapi.CloseBody(res)
  67779. if err := googleapi.CheckResponse(res); err != nil {
  67780. return nil, err
  67781. }
  67782. ret := &RegionAutoscalerList{
  67783. ServerResponse: googleapi.ServerResponse{
  67784. Header: res.Header,
  67785. HTTPStatusCode: res.StatusCode,
  67786. },
  67787. }
  67788. target := &ret
  67789. if err := gensupport.DecodeResponse(target, res); err != nil {
  67790. return nil, err
  67791. }
  67792. return ret, nil
  67793. // {
  67794. // "description": "Retrieves a list of autoscalers contained within the specified region.",
  67795. // "httpMethod": "GET",
  67796. // "id": "compute.regionAutoscalers.list",
  67797. // "parameterOrder": [
  67798. // "project",
  67799. // "region"
  67800. // ],
  67801. // "parameters": {
  67802. // "filter": {
  67803. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  67804. // "location": "query",
  67805. // "type": "string"
  67806. // },
  67807. // "maxResults": {
  67808. // "default": "500",
  67809. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  67810. // "format": "uint32",
  67811. // "location": "query",
  67812. // "minimum": "0",
  67813. // "type": "integer"
  67814. // },
  67815. // "orderBy": {
  67816. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  67817. // "location": "query",
  67818. // "type": "string"
  67819. // },
  67820. // "pageToken": {
  67821. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  67822. // "location": "query",
  67823. // "type": "string"
  67824. // },
  67825. // "project": {
  67826. // "description": "Project ID for this request.",
  67827. // "location": "path",
  67828. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67829. // "required": true,
  67830. // "type": "string"
  67831. // },
  67832. // "region": {
  67833. // "description": "Name of the region scoping this request.",
  67834. // "location": "path",
  67835. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67836. // "required": true,
  67837. // "type": "string"
  67838. // }
  67839. // },
  67840. // "path": "{project}/regions/{region}/autoscalers",
  67841. // "response": {
  67842. // "$ref": "RegionAutoscalerList"
  67843. // },
  67844. // "scopes": [
  67845. // "https://www.googleapis.com/auth/cloud-platform",
  67846. // "https://www.googleapis.com/auth/compute",
  67847. // "https://www.googleapis.com/auth/compute.readonly"
  67848. // ]
  67849. // }
  67850. }
  67851. // Pages invokes f for each page of results.
  67852. // A non-nil error returned from f will halt the iteration.
  67853. // The provided context supersedes any context provided to the Context method.
  67854. func (c *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error {
  67855. c.ctx_ = ctx
  67856. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  67857. for {
  67858. x, err := c.Do()
  67859. if err != nil {
  67860. return err
  67861. }
  67862. if err := f(x); err != nil {
  67863. return err
  67864. }
  67865. if x.NextPageToken == "" {
  67866. return nil
  67867. }
  67868. c.PageToken(x.NextPageToken)
  67869. }
  67870. }
  67871. // method id "compute.regionAutoscalers.patch":
  67872. type RegionAutoscalersPatchCall struct {
  67873. s *Service
  67874. project string
  67875. region string
  67876. autoscaler *Autoscaler
  67877. urlParams_ gensupport.URLParams
  67878. ctx_ context.Context
  67879. header_ http.Header
  67880. }
  67881. // Patch: Updates an autoscaler in the specified project using the data
  67882. // included in the request. This method supports PATCH semantics and
  67883. // uses the JSON merge patch format and processing rules.
  67884. func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall {
  67885. c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67886. c.project = project
  67887. c.region = region
  67888. c.autoscaler = autoscaler
  67889. return c
  67890. }
  67891. // Autoscaler sets the optional parameter "autoscaler": Name of the
  67892. // autoscaler to patch.
  67893. func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall {
  67894. c.urlParams_.Set("autoscaler", autoscaler)
  67895. return c
  67896. }
  67897. // RequestId sets the optional parameter "requestId": An optional
  67898. // request ID to identify requests. Specify a unique request ID so that
  67899. // if you must retry your request, the server will know to ignore the
  67900. // request if it has already been completed.
  67901. //
  67902. // For example, consider a situation where you make an initial request
  67903. // and the request times out. If you make the request again with the
  67904. // same request ID, the server can check if original operation with the
  67905. // same request ID was received, and if so, will ignore the second
  67906. // request. This prevents clients from accidentally creating duplicate
  67907. // commitments.
  67908. //
  67909. // The request ID must be a valid UUID with the exception that zero UUID
  67910. // is not supported (00000000-0000-0000-0000-000000000000).
  67911. func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall {
  67912. c.urlParams_.Set("requestId", requestId)
  67913. return c
  67914. }
  67915. // Fields allows partial responses to be retrieved. See
  67916. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67917. // for more information.
  67918. func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall {
  67919. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67920. return c
  67921. }
  67922. // Context sets the context to be used in this call's Do method. Any
  67923. // pending HTTP request will be aborted if the provided context is
  67924. // canceled.
  67925. func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall {
  67926. c.ctx_ = ctx
  67927. return c
  67928. }
  67929. // Header returns an http.Header that can be modified by the caller to
  67930. // add HTTP headers to the request.
  67931. func (c *RegionAutoscalersPatchCall) Header() http.Header {
  67932. if c.header_ == nil {
  67933. c.header_ = make(http.Header)
  67934. }
  67935. return c.header_
  67936. }
  67937. func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  67938. reqHeaders := make(http.Header)
  67939. for k, v := range c.header_ {
  67940. reqHeaders[k] = v
  67941. }
  67942. reqHeaders.Set("User-Agent", c.s.userAgent())
  67943. var body io.Reader = nil
  67944. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  67945. if err != nil {
  67946. return nil, err
  67947. }
  67948. reqHeaders.Set("Content-Type", "application/json")
  67949. c.urlParams_.Set("alt", alt)
  67950. c.urlParams_.Set("prettyPrint", "false")
  67951. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  67952. urls += "?" + c.urlParams_.Encode()
  67953. req, err := http.NewRequest("PATCH", urls, body)
  67954. if err != nil {
  67955. return nil, err
  67956. }
  67957. req.Header = reqHeaders
  67958. googleapi.Expand(req.URL, map[string]string{
  67959. "project": c.project,
  67960. "region": c.region,
  67961. })
  67962. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67963. }
  67964. // Do executes the "compute.regionAutoscalers.patch" call.
  67965. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67966. // status code is an error. Response headers are in either
  67967. // *Operation.ServerResponse.Header or (if a response was returned at
  67968. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67969. // to check whether the returned error was because
  67970. // http.StatusNotModified was returned.
  67971. func (c *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67972. gensupport.SetOptions(c.urlParams_, opts...)
  67973. res, err := c.doRequest("json")
  67974. if res != nil && res.StatusCode == http.StatusNotModified {
  67975. if res.Body != nil {
  67976. res.Body.Close()
  67977. }
  67978. return nil, &googleapi.Error{
  67979. Code: res.StatusCode,
  67980. Header: res.Header,
  67981. }
  67982. }
  67983. if err != nil {
  67984. return nil, err
  67985. }
  67986. defer googleapi.CloseBody(res)
  67987. if err := googleapi.CheckResponse(res); err != nil {
  67988. return nil, err
  67989. }
  67990. ret := &Operation{
  67991. ServerResponse: googleapi.ServerResponse{
  67992. Header: res.Header,
  67993. HTTPStatusCode: res.StatusCode,
  67994. },
  67995. }
  67996. target := &ret
  67997. if err := gensupport.DecodeResponse(target, res); err != nil {
  67998. return nil, err
  67999. }
  68000. return ret, nil
  68001. // {
  68002. // "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  68003. // "httpMethod": "PATCH",
  68004. // "id": "compute.regionAutoscalers.patch",
  68005. // "parameterOrder": [
  68006. // "project",
  68007. // "region"
  68008. // ],
  68009. // "parameters": {
  68010. // "autoscaler": {
  68011. // "description": "Name of the autoscaler to patch.",
  68012. // "location": "query",
  68013. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68014. // "type": "string"
  68015. // },
  68016. // "project": {
  68017. // "description": "Project ID for this request.",
  68018. // "location": "path",
  68019. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68020. // "required": true,
  68021. // "type": "string"
  68022. // },
  68023. // "region": {
  68024. // "description": "Name of the region scoping this request.",
  68025. // "location": "path",
  68026. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68027. // "required": true,
  68028. // "type": "string"
  68029. // },
  68030. // "requestId": {
  68031. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68032. // "location": "query",
  68033. // "type": "string"
  68034. // }
  68035. // },
  68036. // "path": "{project}/regions/{region}/autoscalers",
  68037. // "request": {
  68038. // "$ref": "Autoscaler"
  68039. // },
  68040. // "response": {
  68041. // "$ref": "Operation"
  68042. // },
  68043. // "scopes": [
  68044. // "https://www.googleapis.com/auth/cloud-platform",
  68045. // "https://www.googleapis.com/auth/compute"
  68046. // ]
  68047. // }
  68048. }
  68049. // method id "compute.regionAutoscalers.update":
  68050. type RegionAutoscalersUpdateCall struct {
  68051. s *Service
  68052. project string
  68053. region string
  68054. autoscaler *Autoscaler
  68055. urlParams_ gensupport.URLParams
  68056. ctx_ context.Context
  68057. header_ http.Header
  68058. }
  68059. // Update: Updates an autoscaler in the specified project using the data
  68060. // included in the request.
  68061. func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall {
  68062. c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68063. c.project = project
  68064. c.region = region
  68065. c.autoscaler = autoscaler
  68066. return c
  68067. }
  68068. // Autoscaler sets the optional parameter "autoscaler": Name of the
  68069. // autoscaler to update.
  68070. func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall {
  68071. c.urlParams_.Set("autoscaler", autoscaler)
  68072. return c
  68073. }
  68074. // RequestId sets the optional parameter "requestId": An optional
  68075. // request ID to identify requests. Specify a unique request ID so that
  68076. // if you must retry your request, the server will know to ignore the
  68077. // request if it has already been completed.
  68078. //
  68079. // For example, consider a situation where you make an initial request
  68080. // and the request times out. If you make the request again with the
  68081. // same request ID, the server can check if original operation with the
  68082. // same request ID was received, and if so, will ignore the second
  68083. // request. This prevents clients from accidentally creating duplicate
  68084. // commitments.
  68085. //
  68086. // The request ID must be a valid UUID with the exception that zero UUID
  68087. // is not supported (00000000-0000-0000-0000-000000000000).
  68088. func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall {
  68089. c.urlParams_.Set("requestId", requestId)
  68090. return c
  68091. }
  68092. // Fields allows partial responses to be retrieved. See
  68093. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68094. // for more information.
  68095. func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall {
  68096. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68097. return c
  68098. }
  68099. // Context sets the context to be used in this call's Do method. Any
  68100. // pending HTTP request will be aborted if the provided context is
  68101. // canceled.
  68102. func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall {
  68103. c.ctx_ = ctx
  68104. return c
  68105. }
  68106. // Header returns an http.Header that can be modified by the caller to
  68107. // add HTTP headers to the request.
  68108. func (c *RegionAutoscalersUpdateCall) Header() http.Header {
  68109. if c.header_ == nil {
  68110. c.header_ = make(http.Header)
  68111. }
  68112. return c.header_
  68113. }
  68114. func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  68115. reqHeaders := make(http.Header)
  68116. for k, v := range c.header_ {
  68117. reqHeaders[k] = v
  68118. }
  68119. reqHeaders.Set("User-Agent", c.s.userAgent())
  68120. var body io.Reader = nil
  68121. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  68122. if err != nil {
  68123. return nil, err
  68124. }
  68125. reqHeaders.Set("Content-Type", "application/json")
  68126. c.urlParams_.Set("alt", alt)
  68127. c.urlParams_.Set("prettyPrint", "false")
  68128. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  68129. urls += "?" + c.urlParams_.Encode()
  68130. req, err := http.NewRequest("PUT", urls, body)
  68131. if err != nil {
  68132. return nil, err
  68133. }
  68134. req.Header = reqHeaders
  68135. googleapi.Expand(req.URL, map[string]string{
  68136. "project": c.project,
  68137. "region": c.region,
  68138. })
  68139. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68140. }
  68141. // Do executes the "compute.regionAutoscalers.update" call.
  68142. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68143. // status code is an error. Response headers are in either
  68144. // *Operation.ServerResponse.Header or (if a response was returned at
  68145. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68146. // to check whether the returned error was because
  68147. // http.StatusNotModified was returned.
  68148. func (c *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68149. gensupport.SetOptions(c.urlParams_, opts...)
  68150. res, err := c.doRequest("json")
  68151. if res != nil && res.StatusCode == http.StatusNotModified {
  68152. if res.Body != nil {
  68153. res.Body.Close()
  68154. }
  68155. return nil, &googleapi.Error{
  68156. Code: res.StatusCode,
  68157. Header: res.Header,
  68158. }
  68159. }
  68160. if err != nil {
  68161. return nil, err
  68162. }
  68163. defer googleapi.CloseBody(res)
  68164. if err := googleapi.CheckResponse(res); err != nil {
  68165. return nil, err
  68166. }
  68167. ret := &Operation{
  68168. ServerResponse: googleapi.ServerResponse{
  68169. Header: res.Header,
  68170. HTTPStatusCode: res.StatusCode,
  68171. },
  68172. }
  68173. target := &ret
  68174. if err := gensupport.DecodeResponse(target, res); err != nil {
  68175. return nil, err
  68176. }
  68177. return ret, nil
  68178. // {
  68179. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  68180. // "httpMethod": "PUT",
  68181. // "id": "compute.regionAutoscalers.update",
  68182. // "parameterOrder": [
  68183. // "project",
  68184. // "region"
  68185. // ],
  68186. // "parameters": {
  68187. // "autoscaler": {
  68188. // "description": "Name of the autoscaler to update.",
  68189. // "location": "query",
  68190. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68191. // "type": "string"
  68192. // },
  68193. // "project": {
  68194. // "description": "Project ID for this request.",
  68195. // "location": "path",
  68196. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68197. // "required": true,
  68198. // "type": "string"
  68199. // },
  68200. // "region": {
  68201. // "description": "Name of the region scoping this request.",
  68202. // "location": "path",
  68203. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68204. // "required": true,
  68205. // "type": "string"
  68206. // },
  68207. // "requestId": {
  68208. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68209. // "location": "query",
  68210. // "type": "string"
  68211. // }
  68212. // },
  68213. // "path": "{project}/regions/{region}/autoscalers",
  68214. // "request": {
  68215. // "$ref": "Autoscaler"
  68216. // },
  68217. // "response": {
  68218. // "$ref": "Operation"
  68219. // },
  68220. // "scopes": [
  68221. // "https://www.googleapis.com/auth/cloud-platform",
  68222. // "https://www.googleapis.com/auth/compute"
  68223. // ]
  68224. // }
  68225. }
  68226. // method id "compute.regionBackendServices.delete":
  68227. type RegionBackendServicesDeleteCall struct {
  68228. s *Service
  68229. project string
  68230. region string
  68231. backendService string
  68232. urlParams_ gensupport.URLParams
  68233. ctx_ context.Context
  68234. header_ http.Header
  68235. }
  68236. // Delete: Deletes the specified regional BackendService resource.
  68237. func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall {
  68238. c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68239. c.project = project
  68240. c.region = region
  68241. c.backendService = backendService
  68242. return c
  68243. }
  68244. // RequestId sets the optional parameter "requestId": An optional
  68245. // request ID to identify requests. Specify a unique request ID so that
  68246. // if you must retry your request, the server will know to ignore the
  68247. // request if it has already been completed.
  68248. //
  68249. // For example, consider a situation where you make an initial request
  68250. // and the request times out. If you make the request again with the
  68251. // same request ID, the server can check if original operation with the
  68252. // same request ID was received, and if so, will ignore the second
  68253. // request. This prevents clients from accidentally creating duplicate
  68254. // commitments.
  68255. //
  68256. // The request ID must be a valid UUID with the exception that zero UUID
  68257. // is not supported (00000000-0000-0000-0000-000000000000).
  68258. func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall {
  68259. c.urlParams_.Set("requestId", requestId)
  68260. return c
  68261. }
  68262. // Fields allows partial responses to be retrieved. See
  68263. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68264. // for more information.
  68265. func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall {
  68266. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68267. return c
  68268. }
  68269. // Context sets the context to be used in this call's Do method. Any
  68270. // pending HTTP request will be aborted if the provided context is
  68271. // canceled.
  68272. func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall {
  68273. c.ctx_ = ctx
  68274. return c
  68275. }
  68276. // Header returns an http.Header that can be modified by the caller to
  68277. // add HTTP headers to the request.
  68278. func (c *RegionBackendServicesDeleteCall) Header() http.Header {
  68279. if c.header_ == nil {
  68280. c.header_ = make(http.Header)
  68281. }
  68282. return c.header_
  68283. }
  68284. func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  68285. reqHeaders := make(http.Header)
  68286. for k, v := range c.header_ {
  68287. reqHeaders[k] = v
  68288. }
  68289. reqHeaders.Set("User-Agent", c.s.userAgent())
  68290. var body io.Reader = nil
  68291. c.urlParams_.Set("alt", alt)
  68292. c.urlParams_.Set("prettyPrint", "false")
  68293. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  68294. urls += "?" + c.urlParams_.Encode()
  68295. req, err := http.NewRequest("DELETE", urls, body)
  68296. if err != nil {
  68297. return nil, err
  68298. }
  68299. req.Header = reqHeaders
  68300. googleapi.Expand(req.URL, map[string]string{
  68301. "project": c.project,
  68302. "region": c.region,
  68303. "backendService": c.backendService,
  68304. })
  68305. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68306. }
  68307. // Do executes the "compute.regionBackendServices.delete" call.
  68308. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68309. // status code is an error. Response headers are in either
  68310. // *Operation.ServerResponse.Header or (if a response was returned at
  68311. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68312. // to check whether the returned error was because
  68313. // http.StatusNotModified was returned.
  68314. func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68315. gensupport.SetOptions(c.urlParams_, opts...)
  68316. res, err := c.doRequest("json")
  68317. if res != nil && res.StatusCode == http.StatusNotModified {
  68318. if res.Body != nil {
  68319. res.Body.Close()
  68320. }
  68321. return nil, &googleapi.Error{
  68322. Code: res.StatusCode,
  68323. Header: res.Header,
  68324. }
  68325. }
  68326. if err != nil {
  68327. return nil, err
  68328. }
  68329. defer googleapi.CloseBody(res)
  68330. if err := googleapi.CheckResponse(res); err != nil {
  68331. return nil, err
  68332. }
  68333. ret := &Operation{
  68334. ServerResponse: googleapi.ServerResponse{
  68335. Header: res.Header,
  68336. HTTPStatusCode: res.StatusCode,
  68337. },
  68338. }
  68339. target := &ret
  68340. if err := gensupport.DecodeResponse(target, res); err != nil {
  68341. return nil, err
  68342. }
  68343. return ret, nil
  68344. // {
  68345. // "description": "Deletes the specified regional BackendService resource.",
  68346. // "httpMethod": "DELETE",
  68347. // "id": "compute.regionBackendServices.delete",
  68348. // "parameterOrder": [
  68349. // "project",
  68350. // "region",
  68351. // "backendService"
  68352. // ],
  68353. // "parameters": {
  68354. // "backendService": {
  68355. // "description": "Name of the BackendService resource to delete.",
  68356. // "location": "path",
  68357. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68358. // "required": true,
  68359. // "type": "string"
  68360. // },
  68361. // "project": {
  68362. // "description": "Project ID for this request.",
  68363. // "location": "path",
  68364. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68365. // "required": true,
  68366. // "type": "string"
  68367. // },
  68368. // "region": {
  68369. // "description": "Name of the region scoping this request.",
  68370. // "location": "path",
  68371. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68372. // "required": true,
  68373. // "type": "string"
  68374. // },
  68375. // "requestId": {
  68376. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68377. // "location": "query",
  68378. // "type": "string"
  68379. // }
  68380. // },
  68381. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  68382. // "response": {
  68383. // "$ref": "Operation"
  68384. // },
  68385. // "scopes": [
  68386. // "https://www.googleapis.com/auth/cloud-platform",
  68387. // "https://www.googleapis.com/auth/compute"
  68388. // ]
  68389. // }
  68390. }
  68391. // method id "compute.regionBackendServices.get":
  68392. type RegionBackendServicesGetCall struct {
  68393. s *Service
  68394. project string
  68395. region string
  68396. backendService string
  68397. urlParams_ gensupport.URLParams
  68398. ifNoneMatch_ string
  68399. ctx_ context.Context
  68400. header_ http.Header
  68401. }
  68402. // Get: Returns the specified regional BackendService resource.
  68403. func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall {
  68404. c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68405. c.project = project
  68406. c.region = region
  68407. c.backendService = backendService
  68408. return c
  68409. }
  68410. // Fields allows partial responses to be retrieved. See
  68411. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68412. // for more information.
  68413. func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall {
  68414. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68415. return c
  68416. }
  68417. // IfNoneMatch sets the optional parameter which makes the operation
  68418. // fail if the object's ETag matches the given value. This is useful for
  68419. // getting updates only after the object has changed since the last
  68420. // request. Use googleapi.IsNotModified to check whether the response
  68421. // error from Do is the result of In-None-Match.
  68422. func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall {
  68423. c.ifNoneMatch_ = entityTag
  68424. return c
  68425. }
  68426. // Context sets the context to be used in this call's Do method. Any
  68427. // pending HTTP request will be aborted if the provided context is
  68428. // canceled.
  68429. func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall {
  68430. c.ctx_ = ctx
  68431. return c
  68432. }
  68433. // Header returns an http.Header that can be modified by the caller to
  68434. // add HTTP headers to the request.
  68435. func (c *RegionBackendServicesGetCall) Header() http.Header {
  68436. if c.header_ == nil {
  68437. c.header_ = make(http.Header)
  68438. }
  68439. return c.header_
  68440. }
  68441. func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  68442. reqHeaders := make(http.Header)
  68443. for k, v := range c.header_ {
  68444. reqHeaders[k] = v
  68445. }
  68446. reqHeaders.Set("User-Agent", c.s.userAgent())
  68447. if c.ifNoneMatch_ != "" {
  68448. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68449. }
  68450. var body io.Reader = nil
  68451. c.urlParams_.Set("alt", alt)
  68452. c.urlParams_.Set("prettyPrint", "false")
  68453. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  68454. urls += "?" + c.urlParams_.Encode()
  68455. req, err := http.NewRequest("GET", urls, body)
  68456. if err != nil {
  68457. return nil, err
  68458. }
  68459. req.Header = reqHeaders
  68460. googleapi.Expand(req.URL, map[string]string{
  68461. "project": c.project,
  68462. "region": c.region,
  68463. "backendService": c.backendService,
  68464. })
  68465. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68466. }
  68467. // Do executes the "compute.regionBackendServices.get" call.
  68468. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  68469. // status code is an error. Response headers are in either
  68470. // *BackendService.ServerResponse.Header or (if a response was returned
  68471. // at all) in error.(*googleapi.Error).Header. Use
  68472. // googleapi.IsNotModified to check whether the returned error was
  68473. // because http.StatusNotModified was returned.
  68474. func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  68475. gensupport.SetOptions(c.urlParams_, opts...)
  68476. res, err := c.doRequest("json")
  68477. if res != nil && res.StatusCode == http.StatusNotModified {
  68478. if res.Body != nil {
  68479. res.Body.Close()
  68480. }
  68481. return nil, &googleapi.Error{
  68482. Code: res.StatusCode,
  68483. Header: res.Header,
  68484. }
  68485. }
  68486. if err != nil {
  68487. return nil, err
  68488. }
  68489. defer googleapi.CloseBody(res)
  68490. if err := googleapi.CheckResponse(res); err != nil {
  68491. return nil, err
  68492. }
  68493. ret := &BackendService{
  68494. ServerResponse: googleapi.ServerResponse{
  68495. Header: res.Header,
  68496. HTTPStatusCode: res.StatusCode,
  68497. },
  68498. }
  68499. target := &ret
  68500. if err := gensupport.DecodeResponse(target, res); err != nil {
  68501. return nil, err
  68502. }
  68503. return ret, nil
  68504. // {
  68505. // "description": "Returns the specified regional BackendService resource.",
  68506. // "httpMethod": "GET",
  68507. // "id": "compute.regionBackendServices.get",
  68508. // "parameterOrder": [
  68509. // "project",
  68510. // "region",
  68511. // "backendService"
  68512. // ],
  68513. // "parameters": {
  68514. // "backendService": {
  68515. // "description": "Name of the BackendService resource to return.",
  68516. // "location": "path",
  68517. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68518. // "required": true,
  68519. // "type": "string"
  68520. // },
  68521. // "project": {
  68522. // "description": "Project ID for this request.",
  68523. // "location": "path",
  68524. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68525. // "required": true,
  68526. // "type": "string"
  68527. // },
  68528. // "region": {
  68529. // "description": "Name of the region scoping this request.",
  68530. // "location": "path",
  68531. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68532. // "required": true,
  68533. // "type": "string"
  68534. // }
  68535. // },
  68536. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  68537. // "response": {
  68538. // "$ref": "BackendService"
  68539. // },
  68540. // "scopes": [
  68541. // "https://www.googleapis.com/auth/cloud-platform",
  68542. // "https://www.googleapis.com/auth/compute",
  68543. // "https://www.googleapis.com/auth/compute.readonly"
  68544. // ]
  68545. // }
  68546. }
  68547. // method id "compute.regionBackendServices.getHealth":
  68548. type RegionBackendServicesGetHealthCall struct {
  68549. s *Service
  68550. project string
  68551. region string
  68552. backendService string
  68553. resourcegroupreference *ResourceGroupReference
  68554. urlParams_ gensupport.URLParams
  68555. ctx_ context.Context
  68556. header_ http.Header
  68557. }
  68558. // GetHealth: Gets the most recent health check results for this
  68559. // regional BackendService.
  68560. func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall {
  68561. c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68562. c.project = project
  68563. c.region = region
  68564. c.backendService = backendService
  68565. c.resourcegroupreference = resourcegroupreference
  68566. return c
  68567. }
  68568. // Fields allows partial responses to be retrieved. See
  68569. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68570. // for more information.
  68571. func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall {
  68572. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68573. return c
  68574. }
  68575. // Context sets the context to be used in this call's Do method. Any
  68576. // pending HTTP request will be aborted if the provided context is
  68577. // canceled.
  68578. func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall {
  68579. c.ctx_ = ctx
  68580. return c
  68581. }
  68582. // Header returns an http.Header that can be modified by the caller to
  68583. // add HTTP headers to the request.
  68584. func (c *RegionBackendServicesGetHealthCall) Header() http.Header {
  68585. if c.header_ == nil {
  68586. c.header_ = make(http.Header)
  68587. }
  68588. return c.header_
  68589. }
  68590. func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  68591. reqHeaders := make(http.Header)
  68592. for k, v := range c.header_ {
  68593. reqHeaders[k] = v
  68594. }
  68595. reqHeaders.Set("User-Agent", c.s.userAgent())
  68596. var body io.Reader = nil
  68597. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  68598. if err != nil {
  68599. return nil, err
  68600. }
  68601. reqHeaders.Set("Content-Type", "application/json")
  68602. c.urlParams_.Set("alt", alt)
  68603. c.urlParams_.Set("prettyPrint", "false")
  68604. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}/getHealth")
  68605. urls += "?" + c.urlParams_.Encode()
  68606. req, err := http.NewRequest("POST", urls, body)
  68607. if err != nil {
  68608. return nil, err
  68609. }
  68610. req.Header = reqHeaders
  68611. googleapi.Expand(req.URL, map[string]string{
  68612. "project": c.project,
  68613. "region": c.region,
  68614. "backendService": c.backendService,
  68615. })
  68616. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68617. }
  68618. // Do executes the "compute.regionBackendServices.getHealth" call.
  68619. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  68620. // Any non-2xx status code is an error. Response headers are in either
  68621. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  68622. // was returned at all) in error.(*googleapi.Error).Header. Use
  68623. // googleapi.IsNotModified to check whether the returned error was
  68624. // because http.StatusNotModified was returned.
  68625. func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  68626. gensupport.SetOptions(c.urlParams_, opts...)
  68627. res, err := c.doRequest("json")
  68628. if res != nil && res.StatusCode == http.StatusNotModified {
  68629. if res.Body != nil {
  68630. res.Body.Close()
  68631. }
  68632. return nil, &googleapi.Error{
  68633. Code: res.StatusCode,
  68634. Header: res.Header,
  68635. }
  68636. }
  68637. if err != nil {
  68638. return nil, err
  68639. }
  68640. defer googleapi.CloseBody(res)
  68641. if err := googleapi.CheckResponse(res); err != nil {
  68642. return nil, err
  68643. }
  68644. ret := &BackendServiceGroupHealth{
  68645. ServerResponse: googleapi.ServerResponse{
  68646. Header: res.Header,
  68647. HTTPStatusCode: res.StatusCode,
  68648. },
  68649. }
  68650. target := &ret
  68651. if err := gensupport.DecodeResponse(target, res); err != nil {
  68652. return nil, err
  68653. }
  68654. return ret, nil
  68655. // {
  68656. // "description": "Gets the most recent health check results for this regional BackendService.",
  68657. // "httpMethod": "POST",
  68658. // "id": "compute.regionBackendServices.getHealth",
  68659. // "parameterOrder": [
  68660. // "project",
  68661. // "region",
  68662. // "backendService"
  68663. // ],
  68664. // "parameters": {
  68665. // "backendService": {
  68666. // "description": "Name of the BackendService resource for which to get health.",
  68667. // "location": "path",
  68668. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68669. // "required": true,
  68670. // "type": "string"
  68671. // },
  68672. // "project": {
  68673. // "location": "path",
  68674. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68675. // "required": true,
  68676. // "type": "string"
  68677. // },
  68678. // "region": {
  68679. // "description": "Name of the region scoping this request.",
  68680. // "location": "path",
  68681. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68682. // "required": true,
  68683. // "type": "string"
  68684. // }
  68685. // },
  68686. // "path": "{project}/regions/{region}/backendServices/{backendService}/getHealth",
  68687. // "request": {
  68688. // "$ref": "ResourceGroupReference"
  68689. // },
  68690. // "response": {
  68691. // "$ref": "BackendServiceGroupHealth"
  68692. // },
  68693. // "scopes": [
  68694. // "https://www.googleapis.com/auth/cloud-platform",
  68695. // "https://www.googleapis.com/auth/compute",
  68696. // "https://www.googleapis.com/auth/compute.readonly"
  68697. // ]
  68698. // }
  68699. }
  68700. // method id "compute.regionBackendServices.insert":
  68701. type RegionBackendServicesInsertCall struct {
  68702. s *Service
  68703. project string
  68704. region string
  68705. backendservice *BackendService
  68706. urlParams_ gensupport.URLParams
  68707. ctx_ context.Context
  68708. header_ http.Header
  68709. }
  68710. // Insert: Creates a regional BackendService resource in the specified
  68711. // project using the data included in the request. There are several
  68712. // restrictions and guidelines to keep in mind when creating a regional
  68713. // backend service. Read Restrictions and Guidelines for more
  68714. // information.
  68715. func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall {
  68716. c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68717. c.project = project
  68718. c.region = region
  68719. c.backendservice = backendservice
  68720. return c
  68721. }
  68722. // RequestId sets the optional parameter "requestId": An optional
  68723. // request ID to identify requests. Specify a unique request ID so that
  68724. // if you must retry your request, the server will know to ignore the
  68725. // request if it has already been completed.
  68726. //
  68727. // For example, consider a situation where you make an initial request
  68728. // and the request times out. If you make the request again with the
  68729. // same request ID, the server can check if original operation with the
  68730. // same request ID was received, and if so, will ignore the second
  68731. // request. This prevents clients from accidentally creating duplicate
  68732. // commitments.
  68733. //
  68734. // The request ID must be a valid UUID with the exception that zero UUID
  68735. // is not supported (00000000-0000-0000-0000-000000000000).
  68736. func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall {
  68737. c.urlParams_.Set("requestId", requestId)
  68738. return c
  68739. }
  68740. // Fields allows partial responses to be retrieved. See
  68741. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68742. // for more information.
  68743. func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall {
  68744. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68745. return c
  68746. }
  68747. // Context sets the context to be used in this call's Do method. Any
  68748. // pending HTTP request will be aborted if the provided context is
  68749. // canceled.
  68750. func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall {
  68751. c.ctx_ = ctx
  68752. return c
  68753. }
  68754. // Header returns an http.Header that can be modified by the caller to
  68755. // add HTTP headers to the request.
  68756. func (c *RegionBackendServicesInsertCall) Header() http.Header {
  68757. if c.header_ == nil {
  68758. c.header_ = make(http.Header)
  68759. }
  68760. return c.header_
  68761. }
  68762. func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  68763. reqHeaders := make(http.Header)
  68764. for k, v := range c.header_ {
  68765. reqHeaders[k] = v
  68766. }
  68767. reqHeaders.Set("User-Agent", c.s.userAgent())
  68768. var body io.Reader = nil
  68769. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  68770. if err != nil {
  68771. return nil, err
  68772. }
  68773. reqHeaders.Set("Content-Type", "application/json")
  68774. c.urlParams_.Set("alt", alt)
  68775. c.urlParams_.Set("prettyPrint", "false")
  68776. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  68777. urls += "?" + c.urlParams_.Encode()
  68778. req, err := http.NewRequest("POST", urls, body)
  68779. if err != nil {
  68780. return nil, err
  68781. }
  68782. req.Header = reqHeaders
  68783. googleapi.Expand(req.URL, map[string]string{
  68784. "project": c.project,
  68785. "region": c.region,
  68786. })
  68787. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68788. }
  68789. // Do executes the "compute.regionBackendServices.insert" call.
  68790. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68791. // status code is an error. Response headers are in either
  68792. // *Operation.ServerResponse.Header or (if a response was returned at
  68793. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68794. // to check whether the returned error was because
  68795. // http.StatusNotModified was returned.
  68796. func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68797. gensupport.SetOptions(c.urlParams_, opts...)
  68798. res, err := c.doRequest("json")
  68799. if res != nil && res.StatusCode == http.StatusNotModified {
  68800. if res.Body != nil {
  68801. res.Body.Close()
  68802. }
  68803. return nil, &googleapi.Error{
  68804. Code: res.StatusCode,
  68805. Header: res.Header,
  68806. }
  68807. }
  68808. if err != nil {
  68809. return nil, err
  68810. }
  68811. defer googleapi.CloseBody(res)
  68812. if err := googleapi.CheckResponse(res); err != nil {
  68813. return nil, err
  68814. }
  68815. ret := &Operation{
  68816. ServerResponse: googleapi.ServerResponse{
  68817. Header: res.Header,
  68818. HTTPStatusCode: res.StatusCode,
  68819. },
  68820. }
  68821. target := &ret
  68822. if err := gensupport.DecodeResponse(target, res); err != nil {
  68823. return nil, err
  68824. }
  68825. return ret, nil
  68826. // {
  68827. // "description": "Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information.",
  68828. // "httpMethod": "POST",
  68829. // "id": "compute.regionBackendServices.insert",
  68830. // "parameterOrder": [
  68831. // "project",
  68832. // "region"
  68833. // ],
  68834. // "parameters": {
  68835. // "project": {
  68836. // "description": "Project ID for this request.",
  68837. // "location": "path",
  68838. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68839. // "required": true,
  68840. // "type": "string"
  68841. // },
  68842. // "region": {
  68843. // "description": "Name of the region scoping this request.",
  68844. // "location": "path",
  68845. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68846. // "required": true,
  68847. // "type": "string"
  68848. // },
  68849. // "requestId": {
  68850. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68851. // "location": "query",
  68852. // "type": "string"
  68853. // }
  68854. // },
  68855. // "path": "{project}/regions/{region}/backendServices",
  68856. // "request": {
  68857. // "$ref": "BackendService"
  68858. // },
  68859. // "response": {
  68860. // "$ref": "Operation"
  68861. // },
  68862. // "scopes": [
  68863. // "https://www.googleapis.com/auth/cloud-platform",
  68864. // "https://www.googleapis.com/auth/compute"
  68865. // ]
  68866. // }
  68867. }
  68868. // method id "compute.regionBackendServices.list":
  68869. type RegionBackendServicesListCall struct {
  68870. s *Service
  68871. project string
  68872. region string
  68873. urlParams_ gensupport.URLParams
  68874. ifNoneMatch_ string
  68875. ctx_ context.Context
  68876. header_ http.Header
  68877. }
  68878. // List: Retrieves the list of regional BackendService resources
  68879. // available to the specified project in the given region.
  68880. func (r *RegionBackendServicesService) List(project string, region string) *RegionBackendServicesListCall {
  68881. c := &RegionBackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68882. c.project = project
  68883. c.region = region
  68884. return c
  68885. }
  68886. // Filter sets the optional parameter "filter": A filter expression that
  68887. // filters resources listed in the response. The expression must specify
  68888. // the field name, a comparison operator, and the value that you want to
  68889. // use for filtering. The value must be a string, a number, or a
  68890. // boolean. The comparison operator must be either =, !=, >, or <.
  68891. //
  68892. // For example, if you are filtering Compute Engine instances, you can
  68893. // exclude instances named example-instance by specifying name !=
  68894. // example-instance.
  68895. //
  68896. // You can also filter nested fields. For example, you could specify
  68897. // scheduling.automaticRestart = false to include instances only if they
  68898. // are not scheduled for automatic restarts. You can use filtering on
  68899. // nested fields to filter based on resource labels.
  68900. //
  68901. // To filter on multiple expressions, provide each separate expression
  68902. // within parentheses. For example, (scheduling.automaticRestart = true)
  68903. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  68904. // AND expression. However, you can include AND and OR expressions
  68905. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  68906. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  68907. // true).
  68908. func (c *RegionBackendServicesListCall) Filter(filter string) *RegionBackendServicesListCall {
  68909. c.urlParams_.Set("filter", filter)
  68910. return c
  68911. }
  68912. // MaxResults sets the optional parameter "maxResults": The maximum
  68913. // number of results per page that should be returned. If the number of
  68914. // available results is larger than maxResults, Compute Engine returns a
  68915. // nextPageToken that can be used to get the next page of results in
  68916. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  68917. // (Default: 500)
  68918. func (c *RegionBackendServicesListCall) MaxResults(maxResults int64) *RegionBackendServicesListCall {
  68919. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  68920. return c
  68921. }
  68922. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  68923. // a certain order. By default, results are returned in alphanumerical
  68924. // order based on the resource name.
  68925. //
  68926. // You can also sort results in descending order based on the creation
  68927. // timestamp using orderBy="creationTimestamp desc". This sorts results
  68928. // based on the creationTimestamp field in reverse chronological order
  68929. // (newest result first). Use this to sort resources like operations so
  68930. // that the newest operation is returned first.
  68931. //
  68932. // Currently, only sorting by name or creationTimestamp desc is
  68933. // supported.
  68934. func (c *RegionBackendServicesListCall) OrderBy(orderBy string) *RegionBackendServicesListCall {
  68935. c.urlParams_.Set("orderBy", orderBy)
  68936. return c
  68937. }
  68938. // PageToken sets the optional parameter "pageToken": Specifies a page
  68939. // token to use. Set pageToken to the nextPageToken returned by a
  68940. // previous list request to get the next page of results.
  68941. func (c *RegionBackendServicesListCall) PageToken(pageToken string) *RegionBackendServicesListCall {
  68942. c.urlParams_.Set("pageToken", pageToken)
  68943. return c
  68944. }
  68945. // Fields allows partial responses to be retrieved. See
  68946. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68947. // for more information.
  68948. func (c *RegionBackendServicesListCall) Fields(s ...googleapi.Field) *RegionBackendServicesListCall {
  68949. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68950. return c
  68951. }
  68952. // IfNoneMatch sets the optional parameter which makes the operation
  68953. // fail if the object's ETag matches the given value. This is useful for
  68954. // getting updates only after the object has changed since the last
  68955. // request. Use googleapi.IsNotModified to check whether the response
  68956. // error from Do is the result of In-None-Match.
  68957. func (c *RegionBackendServicesListCall) IfNoneMatch(entityTag string) *RegionBackendServicesListCall {
  68958. c.ifNoneMatch_ = entityTag
  68959. return c
  68960. }
  68961. // Context sets the context to be used in this call's Do method. Any
  68962. // pending HTTP request will be aborted if the provided context is
  68963. // canceled.
  68964. func (c *RegionBackendServicesListCall) Context(ctx context.Context) *RegionBackendServicesListCall {
  68965. c.ctx_ = ctx
  68966. return c
  68967. }
  68968. // Header returns an http.Header that can be modified by the caller to
  68969. // add HTTP headers to the request.
  68970. func (c *RegionBackendServicesListCall) Header() http.Header {
  68971. if c.header_ == nil {
  68972. c.header_ = make(http.Header)
  68973. }
  68974. return c.header_
  68975. }
  68976. func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  68977. reqHeaders := make(http.Header)
  68978. for k, v := range c.header_ {
  68979. reqHeaders[k] = v
  68980. }
  68981. reqHeaders.Set("User-Agent", c.s.userAgent())
  68982. if c.ifNoneMatch_ != "" {
  68983. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68984. }
  68985. var body io.Reader = nil
  68986. c.urlParams_.Set("alt", alt)
  68987. c.urlParams_.Set("prettyPrint", "false")
  68988. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  68989. urls += "?" + c.urlParams_.Encode()
  68990. req, err := http.NewRequest("GET", urls, body)
  68991. if err != nil {
  68992. return nil, err
  68993. }
  68994. req.Header = reqHeaders
  68995. googleapi.Expand(req.URL, map[string]string{
  68996. "project": c.project,
  68997. "region": c.region,
  68998. })
  68999. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69000. }
  69001. // Do executes the "compute.regionBackendServices.list" call.
  69002. // Exactly one of *BackendServiceList or error will be non-nil. Any
  69003. // non-2xx status code is an error. Response headers are in either
  69004. // *BackendServiceList.ServerResponse.Header or (if a response was
  69005. // returned at all) in error.(*googleapi.Error).Header. Use
  69006. // googleapi.IsNotModified to check whether the returned error was
  69007. // because http.StatusNotModified was returned.
  69008. func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  69009. gensupport.SetOptions(c.urlParams_, opts...)
  69010. res, err := c.doRequest("json")
  69011. if res != nil && res.StatusCode == http.StatusNotModified {
  69012. if res.Body != nil {
  69013. res.Body.Close()
  69014. }
  69015. return nil, &googleapi.Error{
  69016. Code: res.StatusCode,
  69017. Header: res.Header,
  69018. }
  69019. }
  69020. if err != nil {
  69021. return nil, err
  69022. }
  69023. defer googleapi.CloseBody(res)
  69024. if err := googleapi.CheckResponse(res); err != nil {
  69025. return nil, err
  69026. }
  69027. ret := &BackendServiceList{
  69028. ServerResponse: googleapi.ServerResponse{
  69029. Header: res.Header,
  69030. HTTPStatusCode: res.StatusCode,
  69031. },
  69032. }
  69033. target := &ret
  69034. if err := gensupport.DecodeResponse(target, res); err != nil {
  69035. return nil, err
  69036. }
  69037. return ret, nil
  69038. // {
  69039. // "description": "Retrieves the list of regional BackendService resources available to the specified project in the given region.",
  69040. // "httpMethod": "GET",
  69041. // "id": "compute.regionBackendServices.list",
  69042. // "parameterOrder": [
  69043. // "project",
  69044. // "region"
  69045. // ],
  69046. // "parameters": {
  69047. // "filter": {
  69048. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  69049. // "location": "query",
  69050. // "type": "string"
  69051. // },
  69052. // "maxResults": {
  69053. // "default": "500",
  69054. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  69055. // "format": "uint32",
  69056. // "location": "query",
  69057. // "minimum": "0",
  69058. // "type": "integer"
  69059. // },
  69060. // "orderBy": {
  69061. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  69062. // "location": "query",
  69063. // "type": "string"
  69064. // },
  69065. // "pageToken": {
  69066. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  69067. // "location": "query",
  69068. // "type": "string"
  69069. // },
  69070. // "project": {
  69071. // "description": "Project ID for this request.",
  69072. // "location": "path",
  69073. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69074. // "required": true,
  69075. // "type": "string"
  69076. // },
  69077. // "region": {
  69078. // "description": "Name of the region scoping this request.",
  69079. // "location": "path",
  69080. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69081. // "required": true,
  69082. // "type": "string"
  69083. // }
  69084. // },
  69085. // "path": "{project}/regions/{region}/backendServices",
  69086. // "response": {
  69087. // "$ref": "BackendServiceList"
  69088. // },
  69089. // "scopes": [
  69090. // "https://www.googleapis.com/auth/cloud-platform",
  69091. // "https://www.googleapis.com/auth/compute",
  69092. // "https://www.googleapis.com/auth/compute.readonly"
  69093. // ]
  69094. // }
  69095. }
  69096. // Pages invokes f for each page of results.
  69097. // A non-nil error returned from f will halt the iteration.
  69098. // The provided context supersedes any context provided to the Context method.
  69099. func (c *RegionBackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  69100. c.ctx_ = ctx
  69101. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  69102. for {
  69103. x, err := c.Do()
  69104. if err != nil {
  69105. return err
  69106. }
  69107. if err := f(x); err != nil {
  69108. return err
  69109. }
  69110. if x.NextPageToken == "" {
  69111. return nil
  69112. }
  69113. c.PageToken(x.NextPageToken)
  69114. }
  69115. }
  69116. // method id "compute.regionBackendServices.patch":
  69117. type RegionBackendServicesPatchCall struct {
  69118. s *Service
  69119. project string
  69120. region string
  69121. backendService string
  69122. backendservice *BackendService
  69123. urlParams_ gensupport.URLParams
  69124. ctx_ context.Context
  69125. header_ http.Header
  69126. }
  69127. // Patch: Updates the specified regional BackendService resource with
  69128. // the data included in the request. There are several restrictions and
  69129. // guidelines to keep in mind when updating a backend service. Read
  69130. // Restrictions and Guidelines for more information. This method
  69131. // supports PATCH semantics and uses the JSON merge patch format and
  69132. // processing rules.
  69133. func (r *RegionBackendServicesService) Patch(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesPatchCall {
  69134. c := &RegionBackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69135. c.project = project
  69136. c.region = region
  69137. c.backendService = backendService
  69138. c.backendservice = backendservice
  69139. return c
  69140. }
  69141. // RequestId sets the optional parameter "requestId": An optional
  69142. // request ID to identify requests. Specify a unique request ID so that
  69143. // if you must retry your request, the server will know to ignore the
  69144. // request if it has already been completed.
  69145. //
  69146. // For example, consider a situation where you make an initial request
  69147. // and the request times out. If you make the request again with the
  69148. // same request ID, the server can check if original operation with the
  69149. // same request ID was received, and if so, will ignore the second
  69150. // request. This prevents clients from accidentally creating duplicate
  69151. // commitments.
  69152. //
  69153. // The request ID must be a valid UUID with the exception that zero UUID
  69154. // is not supported (00000000-0000-0000-0000-000000000000).
  69155. func (c *RegionBackendServicesPatchCall) RequestId(requestId string) *RegionBackendServicesPatchCall {
  69156. c.urlParams_.Set("requestId", requestId)
  69157. return c
  69158. }
  69159. // Fields allows partial responses to be retrieved. See
  69160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69161. // for more information.
  69162. func (c *RegionBackendServicesPatchCall) Fields(s ...googleapi.Field) *RegionBackendServicesPatchCall {
  69163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69164. return c
  69165. }
  69166. // Context sets the context to be used in this call's Do method. Any
  69167. // pending HTTP request will be aborted if the provided context is
  69168. // canceled.
  69169. func (c *RegionBackendServicesPatchCall) Context(ctx context.Context) *RegionBackendServicesPatchCall {
  69170. c.ctx_ = ctx
  69171. return c
  69172. }
  69173. // Header returns an http.Header that can be modified by the caller to
  69174. // add HTTP headers to the request.
  69175. func (c *RegionBackendServicesPatchCall) Header() http.Header {
  69176. if c.header_ == nil {
  69177. c.header_ = make(http.Header)
  69178. }
  69179. return c.header_
  69180. }
  69181. func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  69182. reqHeaders := make(http.Header)
  69183. for k, v := range c.header_ {
  69184. reqHeaders[k] = v
  69185. }
  69186. reqHeaders.Set("User-Agent", c.s.userAgent())
  69187. var body io.Reader = nil
  69188. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  69189. if err != nil {
  69190. return nil, err
  69191. }
  69192. reqHeaders.Set("Content-Type", "application/json")
  69193. c.urlParams_.Set("alt", alt)
  69194. c.urlParams_.Set("prettyPrint", "false")
  69195. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  69196. urls += "?" + c.urlParams_.Encode()
  69197. req, err := http.NewRequest("PATCH", urls, body)
  69198. if err != nil {
  69199. return nil, err
  69200. }
  69201. req.Header = reqHeaders
  69202. googleapi.Expand(req.URL, map[string]string{
  69203. "project": c.project,
  69204. "region": c.region,
  69205. "backendService": c.backendService,
  69206. })
  69207. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69208. }
  69209. // Do executes the "compute.regionBackendServices.patch" call.
  69210. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69211. // status code is an error. Response headers are in either
  69212. // *Operation.ServerResponse.Header or (if a response was returned at
  69213. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69214. // to check whether the returned error was because
  69215. // http.StatusNotModified was returned.
  69216. func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69217. gensupport.SetOptions(c.urlParams_, opts...)
  69218. res, err := c.doRequest("json")
  69219. if res != nil && res.StatusCode == http.StatusNotModified {
  69220. if res.Body != nil {
  69221. res.Body.Close()
  69222. }
  69223. return nil, &googleapi.Error{
  69224. Code: res.StatusCode,
  69225. Header: res.Header,
  69226. }
  69227. }
  69228. if err != nil {
  69229. return nil, err
  69230. }
  69231. defer googleapi.CloseBody(res)
  69232. if err := googleapi.CheckResponse(res); err != nil {
  69233. return nil, err
  69234. }
  69235. ret := &Operation{
  69236. ServerResponse: googleapi.ServerResponse{
  69237. Header: res.Header,
  69238. HTTPStatusCode: res.StatusCode,
  69239. },
  69240. }
  69241. target := &ret
  69242. if err := gensupport.DecodeResponse(target, res); err != nil {
  69243. return nil, err
  69244. }
  69245. return ret, nil
  69246. // {
  69247. // "description": "Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  69248. // "httpMethod": "PATCH",
  69249. // "id": "compute.regionBackendServices.patch",
  69250. // "parameterOrder": [
  69251. // "project",
  69252. // "region",
  69253. // "backendService"
  69254. // ],
  69255. // "parameters": {
  69256. // "backendService": {
  69257. // "description": "Name of the BackendService resource to patch.",
  69258. // "location": "path",
  69259. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69260. // "required": true,
  69261. // "type": "string"
  69262. // },
  69263. // "project": {
  69264. // "description": "Project ID for this request.",
  69265. // "location": "path",
  69266. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69267. // "required": true,
  69268. // "type": "string"
  69269. // },
  69270. // "region": {
  69271. // "description": "Name of the region scoping this request.",
  69272. // "location": "path",
  69273. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69274. // "required": true,
  69275. // "type": "string"
  69276. // },
  69277. // "requestId": {
  69278. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69279. // "location": "query",
  69280. // "type": "string"
  69281. // }
  69282. // },
  69283. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  69284. // "request": {
  69285. // "$ref": "BackendService"
  69286. // },
  69287. // "response": {
  69288. // "$ref": "Operation"
  69289. // },
  69290. // "scopes": [
  69291. // "https://www.googleapis.com/auth/cloud-platform",
  69292. // "https://www.googleapis.com/auth/compute"
  69293. // ]
  69294. // }
  69295. }
  69296. // method id "compute.regionBackendServices.update":
  69297. type RegionBackendServicesUpdateCall struct {
  69298. s *Service
  69299. project string
  69300. region string
  69301. backendService string
  69302. backendservice *BackendService
  69303. urlParams_ gensupport.URLParams
  69304. ctx_ context.Context
  69305. header_ http.Header
  69306. }
  69307. // Update: Updates the specified regional BackendService resource with
  69308. // the data included in the request. There are several restrictions and
  69309. // guidelines to keep in mind when updating a backend service. Read
  69310. // Restrictions and Guidelines for more information.
  69311. func (r *RegionBackendServicesService) Update(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesUpdateCall {
  69312. c := &RegionBackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69313. c.project = project
  69314. c.region = region
  69315. c.backendService = backendService
  69316. c.backendservice = backendservice
  69317. return c
  69318. }
  69319. // RequestId sets the optional parameter "requestId": An optional
  69320. // request ID to identify requests. Specify a unique request ID so that
  69321. // if you must retry your request, the server will know to ignore the
  69322. // request if it has already been completed.
  69323. //
  69324. // For example, consider a situation where you make an initial request
  69325. // and the request times out. If you make the request again with the
  69326. // same request ID, the server can check if original operation with the
  69327. // same request ID was received, and if so, will ignore the second
  69328. // request. This prevents clients from accidentally creating duplicate
  69329. // commitments.
  69330. //
  69331. // The request ID must be a valid UUID with the exception that zero UUID
  69332. // is not supported (00000000-0000-0000-0000-000000000000).
  69333. func (c *RegionBackendServicesUpdateCall) RequestId(requestId string) *RegionBackendServicesUpdateCall {
  69334. c.urlParams_.Set("requestId", requestId)
  69335. return c
  69336. }
  69337. // Fields allows partial responses to be retrieved. See
  69338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69339. // for more information.
  69340. func (c *RegionBackendServicesUpdateCall) Fields(s ...googleapi.Field) *RegionBackendServicesUpdateCall {
  69341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69342. return c
  69343. }
  69344. // Context sets the context to be used in this call's Do method. Any
  69345. // pending HTTP request will be aborted if the provided context is
  69346. // canceled.
  69347. func (c *RegionBackendServicesUpdateCall) Context(ctx context.Context) *RegionBackendServicesUpdateCall {
  69348. c.ctx_ = ctx
  69349. return c
  69350. }
  69351. // Header returns an http.Header that can be modified by the caller to
  69352. // add HTTP headers to the request.
  69353. func (c *RegionBackendServicesUpdateCall) Header() http.Header {
  69354. if c.header_ == nil {
  69355. c.header_ = make(http.Header)
  69356. }
  69357. return c.header_
  69358. }
  69359. func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  69360. reqHeaders := make(http.Header)
  69361. for k, v := range c.header_ {
  69362. reqHeaders[k] = v
  69363. }
  69364. reqHeaders.Set("User-Agent", c.s.userAgent())
  69365. var body io.Reader = nil
  69366. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  69367. if err != nil {
  69368. return nil, err
  69369. }
  69370. reqHeaders.Set("Content-Type", "application/json")
  69371. c.urlParams_.Set("alt", alt)
  69372. c.urlParams_.Set("prettyPrint", "false")
  69373. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  69374. urls += "?" + c.urlParams_.Encode()
  69375. req, err := http.NewRequest("PUT", urls, body)
  69376. if err != nil {
  69377. return nil, err
  69378. }
  69379. req.Header = reqHeaders
  69380. googleapi.Expand(req.URL, map[string]string{
  69381. "project": c.project,
  69382. "region": c.region,
  69383. "backendService": c.backendService,
  69384. })
  69385. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69386. }
  69387. // Do executes the "compute.regionBackendServices.update" call.
  69388. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69389. // status code is an error. Response headers are in either
  69390. // *Operation.ServerResponse.Header or (if a response was returned at
  69391. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69392. // to check whether the returned error was because
  69393. // http.StatusNotModified was returned.
  69394. func (c *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69395. gensupport.SetOptions(c.urlParams_, opts...)
  69396. res, err := c.doRequest("json")
  69397. if res != nil && res.StatusCode == http.StatusNotModified {
  69398. if res.Body != nil {
  69399. res.Body.Close()
  69400. }
  69401. return nil, &googleapi.Error{
  69402. Code: res.StatusCode,
  69403. Header: res.Header,
  69404. }
  69405. }
  69406. if err != nil {
  69407. return nil, err
  69408. }
  69409. defer googleapi.CloseBody(res)
  69410. if err := googleapi.CheckResponse(res); err != nil {
  69411. return nil, err
  69412. }
  69413. ret := &Operation{
  69414. ServerResponse: googleapi.ServerResponse{
  69415. Header: res.Header,
  69416. HTTPStatusCode: res.StatusCode,
  69417. },
  69418. }
  69419. target := &ret
  69420. if err := gensupport.DecodeResponse(target, res); err != nil {
  69421. return nil, err
  69422. }
  69423. return ret, nil
  69424. // {
  69425. // "description": "Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information.",
  69426. // "httpMethod": "PUT",
  69427. // "id": "compute.regionBackendServices.update",
  69428. // "parameterOrder": [
  69429. // "project",
  69430. // "region",
  69431. // "backendService"
  69432. // ],
  69433. // "parameters": {
  69434. // "backendService": {
  69435. // "description": "Name of the BackendService resource to update.",
  69436. // "location": "path",
  69437. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69438. // "required": true,
  69439. // "type": "string"
  69440. // },
  69441. // "project": {
  69442. // "description": "Project ID for this request.",
  69443. // "location": "path",
  69444. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69445. // "required": true,
  69446. // "type": "string"
  69447. // },
  69448. // "region": {
  69449. // "description": "Name of the region scoping this request.",
  69450. // "location": "path",
  69451. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69452. // "required": true,
  69453. // "type": "string"
  69454. // },
  69455. // "requestId": {
  69456. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69457. // "location": "query",
  69458. // "type": "string"
  69459. // }
  69460. // },
  69461. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  69462. // "request": {
  69463. // "$ref": "BackendService"
  69464. // },
  69465. // "response": {
  69466. // "$ref": "Operation"
  69467. // },
  69468. // "scopes": [
  69469. // "https://www.googleapis.com/auth/cloud-platform",
  69470. // "https://www.googleapis.com/auth/compute"
  69471. // ]
  69472. // }
  69473. }
  69474. // method id "compute.regionCommitments.aggregatedList":
  69475. type RegionCommitmentsAggregatedListCall struct {
  69476. s *Service
  69477. project string
  69478. urlParams_ gensupport.URLParams
  69479. ifNoneMatch_ string
  69480. ctx_ context.Context
  69481. header_ http.Header
  69482. }
  69483. // AggregatedList: Retrieves an aggregated list of commitments.
  69484. func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitmentsAggregatedListCall {
  69485. c := &RegionCommitmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69486. c.project = project
  69487. return c
  69488. }
  69489. // Filter sets the optional parameter "filter": A filter expression that
  69490. // filters resources listed in the response. The expression must specify
  69491. // the field name, a comparison operator, and the value that you want to
  69492. // use for filtering. The value must be a string, a number, or a
  69493. // boolean. The comparison operator must be either =, !=, >, or <.
  69494. //
  69495. // For example, if you are filtering Compute Engine instances, you can
  69496. // exclude instances named example-instance by specifying name !=
  69497. // example-instance.
  69498. //
  69499. // You can also filter nested fields. For example, you could specify
  69500. // scheduling.automaticRestart = false to include instances only if they
  69501. // are not scheduled for automatic restarts. You can use filtering on
  69502. // nested fields to filter based on resource labels.
  69503. //
  69504. // To filter on multiple expressions, provide each separate expression
  69505. // within parentheses. For example, (scheduling.automaticRestart = true)
  69506. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  69507. // AND expression. However, you can include AND and OR expressions
  69508. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  69509. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  69510. // true).
  69511. func (c *RegionCommitmentsAggregatedListCall) Filter(filter string) *RegionCommitmentsAggregatedListCall {
  69512. c.urlParams_.Set("filter", filter)
  69513. return c
  69514. }
  69515. // MaxResults sets the optional parameter "maxResults": The maximum
  69516. // number of results per page that should be returned. If the number of
  69517. // available results is larger than maxResults, Compute Engine returns a
  69518. // nextPageToken that can be used to get the next page of results in
  69519. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  69520. // (Default: 500)
  69521. func (c *RegionCommitmentsAggregatedListCall) MaxResults(maxResults int64) *RegionCommitmentsAggregatedListCall {
  69522. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  69523. return c
  69524. }
  69525. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  69526. // a certain order. By default, results are returned in alphanumerical
  69527. // order based on the resource name.
  69528. //
  69529. // You can also sort results in descending order based on the creation
  69530. // timestamp using orderBy="creationTimestamp desc". This sorts results
  69531. // based on the creationTimestamp field in reverse chronological order
  69532. // (newest result first). Use this to sort resources like operations so
  69533. // that the newest operation is returned first.
  69534. //
  69535. // Currently, only sorting by name or creationTimestamp desc is
  69536. // supported.
  69537. func (c *RegionCommitmentsAggregatedListCall) OrderBy(orderBy string) *RegionCommitmentsAggregatedListCall {
  69538. c.urlParams_.Set("orderBy", orderBy)
  69539. return c
  69540. }
  69541. // PageToken sets the optional parameter "pageToken": Specifies a page
  69542. // token to use. Set pageToken to the nextPageToken returned by a
  69543. // previous list request to get the next page of results.
  69544. func (c *RegionCommitmentsAggregatedListCall) PageToken(pageToken string) *RegionCommitmentsAggregatedListCall {
  69545. c.urlParams_.Set("pageToken", pageToken)
  69546. return c
  69547. }
  69548. // Fields allows partial responses to be retrieved. See
  69549. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69550. // for more information.
  69551. func (c *RegionCommitmentsAggregatedListCall) Fields(s ...googleapi.Field) *RegionCommitmentsAggregatedListCall {
  69552. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69553. return c
  69554. }
  69555. // IfNoneMatch sets the optional parameter which makes the operation
  69556. // fail if the object's ETag matches the given value. This is useful for
  69557. // getting updates only after the object has changed since the last
  69558. // request. Use googleapi.IsNotModified to check whether the response
  69559. // error from Do is the result of In-None-Match.
  69560. func (c *RegionCommitmentsAggregatedListCall) IfNoneMatch(entityTag string) *RegionCommitmentsAggregatedListCall {
  69561. c.ifNoneMatch_ = entityTag
  69562. return c
  69563. }
  69564. // Context sets the context to be used in this call's Do method. Any
  69565. // pending HTTP request will be aborted if the provided context is
  69566. // canceled.
  69567. func (c *RegionCommitmentsAggregatedListCall) Context(ctx context.Context) *RegionCommitmentsAggregatedListCall {
  69568. c.ctx_ = ctx
  69569. return c
  69570. }
  69571. // Header returns an http.Header that can be modified by the caller to
  69572. // add HTTP headers to the request.
  69573. func (c *RegionCommitmentsAggregatedListCall) Header() http.Header {
  69574. if c.header_ == nil {
  69575. c.header_ = make(http.Header)
  69576. }
  69577. return c.header_
  69578. }
  69579. func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  69580. reqHeaders := make(http.Header)
  69581. for k, v := range c.header_ {
  69582. reqHeaders[k] = v
  69583. }
  69584. reqHeaders.Set("User-Agent", c.s.userAgent())
  69585. if c.ifNoneMatch_ != "" {
  69586. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69587. }
  69588. var body io.Reader = nil
  69589. c.urlParams_.Set("alt", alt)
  69590. c.urlParams_.Set("prettyPrint", "false")
  69591. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/commitments")
  69592. urls += "?" + c.urlParams_.Encode()
  69593. req, err := http.NewRequest("GET", urls, body)
  69594. if err != nil {
  69595. return nil, err
  69596. }
  69597. req.Header = reqHeaders
  69598. googleapi.Expand(req.URL, map[string]string{
  69599. "project": c.project,
  69600. })
  69601. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69602. }
  69603. // Do executes the "compute.regionCommitments.aggregatedList" call.
  69604. // Exactly one of *CommitmentAggregatedList or error will be non-nil.
  69605. // Any non-2xx status code is an error. Response headers are in either
  69606. // *CommitmentAggregatedList.ServerResponse.Header or (if a response was
  69607. // returned at all) in error.(*googleapi.Error).Header. Use
  69608. // googleapi.IsNotModified to check whether the returned error was
  69609. // because http.StatusNotModified was returned.
  69610. func (c *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*CommitmentAggregatedList, error) {
  69611. gensupport.SetOptions(c.urlParams_, opts...)
  69612. res, err := c.doRequest("json")
  69613. if res != nil && res.StatusCode == http.StatusNotModified {
  69614. if res.Body != nil {
  69615. res.Body.Close()
  69616. }
  69617. return nil, &googleapi.Error{
  69618. Code: res.StatusCode,
  69619. Header: res.Header,
  69620. }
  69621. }
  69622. if err != nil {
  69623. return nil, err
  69624. }
  69625. defer googleapi.CloseBody(res)
  69626. if err := googleapi.CheckResponse(res); err != nil {
  69627. return nil, err
  69628. }
  69629. ret := &CommitmentAggregatedList{
  69630. ServerResponse: googleapi.ServerResponse{
  69631. Header: res.Header,
  69632. HTTPStatusCode: res.StatusCode,
  69633. },
  69634. }
  69635. target := &ret
  69636. if err := gensupport.DecodeResponse(target, res); err != nil {
  69637. return nil, err
  69638. }
  69639. return ret, nil
  69640. // {
  69641. // "description": "Retrieves an aggregated list of commitments.",
  69642. // "httpMethod": "GET",
  69643. // "id": "compute.regionCommitments.aggregatedList",
  69644. // "parameterOrder": [
  69645. // "project"
  69646. // ],
  69647. // "parameters": {
  69648. // "filter": {
  69649. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  69650. // "location": "query",
  69651. // "type": "string"
  69652. // },
  69653. // "maxResults": {
  69654. // "default": "500",
  69655. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  69656. // "format": "uint32",
  69657. // "location": "query",
  69658. // "minimum": "0",
  69659. // "type": "integer"
  69660. // },
  69661. // "orderBy": {
  69662. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  69663. // "location": "query",
  69664. // "type": "string"
  69665. // },
  69666. // "pageToken": {
  69667. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  69668. // "location": "query",
  69669. // "type": "string"
  69670. // },
  69671. // "project": {
  69672. // "description": "Project ID for this request.",
  69673. // "location": "path",
  69674. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69675. // "required": true,
  69676. // "type": "string"
  69677. // }
  69678. // },
  69679. // "path": "{project}/aggregated/commitments",
  69680. // "response": {
  69681. // "$ref": "CommitmentAggregatedList"
  69682. // },
  69683. // "scopes": [
  69684. // "https://www.googleapis.com/auth/cloud-platform",
  69685. // "https://www.googleapis.com/auth/compute",
  69686. // "https://www.googleapis.com/auth/compute.readonly"
  69687. // ]
  69688. // }
  69689. }
  69690. // Pages invokes f for each page of results.
  69691. // A non-nil error returned from f will halt the iteration.
  69692. // The provided context supersedes any context provided to the Context method.
  69693. func (c *RegionCommitmentsAggregatedListCall) Pages(ctx context.Context, f func(*CommitmentAggregatedList) error) error {
  69694. c.ctx_ = ctx
  69695. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  69696. for {
  69697. x, err := c.Do()
  69698. if err != nil {
  69699. return err
  69700. }
  69701. if err := f(x); err != nil {
  69702. return err
  69703. }
  69704. if x.NextPageToken == "" {
  69705. return nil
  69706. }
  69707. c.PageToken(x.NextPageToken)
  69708. }
  69709. }
  69710. // method id "compute.regionCommitments.get":
  69711. type RegionCommitmentsGetCall struct {
  69712. s *Service
  69713. project string
  69714. region string
  69715. commitment string
  69716. urlParams_ gensupport.URLParams
  69717. ifNoneMatch_ string
  69718. ctx_ context.Context
  69719. header_ http.Header
  69720. }
  69721. // Get: Returns the specified commitment resource. Gets a list of
  69722. // available commitments by making a list() request.
  69723. func (r *RegionCommitmentsService) Get(project string, region string, commitment string) *RegionCommitmentsGetCall {
  69724. c := &RegionCommitmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69725. c.project = project
  69726. c.region = region
  69727. c.commitment = commitment
  69728. return c
  69729. }
  69730. // Fields allows partial responses to be retrieved. See
  69731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69732. // for more information.
  69733. func (c *RegionCommitmentsGetCall) Fields(s ...googleapi.Field) *RegionCommitmentsGetCall {
  69734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69735. return c
  69736. }
  69737. // IfNoneMatch sets the optional parameter which makes the operation
  69738. // fail if the object's ETag matches the given value. This is useful for
  69739. // getting updates only after the object has changed since the last
  69740. // request. Use googleapi.IsNotModified to check whether the response
  69741. // error from Do is the result of In-None-Match.
  69742. func (c *RegionCommitmentsGetCall) IfNoneMatch(entityTag string) *RegionCommitmentsGetCall {
  69743. c.ifNoneMatch_ = entityTag
  69744. return c
  69745. }
  69746. // Context sets the context to be used in this call's Do method. Any
  69747. // pending HTTP request will be aborted if the provided context is
  69748. // canceled.
  69749. func (c *RegionCommitmentsGetCall) Context(ctx context.Context) *RegionCommitmentsGetCall {
  69750. c.ctx_ = ctx
  69751. return c
  69752. }
  69753. // Header returns an http.Header that can be modified by the caller to
  69754. // add HTTP headers to the request.
  69755. func (c *RegionCommitmentsGetCall) Header() http.Header {
  69756. if c.header_ == nil {
  69757. c.header_ = make(http.Header)
  69758. }
  69759. return c.header_
  69760. }
  69761. func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) {
  69762. reqHeaders := make(http.Header)
  69763. for k, v := range c.header_ {
  69764. reqHeaders[k] = v
  69765. }
  69766. reqHeaders.Set("User-Agent", c.s.userAgent())
  69767. if c.ifNoneMatch_ != "" {
  69768. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69769. }
  69770. var body io.Reader = nil
  69771. c.urlParams_.Set("alt", alt)
  69772. c.urlParams_.Set("prettyPrint", "false")
  69773. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{commitment}")
  69774. urls += "?" + c.urlParams_.Encode()
  69775. req, err := http.NewRequest("GET", urls, body)
  69776. if err != nil {
  69777. return nil, err
  69778. }
  69779. req.Header = reqHeaders
  69780. googleapi.Expand(req.URL, map[string]string{
  69781. "project": c.project,
  69782. "region": c.region,
  69783. "commitment": c.commitment,
  69784. })
  69785. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69786. }
  69787. // Do executes the "compute.regionCommitments.get" call.
  69788. // Exactly one of *Commitment or error will be non-nil. Any non-2xx
  69789. // status code is an error. Response headers are in either
  69790. // *Commitment.ServerResponse.Header or (if a response was returned at
  69791. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69792. // to check whether the returned error was because
  69793. // http.StatusNotModified was returned.
  69794. func (c *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment, error) {
  69795. gensupport.SetOptions(c.urlParams_, opts...)
  69796. res, err := c.doRequest("json")
  69797. if res != nil && res.StatusCode == http.StatusNotModified {
  69798. if res.Body != nil {
  69799. res.Body.Close()
  69800. }
  69801. return nil, &googleapi.Error{
  69802. Code: res.StatusCode,
  69803. Header: res.Header,
  69804. }
  69805. }
  69806. if err != nil {
  69807. return nil, err
  69808. }
  69809. defer googleapi.CloseBody(res)
  69810. if err := googleapi.CheckResponse(res); err != nil {
  69811. return nil, err
  69812. }
  69813. ret := &Commitment{
  69814. ServerResponse: googleapi.ServerResponse{
  69815. Header: res.Header,
  69816. HTTPStatusCode: res.StatusCode,
  69817. },
  69818. }
  69819. target := &ret
  69820. if err := gensupport.DecodeResponse(target, res); err != nil {
  69821. return nil, err
  69822. }
  69823. return ret, nil
  69824. // {
  69825. // "description": "Returns the specified commitment resource. Gets a list of available commitments by making a list() request.",
  69826. // "httpMethod": "GET",
  69827. // "id": "compute.regionCommitments.get",
  69828. // "parameterOrder": [
  69829. // "project",
  69830. // "region",
  69831. // "commitment"
  69832. // ],
  69833. // "parameters": {
  69834. // "commitment": {
  69835. // "description": "Name of the commitment to return.",
  69836. // "location": "path",
  69837. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69838. // "required": true,
  69839. // "type": "string"
  69840. // },
  69841. // "project": {
  69842. // "description": "Project ID for this request.",
  69843. // "location": "path",
  69844. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69845. // "required": true,
  69846. // "type": "string"
  69847. // },
  69848. // "region": {
  69849. // "description": "Name of the region for this request.",
  69850. // "location": "path",
  69851. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69852. // "required": true,
  69853. // "type": "string"
  69854. // }
  69855. // },
  69856. // "path": "{project}/regions/{region}/commitments/{commitment}",
  69857. // "response": {
  69858. // "$ref": "Commitment"
  69859. // },
  69860. // "scopes": [
  69861. // "https://www.googleapis.com/auth/cloud-platform",
  69862. // "https://www.googleapis.com/auth/compute",
  69863. // "https://www.googleapis.com/auth/compute.readonly"
  69864. // ]
  69865. // }
  69866. }
  69867. // method id "compute.regionCommitments.insert":
  69868. type RegionCommitmentsInsertCall struct {
  69869. s *Service
  69870. project string
  69871. region string
  69872. commitment *Commitment
  69873. urlParams_ gensupport.URLParams
  69874. ctx_ context.Context
  69875. header_ http.Header
  69876. }
  69877. // Insert: Creates a commitment in the specified project using the data
  69878. // included in the request.
  69879. func (r *RegionCommitmentsService) Insert(project string, region string, commitment *Commitment) *RegionCommitmentsInsertCall {
  69880. c := &RegionCommitmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69881. c.project = project
  69882. c.region = region
  69883. c.commitment = commitment
  69884. return c
  69885. }
  69886. // RequestId sets the optional parameter "requestId": An optional
  69887. // request ID to identify requests. Specify a unique request ID so that
  69888. // if you must retry your request, the server will know to ignore the
  69889. // request if it has already been completed.
  69890. //
  69891. // For example, consider a situation where you make an initial request
  69892. // and the request times out. If you make the request again with the
  69893. // same request ID, the server can check if original operation with the
  69894. // same request ID was received, and if so, will ignore the second
  69895. // request. This prevents clients from accidentally creating duplicate
  69896. // commitments.
  69897. //
  69898. // The request ID must be a valid UUID with the exception that zero UUID
  69899. // is not supported (00000000-0000-0000-0000-000000000000).
  69900. func (c *RegionCommitmentsInsertCall) RequestId(requestId string) *RegionCommitmentsInsertCall {
  69901. c.urlParams_.Set("requestId", requestId)
  69902. return c
  69903. }
  69904. // Fields allows partial responses to be retrieved. See
  69905. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69906. // for more information.
  69907. func (c *RegionCommitmentsInsertCall) Fields(s ...googleapi.Field) *RegionCommitmentsInsertCall {
  69908. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69909. return c
  69910. }
  69911. // Context sets the context to be used in this call's Do method. Any
  69912. // pending HTTP request will be aborted if the provided context is
  69913. // canceled.
  69914. func (c *RegionCommitmentsInsertCall) Context(ctx context.Context) *RegionCommitmentsInsertCall {
  69915. c.ctx_ = ctx
  69916. return c
  69917. }
  69918. // Header returns an http.Header that can be modified by the caller to
  69919. // add HTTP headers to the request.
  69920. func (c *RegionCommitmentsInsertCall) Header() http.Header {
  69921. if c.header_ == nil {
  69922. c.header_ = make(http.Header)
  69923. }
  69924. return c.header_
  69925. }
  69926. func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  69927. reqHeaders := make(http.Header)
  69928. for k, v := range c.header_ {
  69929. reqHeaders[k] = v
  69930. }
  69931. reqHeaders.Set("User-Agent", c.s.userAgent())
  69932. var body io.Reader = nil
  69933. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment)
  69934. if err != nil {
  69935. return nil, err
  69936. }
  69937. reqHeaders.Set("Content-Type", "application/json")
  69938. c.urlParams_.Set("alt", alt)
  69939. c.urlParams_.Set("prettyPrint", "false")
  69940. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  69941. urls += "?" + c.urlParams_.Encode()
  69942. req, err := http.NewRequest("POST", urls, body)
  69943. if err != nil {
  69944. return nil, err
  69945. }
  69946. req.Header = reqHeaders
  69947. googleapi.Expand(req.URL, map[string]string{
  69948. "project": c.project,
  69949. "region": c.region,
  69950. })
  69951. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69952. }
  69953. // Do executes the "compute.regionCommitments.insert" call.
  69954. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69955. // status code is an error. Response headers are in either
  69956. // *Operation.ServerResponse.Header or (if a response was returned at
  69957. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69958. // to check whether the returned error was because
  69959. // http.StatusNotModified was returned.
  69960. func (c *RegionCommitmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69961. gensupport.SetOptions(c.urlParams_, opts...)
  69962. res, err := c.doRequest("json")
  69963. if res != nil && res.StatusCode == http.StatusNotModified {
  69964. if res.Body != nil {
  69965. res.Body.Close()
  69966. }
  69967. return nil, &googleapi.Error{
  69968. Code: res.StatusCode,
  69969. Header: res.Header,
  69970. }
  69971. }
  69972. if err != nil {
  69973. return nil, err
  69974. }
  69975. defer googleapi.CloseBody(res)
  69976. if err := googleapi.CheckResponse(res); err != nil {
  69977. return nil, err
  69978. }
  69979. ret := &Operation{
  69980. ServerResponse: googleapi.ServerResponse{
  69981. Header: res.Header,
  69982. HTTPStatusCode: res.StatusCode,
  69983. },
  69984. }
  69985. target := &ret
  69986. if err := gensupport.DecodeResponse(target, res); err != nil {
  69987. return nil, err
  69988. }
  69989. return ret, nil
  69990. // {
  69991. // "description": "Creates a commitment in the specified project using the data included in the request.",
  69992. // "httpMethod": "POST",
  69993. // "id": "compute.regionCommitments.insert",
  69994. // "parameterOrder": [
  69995. // "project",
  69996. // "region"
  69997. // ],
  69998. // "parameters": {
  69999. // "project": {
  70000. // "description": "Project ID for this request.",
  70001. // "location": "path",
  70002. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70003. // "required": true,
  70004. // "type": "string"
  70005. // },
  70006. // "region": {
  70007. // "description": "Name of the region for this request.",
  70008. // "location": "path",
  70009. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70010. // "required": true,
  70011. // "type": "string"
  70012. // },
  70013. // "requestId": {
  70014. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70015. // "location": "query",
  70016. // "type": "string"
  70017. // }
  70018. // },
  70019. // "path": "{project}/regions/{region}/commitments",
  70020. // "request": {
  70021. // "$ref": "Commitment"
  70022. // },
  70023. // "response": {
  70024. // "$ref": "Operation"
  70025. // },
  70026. // "scopes": [
  70027. // "https://www.googleapis.com/auth/cloud-platform",
  70028. // "https://www.googleapis.com/auth/compute"
  70029. // ]
  70030. // }
  70031. }
  70032. // method id "compute.regionCommitments.list":
  70033. type RegionCommitmentsListCall struct {
  70034. s *Service
  70035. project string
  70036. region string
  70037. urlParams_ gensupport.URLParams
  70038. ifNoneMatch_ string
  70039. ctx_ context.Context
  70040. header_ http.Header
  70041. }
  70042. // List: Retrieves a list of commitments contained within the specified
  70043. // region.
  70044. func (r *RegionCommitmentsService) List(project string, region string) *RegionCommitmentsListCall {
  70045. c := &RegionCommitmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70046. c.project = project
  70047. c.region = region
  70048. return c
  70049. }
  70050. // Filter sets the optional parameter "filter": A filter expression that
  70051. // filters resources listed in the response. The expression must specify
  70052. // the field name, a comparison operator, and the value that you want to
  70053. // use for filtering. The value must be a string, a number, or a
  70054. // boolean. The comparison operator must be either =, !=, >, or <.
  70055. //
  70056. // For example, if you are filtering Compute Engine instances, you can
  70057. // exclude instances named example-instance by specifying name !=
  70058. // example-instance.
  70059. //
  70060. // You can also filter nested fields. For example, you could specify
  70061. // scheduling.automaticRestart = false to include instances only if they
  70062. // are not scheduled for automatic restarts. You can use filtering on
  70063. // nested fields to filter based on resource labels.
  70064. //
  70065. // To filter on multiple expressions, provide each separate expression
  70066. // within parentheses. For example, (scheduling.automaticRestart = true)
  70067. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  70068. // AND expression. However, you can include AND and OR expressions
  70069. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  70070. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  70071. // true).
  70072. func (c *RegionCommitmentsListCall) Filter(filter string) *RegionCommitmentsListCall {
  70073. c.urlParams_.Set("filter", filter)
  70074. return c
  70075. }
  70076. // MaxResults sets the optional parameter "maxResults": The maximum
  70077. // number of results per page that should be returned. If the number of
  70078. // available results is larger than maxResults, Compute Engine returns a
  70079. // nextPageToken that can be used to get the next page of results in
  70080. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  70081. // (Default: 500)
  70082. func (c *RegionCommitmentsListCall) MaxResults(maxResults int64) *RegionCommitmentsListCall {
  70083. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  70084. return c
  70085. }
  70086. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  70087. // a certain order. By default, results are returned in alphanumerical
  70088. // order based on the resource name.
  70089. //
  70090. // You can also sort results in descending order based on the creation
  70091. // timestamp using orderBy="creationTimestamp desc". This sorts results
  70092. // based on the creationTimestamp field in reverse chronological order
  70093. // (newest result first). Use this to sort resources like operations so
  70094. // that the newest operation is returned first.
  70095. //
  70096. // Currently, only sorting by name or creationTimestamp desc is
  70097. // supported.
  70098. func (c *RegionCommitmentsListCall) OrderBy(orderBy string) *RegionCommitmentsListCall {
  70099. c.urlParams_.Set("orderBy", orderBy)
  70100. return c
  70101. }
  70102. // PageToken sets the optional parameter "pageToken": Specifies a page
  70103. // token to use. Set pageToken to the nextPageToken returned by a
  70104. // previous list request to get the next page of results.
  70105. func (c *RegionCommitmentsListCall) PageToken(pageToken string) *RegionCommitmentsListCall {
  70106. c.urlParams_.Set("pageToken", pageToken)
  70107. return c
  70108. }
  70109. // Fields allows partial responses to be retrieved. See
  70110. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70111. // for more information.
  70112. func (c *RegionCommitmentsListCall) Fields(s ...googleapi.Field) *RegionCommitmentsListCall {
  70113. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70114. return c
  70115. }
  70116. // IfNoneMatch sets the optional parameter which makes the operation
  70117. // fail if the object's ETag matches the given value. This is useful for
  70118. // getting updates only after the object has changed since the last
  70119. // request. Use googleapi.IsNotModified to check whether the response
  70120. // error from Do is the result of In-None-Match.
  70121. func (c *RegionCommitmentsListCall) IfNoneMatch(entityTag string) *RegionCommitmentsListCall {
  70122. c.ifNoneMatch_ = entityTag
  70123. return c
  70124. }
  70125. // Context sets the context to be used in this call's Do method. Any
  70126. // pending HTTP request will be aborted if the provided context is
  70127. // canceled.
  70128. func (c *RegionCommitmentsListCall) Context(ctx context.Context) *RegionCommitmentsListCall {
  70129. c.ctx_ = ctx
  70130. return c
  70131. }
  70132. // Header returns an http.Header that can be modified by the caller to
  70133. // add HTTP headers to the request.
  70134. func (c *RegionCommitmentsListCall) Header() http.Header {
  70135. if c.header_ == nil {
  70136. c.header_ = make(http.Header)
  70137. }
  70138. return c.header_
  70139. }
  70140. func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error) {
  70141. reqHeaders := make(http.Header)
  70142. for k, v := range c.header_ {
  70143. reqHeaders[k] = v
  70144. }
  70145. reqHeaders.Set("User-Agent", c.s.userAgent())
  70146. if c.ifNoneMatch_ != "" {
  70147. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70148. }
  70149. var body io.Reader = nil
  70150. c.urlParams_.Set("alt", alt)
  70151. c.urlParams_.Set("prettyPrint", "false")
  70152. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  70153. urls += "?" + c.urlParams_.Encode()
  70154. req, err := http.NewRequest("GET", urls, body)
  70155. if err != nil {
  70156. return nil, err
  70157. }
  70158. req.Header = reqHeaders
  70159. googleapi.Expand(req.URL, map[string]string{
  70160. "project": c.project,
  70161. "region": c.region,
  70162. })
  70163. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70164. }
  70165. // Do executes the "compute.regionCommitments.list" call.
  70166. // Exactly one of *CommitmentList or error will be non-nil. Any non-2xx
  70167. // status code is an error. Response headers are in either
  70168. // *CommitmentList.ServerResponse.Header or (if a response was returned
  70169. // at all) in error.(*googleapi.Error).Header. Use
  70170. // googleapi.IsNotModified to check whether the returned error was
  70171. // because http.StatusNotModified was returned.
  70172. func (c *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*CommitmentList, error) {
  70173. gensupport.SetOptions(c.urlParams_, opts...)
  70174. res, err := c.doRequest("json")
  70175. if res != nil && res.StatusCode == http.StatusNotModified {
  70176. if res.Body != nil {
  70177. res.Body.Close()
  70178. }
  70179. return nil, &googleapi.Error{
  70180. Code: res.StatusCode,
  70181. Header: res.Header,
  70182. }
  70183. }
  70184. if err != nil {
  70185. return nil, err
  70186. }
  70187. defer googleapi.CloseBody(res)
  70188. if err := googleapi.CheckResponse(res); err != nil {
  70189. return nil, err
  70190. }
  70191. ret := &CommitmentList{
  70192. ServerResponse: googleapi.ServerResponse{
  70193. Header: res.Header,
  70194. HTTPStatusCode: res.StatusCode,
  70195. },
  70196. }
  70197. target := &ret
  70198. if err := gensupport.DecodeResponse(target, res); err != nil {
  70199. return nil, err
  70200. }
  70201. return ret, nil
  70202. // {
  70203. // "description": "Retrieves a list of commitments contained within the specified region.",
  70204. // "httpMethod": "GET",
  70205. // "id": "compute.regionCommitments.list",
  70206. // "parameterOrder": [
  70207. // "project",
  70208. // "region"
  70209. // ],
  70210. // "parameters": {
  70211. // "filter": {
  70212. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  70213. // "location": "query",
  70214. // "type": "string"
  70215. // },
  70216. // "maxResults": {
  70217. // "default": "500",
  70218. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  70219. // "format": "uint32",
  70220. // "location": "query",
  70221. // "minimum": "0",
  70222. // "type": "integer"
  70223. // },
  70224. // "orderBy": {
  70225. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  70226. // "location": "query",
  70227. // "type": "string"
  70228. // },
  70229. // "pageToken": {
  70230. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  70231. // "location": "query",
  70232. // "type": "string"
  70233. // },
  70234. // "project": {
  70235. // "description": "Project ID for this request.",
  70236. // "location": "path",
  70237. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70238. // "required": true,
  70239. // "type": "string"
  70240. // },
  70241. // "region": {
  70242. // "description": "Name of the region for this request.",
  70243. // "location": "path",
  70244. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70245. // "required": true,
  70246. // "type": "string"
  70247. // }
  70248. // },
  70249. // "path": "{project}/regions/{region}/commitments",
  70250. // "response": {
  70251. // "$ref": "CommitmentList"
  70252. // },
  70253. // "scopes": [
  70254. // "https://www.googleapis.com/auth/cloud-platform",
  70255. // "https://www.googleapis.com/auth/compute",
  70256. // "https://www.googleapis.com/auth/compute.readonly"
  70257. // ]
  70258. // }
  70259. }
  70260. // Pages invokes f for each page of results.
  70261. // A non-nil error returned from f will halt the iteration.
  70262. // The provided context supersedes any context provided to the Context method.
  70263. func (c *RegionCommitmentsListCall) Pages(ctx context.Context, f func(*CommitmentList) error) error {
  70264. c.ctx_ = ctx
  70265. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  70266. for {
  70267. x, err := c.Do()
  70268. if err != nil {
  70269. return err
  70270. }
  70271. if err := f(x); err != nil {
  70272. return err
  70273. }
  70274. if x.NextPageToken == "" {
  70275. return nil
  70276. }
  70277. c.PageToken(x.NextPageToken)
  70278. }
  70279. }
  70280. // method id "compute.regionDiskTypes.get":
  70281. type RegionDiskTypesGetCall struct {
  70282. s *Service
  70283. project string
  70284. region string
  70285. diskType string
  70286. urlParams_ gensupport.URLParams
  70287. ifNoneMatch_ string
  70288. ctx_ context.Context
  70289. header_ http.Header
  70290. }
  70291. // Get: Returns the specified regional disk type. Gets a list of
  70292. // available disk types by making a list() request.
  70293. func (r *RegionDiskTypesService) Get(project string, region string, diskType string) *RegionDiskTypesGetCall {
  70294. c := &RegionDiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70295. c.project = project
  70296. c.region = region
  70297. c.diskType = diskType
  70298. return c
  70299. }
  70300. // Fields allows partial responses to be retrieved. See
  70301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70302. // for more information.
  70303. func (c *RegionDiskTypesGetCall) Fields(s ...googleapi.Field) *RegionDiskTypesGetCall {
  70304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70305. return c
  70306. }
  70307. // IfNoneMatch sets the optional parameter which makes the operation
  70308. // fail if the object's ETag matches the given value. This is useful for
  70309. // getting updates only after the object has changed since the last
  70310. // request. Use googleapi.IsNotModified to check whether the response
  70311. // error from Do is the result of In-None-Match.
  70312. func (c *RegionDiskTypesGetCall) IfNoneMatch(entityTag string) *RegionDiskTypesGetCall {
  70313. c.ifNoneMatch_ = entityTag
  70314. return c
  70315. }
  70316. // Context sets the context to be used in this call's Do method. Any
  70317. // pending HTTP request will be aborted if the provided context is
  70318. // canceled.
  70319. func (c *RegionDiskTypesGetCall) Context(ctx context.Context) *RegionDiskTypesGetCall {
  70320. c.ctx_ = ctx
  70321. return c
  70322. }
  70323. // Header returns an http.Header that can be modified by the caller to
  70324. // add HTTP headers to the request.
  70325. func (c *RegionDiskTypesGetCall) Header() http.Header {
  70326. if c.header_ == nil {
  70327. c.header_ = make(http.Header)
  70328. }
  70329. return c.header_
  70330. }
  70331. func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  70332. reqHeaders := make(http.Header)
  70333. for k, v := range c.header_ {
  70334. reqHeaders[k] = v
  70335. }
  70336. reqHeaders.Set("User-Agent", c.s.userAgent())
  70337. if c.ifNoneMatch_ != "" {
  70338. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70339. }
  70340. var body io.Reader = nil
  70341. c.urlParams_.Set("alt", alt)
  70342. c.urlParams_.Set("prettyPrint", "false")
  70343. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes/{diskType}")
  70344. urls += "?" + c.urlParams_.Encode()
  70345. req, err := http.NewRequest("GET", urls, body)
  70346. if err != nil {
  70347. return nil, err
  70348. }
  70349. req.Header = reqHeaders
  70350. googleapi.Expand(req.URL, map[string]string{
  70351. "project": c.project,
  70352. "region": c.region,
  70353. "diskType": c.diskType,
  70354. })
  70355. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70356. }
  70357. // Do executes the "compute.regionDiskTypes.get" call.
  70358. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  70359. // code is an error. Response headers are in either
  70360. // *DiskType.ServerResponse.Header or (if a response was returned at
  70361. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70362. // to check whether the returned error was because
  70363. // http.StatusNotModified was returned.
  70364. func (c *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  70365. gensupport.SetOptions(c.urlParams_, opts...)
  70366. res, err := c.doRequest("json")
  70367. if res != nil && res.StatusCode == http.StatusNotModified {
  70368. if res.Body != nil {
  70369. res.Body.Close()
  70370. }
  70371. return nil, &googleapi.Error{
  70372. Code: res.StatusCode,
  70373. Header: res.Header,
  70374. }
  70375. }
  70376. if err != nil {
  70377. return nil, err
  70378. }
  70379. defer googleapi.CloseBody(res)
  70380. if err := googleapi.CheckResponse(res); err != nil {
  70381. return nil, err
  70382. }
  70383. ret := &DiskType{
  70384. ServerResponse: googleapi.ServerResponse{
  70385. Header: res.Header,
  70386. HTTPStatusCode: res.StatusCode,
  70387. },
  70388. }
  70389. target := &ret
  70390. if err := gensupport.DecodeResponse(target, res); err != nil {
  70391. return nil, err
  70392. }
  70393. return ret, nil
  70394. // {
  70395. // "description": "Returns the specified regional disk type. Gets a list of available disk types by making a list() request.",
  70396. // "httpMethod": "GET",
  70397. // "id": "compute.regionDiskTypes.get",
  70398. // "parameterOrder": [
  70399. // "project",
  70400. // "region",
  70401. // "diskType"
  70402. // ],
  70403. // "parameters": {
  70404. // "diskType": {
  70405. // "description": "Name of the disk type to return.",
  70406. // "location": "path",
  70407. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70408. // "required": true,
  70409. // "type": "string"
  70410. // },
  70411. // "project": {
  70412. // "description": "Project ID for this request.",
  70413. // "location": "path",
  70414. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70415. // "required": true,
  70416. // "type": "string"
  70417. // },
  70418. // "region": {
  70419. // "description": "The name of the region for this request.",
  70420. // "location": "path",
  70421. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70422. // "required": true,
  70423. // "type": "string"
  70424. // }
  70425. // },
  70426. // "path": "{project}/regions/{region}/diskTypes/{diskType}",
  70427. // "response": {
  70428. // "$ref": "DiskType"
  70429. // },
  70430. // "scopes": [
  70431. // "https://www.googleapis.com/auth/cloud-platform",
  70432. // "https://www.googleapis.com/auth/compute",
  70433. // "https://www.googleapis.com/auth/compute.readonly"
  70434. // ]
  70435. // }
  70436. }
  70437. // method id "compute.regionDiskTypes.list":
  70438. type RegionDiskTypesListCall struct {
  70439. s *Service
  70440. project string
  70441. region string
  70442. urlParams_ gensupport.URLParams
  70443. ifNoneMatch_ string
  70444. ctx_ context.Context
  70445. header_ http.Header
  70446. }
  70447. // List: Retrieves a list of regional disk types available to the
  70448. // specified project.
  70449. func (r *RegionDiskTypesService) List(project string, region string) *RegionDiskTypesListCall {
  70450. c := &RegionDiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70451. c.project = project
  70452. c.region = region
  70453. return c
  70454. }
  70455. // Filter sets the optional parameter "filter": A filter expression that
  70456. // filters resources listed in the response. The expression must specify
  70457. // the field name, a comparison operator, and the value that you want to
  70458. // use for filtering. The value must be a string, a number, or a
  70459. // boolean. The comparison operator must be either =, !=, >, or <.
  70460. //
  70461. // For example, if you are filtering Compute Engine instances, you can
  70462. // exclude instances named example-instance by specifying name !=
  70463. // example-instance.
  70464. //
  70465. // You can also filter nested fields. For example, you could specify
  70466. // scheduling.automaticRestart = false to include instances only if they
  70467. // are not scheduled for automatic restarts. You can use filtering on
  70468. // nested fields to filter based on resource labels.
  70469. //
  70470. // To filter on multiple expressions, provide each separate expression
  70471. // within parentheses. For example, (scheduling.automaticRestart = true)
  70472. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  70473. // AND expression. However, you can include AND and OR expressions
  70474. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  70475. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  70476. // true).
  70477. func (c *RegionDiskTypesListCall) Filter(filter string) *RegionDiskTypesListCall {
  70478. c.urlParams_.Set("filter", filter)
  70479. return c
  70480. }
  70481. // MaxResults sets the optional parameter "maxResults": The maximum
  70482. // number of results per page that should be returned. If the number of
  70483. // available results is larger than maxResults, Compute Engine returns a
  70484. // nextPageToken that can be used to get the next page of results in
  70485. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  70486. // (Default: 500)
  70487. func (c *RegionDiskTypesListCall) MaxResults(maxResults int64) *RegionDiskTypesListCall {
  70488. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  70489. return c
  70490. }
  70491. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  70492. // a certain order. By default, results are returned in alphanumerical
  70493. // order based on the resource name.
  70494. //
  70495. // You can also sort results in descending order based on the creation
  70496. // timestamp using orderBy="creationTimestamp desc". This sorts results
  70497. // based on the creationTimestamp field in reverse chronological order
  70498. // (newest result first). Use this to sort resources like operations so
  70499. // that the newest operation is returned first.
  70500. //
  70501. // Currently, only sorting by name or creationTimestamp desc is
  70502. // supported.
  70503. func (c *RegionDiskTypesListCall) OrderBy(orderBy string) *RegionDiskTypesListCall {
  70504. c.urlParams_.Set("orderBy", orderBy)
  70505. return c
  70506. }
  70507. // PageToken sets the optional parameter "pageToken": Specifies a page
  70508. // token to use. Set pageToken to the nextPageToken returned by a
  70509. // previous list request to get the next page of results.
  70510. func (c *RegionDiskTypesListCall) PageToken(pageToken string) *RegionDiskTypesListCall {
  70511. c.urlParams_.Set("pageToken", pageToken)
  70512. return c
  70513. }
  70514. // Fields allows partial responses to be retrieved. See
  70515. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70516. // for more information.
  70517. func (c *RegionDiskTypesListCall) Fields(s ...googleapi.Field) *RegionDiskTypesListCall {
  70518. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70519. return c
  70520. }
  70521. // IfNoneMatch sets the optional parameter which makes the operation
  70522. // fail if the object's ETag matches the given value. This is useful for
  70523. // getting updates only after the object has changed since the last
  70524. // request. Use googleapi.IsNotModified to check whether the response
  70525. // error from Do is the result of In-None-Match.
  70526. func (c *RegionDiskTypesListCall) IfNoneMatch(entityTag string) *RegionDiskTypesListCall {
  70527. c.ifNoneMatch_ = entityTag
  70528. return c
  70529. }
  70530. // Context sets the context to be used in this call's Do method. Any
  70531. // pending HTTP request will be aborted if the provided context is
  70532. // canceled.
  70533. func (c *RegionDiskTypesListCall) Context(ctx context.Context) *RegionDiskTypesListCall {
  70534. c.ctx_ = ctx
  70535. return c
  70536. }
  70537. // Header returns an http.Header that can be modified by the caller to
  70538. // add HTTP headers to the request.
  70539. func (c *RegionDiskTypesListCall) Header() http.Header {
  70540. if c.header_ == nil {
  70541. c.header_ = make(http.Header)
  70542. }
  70543. return c.header_
  70544. }
  70545. func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  70546. reqHeaders := make(http.Header)
  70547. for k, v := range c.header_ {
  70548. reqHeaders[k] = v
  70549. }
  70550. reqHeaders.Set("User-Agent", c.s.userAgent())
  70551. if c.ifNoneMatch_ != "" {
  70552. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70553. }
  70554. var body io.Reader = nil
  70555. c.urlParams_.Set("alt", alt)
  70556. c.urlParams_.Set("prettyPrint", "false")
  70557. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes")
  70558. urls += "?" + c.urlParams_.Encode()
  70559. req, err := http.NewRequest("GET", urls, body)
  70560. if err != nil {
  70561. return nil, err
  70562. }
  70563. req.Header = reqHeaders
  70564. googleapi.Expand(req.URL, map[string]string{
  70565. "project": c.project,
  70566. "region": c.region,
  70567. })
  70568. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70569. }
  70570. // Do executes the "compute.regionDiskTypes.list" call.
  70571. // Exactly one of *RegionDiskTypeList or error will be non-nil. Any
  70572. // non-2xx status code is an error. Response headers are in either
  70573. // *RegionDiskTypeList.ServerResponse.Header or (if a response was
  70574. // returned at all) in error.(*googleapi.Error).Header. Use
  70575. // googleapi.IsNotModified to check whether the returned error was
  70576. // because http.StatusNotModified was returned.
  70577. func (c *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskTypeList, error) {
  70578. gensupport.SetOptions(c.urlParams_, opts...)
  70579. res, err := c.doRequest("json")
  70580. if res != nil && res.StatusCode == http.StatusNotModified {
  70581. if res.Body != nil {
  70582. res.Body.Close()
  70583. }
  70584. return nil, &googleapi.Error{
  70585. Code: res.StatusCode,
  70586. Header: res.Header,
  70587. }
  70588. }
  70589. if err != nil {
  70590. return nil, err
  70591. }
  70592. defer googleapi.CloseBody(res)
  70593. if err := googleapi.CheckResponse(res); err != nil {
  70594. return nil, err
  70595. }
  70596. ret := &RegionDiskTypeList{
  70597. ServerResponse: googleapi.ServerResponse{
  70598. Header: res.Header,
  70599. HTTPStatusCode: res.StatusCode,
  70600. },
  70601. }
  70602. target := &ret
  70603. if err := gensupport.DecodeResponse(target, res); err != nil {
  70604. return nil, err
  70605. }
  70606. return ret, nil
  70607. // {
  70608. // "description": "Retrieves a list of regional disk types available to the specified project.",
  70609. // "httpMethod": "GET",
  70610. // "id": "compute.regionDiskTypes.list",
  70611. // "parameterOrder": [
  70612. // "project",
  70613. // "region"
  70614. // ],
  70615. // "parameters": {
  70616. // "filter": {
  70617. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  70618. // "location": "query",
  70619. // "type": "string"
  70620. // },
  70621. // "maxResults": {
  70622. // "default": "500",
  70623. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  70624. // "format": "uint32",
  70625. // "location": "query",
  70626. // "minimum": "0",
  70627. // "type": "integer"
  70628. // },
  70629. // "orderBy": {
  70630. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  70631. // "location": "query",
  70632. // "type": "string"
  70633. // },
  70634. // "pageToken": {
  70635. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  70636. // "location": "query",
  70637. // "type": "string"
  70638. // },
  70639. // "project": {
  70640. // "description": "Project ID for this request.",
  70641. // "location": "path",
  70642. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70643. // "required": true,
  70644. // "type": "string"
  70645. // },
  70646. // "region": {
  70647. // "description": "The name of the region for this request.",
  70648. // "location": "path",
  70649. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70650. // "required": true,
  70651. // "type": "string"
  70652. // }
  70653. // },
  70654. // "path": "{project}/regions/{region}/diskTypes",
  70655. // "response": {
  70656. // "$ref": "RegionDiskTypeList"
  70657. // },
  70658. // "scopes": [
  70659. // "https://www.googleapis.com/auth/cloud-platform",
  70660. // "https://www.googleapis.com/auth/compute",
  70661. // "https://www.googleapis.com/auth/compute.readonly"
  70662. // ]
  70663. // }
  70664. }
  70665. // Pages invokes f for each page of results.
  70666. // A non-nil error returned from f will halt the iteration.
  70667. // The provided context supersedes any context provided to the Context method.
  70668. func (c *RegionDiskTypesListCall) Pages(ctx context.Context, f func(*RegionDiskTypeList) error) error {
  70669. c.ctx_ = ctx
  70670. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  70671. for {
  70672. x, err := c.Do()
  70673. if err != nil {
  70674. return err
  70675. }
  70676. if err := f(x); err != nil {
  70677. return err
  70678. }
  70679. if x.NextPageToken == "" {
  70680. return nil
  70681. }
  70682. c.PageToken(x.NextPageToken)
  70683. }
  70684. }
  70685. // method id "compute.regionDisks.createSnapshot":
  70686. type RegionDisksCreateSnapshotCall struct {
  70687. s *Service
  70688. project string
  70689. region string
  70690. disk string
  70691. snapshot *Snapshot
  70692. urlParams_ gensupport.URLParams
  70693. ctx_ context.Context
  70694. header_ http.Header
  70695. }
  70696. // CreateSnapshot: Creates a snapshot of this regional disk.
  70697. func (r *RegionDisksService) CreateSnapshot(project string, region string, disk string, snapshot *Snapshot) *RegionDisksCreateSnapshotCall {
  70698. c := &RegionDisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70699. c.project = project
  70700. c.region = region
  70701. c.disk = disk
  70702. c.snapshot = snapshot
  70703. return c
  70704. }
  70705. // RequestId sets the optional parameter "requestId": An optional
  70706. // request ID to identify requests. Specify a unique request ID so that
  70707. // if you must retry your request, the server will know to ignore the
  70708. // request if it has already been completed.
  70709. //
  70710. // For example, consider a situation where you make an initial request
  70711. // and the request times out. If you make the request again with the
  70712. // same request ID, the server can check if original operation with the
  70713. // same request ID was received, and if so, will ignore the second
  70714. // request. This prevents clients from accidentally creating duplicate
  70715. // commitments.
  70716. //
  70717. // The request ID must be a valid UUID with the exception that zero UUID
  70718. // is not supported (00000000-0000-0000-0000-000000000000).
  70719. func (c *RegionDisksCreateSnapshotCall) RequestId(requestId string) *RegionDisksCreateSnapshotCall {
  70720. c.urlParams_.Set("requestId", requestId)
  70721. return c
  70722. }
  70723. // Fields allows partial responses to be retrieved. See
  70724. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70725. // for more information.
  70726. func (c *RegionDisksCreateSnapshotCall) Fields(s ...googleapi.Field) *RegionDisksCreateSnapshotCall {
  70727. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70728. return c
  70729. }
  70730. // Context sets the context to be used in this call's Do method. Any
  70731. // pending HTTP request will be aborted if the provided context is
  70732. // canceled.
  70733. func (c *RegionDisksCreateSnapshotCall) Context(ctx context.Context) *RegionDisksCreateSnapshotCall {
  70734. c.ctx_ = ctx
  70735. return c
  70736. }
  70737. // Header returns an http.Header that can be modified by the caller to
  70738. // add HTTP headers to the request.
  70739. func (c *RegionDisksCreateSnapshotCall) Header() http.Header {
  70740. if c.header_ == nil {
  70741. c.header_ = make(http.Header)
  70742. }
  70743. return c.header_
  70744. }
  70745. func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  70746. reqHeaders := make(http.Header)
  70747. for k, v := range c.header_ {
  70748. reqHeaders[k] = v
  70749. }
  70750. reqHeaders.Set("User-Agent", c.s.userAgent())
  70751. var body io.Reader = nil
  70752. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  70753. if err != nil {
  70754. return nil, err
  70755. }
  70756. reqHeaders.Set("Content-Type", "application/json")
  70757. c.urlParams_.Set("alt", alt)
  70758. c.urlParams_.Set("prettyPrint", "false")
  70759. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/createSnapshot")
  70760. urls += "?" + c.urlParams_.Encode()
  70761. req, err := http.NewRequest("POST", urls, body)
  70762. if err != nil {
  70763. return nil, err
  70764. }
  70765. req.Header = reqHeaders
  70766. googleapi.Expand(req.URL, map[string]string{
  70767. "project": c.project,
  70768. "region": c.region,
  70769. "disk": c.disk,
  70770. })
  70771. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70772. }
  70773. // Do executes the "compute.regionDisks.createSnapshot" call.
  70774. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70775. // status code is an error. Response headers are in either
  70776. // *Operation.ServerResponse.Header or (if a response was returned at
  70777. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70778. // to check whether the returned error was because
  70779. // http.StatusNotModified was returned.
  70780. func (c *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70781. gensupport.SetOptions(c.urlParams_, opts...)
  70782. res, err := c.doRequest("json")
  70783. if res != nil && res.StatusCode == http.StatusNotModified {
  70784. if res.Body != nil {
  70785. res.Body.Close()
  70786. }
  70787. return nil, &googleapi.Error{
  70788. Code: res.StatusCode,
  70789. Header: res.Header,
  70790. }
  70791. }
  70792. if err != nil {
  70793. return nil, err
  70794. }
  70795. defer googleapi.CloseBody(res)
  70796. if err := googleapi.CheckResponse(res); err != nil {
  70797. return nil, err
  70798. }
  70799. ret := &Operation{
  70800. ServerResponse: googleapi.ServerResponse{
  70801. Header: res.Header,
  70802. HTTPStatusCode: res.StatusCode,
  70803. },
  70804. }
  70805. target := &ret
  70806. if err := gensupport.DecodeResponse(target, res); err != nil {
  70807. return nil, err
  70808. }
  70809. return ret, nil
  70810. // {
  70811. // "description": "Creates a snapshot of this regional disk.",
  70812. // "httpMethod": "POST",
  70813. // "id": "compute.regionDisks.createSnapshot",
  70814. // "parameterOrder": [
  70815. // "project",
  70816. // "region",
  70817. // "disk"
  70818. // ],
  70819. // "parameters": {
  70820. // "disk": {
  70821. // "description": "Name of the regional persistent disk to snapshot.",
  70822. // "location": "path",
  70823. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70824. // "required": true,
  70825. // "type": "string"
  70826. // },
  70827. // "project": {
  70828. // "description": "Project ID for this request.",
  70829. // "location": "path",
  70830. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70831. // "required": true,
  70832. // "type": "string"
  70833. // },
  70834. // "region": {
  70835. // "description": "Name of the region for this request.",
  70836. // "location": "path",
  70837. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70838. // "required": true,
  70839. // "type": "string"
  70840. // },
  70841. // "requestId": {
  70842. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70843. // "location": "query",
  70844. // "type": "string"
  70845. // }
  70846. // },
  70847. // "path": "{project}/regions/{region}/disks/{disk}/createSnapshot",
  70848. // "request": {
  70849. // "$ref": "Snapshot"
  70850. // },
  70851. // "response": {
  70852. // "$ref": "Operation"
  70853. // },
  70854. // "scopes": [
  70855. // "https://www.googleapis.com/auth/cloud-platform",
  70856. // "https://www.googleapis.com/auth/compute"
  70857. // ]
  70858. // }
  70859. }
  70860. // method id "compute.regionDisks.delete":
  70861. type RegionDisksDeleteCall struct {
  70862. s *Service
  70863. project string
  70864. region string
  70865. disk string
  70866. urlParams_ gensupport.URLParams
  70867. ctx_ context.Context
  70868. header_ http.Header
  70869. }
  70870. // Delete: Deletes the specified regional persistent disk. Deleting a
  70871. // regional disk removes all the replicas of its data permanently and is
  70872. // irreversible. However, deleting a disk does not delete any snapshots
  70873. // previously made from the disk. You must separately delete snapshots.
  70874. func (r *RegionDisksService) Delete(project string, region string, disk string) *RegionDisksDeleteCall {
  70875. c := &RegionDisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70876. c.project = project
  70877. c.region = region
  70878. c.disk = disk
  70879. return c
  70880. }
  70881. // RequestId sets the optional parameter "requestId": An optional
  70882. // request ID to identify requests. Specify a unique request ID so that
  70883. // if you must retry your request, the server will know to ignore the
  70884. // request if it has already been completed.
  70885. //
  70886. // For example, consider a situation where you make an initial request
  70887. // and the request times out. If you make the request again with the
  70888. // same request ID, the server can check if original operation with the
  70889. // same request ID was received, and if so, will ignore the second
  70890. // request. This prevents clients from accidentally creating duplicate
  70891. // commitments.
  70892. //
  70893. // The request ID must be a valid UUID with the exception that zero UUID
  70894. // is not supported (00000000-0000-0000-0000-000000000000).
  70895. func (c *RegionDisksDeleteCall) RequestId(requestId string) *RegionDisksDeleteCall {
  70896. c.urlParams_.Set("requestId", requestId)
  70897. return c
  70898. }
  70899. // Fields allows partial responses to be retrieved. See
  70900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70901. // for more information.
  70902. func (c *RegionDisksDeleteCall) Fields(s ...googleapi.Field) *RegionDisksDeleteCall {
  70903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70904. return c
  70905. }
  70906. // Context sets the context to be used in this call's Do method. Any
  70907. // pending HTTP request will be aborted if the provided context is
  70908. // canceled.
  70909. func (c *RegionDisksDeleteCall) Context(ctx context.Context) *RegionDisksDeleteCall {
  70910. c.ctx_ = ctx
  70911. return c
  70912. }
  70913. // Header returns an http.Header that can be modified by the caller to
  70914. // add HTTP headers to the request.
  70915. func (c *RegionDisksDeleteCall) Header() http.Header {
  70916. if c.header_ == nil {
  70917. c.header_ = make(http.Header)
  70918. }
  70919. return c.header_
  70920. }
  70921. func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  70922. reqHeaders := make(http.Header)
  70923. for k, v := range c.header_ {
  70924. reqHeaders[k] = v
  70925. }
  70926. reqHeaders.Set("User-Agent", c.s.userAgent())
  70927. var body io.Reader = nil
  70928. c.urlParams_.Set("alt", alt)
  70929. c.urlParams_.Set("prettyPrint", "false")
  70930. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  70931. urls += "?" + c.urlParams_.Encode()
  70932. req, err := http.NewRequest("DELETE", urls, body)
  70933. if err != nil {
  70934. return nil, err
  70935. }
  70936. req.Header = reqHeaders
  70937. googleapi.Expand(req.URL, map[string]string{
  70938. "project": c.project,
  70939. "region": c.region,
  70940. "disk": c.disk,
  70941. })
  70942. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70943. }
  70944. // Do executes the "compute.regionDisks.delete" call.
  70945. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70946. // status code is an error. Response headers are in either
  70947. // *Operation.ServerResponse.Header or (if a response was returned at
  70948. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70949. // to check whether the returned error was because
  70950. // http.StatusNotModified was returned.
  70951. func (c *RegionDisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70952. gensupport.SetOptions(c.urlParams_, opts...)
  70953. res, err := c.doRequest("json")
  70954. if res != nil && res.StatusCode == http.StatusNotModified {
  70955. if res.Body != nil {
  70956. res.Body.Close()
  70957. }
  70958. return nil, &googleapi.Error{
  70959. Code: res.StatusCode,
  70960. Header: res.Header,
  70961. }
  70962. }
  70963. if err != nil {
  70964. return nil, err
  70965. }
  70966. defer googleapi.CloseBody(res)
  70967. if err := googleapi.CheckResponse(res); err != nil {
  70968. return nil, err
  70969. }
  70970. ret := &Operation{
  70971. ServerResponse: googleapi.ServerResponse{
  70972. Header: res.Header,
  70973. HTTPStatusCode: res.StatusCode,
  70974. },
  70975. }
  70976. target := &ret
  70977. if err := gensupport.DecodeResponse(target, res); err != nil {
  70978. return nil, err
  70979. }
  70980. return ret, nil
  70981. // {
  70982. // "description": "Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.",
  70983. // "httpMethod": "DELETE",
  70984. // "id": "compute.regionDisks.delete",
  70985. // "parameterOrder": [
  70986. // "project",
  70987. // "region",
  70988. // "disk"
  70989. // ],
  70990. // "parameters": {
  70991. // "disk": {
  70992. // "description": "Name of the regional persistent disk to delete.",
  70993. // "location": "path",
  70994. // "required": true,
  70995. // "type": "string"
  70996. // },
  70997. // "project": {
  70998. // "description": "Project ID for this request.",
  70999. // "location": "path",
  71000. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71001. // "required": true,
  71002. // "type": "string"
  71003. // },
  71004. // "region": {
  71005. // "description": "Name of the region for this request.",
  71006. // "location": "path",
  71007. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71008. // "required": true,
  71009. // "type": "string"
  71010. // },
  71011. // "requestId": {
  71012. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71013. // "location": "query",
  71014. // "type": "string"
  71015. // }
  71016. // },
  71017. // "path": "{project}/regions/{region}/disks/{disk}",
  71018. // "response": {
  71019. // "$ref": "Operation"
  71020. // },
  71021. // "scopes": [
  71022. // "https://www.googleapis.com/auth/cloud-platform",
  71023. // "https://www.googleapis.com/auth/compute"
  71024. // ]
  71025. // }
  71026. }
  71027. // method id "compute.regionDisks.get":
  71028. type RegionDisksGetCall struct {
  71029. s *Service
  71030. project string
  71031. region string
  71032. disk string
  71033. urlParams_ gensupport.URLParams
  71034. ifNoneMatch_ string
  71035. ctx_ context.Context
  71036. header_ http.Header
  71037. }
  71038. // Get: Returns a specified regional persistent disk.
  71039. func (r *RegionDisksService) Get(project string, region string, disk string) *RegionDisksGetCall {
  71040. c := &RegionDisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71041. c.project = project
  71042. c.region = region
  71043. c.disk = disk
  71044. return c
  71045. }
  71046. // Fields allows partial responses to be retrieved. See
  71047. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71048. // for more information.
  71049. func (c *RegionDisksGetCall) Fields(s ...googleapi.Field) *RegionDisksGetCall {
  71050. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71051. return c
  71052. }
  71053. // IfNoneMatch sets the optional parameter which makes the operation
  71054. // fail if the object's ETag matches the given value. This is useful for
  71055. // getting updates only after the object has changed since the last
  71056. // request. Use googleapi.IsNotModified to check whether the response
  71057. // error from Do is the result of In-None-Match.
  71058. func (c *RegionDisksGetCall) IfNoneMatch(entityTag string) *RegionDisksGetCall {
  71059. c.ifNoneMatch_ = entityTag
  71060. return c
  71061. }
  71062. // Context sets the context to be used in this call's Do method. Any
  71063. // pending HTTP request will be aborted if the provided context is
  71064. // canceled.
  71065. func (c *RegionDisksGetCall) Context(ctx context.Context) *RegionDisksGetCall {
  71066. c.ctx_ = ctx
  71067. return c
  71068. }
  71069. // Header returns an http.Header that can be modified by the caller to
  71070. // add HTTP headers to the request.
  71071. func (c *RegionDisksGetCall) Header() http.Header {
  71072. if c.header_ == nil {
  71073. c.header_ = make(http.Header)
  71074. }
  71075. return c.header_
  71076. }
  71077. func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) {
  71078. reqHeaders := make(http.Header)
  71079. for k, v := range c.header_ {
  71080. reqHeaders[k] = v
  71081. }
  71082. reqHeaders.Set("User-Agent", c.s.userAgent())
  71083. if c.ifNoneMatch_ != "" {
  71084. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71085. }
  71086. var body io.Reader = nil
  71087. c.urlParams_.Set("alt", alt)
  71088. c.urlParams_.Set("prettyPrint", "false")
  71089. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  71090. urls += "?" + c.urlParams_.Encode()
  71091. req, err := http.NewRequest("GET", urls, body)
  71092. if err != nil {
  71093. return nil, err
  71094. }
  71095. req.Header = reqHeaders
  71096. googleapi.Expand(req.URL, map[string]string{
  71097. "project": c.project,
  71098. "region": c.region,
  71099. "disk": c.disk,
  71100. })
  71101. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71102. }
  71103. // Do executes the "compute.regionDisks.get" call.
  71104. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  71105. // code is an error. Response headers are in either
  71106. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  71107. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  71108. // whether the returned error was because http.StatusNotModified was
  71109. // returned.
  71110. func (c *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  71111. gensupport.SetOptions(c.urlParams_, opts...)
  71112. res, err := c.doRequest("json")
  71113. if res != nil && res.StatusCode == http.StatusNotModified {
  71114. if res.Body != nil {
  71115. res.Body.Close()
  71116. }
  71117. return nil, &googleapi.Error{
  71118. Code: res.StatusCode,
  71119. Header: res.Header,
  71120. }
  71121. }
  71122. if err != nil {
  71123. return nil, err
  71124. }
  71125. defer googleapi.CloseBody(res)
  71126. if err := googleapi.CheckResponse(res); err != nil {
  71127. return nil, err
  71128. }
  71129. ret := &Disk{
  71130. ServerResponse: googleapi.ServerResponse{
  71131. Header: res.Header,
  71132. HTTPStatusCode: res.StatusCode,
  71133. },
  71134. }
  71135. target := &ret
  71136. if err := gensupport.DecodeResponse(target, res); err != nil {
  71137. return nil, err
  71138. }
  71139. return ret, nil
  71140. // {
  71141. // "description": "Returns a specified regional persistent disk.",
  71142. // "httpMethod": "GET",
  71143. // "id": "compute.regionDisks.get",
  71144. // "parameterOrder": [
  71145. // "project",
  71146. // "region",
  71147. // "disk"
  71148. // ],
  71149. // "parameters": {
  71150. // "disk": {
  71151. // "description": "Name of the regional persistent disk to return.",
  71152. // "location": "path",
  71153. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71154. // "required": true,
  71155. // "type": "string"
  71156. // },
  71157. // "project": {
  71158. // "description": "Project ID for this request.",
  71159. // "location": "path",
  71160. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71161. // "required": true,
  71162. // "type": "string"
  71163. // },
  71164. // "region": {
  71165. // "description": "Name of the region for this request.",
  71166. // "location": "path",
  71167. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71168. // "required": true,
  71169. // "type": "string"
  71170. // }
  71171. // },
  71172. // "path": "{project}/regions/{region}/disks/{disk}",
  71173. // "response": {
  71174. // "$ref": "Disk"
  71175. // },
  71176. // "scopes": [
  71177. // "https://www.googleapis.com/auth/cloud-platform",
  71178. // "https://www.googleapis.com/auth/compute",
  71179. // "https://www.googleapis.com/auth/compute.readonly"
  71180. // ]
  71181. // }
  71182. }
  71183. // method id "compute.regionDisks.insert":
  71184. type RegionDisksInsertCall struct {
  71185. s *Service
  71186. project string
  71187. region string
  71188. disk *Disk
  71189. urlParams_ gensupport.URLParams
  71190. ctx_ context.Context
  71191. header_ http.Header
  71192. }
  71193. // Insert: Creates a persistent regional disk in the specified project
  71194. // using the data included in the request.
  71195. func (r *RegionDisksService) Insert(project string, region string, disk *Disk) *RegionDisksInsertCall {
  71196. c := &RegionDisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71197. c.project = project
  71198. c.region = region
  71199. c.disk = disk
  71200. return c
  71201. }
  71202. // RequestId sets the optional parameter "requestId": An optional
  71203. // request ID to identify requests. Specify a unique request ID so that
  71204. // if you must retry your request, the server will know to ignore the
  71205. // request if it has already been completed.
  71206. //
  71207. // For example, consider a situation where you make an initial request
  71208. // and the request times out. If you make the request again with the
  71209. // same request ID, the server can check if original operation with the
  71210. // same request ID was received, and if so, will ignore the second
  71211. // request. This prevents clients from accidentally creating duplicate
  71212. // commitments.
  71213. //
  71214. // The request ID must be a valid UUID with the exception that zero UUID
  71215. // is not supported (00000000-0000-0000-0000-000000000000).
  71216. func (c *RegionDisksInsertCall) RequestId(requestId string) *RegionDisksInsertCall {
  71217. c.urlParams_.Set("requestId", requestId)
  71218. return c
  71219. }
  71220. // SourceImage sets the optional parameter "sourceImage": Source image
  71221. // to restore onto a disk.
  71222. func (c *RegionDisksInsertCall) SourceImage(sourceImage string) *RegionDisksInsertCall {
  71223. c.urlParams_.Set("sourceImage", sourceImage)
  71224. return c
  71225. }
  71226. // Fields allows partial responses to be retrieved. See
  71227. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71228. // for more information.
  71229. func (c *RegionDisksInsertCall) Fields(s ...googleapi.Field) *RegionDisksInsertCall {
  71230. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71231. return c
  71232. }
  71233. // Context sets the context to be used in this call's Do method. Any
  71234. // pending HTTP request will be aborted if the provided context is
  71235. // canceled.
  71236. func (c *RegionDisksInsertCall) Context(ctx context.Context) *RegionDisksInsertCall {
  71237. c.ctx_ = ctx
  71238. return c
  71239. }
  71240. // Header returns an http.Header that can be modified by the caller to
  71241. // add HTTP headers to the request.
  71242. func (c *RegionDisksInsertCall) Header() http.Header {
  71243. if c.header_ == nil {
  71244. c.header_ = make(http.Header)
  71245. }
  71246. return c.header_
  71247. }
  71248. func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) {
  71249. reqHeaders := make(http.Header)
  71250. for k, v := range c.header_ {
  71251. reqHeaders[k] = v
  71252. }
  71253. reqHeaders.Set("User-Agent", c.s.userAgent())
  71254. var body io.Reader = nil
  71255. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  71256. if err != nil {
  71257. return nil, err
  71258. }
  71259. reqHeaders.Set("Content-Type", "application/json")
  71260. c.urlParams_.Set("alt", alt)
  71261. c.urlParams_.Set("prettyPrint", "false")
  71262. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  71263. urls += "?" + c.urlParams_.Encode()
  71264. req, err := http.NewRequest("POST", urls, body)
  71265. if err != nil {
  71266. return nil, err
  71267. }
  71268. req.Header = reqHeaders
  71269. googleapi.Expand(req.URL, map[string]string{
  71270. "project": c.project,
  71271. "region": c.region,
  71272. })
  71273. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71274. }
  71275. // Do executes the "compute.regionDisks.insert" call.
  71276. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71277. // status code is an error. Response headers are in either
  71278. // *Operation.ServerResponse.Header or (if a response was returned at
  71279. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71280. // to check whether the returned error was because
  71281. // http.StatusNotModified was returned.
  71282. func (c *RegionDisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71283. gensupport.SetOptions(c.urlParams_, opts...)
  71284. res, err := c.doRequest("json")
  71285. if res != nil && res.StatusCode == http.StatusNotModified {
  71286. if res.Body != nil {
  71287. res.Body.Close()
  71288. }
  71289. return nil, &googleapi.Error{
  71290. Code: res.StatusCode,
  71291. Header: res.Header,
  71292. }
  71293. }
  71294. if err != nil {
  71295. return nil, err
  71296. }
  71297. defer googleapi.CloseBody(res)
  71298. if err := googleapi.CheckResponse(res); err != nil {
  71299. return nil, err
  71300. }
  71301. ret := &Operation{
  71302. ServerResponse: googleapi.ServerResponse{
  71303. Header: res.Header,
  71304. HTTPStatusCode: res.StatusCode,
  71305. },
  71306. }
  71307. target := &ret
  71308. if err := gensupport.DecodeResponse(target, res); err != nil {
  71309. return nil, err
  71310. }
  71311. return ret, nil
  71312. // {
  71313. // "description": "Creates a persistent regional disk in the specified project using the data included in the request.",
  71314. // "httpMethod": "POST",
  71315. // "id": "compute.regionDisks.insert",
  71316. // "parameterOrder": [
  71317. // "project",
  71318. // "region"
  71319. // ],
  71320. // "parameters": {
  71321. // "project": {
  71322. // "description": "Project ID for this request.",
  71323. // "location": "path",
  71324. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71325. // "required": true,
  71326. // "type": "string"
  71327. // },
  71328. // "region": {
  71329. // "description": "Name of the region for this request.",
  71330. // "location": "path",
  71331. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71332. // "required": true,
  71333. // "type": "string"
  71334. // },
  71335. // "requestId": {
  71336. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71337. // "location": "query",
  71338. // "type": "string"
  71339. // },
  71340. // "sourceImage": {
  71341. // "description": "Optional. Source image to restore onto a disk.",
  71342. // "location": "query",
  71343. // "type": "string"
  71344. // }
  71345. // },
  71346. // "path": "{project}/regions/{region}/disks",
  71347. // "request": {
  71348. // "$ref": "Disk"
  71349. // },
  71350. // "response": {
  71351. // "$ref": "Operation"
  71352. // },
  71353. // "scopes": [
  71354. // "https://www.googleapis.com/auth/cloud-platform",
  71355. // "https://www.googleapis.com/auth/compute"
  71356. // ]
  71357. // }
  71358. }
  71359. // method id "compute.regionDisks.list":
  71360. type RegionDisksListCall struct {
  71361. s *Service
  71362. project string
  71363. region string
  71364. urlParams_ gensupport.URLParams
  71365. ifNoneMatch_ string
  71366. ctx_ context.Context
  71367. header_ http.Header
  71368. }
  71369. // List: Retrieves the list of persistent disks contained within the
  71370. // specified region.
  71371. func (r *RegionDisksService) List(project string, region string) *RegionDisksListCall {
  71372. c := &RegionDisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71373. c.project = project
  71374. c.region = region
  71375. return c
  71376. }
  71377. // Filter sets the optional parameter "filter": A filter expression that
  71378. // filters resources listed in the response. The expression must specify
  71379. // the field name, a comparison operator, and the value that you want to
  71380. // use for filtering. The value must be a string, a number, or a
  71381. // boolean. The comparison operator must be either =, !=, >, or <.
  71382. //
  71383. // For example, if you are filtering Compute Engine instances, you can
  71384. // exclude instances named example-instance by specifying name !=
  71385. // example-instance.
  71386. //
  71387. // You can also filter nested fields. For example, you could specify
  71388. // scheduling.automaticRestart = false to include instances only if they
  71389. // are not scheduled for automatic restarts. You can use filtering on
  71390. // nested fields to filter based on resource labels.
  71391. //
  71392. // To filter on multiple expressions, provide each separate expression
  71393. // within parentheses. For example, (scheduling.automaticRestart = true)
  71394. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  71395. // AND expression. However, you can include AND and OR expressions
  71396. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  71397. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  71398. // true).
  71399. func (c *RegionDisksListCall) Filter(filter string) *RegionDisksListCall {
  71400. c.urlParams_.Set("filter", filter)
  71401. return c
  71402. }
  71403. // MaxResults sets the optional parameter "maxResults": The maximum
  71404. // number of results per page that should be returned. If the number of
  71405. // available results is larger than maxResults, Compute Engine returns a
  71406. // nextPageToken that can be used to get the next page of results in
  71407. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  71408. // (Default: 500)
  71409. func (c *RegionDisksListCall) MaxResults(maxResults int64) *RegionDisksListCall {
  71410. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  71411. return c
  71412. }
  71413. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  71414. // a certain order. By default, results are returned in alphanumerical
  71415. // order based on the resource name.
  71416. //
  71417. // You can also sort results in descending order based on the creation
  71418. // timestamp using orderBy="creationTimestamp desc". This sorts results
  71419. // based on the creationTimestamp field in reverse chronological order
  71420. // (newest result first). Use this to sort resources like operations so
  71421. // that the newest operation is returned first.
  71422. //
  71423. // Currently, only sorting by name or creationTimestamp desc is
  71424. // supported.
  71425. func (c *RegionDisksListCall) OrderBy(orderBy string) *RegionDisksListCall {
  71426. c.urlParams_.Set("orderBy", orderBy)
  71427. return c
  71428. }
  71429. // PageToken sets the optional parameter "pageToken": Specifies a page
  71430. // token to use. Set pageToken to the nextPageToken returned by a
  71431. // previous list request to get the next page of results.
  71432. func (c *RegionDisksListCall) PageToken(pageToken string) *RegionDisksListCall {
  71433. c.urlParams_.Set("pageToken", pageToken)
  71434. return c
  71435. }
  71436. // Fields allows partial responses to be retrieved. See
  71437. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71438. // for more information.
  71439. func (c *RegionDisksListCall) Fields(s ...googleapi.Field) *RegionDisksListCall {
  71440. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71441. return c
  71442. }
  71443. // IfNoneMatch sets the optional parameter which makes the operation
  71444. // fail if the object's ETag matches the given value. This is useful for
  71445. // getting updates only after the object has changed since the last
  71446. // request. Use googleapi.IsNotModified to check whether the response
  71447. // error from Do is the result of In-None-Match.
  71448. func (c *RegionDisksListCall) IfNoneMatch(entityTag string) *RegionDisksListCall {
  71449. c.ifNoneMatch_ = entityTag
  71450. return c
  71451. }
  71452. // Context sets the context to be used in this call's Do method. Any
  71453. // pending HTTP request will be aborted if the provided context is
  71454. // canceled.
  71455. func (c *RegionDisksListCall) Context(ctx context.Context) *RegionDisksListCall {
  71456. c.ctx_ = ctx
  71457. return c
  71458. }
  71459. // Header returns an http.Header that can be modified by the caller to
  71460. // add HTTP headers to the request.
  71461. func (c *RegionDisksListCall) Header() http.Header {
  71462. if c.header_ == nil {
  71463. c.header_ = make(http.Header)
  71464. }
  71465. return c.header_
  71466. }
  71467. func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) {
  71468. reqHeaders := make(http.Header)
  71469. for k, v := range c.header_ {
  71470. reqHeaders[k] = v
  71471. }
  71472. reqHeaders.Set("User-Agent", c.s.userAgent())
  71473. if c.ifNoneMatch_ != "" {
  71474. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71475. }
  71476. var body io.Reader = nil
  71477. c.urlParams_.Set("alt", alt)
  71478. c.urlParams_.Set("prettyPrint", "false")
  71479. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  71480. urls += "?" + c.urlParams_.Encode()
  71481. req, err := http.NewRequest("GET", urls, body)
  71482. if err != nil {
  71483. return nil, err
  71484. }
  71485. req.Header = reqHeaders
  71486. googleapi.Expand(req.URL, map[string]string{
  71487. "project": c.project,
  71488. "region": c.region,
  71489. })
  71490. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71491. }
  71492. // Do executes the "compute.regionDisks.list" call.
  71493. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  71494. // code is an error. Response headers are in either
  71495. // *DiskList.ServerResponse.Header or (if a response was returned at
  71496. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71497. // to check whether the returned error was because
  71498. // http.StatusNotModified was returned.
  71499. func (c *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  71500. gensupport.SetOptions(c.urlParams_, opts...)
  71501. res, err := c.doRequest("json")
  71502. if res != nil && res.StatusCode == http.StatusNotModified {
  71503. if res.Body != nil {
  71504. res.Body.Close()
  71505. }
  71506. return nil, &googleapi.Error{
  71507. Code: res.StatusCode,
  71508. Header: res.Header,
  71509. }
  71510. }
  71511. if err != nil {
  71512. return nil, err
  71513. }
  71514. defer googleapi.CloseBody(res)
  71515. if err := googleapi.CheckResponse(res); err != nil {
  71516. return nil, err
  71517. }
  71518. ret := &DiskList{
  71519. ServerResponse: googleapi.ServerResponse{
  71520. Header: res.Header,
  71521. HTTPStatusCode: res.StatusCode,
  71522. },
  71523. }
  71524. target := &ret
  71525. if err := gensupport.DecodeResponse(target, res); err != nil {
  71526. return nil, err
  71527. }
  71528. return ret, nil
  71529. // {
  71530. // "description": "Retrieves the list of persistent disks contained within the specified region.",
  71531. // "httpMethod": "GET",
  71532. // "id": "compute.regionDisks.list",
  71533. // "parameterOrder": [
  71534. // "project",
  71535. // "region"
  71536. // ],
  71537. // "parameters": {
  71538. // "filter": {
  71539. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  71540. // "location": "query",
  71541. // "type": "string"
  71542. // },
  71543. // "maxResults": {
  71544. // "default": "500",
  71545. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  71546. // "format": "uint32",
  71547. // "location": "query",
  71548. // "minimum": "0",
  71549. // "type": "integer"
  71550. // },
  71551. // "orderBy": {
  71552. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  71553. // "location": "query",
  71554. // "type": "string"
  71555. // },
  71556. // "pageToken": {
  71557. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  71558. // "location": "query",
  71559. // "type": "string"
  71560. // },
  71561. // "project": {
  71562. // "description": "Project ID for this request.",
  71563. // "location": "path",
  71564. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71565. // "required": true,
  71566. // "type": "string"
  71567. // },
  71568. // "region": {
  71569. // "description": "Name of the region for this request.",
  71570. // "location": "path",
  71571. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71572. // "required": true,
  71573. // "type": "string"
  71574. // }
  71575. // },
  71576. // "path": "{project}/regions/{region}/disks",
  71577. // "response": {
  71578. // "$ref": "DiskList"
  71579. // },
  71580. // "scopes": [
  71581. // "https://www.googleapis.com/auth/cloud-platform",
  71582. // "https://www.googleapis.com/auth/compute",
  71583. // "https://www.googleapis.com/auth/compute.readonly"
  71584. // ]
  71585. // }
  71586. }
  71587. // Pages invokes f for each page of results.
  71588. // A non-nil error returned from f will halt the iteration.
  71589. // The provided context supersedes any context provided to the Context method.
  71590. func (c *RegionDisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  71591. c.ctx_ = ctx
  71592. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  71593. for {
  71594. x, err := c.Do()
  71595. if err != nil {
  71596. return err
  71597. }
  71598. if err := f(x); err != nil {
  71599. return err
  71600. }
  71601. if x.NextPageToken == "" {
  71602. return nil
  71603. }
  71604. c.PageToken(x.NextPageToken)
  71605. }
  71606. }
  71607. // method id "compute.regionDisks.resize":
  71608. type RegionDisksResizeCall struct {
  71609. s *Service
  71610. project string
  71611. region string
  71612. disk string
  71613. regiondisksresizerequest *RegionDisksResizeRequest
  71614. urlParams_ gensupport.URLParams
  71615. ctx_ context.Context
  71616. header_ http.Header
  71617. }
  71618. // Resize: Resizes the specified regional persistent disk.
  71619. func (r *RegionDisksService) Resize(project string, region string, disk string, regiondisksresizerequest *RegionDisksResizeRequest) *RegionDisksResizeCall {
  71620. c := &RegionDisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71621. c.project = project
  71622. c.region = region
  71623. c.disk = disk
  71624. c.regiondisksresizerequest = regiondisksresizerequest
  71625. return c
  71626. }
  71627. // RequestId sets the optional parameter "requestId": An optional
  71628. // request ID to identify requests. Specify a unique request ID so that
  71629. // if you must retry your request, the server will know to ignore the
  71630. // request if it has already been completed.
  71631. //
  71632. // For example, consider a situation where you make an initial request
  71633. // and the request times out. If you make the request again with the
  71634. // same request ID, the server can check if original operation with the
  71635. // same request ID was received, and if so, will ignore the second
  71636. // request. This prevents clients from accidentally creating duplicate
  71637. // commitments.
  71638. //
  71639. // The request ID must be a valid UUID with the exception that zero UUID
  71640. // is not supported (00000000-0000-0000-0000-000000000000).
  71641. func (c *RegionDisksResizeCall) RequestId(requestId string) *RegionDisksResizeCall {
  71642. c.urlParams_.Set("requestId", requestId)
  71643. return c
  71644. }
  71645. // Fields allows partial responses to be retrieved. See
  71646. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71647. // for more information.
  71648. func (c *RegionDisksResizeCall) Fields(s ...googleapi.Field) *RegionDisksResizeCall {
  71649. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71650. return c
  71651. }
  71652. // Context sets the context to be used in this call's Do method. Any
  71653. // pending HTTP request will be aborted if the provided context is
  71654. // canceled.
  71655. func (c *RegionDisksResizeCall) Context(ctx context.Context) *RegionDisksResizeCall {
  71656. c.ctx_ = ctx
  71657. return c
  71658. }
  71659. // Header returns an http.Header that can be modified by the caller to
  71660. // add HTTP headers to the request.
  71661. func (c *RegionDisksResizeCall) Header() http.Header {
  71662. if c.header_ == nil {
  71663. c.header_ = make(http.Header)
  71664. }
  71665. return c.header_
  71666. }
  71667. func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) {
  71668. reqHeaders := make(http.Header)
  71669. for k, v := range c.header_ {
  71670. reqHeaders[k] = v
  71671. }
  71672. reqHeaders.Set("User-Agent", c.s.userAgent())
  71673. var body io.Reader = nil
  71674. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest)
  71675. if err != nil {
  71676. return nil, err
  71677. }
  71678. reqHeaders.Set("Content-Type", "application/json")
  71679. c.urlParams_.Set("alt", alt)
  71680. c.urlParams_.Set("prettyPrint", "false")
  71681. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/resize")
  71682. urls += "?" + c.urlParams_.Encode()
  71683. req, err := http.NewRequest("POST", urls, body)
  71684. if err != nil {
  71685. return nil, err
  71686. }
  71687. req.Header = reqHeaders
  71688. googleapi.Expand(req.URL, map[string]string{
  71689. "project": c.project,
  71690. "region": c.region,
  71691. "disk": c.disk,
  71692. })
  71693. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71694. }
  71695. // Do executes the "compute.regionDisks.resize" call.
  71696. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71697. // status code is an error. Response headers are in either
  71698. // *Operation.ServerResponse.Header or (if a response was returned at
  71699. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71700. // to check whether the returned error was because
  71701. // http.StatusNotModified was returned.
  71702. func (c *RegionDisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71703. gensupport.SetOptions(c.urlParams_, opts...)
  71704. res, err := c.doRequest("json")
  71705. if res != nil && res.StatusCode == http.StatusNotModified {
  71706. if res.Body != nil {
  71707. res.Body.Close()
  71708. }
  71709. return nil, &googleapi.Error{
  71710. Code: res.StatusCode,
  71711. Header: res.Header,
  71712. }
  71713. }
  71714. if err != nil {
  71715. return nil, err
  71716. }
  71717. defer googleapi.CloseBody(res)
  71718. if err := googleapi.CheckResponse(res); err != nil {
  71719. return nil, err
  71720. }
  71721. ret := &Operation{
  71722. ServerResponse: googleapi.ServerResponse{
  71723. Header: res.Header,
  71724. HTTPStatusCode: res.StatusCode,
  71725. },
  71726. }
  71727. target := &ret
  71728. if err := gensupport.DecodeResponse(target, res); err != nil {
  71729. return nil, err
  71730. }
  71731. return ret, nil
  71732. // {
  71733. // "description": "Resizes the specified regional persistent disk.",
  71734. // "httpMethod": "POST",
  71735. // "id": "compute.regionDisks.resize",
  71736. // "parameterOrder": [
  71737. // "project",
  71738. // "region",
  71739. // "disk"
  71740. // ],
  71741. // "parameters": {
  71742. // "disk": {
  71743. // "description": "Name of the regional persistent disk.",
  71744. // "location": "path",
  71745. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71746. // "required": true,
  71747. // "type": "string"
  71748. // },
  71749. // "project": {
  71750. // "description": "The project ID for this request.",
  71751. // "location": "path",
  71752. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71753. // "required": true,
  71754. // "type": "string"
  71755. // },
  71756. // "region": {
  71757. // "description": "Name of the region for this request.",
  71758. // "location": "path",
  71759. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71760. // "required": true,
  71761. // "type": "string"
  71762. // },
  71763. // "requestId": {
  71764. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71765. // "location": "query",
  71766. // "type": "string"
  71767. // }
  71768. // },
  71769. // "path": "{project}/regions/{region}/disks/{disk}/resize",
  71770. // "request": {
  71771. // "$ref": "RegionDisksResizeRequest"
  71772. // },
  71773. // "response": {
  71774. // "$ref": "Operation"
  71775. // },
  71776. // "scopes": [
  71777. // "https://www.googleapis.com/auth/cloud-platform",
  71778. // "https://www.googleapis.com/auth/compute"
  71779. // ]
  71780. // }
  71781. }
  71782. // method id "compute.regionDisks.setLabels":
  71783. type RegionDisksSetLabelsCall struct {
  71784. s *Service
  71785. project string
  71786. region string
  71787. resource string
  71788. regionsetlabelsrequest *RegionSetLabelsRequest
  71789. urlParams_ gensupport.URLParams
  71790. ctx_ context.Context
  71791. header_ http.Header
  71792. }
  71793. // SetLabels: Sets the labels on the target regional disk.
  71794. func (r *RegionDisksService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *RegionDisksSetLabelsCall {
  71795. c := &RegionDisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71796. c.project = project
  71797. c.region = region
  71798. c.resource = resource
  71799. c.regionsetlabelsrequest = regionsetlabelsrequest
  71800. return c
  71801. }
  71802. // RequestId sets the optional parameter "requestId": An optional
  71803. // request ID to identify requests. Specify a unique request ID so that
  71804. // if you must retry your request, the server will know to ignore the
  71805. // request if it has already been completed.
  71806. //
  71807. // For example, consider a situation where you make an initial request
  71808. // and the request times out. If you make the request again with the
  71809. // same request ID, the server can check if original operation with the
  71810. // same request ID was received, and if so, will ignore the second
  71811. // request. This prevents clients from accidentally creating duplicate
  71812. // commitments.
  71813. //
  71814. // The request ID must be a valid UUID with the exception that zero UUID
  71815. // is not supported (00000000-0000-0000-0000-000000000000).
  71816. func (c *RegionDisksSetLabelsCall) RequestId(requestId string) *RegionDisksSetLabelsCall {
  71817. c.urlParams_.Set("requestId", requestId)
  71818. return c
  71819. }
  71820. // Fields allows partial responses to be retrieved. See
  71821. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71822. // for more information.
  71823. func (c *RegionDisksSetLabelsCall) Fields(s ...googleapi.Field) *RegionDisksSetLabelsCall {
  71824. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71825. return c
  71826. }
  71827. // Context sets the context to be used in this call's Do method. Any
  71828. // pending HTTP request will be aborted if the provided context is
  71829. // canceled.
  71830. func (c *RegionDisksSetLabelsCall) Context(ctx context.Context) *RegionDisksSetLabelsCall {
  71831. c.ctx_ = ctx
  71832. return c
  71833. }
  71834. // Header returns an http.Header that can be modified by the caller to
  71835. // add HTTP headers to the request.
  71836. func (c *RegionDisksSetLabelsCall) Header() http.Header {
  71837. if c.header_ == nil {
  71838. c.header_ = make(http.Header)
  71839. }
  71840. return c.header_
  71841. }
  71842. func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  71843. reqHeaders := make(http.Header)
  71844. for k, v := range c.header_ {
  71845. reqHeaders[k] = v
  71846. }
  71847. reqHeaders.Set("User-Agent", c.s.userAgent())
  71848. var body io.Reader = nil
  71849. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  71850. if err != nil {
  71851. return nil, err
  71852. }
  71853. reqHeaders.Set("Content-Type", "application/json")
  71854. c.urlParams_.Set("alt", alt)
  71855. c.urlParams_.Set("prettyPrint", "false")
  71856. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/setLabels")
  71857. urls += "?" + c.urlParams_.Encode()
  71858. req, err := http.NewRequest("POST", urls, body)
  71859. if err != nil {
  71860. return nil, err
  71861. }
  71862. req.Header = reqHeaders
  71863. googleapi.Expand(req.URL, map[string]string{
  71864. "project": c.project,
  71865. "region": c.region,
  71866. "resource": c.resource,
  71867. })
  71868. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71869. }
  71870. // Do executes the "compute.regionDisks.setLabels" call.
  71871. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71872. // status code is an error. Response headers are in either
  71873. // *Operation.ServerResponse.Header or (if a response was returned at
  71874. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71875. // to check whether the returned error was because
  71876. // http.StatusNotModified was returned.
  71877. func (c *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71878. gensupport.SetOptions(c.urlParams_, opts...)
  71879. res, err := c.doRequest("json")
  71880. if res != nil && res.StatusCode == http.StatusNotModified {
  71881. if res.Body != nil {
  71882. res.Body.Close()
  71883. }
  71884. return nil, &googleapi.Error{
  71885. Code: res.StatusCode,
  71886. Header: res.Header,
  71887. }
  71888. }
  71889. if err != nil {
  71890. return nil, err
  71891. }
  71892. defer googleapi.CloseBody(res)
  71893. if err := googleapi.CheckResponse(res); err != nil {
  71894. return nil, err
  71895. }
  71896. ret := &Operation{
  71897. ServerResponse: googleapi.ServerResponse{
  71898. Header: res.Header,
  71899. HTTPStatusCode: res.StatusCode,
  71900. },
  71901. }
  71902. target := &ret
  71903. if err := gensupport.DecodeResponse(target, res); err != nil {
  71904. return nil, err
  71905. }
  71906. return ret, nil
  71907. // {
  71908. // "description": "Sets the labels on the target regional disk.",
  71909. // "httpMethod": "POST",
  71910. // "id": "compute.regionDisks.setLabels",
  71911. // "parameterOrder": [
  71912. // "project",
  71913. // "region",
  71914. // "resource"
  71915. // ],
  71916. // "parameters": {
  71917. // "project": {
  71918. // "description": "Project ID for this request.",
  71919. // "location": "path",
  71920. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71921. // "required": true,
  71922. // "type": "string"
  71923. // },
  71924. // "region": {
  71925. // "description": "The region for this request.",
  71926. // "location": "path",
  71927. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71928. // "required": true,
  71929. // "type": "string"
  71930. // },
  71931. // "requestId": {
  71932. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71933. // "location": "query",
  71934. // "type": "string"
  71935. // },
  71936. // "resource": {
  71937. // "description": "Name or id of the resource for this request.",
  71938. // "location": "path",
  71939. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71940. // "required": true,
  71941. // "type": "string"
  71942. // }
  71943. // },
  71944. // "path": "{project}/regions/{region}/disks/{resource}/setLabels",
  71945. // "request": {
  71946. // "$ref": "RegionSetLabelsRequest"
  71947. // },
  71948. // "response": {
  71949. // "$ref": "Operation"
  71950. // },
  71951. // "scopes": [
  71952. // "https://www.googleapis.com/auth/cloud-platform",
  71953. // "https://www.googleapis.com/auth/compute"
  71954. // ]
  71955. // }
  71956. }
  71957. // method id "compute.regionDisks.testIamPermissions":
  71958. type RegionDisksTestIamPermissionsCall struct {
  71959. s *Service
  71960. project string
  71961. region string
  71962. resource string
  71963. testpermissionsrequest *TestPermissionsRequest
  71964. urlParams_ gensupport.URLParams
  71965. ctx_ context.Context
  71966. header_ http.Header
  71967. }
  71968. // TestIamPermissions: Returns permissions that a caller has on the
  71969. // specified resource.
  71970. func (r *RegionDisksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionDisksTestIamPermissionsCall {
  71971. c := &RegionDisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71972. c.project = project
  71973. c.region = region
  71974. c.resource = resource
  71975. c.testpermissionsrequest = testpermissionsrequest
  71976. return c
  71977. }
  71978. // Fields allows partial responses to be retrieved. See
  71979. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71980. // for more information.
  71981. func (c *RegionDisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionDisksTestIamPermissionsCall {
  71982. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71983. return c
  71984. }
  71985. // Context sets the context to be used in this call's Do method. Any
  71986. // pending HTTP request will be aborted if the provided context is
  71987. // canceled.
  71988. func (c *RegionDisksTestIamPermissionsCall) Context(ctx context.Context) *RegionDisksTestIamPermissionsCall {
  71989. c.ctx_ = ctx
  71990. return c
  71991. }
  71992. // Header returns an http.Header that can be modified by the caller to
  71993. // add HTTP headers to the request.
  71994. func (c *RegionDisksTestIamPermissionsCall) Header() http.Header {
  71995. if c.header_ == nil {
  71996. c.header_ = make(http.Header)
  71997. }
  71998. return c.header_
  71999. }
  72000. func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  72001. reqHeaders := make(http.Header)
  72002. for k, v := range c.header_ {
  72003. reqHeaders[k] = v
  72004. }
  72005. reqHeaders.Set("User-Agent", c.s.userAgent())
  72006. var body io.Reader = nil
  72007. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  72008. if err != nil {
  72009. return nil, err
  72010. }
  72011. reqHeaders.Set("Content-Type", "application/json")
  72012. c.urlParams_.Set("alt", alt)
  72013. c.urlParams_.Set("prettyPrint", "false")
  72014. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/testIamPermissions")
  72015. urls += "?" + c.urlParams_.Encode()
  72016. req, err := http.NewRequest("POST", urls, body)
  72017. if err != nil {
  72018. return nil, err
  72019. }
  72020. req.Header = reqHeaders
  72021. googleapi.Expand(req.URL, map[string]string{
  72022. "project": c.project,
  72023. "region": c.region,
  72024. "resource": c.resource,
  72025. })
  72026. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72027. }
  72028. // Do executes the "compute.regionDisks.testIamPermissions" call.
  72029. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  72030. // non-2xx status code is an error. Response headers are in either
  72031. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  72032. // returned at all) in error.(*googleapi.Error).Header. Use
  72033. // googleapi.IsNotModified to check whether the returned error was
  72034. // because http.StatusNotModified was returned.
  72035. func (c *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  72036. gensupport.SetOptions(c.urlParams_, opts...)
  72037. res, err := c.doRequest("json")
  72038. if res != nil && res.StatusCode == http.StatusNotModified {
  72039. if res.Body != nil {
  72040. res.Body.Close()
  72041. }
  72042. return nil, &googleapi.Error{
  72043. Code: res.StatusCode,
  72044. Header: res.Header,
  72045. }
  72046. }
  72047. if err != nil {
  72048. return nil, err
  72049. }
  72050. defer googleapi.CloseBody(res)
  72051. if err := googleapi.CheckResponse(res); err != nil {
  72052. return nil, err
  72053. }
  72054. ret := &TestPermissionsResponse{
  72055. ServerResponse: googleapi.ServerResponse{
  72056. Header: res.Header,
  72057. HTTPStatusCode: res.StatusCode,
  72058. },
  72059. }
  72060. target := &ret
  72061. if err := gensupport.DecodeResponse(target, res); err != nil {
  72062. return nil, err
  72063. }
  72064. return ret, nil
  72065. // {
  72066. // "description": "Returns permissions that a caller has on the specified resource.",
  72067. // "httpMethod": "POST",
  72068. // "id": "compute.regionDisks.testIamPermissions",
  72069. // "parameterOrder": [
  72070. // "project",
  72071. // "region",
  72072. // "resource"
  72073. // ],
  72074. // "parameters": {
  72075. // "project": {
  72076. // "description": "Project ID for this request.",
  72077. // "location": "path",
  72078. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72079. // "required": true,
  72080. // "type": "string"
  72081. // },
  72082. // "region": {
  72083. // "description": "The name of the region for this request.",
  72084. // "location": "path",
  72085. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72086. // "required": true,
  72087. // "type": "string"
  72088. // },
  72089. // "resource": {
  72090. // "description": "Name or id of the resource for this request.",
  72091. // "location": "path",
  72092. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72093. // "required": true,
  72094. // "type": "string"
  72095. // }
  72096. // },
  72097. // "path": "{project}/regions/{region}/disks/{resource}/testIamPermissions",
  72098. // "request": {
  72099. // "$ref": "TestPermissionsRequest"
  72100. // },
  72101. // "response": {
  72102. // "$ref": "TestPermissionsResponse"
  72103. // },
  72104. // "scopes": [
  72105. // "https://www.googleapis.com/auth/cloud-platform",
  72106. // "https://www.googleapis.com/auth/compute",
  72107. // "https://www.googleapis.com/auth/compute.readonly"
  72108. // ]
  72109. // }
  72110. }
  72111. // method id "compute.regionInstanceGroupManagers.abandonInstances":
  72112. type RegionInstanceGroupManagersAbandonInstancesCall struct {
  72113. s *Service
  72114. project string
  72115. region string
  72116. instanceGroupManager string
  72117. regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest
  72118. urlParams_ gensupport.URLParams
  72119. ctx_ context.Context
  72120. header_ http.Header
  72121. }
  72122. // AbandonInstances: Flags the specified instances to be immediately
  72123. // removed from the managed instance group. Abandoning an instance does
  72124. // not delete the instance, but it does remove the instance from any
  72125. // target pools that are applied by the managed instance group. This
  72126. // method reduces the targetSize of the managed instance group by the
  72127. // number of instances that you abandon. This operation is marked as
  72128. // DONE when the action is scheduled even if the instances have not yet
  72129. // been removed from the group. You must separately verify the status of
  72130. // the abandoning action with the listmanagedinstances method.
  72131. //
  72132. // If the group is part of a backend service that has enabled connection
  72133. // draining, it can take up to 60 seconds after the connection draining
  72134. // duration has elapsed before the VM instance is removed or
  72135. // deleted.
  72136. //
  72137. // You can specify a maximum of 1000 instances with this method per
  72138. // request.
  72139. func (r *RegionInstanceGroupManagersService) AbandonInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest) *RegionInstanceGroupManagersAbandonInstancesCall {
  72140. c := &RegionInstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72141. c.project = project
  72142. c.region = region
  72143. c.instanceGroupManager = instanceGroupManager
  72144. c.regioninstancegroupmanagersabandoninstancesrequest = regioninstancegroupmanagersabandoninstancesrequest
  72145. return c
  72146. }
  72147. // RequestId sets the optional parameter "requestId": An optional
  72148. // request ID to identify requests. Specify a unique request ID so that
  72149. // if you must retry your request, the server will know to ignore the
  72150. // request if it has already been completed.
  72151. //
  72152. // For example, consider a situation where you make an initial request
  72153. // and the request times out. If you make the request again with the
  72154. // same request ID, the server can check if original operation with the
  72155. // same request ID was received, and if so, will ignore the second
  72156. // request. This prevents clients from accidentally creating duplicate
  72157. // commitments.
  72158. //
  72159. // The request ID must be a valid UUID with the exception that zero UUID
  72160. // is not supported (00000000-0000-0000-0000-000000000000).
  72161. func (c *RegionInstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersAbandonInstancesCall {
  72162. c.urlParams_.Set("requestId", requestId)
  72163. return c
  72164. }
  72165. // Fields allows partial responses to be retrieved. See
  72166. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72167. // for more information.
  72168. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersAbandonInstancesCall {
  72169. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72170. return c
  72171. }
  72172. // Context sets the context to be used in this call's Do method. Any
  72173. // pending HTTP request will be aborted if the provided context is
  72174. // canceled.
  72175. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersAbandonInstancesCall {
  72176. c.ctx_ = ctx
  72177. return c
  72178. }
  72179. // Header returns an http.Header that can be modified by the caller to
  72180. // add HTTP headers to the request.
  72181. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  72182. if c.header_ == nil {
  72183. c.header_ = make(http.Header)
  72184. }
  72185. return c.header_
  72186. }
  72187. func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  72188. reqHeaders := make(http.Header)
  72189. for k, v := range c.header_ {
  72190. reqHeaders[k] = v
  72191. }
  72192. reqHeaders.Set("User-Agent", c.s.userAgent())
  72193. var body io.Reader = nil
  72194. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest)
  72195. if err != nil {
  72196. return nil, err
  72197. }
  72198. reqHeaders.Set("Content-Type", "application/json")
  72199. c.urlParams_.Set("alt", alt)
  72200. c.urlParams_.Set("prettyPrint", "false")
  72201. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  72202. urls += "?" + c.urlParams_.Encode()
  72203. req, err := http.NewRequest("POST", urls, body)
  72204. if err != nil {
  72205. return nil, err
  72206. }
  72207. req.Header = reqHeaders
  72208. googleapi.Expand(req.URL, map[string]string{
  72209. "project": c.project,
  72210. "region": c.region,
  72211. "instanceGroupManager": c.instanceGroupManager,
  72212. })
  72213. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72214. }
  72215. // Do executes the "compute.regionInstanceGroupManagers.abandonInstances" call.
  72216. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72217. // status code is an error. Response headers are in either
  72218. // *Operation.ServerResponse.Header or (if a response was returned at
  72219. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72220. // to check whether the returned error was because
  72221. // http.StatusNotModified was returned.
  72222. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72223. gensupport.SetOptions(c.urlParams_, opts...)
  72224. res, err := c.doRequest("json")
  72225. if res != nil && res.StatusCode == http.StatusNotModified {
  72226. if res.Body != nil {
  72227. res.Body.Close()
  72228. }
  72229. return nil, &googleapi.Error{
  72230. Code: res.StatusCode,
  72231. Header: res.Header,
  72232. }
  72233. }
  72234. if err != nil {
  72235. return nil, err
  72236. }
  72237. defer googleapi.CloseBody(res)
  72238. if err := googleapi.CheckResponse(res); err != nil {
  72239. return nil, err
  72240. }
  72241. ret := &Operation{
  72242. ServerResponse: googleapi.ServerResponse{
  72243. Header: res.Header,
  72244. HTTPStatusCode: res.StatusCode,
  72245. },
  72246. }
  72247. target := &ret
  72248. if err := gensupport.DecodeResponse(target, res); err != nil {
  72249. return nil, err
  72250. }
  72251. return ret, nil
  72252. // {
  72253. // "description": "Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  72254. // "httpMethod": "POST",
  72255. // "id": "compute.regionInstanceGroupManagers.abandonInstances",
  72256. // "parameterOrder": [
  72257. // "project",
  72258. // "region",
  72259. // "instanceGroupManager"
  72260. // ],
  72261. // "parameters": {
  72262. // "instanceGroupManager": {
  72263. // "description": "Name of the managed instance group.",
  72264. // "location": "path",
  72265. // "required": true,
  72266. // "type": "string"
  72267. // },
  72268. // "project": {
  72269. // "description": "Project ID for this request.",
  72270. // "location": "path",
  72271. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72272. // "required": true,
  72273. // "type": "string"
  72274. // },
  72275. // "region": {
  72276. // "description": "Name of the region scoping this request.",
  72277. // "location": "path",
  72278. // "required": true,
  72279. // "type": "string"
  72280. // },
  72281. // "requestId": {
  72282. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72283. // "location": "query",
  72284. // "type": "string"
  72285. // }
  72286. // },
  72287. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  72288. // "request": {
  72289. // "$ref": "RegionInstanceGroupManagersAbandonInstancesRequest"
  72290. // },
  72291. // "response": {
  72292. // "$ref": "Operation"
  72293. // },
  72294. // "scopes": [
  72295. // "https://www.googleapis.com/auth/cloud-platform",
  72296. // "https://www.googleapis.com/auth/compute"
  72297. // ]
  72298. // }
  72299. }
  72300. // method id "compute.regionInstanceGroupManagers.delete":
  72301. type RegionInstanceGroupManagersDeleteCall struct {
  72302. s *Service
  72303. project string
  72304. region string
  72305. instanceGroupManager string
  72306. urlParams_ gensupport.URLParams
  72307. ctx_ context.Context
  72308. header_ http.Header
  72309. }
  72310. // Delete: Deletes the specified managed instance group and all of the
  72311. // instances in that group.
  72312. func (r *RegionInstanceGroupManagersService) Delete(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersDeleteCall {
  72313. c := &RegionInstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72314. c.project = project
  72315. c.region = region
  72316. c.instanceGroupManager = instanceGroupManager
  72317. return c
  72318. }
  72319. // RequestId sets the optional parameter "requestId": An optional
  72320. // request ID to identify requests. Specify a unique request ID so that
  72321. // if you must retry your request, the server will know to ignore the
  72322. // request if it has already been completed.
  72323. //
  72324. // For example, consider a situation where you make an initial request
  72325. // and the request times out. If you make the request again with the
  72326. // same request ID, the server can check if original operation with the
  72327. // same request ID was received, and if so, will ignore the second
  72328. // request. This prevents clients from accidentally creating duplicate
  72329. // commitments.
  72330. //
  72331. // The request ID must be a valid UUID with the exception that zero UUID
  72332. // is not supported (00000000-0000-0000-0000-000000000000).
  72333. func (c *RegionInstanceGroupManagersDeleteCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteCall {
  72334. c.urlParams_.Set("requestId", requestId)
  72335. return c
  72336. }
  72337. // Fields allows partial responses to be retrieved. See
  72338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72339. // for more information.
  72340. func (c *RegionInstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteCall {
  72341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72342. return c
  72343. }
  72344. // Context sets the context to be used in this call's Do method. Any
  72345. // pending HTTP request will be aborted if the provided context is
  72346. // canceled.
  72347. func (c *RegionInstanceGroupManagersDeleteCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteCall {
  72348. c.ctx_ = ctx
  72349. return c
  72350. }
  72351. // Header returns an http.Header that can be modified by the caller to
  72352. // add HTTP headers to the request.
  72353. func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header {
  72354. if c.header_ == nil {
  72355. c.header_ = make(http.Header)
  72356. }
  72357. return c.header_
  72358. }
  72359. func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  72360. reqHeaders := make(http.Header)
  72361. for k, v := range c.header_ {
  72362. reqHeaders[k] = v
  72363. }
  72364. reqHeaders.Set("User-Agent", c.s.userAgent())
  72365. var body io.Reader = nil
  72366. c.urlParams_.Set("alt", alt)
  72367. c.urlParams_.Set("prettyPrint", "false")
  72368. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  72369. urls += "?" + c.urlParams_.Encode()
  72370. req, err := http.NewRequest("DELETE", urls, body)
  72371. if err != nil {
  72372. return nil, err
  72373. }
  72374. req.Header = reqHeaders
  72375. googleapi.Expand(req.URL, map[string]string{
  72376. "project": c.project,
  72377. "region": c.region,
  72378. "instanceGroupManager": c.instanceGroupManager,
  72379. })
  72380. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72381. }
  72382. // Do executes the "compute.regionInstanceGroupManagers.delete" call.
  72383. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72384. // status code is an error. Response headers are in either
  72385. // *Operation.ServerResponse.Header or (if a response was returned at
  72386. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72387. // to check whether the returned error was because
  72388. // http.StatusNotModified was returned.
  72389. func (c *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72390. gensupport.SetOptions(c.urlParams_, opts...)
  72391. res, err := c.doRequest("json")
  72392. if res != nil && res.StatusCode == http.StatusNotModified {
  72393. if res.Body != nil {
  72394. res.Body.Close()
  72395. }
  72396. return nil, &googleapi.Error{
  72397. Code: res.StatusCode,
  72398. Header: res.Header,
  72399. }
  72400. }
  72401. if err != nil {
  72402. return nil, err
  72403. }
  72404. defer googleapi.CloseBody(res)
  72405. if err := googleapi.CheckResponse(res); err != nil {
  72406. return nil, err
  72407. }
  72408. ret := &Operation{
  72409. ServerResponse: googleapi.ServerResponse{
  72410. Header: res.Header,
  72411. HTTPStatusCode: res.StatusCode,
  72412. },
  72413. }
  72414. target := &ret
  72415. if err := gensupport.DecodeResponse(target, res); err != nil {
  72416. return nil, err
  72417. }
  72418. return ret, nil
  72419. // {
  72420. // "description": "Deletes the specified managed instance group and all of the instances in that group.",
  72421. // "httpMethod": "DELETE",
  72422. // "id": "compute.regionInstanceGroupManagers.delete",
  72423. // "parameterOrder": [
  72424. // "project",
  72425. // "region",
  72426. // "instanceGroupManager"
  72427. // ],
  72428. // "parameters": {
  72429. // "instanceGroupManager": {
  72430. // "description": "Name of the managed instance group to delete.",
  72431. // "location": "path",
  72432. // "required": true,
  72433. // "type": "string"
  72434. // },
  72435. // "project": {
  72436. // "description": "Project ID for this request.",
  72437. // "location": "path",
  72438. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72439. // "required": true,
  72440. // "type": "string"
  72441. // },
  72442. // "region": {
  72443. // "description": "Name of the region scoping this request.",
  72444. // "location": "path",
  72445. // "required": true,
  72446. // "type": "string"
  72447. // },
  72448. // "requestId": {
  72449. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72450. // "location": "query",
  72451. // "type": "string"
  72452. // }
  72453. // },
  72454. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  72455. // "response": {
  72456. // "$ref": "Operation"
  72457. // },
  72458. // "scopes": [
  72459. // "https://www.googleapis.com/auth/cloud-platform",
  72460. // "https://www.googleapis.com/auth/compute"
  72461. // ]
  72462. // }
  72463. }
  72464. // method id "compute.regionInstanceGroupManagers.deleteInstances":
  72465. type RegionInstanceGroupManagersDeleteInstancesCall struct {
  72466. s *Service
  72467. project string
  72468. region string
  72469. instanceGroupManager string
  72470. regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest
  72471. urlParams_ gensupport.URLParams
  72472. ctx_ context.Context
  72473. header_ http.Header
  72474. }
  72475. // DeleteInstances: Flags the specified instances in the managed
  72476. // instance group to be immediately deleted. The instances are also
  72477. // removed from any target pools of which they were a member. This
  72478. // method reduces the targetSize of the managed instance group by the
  72479. // number of instances that you delete. The deleteInstances operation is
  72480. // marked DONE if the deleteInstances request is successful. The
  72481. // underlying actions take additional time. You must separately verify
  72482. // the status of the deleting action with the listmanagedinstances
  72483. // method.
  72484. //
  72485. // If the group is part of a backend service that has enabled connection
  72486. // draining, it can take up to 60 seconds after the connection draining
  72487. // duration has elapsed before the VM instance is removed or
  72488. // deleted.
  72489. //
  72490. // You can specify a maximum of 1000 instances with this method per
  72491. // request.
  72492. func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest) *RegionInstanceGroupManagersDeleteInstancesCall {
  72493. c := &RegionInstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72494. c.project = project
  72495. c.region = region
  72496. c.instanceGroupManager = instanceGroupManager
  72497. c.regioninstancegroupmanagersdeleteinstancesrequest = regioninstancegroupmanagersdeleteinstancesrequest
  72498. return c
  72499. }
  72500. // RequestId sets the optional parameter "requestId": An optional
  72501. // request ID to identify requests. Specify a unique request ID so that
  72502. // if you must retry your request, the server will know to ignore the
  72503. // request if it has already been completed.
  72504. //
  72505. // For example, consider a situation where you make an initial request
  72506. // and the request times out. If you make the request again with the
  72507. // same request ID, the server can check if original operation with the
  72508. // same request ID was received, and if so, will ignore the second
  72509. // request. This prevents clients from accidentally creating duplicate
  72510. // commitments.
  72511. //
  72512. // The request ID must be a valid UUID with the exception that zero UUID
  72513. // is not supported (00000000-0000-0000-0000-000000000000).
  72514. func (c *RegionInstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteInstancesCall {
  72515. c.urlParams_.Set("requestId", requestId)
  72516. return c
  72517. }
  72518. // Fields allows partial responses to be retrieved. See
  72519. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72520. // for more information.
  72521. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteInstancesCall {
  72522. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72523. return c
  72524. }
  72525. // Context sets the context to be used in this call's Do method. Any
  72526. // pending HTTP request will be aborted if the provided context is
  72527. // canceled.
  72528. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteInstancesCall {
  72529. c.ctx_ = ctx
  72530. return c
  72531. }
  72532. // Header returns an http.Header that can be modified by the caller to
  72533. // add HTTP headers to the request.
  72534. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  72535. if c.header_ == nil {
  72536. c.header_ = make(http.Header)
  72537. }
  72538. return c.header_
  72539. }
  72540. func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  72541. reqHeaders := make(http.Header)
  72542. for k, v := range c.header_ {
  72543. reqHeaders[k] = v
  72544. }
  72545. reqHeaders.Set("User-Agent", c.s.userAgent())
  72546. var body io.Reader = nil
  72547. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest)
  72548. if err != nil {
  72549. return nil, err
  72550. }
  72551. reqHeaders.Set("Content-Type", "application/json")
  72552. c.urlParams_.Set("alt", alt)
  72553. c.urlParams_.Set("prettyPrint", "false")
  72554. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  72555. urls += "?" + c.urlParams_.Encode()
  72556. req, err := http.NewRequest("POST", urls, body)
  72557. if err != nil {
  72558. return nil, err
  72559. }
  72560. req.Header = reqHeaders
  72561. googleapi.Expand(req.URL, map[string]string{
  72562. "project": c.project,
  72563. "region": c.region,
  72564. "instanceGroupManager": c.instanceGroupManager,
  72565. })
  72566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72567. }
  72568. // Do executes the "compute.regionInstanceGroupManagers.deleteInstances" call.
  72569. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72570. // status code is an error. Response headers are in either
  72571. // *Operation.ServerResponse.Header or (if a response was returned at
  72572. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72573. // to check whether the returned error was because
  72574. // http.StatusNotModified was returned.
  72575. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72576. gensupport.SetOptions(c.urlParams_, opts...)
  72577. res, err := c.doRequest("json")
  72578. if res != nil && res.StatusCode == http.StatusNotModified {
  72579. if res.Body != nil {
  72580. res.Body.Close()
  72581. }
  72582. return nil, &googleapi.Error{
  72583. Code: res.StatusCode,
  72584. Header: res.Header,
  72585. }
  72586. }
  72587. if err != nil {
  72588. return nil, err
  72589. }
  72590. defer googleapi.CloseBody(res)
  72591. if err := googleapi.CheckResponse(res); err != nil {
  72592. return nil, err
  72593. }
  72594. ret := &Operation{
  72595. ServerResponse: googleapi.ServerResponse{
  72596. Header: res.Header,
  72597. HTTPStatusCode: res.StatusCode,
  72598. },
  72599. }
  72600. target := &ret
  72601. if err := gensupport.DecodeResponse(target, res); err != nil {
  72602. return nil, err
  72603. }
  72604. return ret, nil
  72605. // {
  72606. // "description": "Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  72607. // "httpMethod": "POST",
  72608. // "id": "compute.regionInstanceGroupManagers.deleteInstances",
  72609. // "parameterOrder": [
  72610. // "project",
  72611. // "region",
  72612. // "instanceGroupManager"
  72613. // ],
  72614. // "parameters": {
  72615. // "instanceGroupManager": {
  72616. // "description": "Name of the managed instance group.",
  72617. // "location": "path",
  72618. // "required": true,
  72619. // "type": "string"
  72620. // },
  72621. // "project": {
  72622. // "description": "Project ID for this request.",
  72623. // "location": "path",
  72624. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72625. // "required": true,
  72626. // "type": "string"
  72627. // },
  72628. // "region": {
  72629. // "description": "Name of the region scoping this request.",
  72630. // "location": "path",
  72631. // "required": true,
  72632. // "type": "string"
  72633. // },
  72634. // "requestId": {
  72635. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72636. // "location": "query",
  72637. // "type": "string"
  72638. // }
  72639. // },
  72640. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  72641. // "request": {
  72642. // "$ref": "RegionInstanceGroupManagersDeleteInstancesRequest"
  72643. // },
  72644. // "response": {
  72645. // "$ref": "Operation"
  72646. // },
  72647. // "scopes": [
  72648. // "https://www.googleapis.com/auth/cloud-platform",
  72649. // "https://www.googleapis.com/auth/compute"
  72650. // ]
  72651. // }
  72652. }
  72653. // method id "compute.regionInstanceGroupManagers.get":
  72654. type RegionInstanceGroupManagersGetCall struct {
  72655. s *Service
  72656. project string
  72657. region string
  72658. instanceGroupManager string
  72659. urlParams_ gensupport.URLParams
  72660. ifNoneMatch_ string
  72661. ctx_ context.Context
  72662. header_ http.Header
  72663. }
  72664. // Get: Returns all of the details about the specified managed instance
  72665. // group.
  72666. func (r *RegionInstanceGroupManagersService) Get(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersGetCall {
  72667. c := &RegionInstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72668. c.project = project
  72669. c.region = region
  72670. c.instanceGroupManager = instanceGroupManager
  72671. return c
  72672. }
  72673. // Fields allows partial responses to be retrieved. See
  72674. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72675. // for more information.
  72676. func (c *RegionInstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersGetCall {
  72677. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72678. return c
  72679. }
  72680. // IfNoneMatch sets the optional parameter which makes the operation
  72681. // fail if the object's ETag matches the given value. This is useful for
  72682. // getting updates only after the object has changed since the last
  72683. // request. Use googleapi.IsNotModified to check whether the response
  72684. // error from Do is the result of In-None-Match.
  72685. func (c *RegionInstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersGetCall {
  72686. c.ifNoneMatch_ = entityTag
  72687. return c
  72688. }
  72689. // Context sets the context to be used in this call's Do method. Any
  72690. // pending HTTP request will be aborted if the provided context is
  72691. // canceled.
  72692. func (c *RegionInstanceGroupManagersGetCall) Context(ctx context.Context) *RegionInstanceGroupManagersGetCall {
  72693. c.ctx_ = ctx
  72694. return c
  72695. }
  72696. // Header returns an http.Header that can be modified by the caller to
  72697. // add HTTP headers to the request.
  72698. func (c *RegionInstanceGroupManagersGetCall) Header() http.Header {
  72699. if c.header_ == nil {
  72700. c.header_ = make(http.Header)
  72701. }
  72702. return c.header_
  72703. }
  72704. func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  72705. reqHeaders := make(http.Header)
  72706. for k, v := range c.header_ {
  72707. reqHeaders[k] = v
  72708. }
  72709. reqHeaders.Set("User-Agent", c.s.userAgent())
  72710. if c.ifNoneMatch_ != "" {
  72711. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72712. }
  72713. var body io.Reader = nil
  72714. c.urlParams_.Set("alt", alt)
  72715. c.urlParams_.Set("prettyPrint", "false")
  72716. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  72717. urls += "?" + c.urlParams_.Encode()
  72718. req, err := http.NewRequest("GET", urls, body)
  72719. if err != nil {
  72720. return nil, err
  72721. }
  72722. req.Header = reqHeaders
  72723. googleapi.Expand(req.URL, map[string]string{
  72724. "project": c.project,
  72725. "region": c.region,
  72726. "instanceGroupManager": c.instanceGroupManager,
  72727. })
  72728. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72729. }
  72730. // Do executes the "compute.regionInstanceGroupManagers.get" call.
  72731. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  72732. // non-2xx status code is an error. Response headers are in either
  72733. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  72734. // returned at all) in error.(*googleapi.Error).Header. Use
  72735. // googleapi.IsNotModified to check whether the returned error was
  72736. // because http.StatusNotModified was returned.
  72737. func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  72738. gensupport.SetOptions(c.urlParams_, opts...)
  72739. res, err := c.doRequest("json")
  72740. if res != nil && res.StatusCode == http.StatusNotModified {
  72741. if res.Body != nil {
  72742. res.Body.Close()
  72743. }
  72744. return nil, &googleapi.Error{
  72745. Code: res.StatusCode,
  72746. Header: res.Header,
  72747. }
  72748. }
  72749. if err != nil {
  72750. return nil, err
  72751. }
  72752. defer googleapi.CloseBody(res)
  72753. if err := googleapi.CheckResponse(res); err != nil {
  72754. return nil, err
  72755. }
  72756. ret := &InstanceGroupManager{
  72757. ServerResponse: googleapi.ServerResponse{
  72758. Header: res.Header,
  72759. HTTPStatusCode: res.StatusCode,
  72760. },
  72761. }
  72762. target := &ret
  72763. if err := gensupport.DecodeResponse(target, res); err != nil {
  72764. return nil, err
  72765. }
  72766. return ret, nil
  72767. // {
  72768. // "description": "Returns all of the details about the specified managed instance group.",
  72769. // "httpMethod": "GET",
  72770. // "id": "compute.regionInstanceGroupManagers.get",
  72771. // "parameterOrder": [
  72772. // "project",
  72773. // "region",
  72774. // "instanceGroupManager"
  72775. // ],
  72776. // "parameters": {
  72777. // "instanceGroupManager": {
  72778. // "description": "Name of the managed instance group to return.",
  72779. // "location": "path",
  72780. // "required": true,
  72781. // "type": "string"
  72782. // },
  72783. // "project": {
  72784. // "description": "Project ID for this request.",
  72785. // "location": "path",
  72786. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72787. // "required": true,
  72788. // "type": "string"
  72789. // },
  72790. // "region": {
  72791. // "description": "Name of the region scoping this request.",
  72792. // "location": "path",
  72793. // "required": true,
  72794. // "type": "string"
  72795. // }
  72796. // },
  72797. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  72798. // "response": {
  72799. // "$ref": "InstanceGroupManager"
  72800. // },
  72801. // "scopes": [
  72802. // "https://www.googleapis.com/auth/cloud-platform",
  72803. // "https://www.googleapis.com/auth/compute",
  72804. // "https://www.googleapis.com/auth/compute.readonly"
  72805. // ]
  72806. // }
  72807. }
  72808. // method id "compute.regionInstanceGroupManagers.insert":
  72809. type RegionInstanceGroupManagersInsertCall struct {
  72810. s *Service
  72811. project string
  72812. region string
  72813. instancegroupmanager *InstanceGroupManager
  72814. urlParams_ gensupport.URLParams
  72815. ctx_ context.Context
  72816. header_ http.Header
  72817. }
  72818. // Insert: Creates a managed instance group using the information that
  72819. // you specify in the request. After the group is created, instances in
  72820. // the group are created using the specified instance template. This
  72821. // operation is marked as DONE when the group is created even if the
  72822. // instances in the group have not yet been created. You must separately
  72823. // verify the status of the individual instances with the
  72824. // listmanagedinstances method.
  72825. //
  72826. // A regional managed instance group can contain up to 2000 instances.
  72827. func (r *RegionInstanceGroupManagersService) Insert(project string, region string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersInsertCall {
  72828. c := &RegionInstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72829. c.project = project
  72830. c.region = region
  72831. c.instancegroupmanager = instancegroupmanager
  72832. return c
  72833. }
  72834. // RequestId sets the optional parameter "requestId": An optional
  72835. // request ID to identify requests. Specify a unique request ID so that
  72836. // if you must retry your request, the server will know to ignore the
  72837. // request if it has already been completed.
  72838. //
  72839. // For example, consider a situation where you make an initial request
  72840. // and the request times out. If you make the request again with the
  72841. // same request ID, the server can check if original operation with the
  72842. // same request ID was received, and if so, will ignore the second
  72843. // request. This prevents clients from accidentally creating duplicate
  72844. // commitments.
  72845. //
  72846. // The request ID must be a valid UUID with the exception that zero UUID
  72847. // is not supported (00000000-0000-0000-0000-000000000000).
  72848. func (c *RegionInstanceGroupManagersInsertCall) RequestId(requestId string) *RegionInstanceGroupManagersInsertCall {
  72849. c.urlParams_.Set("requestId", requestId)
  72850. return c
  72851. }
  72852. // Fields allows partial responses to be retrieved. See
  72853. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72854. // for more information.
  72855. func (c *RegionInstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersInsertCall {
  72856. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72857. return c
  72858. }
  72859. // Context sets the context to be used in this call's Do method. Any
  72860. // pending HTTP request will be aborted if the provided context is
  72861. // canceled.
  72862. func (c *RegionInstanceGroupManagersInsertCall) Context(ctx context.Context) *RegionInstanceGroupManagersInsertCall {
  72863. c.ctx_ = ctx
  72864. return c
  72865. }
  72866. // Header returns an http.Header that can be modified by the caller to
  72867. // add HTTP headers to the request.
  72868. func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header {
  72869. if c.header_ == nil {
  72870. c.header_ = make(http.Header)
  72871. }
  72872. return c.header_
  72873. }
  72874. func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  72875. reqHeaders := make(http.Header)
  72876. for k, v := range c.header_ {
  72877. reqHeaders[k] = v
  72878. }
  72879. reqHeaders.Set("User-Agent", c.s.userAgent())
  72880. var body io.Reader = nil
  72881. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  72882. if err != nil {
  72883. return nil, err
  72884. }
  72885. reqHeaders.Set("Content-Type", "application/json")
  72886. c.urlParams_.Set("alt", alt)
  72887. c.urlParams_.Set("prettyPrint", "false")
  72888. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  72889. urls += "?" + c.urlParams_.Encode()
  72890. req, err := http.NewRequest("POST", urls, body)
  72891. if err != nil {
  72892. return nil, err
  72893. }
  72894. req.Header = reqHeaders
  72895. googleapi.Expand(req.URL, map[string]string{
  72896. "project": c.project,
  72897. "region": c.region,
  72898. })
  72899. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72900. }
  72901. // Do executes the "compute.regionInstanceGroupManagers.insert" call.
  72902. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72903. // status code is an error. Response headers are in either
  72904. // *Operation.ServerResponse.Header or (if a response was returned at
  72905. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72906. // to check whether the returned error was because
  72907. // http.StatusNotModified was returned.
  72908. func (c *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72909. gensupport.SetOptions(c.urlParams_, opts...)
  72910. res, err := c.doRequest("json")
  72911. if res != nil && res.StatusCode == http.StatusNotModified {
  72912. if res.Body != nil {
  72913. res.Body.Close()
  72914. }
  72915. return nil, &googleapi.Error{
  72916. Code: res.StatusCode,
  72917. Header: res.Header,
  72918. }
  72919. }
  72920. if err != nil {
  72921. return nil, err
  72922. }
  72923. defer googleapi.CloseBody(res)
  72924. if err := googleapi.CheckResponse(res); err != nil {
  72925. return nil, err
  72926. }
  72927. ret := &Operation{
  72928. ServerResponse: googleapi.ServerResponse{
  72929. Header: res.Header,
  72930. HTTPStatusCode: res.StatusCode,
  72931. },
  72932. }
  72933. target := &ret
  72934. if err := gensupport.DecodeResponse(target, res); err != nil {
  72935. return nil, err
  72936. }
  72937. return ret, nil
  72938. // {
  72939. // "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\n\nA regional managed instance group can contain up to 2000 instances.",
  72940. // "httpMethod": "POST",
  72941. // "id": "compute.regionInstanceGroupManagers.insert",
  72942. // "parameterOrder": [
  72943. // "project",
  72944. // "region"
  72945. // ],
  72946. // "parameters": {
  72947. // "project": {
  72948. // "description": "Project ID for this request.",
  72949. // "location": "path",
  72950. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72951. // "required": true,
  72952. // "type": "string"
  72953. // },
  72954. // "region": {
  72955. // "description": "Name of the region scoping this request.",
  72956. // "location": "path",
  72957. // "required": true,
  72958. // "type": "string"
  72959. // },
  72960. // "requestId": {
  72961. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72962. // "location": "query",
  72963. // "type": "string"
  72964. // }
  72965. // },
  72966. // "path": "{project}/regions/{region}/instanceGroupManagers",
  72967. // "request": {
  72968. // "$ref": "InstanceGroupManager"
  72969. // },
  72970. // "response": {
  72971. // "$ref": "Operation"
  72972. // },
  72973. // "scopes": [
  72974. // "https://www.googleapis.com/auth/cloud-platform",
  72975. // "https://www.googleapis.com/auth/compute"
  72976. // ]
  72977. // }
  72978. }
  72979. // method id "compute.regionInstanceGroupManagers.list":
  72980. type RegionInstanceGroupManagersListCall struct {
  72981. s *Service
  72982. project string
  72983. region string
  72984. urlParams_ gensupport.URLParams
  72985. ifNoneMatch_ string
  72986. ctx_ context.Context
  72987. header_ http.Header
  72988. }
  72989. // List: Retrieves the list of managed instance groups that are
  72990. // contained within the specified region.
  72991. func (r *RegionInstanceGroupManagersService) List(project string, region string) *RegionInstanceGroupManagersListCall {
  72992. c := &RegionInstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72993. c.project = project
  72994. c.region = region
  72995. return c
  72996. }
  72997. // Filter sets the optional parameter "filter": A filter expression that
  72998. // filters resources listed in the response. The expression must specify
  72999. // the field name, a comparison operator, and the value that you want to
  73000. // use for filtering. The value must be a string, a number, or a
  73001. // boolean. The comparison operator must be either =, !=, >, or <.
  73002. //
  73003. // For example, if you are filtering Compute Engine instances, you can
  73004. // exclude instances named example-instance by specifying name !=
  73005. // example-instance.
  73006. //
  73007. // You can also filter nested fields. For example, you could specify
  73008. // scheduling.automaticRestart = false to include instances only if they
  73009. // are not scheduled for automatic restarts. You can use filtering on
  73010. // nested fields to filter based on resource labels.
  73011. //
  73012. // To filter on multiple expressions, provide each separate expression
  73013. // within parentheses. For example, (scheduling.automaticRestart = true)
  73014. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  73015. // AND expression. However, you can include AND and OR expressions
  73016. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  73017. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  73018. // true).
  73019. func (c *RegionInstanceGroupManagersListCall) Filter(filter string) *RegionInstanceGroupManagersListCall {
  73020. c.urlParams_.Set("filter", filter)
  73021. return c
  73022. }
  73023. // MaxResults sets the optional parameter "maxResults": The maximum
  73024. // number of results per page that should be returned. If the number of
  73025. // available results is larger than maxResults, Compute Engine returns a
  73026. // nextPageToken that can be used to get the next page of results in
  73027. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  73028. // (Default: 500)
  73029. func (c *RegionInstanceGroupManagersListCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListCall {
  73030. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  73031. return c
  73032. }
  73033. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  73034. // a certain order. By default, results are returned in alphanumerical
  73035. // order based on the resource name.
  73036. //
  73037. // You can also sort results in descending order based on the creation
  73038. // timestamp using orderBy="creationTimestamp desc". This sorts results
  73039. // based on the creationTimestamp field in reverse chronological order
  73040. // (newest result first). Use this to sort resources like operations so
  73041. // that the newest operation is returned first.
  73042. //
  73043. // Currently, only sorting by name or creationTimestamp desc is
  73044. // supported.
  73045. func (c *RegionInstanceGroupManagersListCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListCall {
  73046. c.urlParams_.Set("orderBy", orderBy)
  73047. return c
  73048. }
  73049. // PageToken sets the optional parameter "pageToken": Specifies a page
  73050. // token to use. Set pageToken to the nextPageToken returned by a
  73051. // previous list request to get the next page of results.
  73052. func (c *RegionInstanceGroupManagersListCall) PageToken(pageToken string) *RegionInstanceGroupManagersListCall {
  73053. c.urlParams_.Set("pageToken", pageToken)
  73054. return c
  73055. }
  73056. // Fields allows partial responses to be retrieved. See
  73057. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73058. // for more information.
  73059. func (c *RegionInstanceGroupManagersListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListCall {
  73060. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73061. return c
  73062. }
  73063. // IfNoneMatch sets the optional parameter which makes the operation
  73064. // fail if the object's ETag matches the given value. This is useful for
  73065. // getting updates only after the object has changed since the last
  73066. // request. Use googleapi.IsNotModified to check whether the response
  73067. // error from Do is the result of In-None-Match.
  73068. func (c *RegionInstanceGroupManagersListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListCall {
  73069. c.ifNoneMatch_ = entityTag
  73070. return c
  73071. }
  73072. // Context sets the context to be used in this call's Do method. Any
  73073. // pending HTTP request will be aborted if the provided context is
  73074. // canceled.
  73075. func (c *RegionInstanceGroupManagersListCall) Context(ctx context.Context) *RegionInstanceGroupManagersListCall {
  73076. c.ctx_ = ctx
  73077. return c
  73078. }
  73079. // Header returns an http.Header that can be modified by the caller to
  73080. // add HTTP headers to the request.
  73081. func (c *RegionInstanceGroupManagersListCall) Header() http.Header {
  73082. if c.header_ == nil {
  73083. c.header_ = make(http.Header)
  73084. }
  73085. return c.header_
  73086. }
  73087. func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  73088. reqHeaders := make(http.Header)
  73089. for k, v := range c.header_ {
  73090. reqHeaders[k] = v
  73091. }
  73092. reqHeaders.Set("User-Agent", c.s.userAgent())
  73093. if c.ifNoneMatch_ != "" {
  73094. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73095. }
  73096. var body io.Reader = nil
  73097. c.urlParams_.Set("alt", alt)
  73098. c.urlParams_.Set("prettyPrint", "false")
  73099. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  73100. urls += "?" + c.urlParams_.Encode()
  73101. req, err := http.NewRequest("GET", urls, body)
  73102. if err != nil {
  73103. return nil, err
  73104. }
  73105. req.Header = reqHeaders
  73106. googleapi.Expand(req.URL, map[string]string{
  73107. "project": c.project,
  73108. "region": c.region,
  73109. })
  73110. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73111. }
  73112. // Do executes the "compute.regionInstanceGroupManagers.list" call.
  73113. // Exactly one of *RegionInstanceGroupManagerList or error will be
  73114. // non-nil. Any non-2xx status code is an error. Response headers are in
  73115. // either *RegionInstanceGroupManagerList.ServerResponse.Header or (if a
  73116. // response was returned at all) in error.(*googleapi.Error).Header. Use
  73117. // googleapi.IsNotModified to check whether the returned error was
  73118. // because http.StatusNotModified was returned.
  73119. func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagerList, error) {
  73120. gensupport.SetOptions(c.urlParams_, opts...)
  73121. res, err := c.doRequest("json")
  73122. if res != nil && res.StatusCode == http.StatusNotModified {
  73123. if res.Body != nil {
  73124. res.Body.Close()
  73125. }
  73126. return nil, &googleapi.Error{
  73127. Code: res.StatusCode,
  73128. Header: res.Header,
  73129. }
  73130. }
  73131. if err != nil {
  73132. return nil, err
  73133. }
  73134. defer googleapi.CloseBody(res)
  73135. if err := googleapi.CheckResponse(res); err != nil {
  73136. return nil, err
  73137. }
  73138. ret := &RegionInstanceGroupManagerList{
  73139. ServerResponse: googleapi.ServerResponse{
  73140. Header: res.Header,
  73141. HTTPStatusCode: res.StatusCode,
  73142. },
  73143. }
  73144. target := &ret
  73145. if err := gensupport.DecodeResponse(target, res); err != nil {
  73146. return nil, err
  73147. }
  73148. return ret, nil
  73149. // {
  73150. // "description": "Retrieves the list of managed instance groups that are contained within the specified region.",
  73151. // "httpMethod": "GET",
  73152. // "id": "compute.regionInstanceGroupManagers.list",
  73153. // "parameterOrder": [
  73154. // "project",
  73155. // "region"
  73156. // ],
  73157. // "parameters": {
  73158. // "filter": {
  73159. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  73160. // "location": "query",
  73161. // "type": "string"
  73162. // },
  73163. // "maxResults": {
  73164. // "default": "500",
  73165. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  73166. // "format": "uint32",
  73167. // "location": "query",
  73168. // "minimum": "0",
  73169. // "type": "integer"
  73170. // },
  73171. // "orderBy": {
  73172. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  73173. // "location": "query",
  73174. // "type": "string"
  73175. // },
  73176. // "pageToken": {
  73177. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  73178. // "location": "query",
  73179. // "type": "string"
  73180. // },
  73181. // "project": {
  73182. // "description": "Project ID for this request.",
  73183. // "location": "path",
  73184. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73185. // "required": true,
  73186. // "type": "string"
  73187. // },
  73188. // "region": {
  73189. // "description": "Name of the region scoping this request.",
  73190. // "location": "path",
  73191. // "required": true,
  73192. // "type": "string"
  73193. // }
  73194. // },
  73195. // "path": "{project}/regions/{region}/instanceGroupManagers",
  73196. // "response": {
  73197. // "$ref": "RegionInstanceGroupManagerList"
  73198. // },
  73199. // "scopes": [
  73200. // "https://www.googleapis.com/auth/cloud-platform",
  73201. // "https://www.googleapis.com/auth/compute",
  73202. // "https://www.googleapis.com/auth/compute.readonly"
  73203. // ]
  73204. // }
  73205. }
  73206. // Pages invokes f for each page of results.
  73207. // A non-nil error returned from f will halt the iteration.
  73208. // The provided context supersedes any context provided to the Context method.
  73209. func (c *RegionInstanceGroupManagersListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagerList) error) error {
  73210. c.ctx_ = ctx
  73211. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  73212. for {
  73213. x, err := c.Do()
  73214. if err != nil {
  73215. return err
  73216. }
  73217. if err := f(x); err != nil {
  73218. return err
  73219. }
  73220. if x.NextPageToken == "" {
  73221. return nil
  73222. }
  73223. c.PageToken(x.NextPageToken)
  73224. }
  73225. }
  73226. // method id "compute.regionInstanceGroupManagers.listManagedInstances":
  73227. type RegionInstanceGroupManagersListManagedInstancesCall struct {
  73228. s *Service
  73229. project string
  73230. region string
  73231. instanceGroupManager string
  73232. urlParams_ gensupport.URLParams
  73233. ctx_ context.Context
  73234. header_ http.Header
  73235. }
  73236. // ListManagedInstances: Lists the instances in the managed instance
  73237. // group and instances that are scheduled to be created. The list
  73238. // includes any current actions that the group has scheduled for its
  73239. // instances.
  73240. func (r *RegionInstanceGroupManagersService) ListManagedInstances(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListManagedInstancesCall {
  73241. c := &RegionInstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73242. c.project = project
  73243. c.region = region
  73244. c.instanceGroupManager = instanceGroupManager
  73245. return c
  73246. }
  73247. // Filter sets the optional parameter "filter": A filter expression that
  73248. // filters resources listed in the response. The expression must specify
  73249. // the field name, a comparison operator, and the value that you want to
  73250. // use for filtering. The value must be a string, a number, or a
  73251. // boolean. The comparison operator must be either =, !=, >, or <.
  73252. //
  73253. // For example, if you are filtering Compute Engine instances, you can
  73254. // exclude instances named example-instance by specifying name !=
  73255. // example-instance.
  73256. //
  73257. // You can also filter nested fields. For example, you could specify
  73258. // scheduling.automaticRestart = false to include instances only if they
  73259. // are not scheduled for automatic restarts. You can use filtering on
  73260. // nested fields to filter based on resource labels.
  73261. //
  73262. // To filter on multiple expressions, provide each separate expression
  73263. // within parentheses. For example, (scheduling.automaticRestart = true)
  73264. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  73265. // AND expression. However, you can include AND and OR expressions
  73266. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  73267. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  73268. // true).
  73269. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Filter(filter string) *RegionInstanceGroupManagersListManagedInstancesCall {
  73270. c.urlParams_.Set("filter", filter)
  73271. return c
  73272. }
  73273. // MaxResults sets the optional parameter "maxResults": The maximum
  73274. // number of results per page that should be returned. If the number of
  73275. // available results is larger than maxResults, Compute Engine returns a
  73276. // nextPageToken that can be used to get the next page of results in
  73277. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  73278. // (Default: 500)
  73279. func (c *RegionInstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListManagedInstancesCall {
  73280. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  73281. return c
  73282. }
  73283. // OrderBy sets the optional parameter "order_by": Sorts list results by
  73284. // a certain order. By default, results are returned in alphanumerical
  73285. // order based on the resource name.
  73286. //
  73287. // You can also sort results in descending order based on the creation
  73288. // timestamp using orderBy="creationTimestamp desc". This sorts results
  73289. // based on the creationTimestamp field in reverse chronological order
  73290. // (newest result first). Use this to sort resources like operations so
  73291. // that the newest operation is returned first.
  73292. //
  73293. // Currently, only sorting by name or creationTimestamp desc is
  73294. // supported.
  73295. func (c *RegionInstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListManagedInstancesCall {
  73296. c.urlParams_.Set("order_by", orderBy)
  73297. return c
  73298. }
  73299. // PageToken sets the optional parameter "pageToken": Specifies a page
  73300. // token to use. Set pageToken to the nextPageToken returned by a
  73301. // previous list request to get the next page of results.
  73302. func (c *RegionInstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *RegionInstanceGroupManagersListManagedInstancesCall {
  73303. c.urlParams_.Set("pageToken", pageToken)
  73304. return c
  73305. }
  73306. // Fields allows partial responses to be retrieved. See
  73307. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73308. // for more information.
  73309. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListManagedInstancesCall {
  73310. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73311. return c
  73312. }
  73313. // Context sets the context to be used in this call's Do method. Any
  73314. // pending HTTP request will be aborted if the provided context is
  73315. // canceled.
  73316. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersListManagedInstancesCall {
  73317. c.ctx_ = ctx
  73318. return c
  73319. }
  73320. // Header returns an http.Header that can be modified by the caller to
  73321. // add HTTP headers to the request.
  73322. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  73323. if c.header_ == nil {
  73324. c.header_ = make(http.Header)
  73325. }
  73326. return c.header_
  73327. }
  73328. func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  73329. reqHeaders := make(http.Header)
  73330. for k, v := range c.header_ {
  73331. reqHeaders[k] = v
  73332. }
  73333. reqHeaders.Set("User-Agent", c.s.userAgent())
  73334. var body io.Reader = nil
  73335. c.urlParams_.Set("alt", alt)
  73336. c.urlParams_.Set("prettyPrint", "false")
  73337. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  73338. urls += "?" + c.urlParams_.Encode()
  73339. req, err := http.NewRequest("POST", urls, body)
  73340. if err != nil {
  73341. return nil, err
  73342. }
  73343. req.Header = reqHeaders
  73344. googleapi.Expand(req.URL, map[string]string{
  73345. "project": c.project,
  73346. "region": c.region,
  73347. "instanceGroupManager": c.instanceGroupManager,
  73348. })
  73349. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73350. }
  73351. // Do executes the "compute.regionInstanceGroupManagers.listManagedInstances" call.
  73352. // Exactly one of *RegionInstanceGroupManagersListInstancesResponse or
  73353. // error will be non-nil. Any non-2xx status code is an error. Response
  73354. // headers are in either
  73355. // *RegionInstanceGroupManagersListInstancesResponse.ServerResponse.Heade
  73356. // r or (if a response was returned at all) in
  73357. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  73358. // whether the returned error was because http.StatusNotModified was
  73359. // returned.
  73360. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstancesResponse, error) {
  73361. gensupport.SetOptions(c.urlParams_, opts...)
  73362. res, err := c.doRequest("json")
  73363. if res != nil && res.StatusCode == http.StatusNotModified {
  73364. if res.Body != nil {
  73365. res.Body.Close()
  73366. }
  73367. return nil, &googleapi.Error{
  73368. Code: res.StatusCode,
  73369. Header: res.Header,
  73370. }
  73371. }
  73372. if err != nil {
  73373. return nil, err
  73374. }
  73375. defer googleapi.CloseBody(res)
  73376. if err := googleapi.CheckResponse(res); err != nil {
  73377. return nil, err
  73378. }
  73379. ret := &RegionInstanceGroupManagersListInstancesResponse{
  73380. ServerResponse: googleapi.ServerResponse{
  73381. Header: res.Header,
  73382. HTTPStatusCode: res.StatusCode,
  73383. },
  73384. }
  73385. target := &ret
  73386. if err := gensupport.DecodeResponse(target, res); err != nil {
  73387. return nil, err
  73388. }
  73389. return ret, nil
  73390. // {
  73391. // "description": "Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances.",
  73392. // "httpMethod": "POST",
  73393. // "id": "compute.regionInstanceGroupManagers.listManagedInstances",
  73394. // "parameterOrder": [
  73395. // "project",
  73396. // "region",
  73397. // "instanceGroupManager"
  73398. // ],
  73399. // "parameters": {
  73400. // "filter": {
  73401. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  73402. // "location": "query",
  73403. // "type": "string"
  73404. // },
  73405. // "instanceGroupManager": {
  73406. // "description": "The name of the managed instance group.",
  73407. // "location": "path",
  73408. // "required": true,
  73409. // "type": "string"
  73410. // },
  73411. // "maxResults": {
  73412. // "default": "500",
  73413. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  73414. // "format": "uint32",
  73415. // "location": "query",
  73416. // "minimum": "0",
  73417. // "type": "integer"
  73418. // },
  73419. // "order_by": {
  73420. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  73421. // "location": "query",
  73422. // "type": "string"
  73423. // },
  73424. // "pageToken": {
  73425. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  73426. // "location": "query",
  73427. // "type": "string"
  73428. // },
  73429. // "project": {
  73430. // "description": "Project ID for this request.",
  73431. // "location": "path",
  73432. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73433. // "required": true,
  73434. // "type": "string"
  73435. // },
  73436. // "region": {
  73437. // "description": "Name of the region scoping this request.",
  73438. // "location": "path",
  73439. // "required": true,
  73440. // "type": "string"
  73441. // }
  73442. // },
  73443. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  73444. // "response": {
  73445. // "$ref": "RegionInstanceGroupManagersListInstancesResponse"
  73446. // },
  73447. // "scopes": [
  73448. // "https://www.googleapis.com/auth/cloud-platform",
  73449. // "https://www.googleapis.com/auth/compute",
  73450. // "https://www.googleapis.com/auth/compute.readonly"
  73451. // ]
  73452. // }
  73453. }
  73454. // method id "compute.regionInstanceGroupManagers.patch":
  73455. type RegionInstanceGroupManagersPatchCall struct {
  73456. s *Service
  73457. project string
  73458. region string
  73459. instanceGroupManager string
  73460. instancegroupmanager *InstanceGroupManager
  73461. urlParams_ gensupport.URLParams
  73462. ctx_ context.Context
  73463. header_ http.Header
  73464. }
  73465. // Patch: Updates a managed instance group using the information that
  73466. // you specify in the request. This operation is marked as DONE when the
  73467. // group is patched even if the instances in the group are still in the
  73468. // process of being patched. You must separately verify the status of
  73469. // the individual instances with the listmanagedinstances method. This
  73470. // method supports PATCH semantics and uses the JSON merge patch format
  73471. // and processing rules.
  73472. func (r *RegionInstanceGroupManagersService) Patch(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersPatchCall {
  73473. c := &RegionInstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73474. c.project = project
  73475. c.region = region
  73476. c.instanceGroupManager = instanceGroupManager
  73477. c.instancegroupmanager = instancegroupmanager
  73478. return c
  73479. }
  73480. // RequestId sets the optional parameter "requestId": An optional
  73481. // request ID to identify requests. Specify a unique request ID so that
  73482. // if you must retry your request, the server will know to ignore the
  73483. // request if it has already been completed.
  73484. //
  73485. // For example, consider a situation where you make an initial request
  73486. // and the request times out. If you make the request again with the
  73487. // same request ID, the server can check if original operation with the
  73488. // same request ID was received, and if so, will ignore the second
  73489. // request. This prevents clients from accidentally creating duplicate
  73490. // commitments.
  73491. //
  73492. // The request ID must be a valid UUID with the exception that zero UUID
  73493. // is not supported (00000000-0000-0000-0000-000000000000).
  73494. func (c *RegionInstanceGroupManagersPatchCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchCall {
  73495. c.urlParams_.Set("requestId", requestId)
  73496. return c
  73497. }
  73498. // Fields allows partial responses to be retrieved. See
  73499. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73500. // for more information.
  73501. func (c *RegionInstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchCall {
  73502. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73503. return c
  73504. }
  73505. // Context sets the context to be used in this call's Do method. Any
  73506. // pending HTTP request will be aborted if the provided context is
  73507. // canceled.
  73508. func (c *RegionInstanceGroupManagersPatchCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchCall {
  73509. c.ctx_ = ctx
  73510. return c
  73511. }
  73512. // Header returns an http.Header that can be modified by the caller to
  73513. // add HTTP headers to the request.
  73514. func (c *RegionInstanceGroupManagersPatchCall) Header() http.Header {
  73515. if c.header_ == nil {
  73516. c.header_ = make(http.Header)
  73517. }
  73518. return c.header_
  73519. }
  73520. func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  73521. reqHeaders := make(http.Header)
  73522. for k, v := range c.header_ {
  73523. reqHeaders[k] = v
  73524. }
  73525. reqHeaders.Set("User-Agent", c.s.userAgent())
  73526. var body io.Reader = nil
  73527. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  73528. if err != nil {
  73529. return nil, err
  73530. }
  73531. reqHeaders.Set("Content-Type", "application/json")
  73532. c.urlParams_.Set("alt", alt)
  73533. c.urlParams_.Set("prettyPrint", "false")
  73534. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  73535. urls += "?" + c.urlParams_.Encode()
  73536. req, err := http.NewRequest("PATCH", urls, body)
  73537. if err != nil {
  73538. return nil, err
  73539. }
  73540. req.Header = reqHeaders
  73541. googleapi.Expand(req.URL, map[string]string{
  73542. "project": c.project,
  73543. "region": c.region,
  73544. "instanceGroupManager": c.instanceGroupManager,
  73545. })
  73546. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73547. }
  73548. // Do executes the "compute.regionInstanceGroupManagers.patch" call.
  73549. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73550. // status code is an error. Response headers are in either
  73551. // *Operation.ServerResponse.Header or (if a response was returned at
  73552. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73553. // to check whether the returned error was because
  73554. // http.StatusNotModified was returned.
  73555. func (c *RegionInstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73556. gensupport.SetOptions(c.urlParams_, opts...)
  73557. res, err := c.doRequest("json")
  73558. if res != nil && res.StatusCode == http.StatusNotModified {
  73559. if res.Body != nil {
  73560. res.Body.Close()
  73561. }
  73562. return nil, &googleapi.Error{
  73563. Code: res.StatusCode,
  73564. Header: res.Header,
  73565. }
  73566. }
  73567. if err != nil {
  73568. return nil, err
  73569. }
  73570. defer googleapi.CloseBody(res)
  73571. if err := googleapi.CheckResponse(res); err != nil {
  73572. return nil, err
  73573. }
  73574. ret := &Operation{
  73575. ServerResponse: googleapi.ServerResponse{
  73576. Header: res.Header,
  73577. HTTPStatusCode: res.StatusCode,
  73578. },
  73579. }
  73580. target := &ret
  73581. if err := gensupport.DecodeResponse(target, res); err != nil {
  73582. return nil, err
  73583. }
  73584. return ret, nil
  73585. // {
  73586. // "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  73587. // "httpMethod": "PATCH",
  73588. // "id": "compute.regionInstanceGroupManagers.patch",
  73589. // "parameterOrder": [
  73590. // "project",
  73591. // "region",
  73592. // "instanceGroupManager"
  73593. // ],
  73594. // "parameters": {
  73595. // "instanceGroupManager": {
  73596. // "description": "The name of the instance group manager.",
  73597. // "location": "path",
  73598. // "required": true,
  73599. // "type": "string"
  73600. // },
  73601. // "project": {
  73602. // "description": "Project ID for this request.",
  73603. // "location": "path",
  73604. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73605. // "required": true,
  73606. // "type": "string"
  73607. // },
  73608. // "region": {
  73609. // "description": "Name of the region scoping this request.",
  73610. // "location": "path",
  73611. // "required": true,
  73612. // "type": "string"
  73613. // },
  73614. // "requestId": {
  73615. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73616. // "location": "query",
  73617. // "type": "string"
  73618. // }
  73619. // },
  73620. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  73621. // "request": {
  73622. // "$ref": "InstanceGroupManager"
  73623. // },
  73624. // "response": {
  73625. // "$ref": "Operation"
  73626. // },
  73627. // "scopes": [
  73628. // "https://www.googleapis.com/auth/cloud-platform",
  73629. // "https://www.googleapis.com/auth/compute"
  73630. // ]
  73631. // }
  73632. }
  73633. // method id "compute.regionInstanceGroupManagers.recreateInstances":
  73634. type RegionInstanceGroupManagersRecreateInstancesCall struct {
  73635. s *Service
  73636. project string
  73637. region string
  73638. instanceGroupManager string
  73639. regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest
  73640. urlParams_ gensupport.URLParams
  73641. ctx_ context.Context
  73642. header_ http.Header
  73643. }
  73644. // RecreateInstances: Flags the specified instances in the managed
  73645. // instance group to be immediately recreated. The instances are deleted
  73646. // and recreated using the current instance template for the managed
  73647. // instance group. This operation is marked as DONE when the flag is set
  73648. // even if the instances have not yet been recreated. You must
  73649. // separately verify the status of the recreating action with the
  73650. // listmanagedinstances method.
  73651. //
  73652. // If the group is part of a backend service that has enabled connection
  73653. // draining, it can take up to 60 seconds after the connection draining
  73654. // duration has elapsed before the VM instance is removed or
  73655. // deleted.
  73656. //
  73657. // You can specify a maximum of 1000 instances with this method per
  73658. // request.
  73659. func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest) *RegionInstanceGroupManagersRecreateInstancesCall {
  73660. c := &RegionInstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73661. c.project = project
  73662. c.region = region
  73663. c.instanceGroupManager = instanceGroupManager
  73664. c.regioninstancegroupmanagersrecreaterequest = regioninstancegroupmanagersrecreaterequest
  73665. return c
  73666. }
  73667. // RequestId sets the optional parameter "requestId": An optional
  73668. // request ID to identify requests. Specify a unique request ID so that
  73669. // if you must retry your request, the server will know to ignore the
  73670. // request if it has already been completed.
  73671. //
  73672. // For example, consider a situation where you make an initial request
  73673. // and the request times out. If you make the request again with the
  73674. // same request ID, the server can check if original operation with the
  73675. // same request ID was received, and if so, will ignore the second
  73676. // request. This prevents clients from accidentally creating duplicate
  73677. // commitments.
  73678. //
  73679. // The request ID must be a valid UUID with the exception that zero UUID
  73680. // is not supported (00000000-0000-0000-0000-000000000000).
  73681. func (c *RegionInstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersRecreateInstancesCall {
  73682. c.urlParams_.Set("requestId", requestId)
  73683. return c
  73684. }
  73685. // Fields allows partial responses to be retrieved. See
  73686. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73687. // for more information.
  73688. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersRecreateInstancesCall {
  73689. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73690. return c
  73691. }
  73692. // Context sets the context to be used in this call's Do method. Any
  73693. // pending HTTP request will be aborted if the provided context is
  73694. // canceled.
  73695. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersRecreateInstancesCall {
  73696. c.ctx_ = ctx
  73697. return c
  73698. }
  73699. // Header returns an http.Header that can be modified by the caller to
  73700. // add HTTP headers to the request.
  73701. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  73702. if c.header_ == nil {
  73703. c.header_ = make(http.Header)
  73704. }
  73705. return c.header_
  73706. }
  73707. func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  73708. reqHeaders := make(http.Header)
  73709. for k, v := range c.header_ {
  73710. reqHeaders[k] = v
  73711. }
  73712. reqHeaders.Set("User-Agent", c.s.userAgent())
  73713. var body io.Reader = nil
  73714. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest)
  73715. if err != nil {
  73716. return nil, err
  73717. }
  73718. reqHeaders.Set("Content-Type", "application/json")
  73719. c.urlParams_.Set("alt", alt)
  73720. c.urlParams_.Set("prettyPrint", "false")
  73721. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  73722. urls += "?" + c.urlParams_.Encode()
  73723. req, err := http.NewRequest("POST", urls, body)
  73724. if err != nil {
  73725. return nil, err
  73726. }
  73727. req.Header = reqHeaders
  73728. googleapi.Expand(req.URL, map[string]string{
  73729. "project": c.project,
  73730. "region": c.region,
  73731. "instanceGroupManager": c.instanceGroupManager,
  73732. })
  73733. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73734. }
  73735. // Do executes the "compute.regionInstanceGroupManagers.recreateInstances" call.
  73736. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73737. // status code is an error. Response headers are in either
  73738. // *Operation.ServerResponse.Header or (if a response was returned at
  73739. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73740. // to check whether the returned error was because
  73741. // http.StatusNotModified was returned.
  73742. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73743. gensupport.SetOptions(c.urlParams_, opts...)
  73744. res, err := c.doRequest("json")
  73745. if res != nil && res.StatusCode == http.StatusNotModified {
  73746. if res.Body != nil {
  73747. res.Body.Close()
  73748. }
  73749. return nil, &googleapi.Error{
  73750. Code: res.StatusCode,
  73751. Header: res.Header,
  73752. }
  73753. }
  73754. if err != nil {
  73755. return nil, err
  73756. }
  73757. defer googleapi.CloseBody(res)
  73758. if err := googleapi.CheckResponse(res); err != nil {
  73759. return nil, err
  73760. }
  73761. ret := &Operation{
  73762. ServerResponse: googleapi.ServerResponse{
  73763. Header: res.Header,
  73764. HTTPStatusCode: res.StatusCode,
  73765. },
  73766. }
  73767. target := &ret
  73768. if err := gensupport.DecodeResponse(target, res); err != nil {
  73769. return nil, err
  73770. }
  73771. return ret, nil
  73772. // {
  73773. // "description": "Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  73774. // "httpMethod": "POST",
  73775. // "id": "compute.regionInstanceGroupManagers.recreateInstances",
  73776. // "parameterOrder": [
  73777. // "project",
  73778. // "region",
  73779. // "instanceGroupManager"
  73780. // ],
  73781. // "parameters": {
  73782. // "instanceGroupManager": {
  73783. // "description": "Name of the managed instance group.",
  73784. // "location": "path",
  73785. // "required": true,
  73786. // "type": "string"
  73787. // },
  73788. // "project": {
  73789. // "description": "Project ID for this request.",
  73790. // "location": "path",
  73791. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73792. // "required": true,
  73793. // "type": "string"
  73794. // },
  73795. // "region": {
  73796. // "description": "Name of the region scoping this request.",
  73797. // "location": "path",
  73798. // "required": true,
  73799. // "type": "string"
  73800. // },
  73801. // "requestId": {
  73802. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73803. // "location": "query",
  73804. // "type": "string"
  73805. // }
  73806. // },
  73807. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  73808. // "request": {
  73809. // "$ref": "RegionInstanceGroupManagersRecreateRequest"
  73810. // },
  73811. // "response": {
  73812. // "$ref": "Operation"
  73813. // },
  73814. // "scopes": [
  73815. // "https://www.googleapis.com/auth/cloud-platform",
  73816. // "https://www.googleapis.com/auth/compute"
  73817. // ]
  73818. // }
  73819. }
  73820. // method id "compute.regionInstanceGroupManagers.resize":
  73821. type RegionInstanceGroupManagersResizeCall struct {
  73822. s *Service
  73823. project string
  73824. region string
  73825. instanceGroupManager string
  73826. urlParams_ gensupport.URLParams
  73827. ctx_ context.Context
  73828. header_ http.Header
  73829. }
  73830. // Resize: Changes the intended size of the managed instance group. If
  73831. // you increase the size, the group creates new instances using the
  73832. // current instance template. If you decrease the size, the group
  73833. // deletes one or more instances.
  73834. //
  73835. // The resize operation is marked DONE if the resize request is
  73836. // successful. The underlying actions take additional time. You must
  73837. // separately verify the status of the creating or deleting actions with
  73838. // the listmanagedinstances method.
  73839. //
  73840. // If the group is part of a backend service that has enabled connection
  73841. // draining, it can take up to 60 seconds after the connection draining
  73842. // duration has elapsed before the VM instance is removed or deleted.
  73843. func (r *RegionInstanceGroupManagersService) Resize(project string, region string, instanceGroupManager string, size int64) *RegionInstanceGroupManagersResizeCall {
  73844. c := &RegionInstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73845. c.project = project
  73846. c.region = region
  73847. c.instanceGroupManager = instanceGroupManager
  73848. c.urlParams_.Set("size", fmt.Sprint(size))
  73849. return c
  73850. }
  73851. // RequestId sets the optional parameter "requestId": An optional
  73852. // request ID to identify requests. Specify a unique request ID so that
  73853. // if you must retry your request, the server will know to ignore the
  73854. // request if it has already been completed.
  73855. //
  73856. // For example, consider a situation where you make an initial request
  73857. // and the request times out. If you make the request again with the
  73858. // same request ID, the server can check if original operation with the
  73859. // same request ID was received, and if so, will ignore the second
  73860. // request. This prevents clients from accidentally creating duplicate
  73861. // commitments.
  73862. //
  73863. // The request ID must be a valid UUID with the exception that zero UUID
  73864. // is not supported (00000000-0000-0000-0000-000000000000).
  73865. func (c *RegionInstanceGroupManagersResizeCall) RequestId(requestId string) *RegionInstanceGroupManagersResizeCall {
  73866. c.urlParams_.Set("requestId", requestId)
  73867. return c
  73868. }
  73869. // Fields allows partial responses to be retrieved. See
  73870. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73871. // for more information.
  73872. func (c *RegionInstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResizeCall {
  73873. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73874. return c
  73875. }
  73876. // Context sets the context to be used in this call's Do method. Any
  73877. // pending HTTP request will be aborted if the provided context is
  73878. // canceled.
  73879. func (c *RegionInstanceGroupManagersResizeCall) Context(ctx context.Context) *RegionInstanceGroupManagersResizeCall {
  73880. c.ctx_ = ctx
  73881. return c
  73882. }
  73883. // Header returns an http.Header that can be modified by the caller to
  73884. // add HTTP headers to the request.
  73885. func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header {
  73886. if c.header_ == nil {
  73887. c.header_ = make(http.Header)
  73888. }
  73889. return c.header_
  73890. }
  73891. func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  73892. reqHeaders := make(http.Header)
  73893. for k, v := range c.header_ {
  73894. reqHeaders[k] = v
  73895. }
  73896. reqHeaders.Set("User-Agent", c.s.userAgent())
  73897. var body io.Reader = nil
  73898. c.urlParams_.Set("alt", alt)
  73899. c.urlParams_.Set("prettyPrint", "false")
  73900. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")
  73901. urls += "?" + c.urlParams_.Encode()
  73902. req, err := http.NewRequest("POST", urls, body)
  73903. if err != nil {
  73904. return nil, err
  73905. }
  73906. req.Header = reqHeaders
  73907. googleapi.Expand(req.URL, map[string]string{
  73908. "project": c.project,
  73909. "region": c.region,
  73910. "instanceGroupManager": c.instanceGroupManager,
  73911. })
  73912. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73913. }
  73914. // Do executes the "compute.regionInstanceGroupManagers.resize" call.
  73915. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73916. // status code is an error. Response headers are in either
  73917. // *Operation.ServerResponse.Header or (if a response was returned at
  73918. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73919. // to check whether the returned error was because
  73920. // http.StatusNotModified was returned.
  73921. func (c *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73922. gensupport.SetOptions(c.urlParams_, opts...)
  73923. res, err := c.doRequest("json")
  73924. if res != nil && res.StatusCode == http.StatusNotModified {
  73925. if res.Body != nil {
  73926. res.Body.Close()
  73927. }
  73928. return nil, &googleapi.Error{
  73929. Code: res.StatusCode,
  73930. Header: res.Header,
  73931. }
  73932. }
  73933. if err != nil {
  73934. return nil, err
  73935. }
  73936. defer googleapi.CloseBody(res)
  73937. if err := googleapi.CheckResponse(res); err != nil {
  73938. return nil, err
  73939. }
  73940. ret := &Operation{
  73941. ServerResponse: googleapi.ServerResponse{
  73942. Header: res.Header,
  73943. HTTPStatusCode: res.StatusCode,
  73944. },
  73945. }
  73946. target := &ret
  73947. if err := gensupport.DecodeResponse(target, res); err != nil {
  73948. return nil, err
  73949. }
  73950. return ret, nil
  73951. // {
  73952. // "description": "Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances.\n\nThe resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.",
  73953. // "httpMethod": "POST",
  73954. // "id": "compute.regionInstanceGroupManagers.resize",
  73955. // "parameterOrder": [
  73956. // "project",
  73957. // "region",
  73958. // "instanceGroupManager",
  73959. // "size"
  73960. // ],
  73961. // "parameters": {
  73962. // "instanceGroupManager": {
  73963. // "description": "Name of the managed instance group.",
  73964. // "location": "path",
  73965. // "required": true,
  73966. // "type": "string"
  73967. // },
  73968. // "project": {
  73969. // "description": "Project ID for this request.",
  73970. // "location": "path",
  73971. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73972. // "required": true,
  73973. // "type": "string"
  73974. // },
  73975. // "region": {
  73976. // "description": "Name of the region scoping this request.",
  73977. // "location": "path",
  73978. // "required": true,
  73979. // "type": "string"
  73980. // },
  73981. // "requestId": {
  73982. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73983. // "location": "query",
  73984. // "type": "string"
  73985. // },
  73986. // "size": {
  73987. // "description": "Number of instances that should exist in this instance group manager.",
  73988. // "format": "int32",
  73989. // "location": "query",
  73990. // "minimum": "0",
  73991. // "required": true,
  73992. // "type": "integer"
  73993. // }
  73994. // },
  73995. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize",
  73996. // "response": {
  73997. // "$ref": "Operation"
  73998. // },
  73999. // "scopes": [
  74000. // "https://www.googleapis.com/auth/cloud-platform",
  74001. // "https://www.googleapis.com/auth/compute"
  74002. // ]
  74003. // }
  74004. }
  74005. // method id "compute.regionInstanceGroupManagers.setInstanceTemplate":
  74006. type RegionInstanceGroupManagersSetInstanceTemplateCall struct {
  74007. s *Service
  74008. project string
  74009. region string
  74010. instanceGroupManager string
  74011. regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest
  74012. urlParams_ gensupport.URLParams
  74013. ctx_ context.Context
  74014. header_ http.Header
  74015. }
  74016. // SetInstanceTemplate: Sets the instance template to use when creating
  74017. // new instances or recreating instances in this group. Existing
  74018. // instances are not affected.
  74019. func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  74020. c := &RegionInstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74021. c.project = project
  74022. c.region = region
  74023. c.instanceGroupManager = instanceGroupManager
  74024. c.regioninstancegroupmanagerssettemplaterequest = regioninstancegroupmanagerssettemplaterequest
  74025. return c
  74026. }
  74027. // RequestId sets the optional parameter "requestId": An optional
  74028. // request ID to identify requests. Specify a unique request ID so that
  74029. // if you must retry your request, the server will know to ignore the
  74030. // request if it has already been completed.
  74031. //
  74032. // For example, consider a situation where you make an initial request
  74033. // and the request times out. If you make the request again with the
  74034. // same request ID, the server can check if original operation with the
  74035. // same request ID was received, and if so, will ignore the second
  74036. // request. This prevents clients from accidentally creating duplicate
  74037. // commitments.
  74038. //
  74039. // The request ID must be a valid UUID with the exception that zero UUID
  74040. // is not supported (00000000-0000-0000-0000-000000000000).
  74041. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  74042. c.urlParams_.Set("requestId", requestId)
  74043. return c
  74044. }
  74045. // Fields allows partial responses to be retrieved. See
  74046. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74047. // for more information.
  74048. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  74049. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74050. return c
  74051. }
  74052. // Context sets the context to be used in this call's Do method. Any
  74053. // pending HTTP request will be aborted if the provided context is
  74054. // canceled.
  74055. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  74056. c.ctx_ = ctx
  74057. return c
  74058. }
  74059. // Header returns an http.Header that can be modified by the caller to
  74060. // add HTTP headers to the request.
  74061. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  74062. if c.header_ == nil {
  74063. c.header_ = make(http.Header)
  74064. }
  74065. return c.header_
  74066. }
  74067. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  74068. reqHeaders := make(http.Header)
  74069. for k, v := range c.header_ {
  74070. reqHeaders[k] = v
  74071. }
  74072. reqHeaders.Set("User-Agent", c.s.userAgent())
  74073. var body io.Reader = nil
  74074. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest)
  74075. if err != nil {
  74076. return nil, err
  74077. }
  74078. reqHeaders.Set("Content-Type", "application/json")
  74079. c.urlParams_.Set("alt", alt)
  74080. c.urlParams_.Set("prettyPrint", "false")
  74081. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  74082. urls += "?" + c.urlParams_.Encode()
  74083. req, err := http.NewRequest("POST", urls, body)
  74084. if err != nil {
  74085. return nil, err
  74086. }
  74087. req.Header = reqHeaders
  74088. googleapi.Expand(req.URL, map[string]string{
  74089. "project": c.project,
  74090. "region": c.region,
  74091. "instanceGroupManager": c.instanceGroupManager,
  74092. })
  74093. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74094. }
  74095. // Do executes the "compute.regionInstanceGroupManagers.setInstanceTemplate" call.
  74096. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74097. // status code is an error. Response headers are in either
  74098. // *Operation.ServerResponse.Header or (if a response was returned at
  74099. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74100. // to check whether the returned error was because
  74101. // http.StatusNotModified was returned.
  74102. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74103. gensupport.SetOptions(c.urlParams_, opts...)
  74104. res, err := c.doRequest("json")
  74105. if res != nil && res.StatusCode == http.StatusNotModified {
  74106. if res.Body != nil {
  74107. res.Body.Close()
  74108. }
  74109. return nil, &googleapi.Error{
  74110. Code: res.StatusCode,
  74111. Header: res.Header,
  74112. }
  74113. }
  74114. if err != nil {
  74115. return nil, err
  74116. }
  74117. defer googleapi.CloseBody(res)
  74118. if err := googleapi.CheckResponse(res); err != nil {
  74119. return nil, err
  74120. }
  74121. ret := &Operation{
  74122. ServerResponse: googleapi.ServerResponse{
  74123. Header: res.Header,
  74124. HTTPStatusCode: res.StatusCode,
  74125. },
  74126. }
  74127. target := &ret
  74128. if err := gensupport.DecodeResponse(target, res); err != nil {
  74129. return nil, err
  74130. }
  74131. return ret, nil
  74132. // {
  74133. // "description": "Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.",
  74134. // "httpMethod": "POST",
  74135. // "id": "compute.regionInstanceGroupManagers.setInstanceTemplate",
  74136. // "parameterOrder": [
  74137. // "project",
  74138. // "region",
  74139. // "instanceGroupManager"
  74140. // ],
  74141. // "parameters": {
  74142. // "instanceGroupManager": {
  74143. // "description": "The name of the managed instance group.",
  74144. // "location": "path",
  74145. // "required": true,
  74146. // "type": "string"
  74147. // },
  74148. // "project": {
  74149. // "description": "Project ID for this request.",
  74150. // "location": "path",
  74151. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74152. // "required": true,
  74153. // "type": "string"
  74154. // },
  74155. // "region": {
  74156. // "description": "Name of the region scoping this request.",
  74157. // "location": "path",
  74158. // "required": true,
  74159. // "type": "string"
  74160. // },
  74161. // "requestId": {
  74162. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74163. // "location": "query",
  74164. // "type": "string"
  74165. // }
  74166. // },
  74167. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  74168. // "request": {
  74169. // "$ref": "RegionInstanceGroupManagersSetTemplateRequest"
  74170. // },
  74171. // "response": {
  74172. // "$ref": "Operation"
  74173. // },
  74174. // "scopes": [
  74175. // "https://www.googleapis.com/auth/cloud-platform",
  74176. // "https://www.googleapis.com/auth/compute"
  74177. // ]
  74178. // }
  74179. }
  74180. // method id "compute.regionInstanceGroupManagers.setTargetPools":
  74181. type RegionInstanceGroupManagersSetTargetPoolsCall struct {
  74182. s *Service
  74183. project string
  74184. region string
  74185. instanceGroupManager string
  74186. regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest
  74187. urlParams_ gensupport.URLParams
  74188. ctx_ context.Context
  74189. header_ http.Header
  74190. }
  74191. // SetTargetPools: Modifies the target pools to which all new instances
  74192. // in this group are assigned. Existing instances in the group are not
  74193. // affected.
  74194. func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest) *RegionInstanceGroupManagersSetTargetPoolsCall {
  74195. c := &RegionInstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74196. c.project = project
  74197. c.region = region
  74198. c.instanceGroupManager = instanceGroupManager
  74199. c.regioninstancegroupmanagerssettargetpoolsrequest = regioninstancegroupmanagerssettargetpoolsrequest
  74200. return c
  74201. }
  74202. // RequestId sets the optional parameter "requestId": An optional
  74203. // request ID to identify requests. Specify a unique request ID so that
  74204. // if you must retry your request, the server will know to ignore the
  74205. // request if it has already been completed.
  74206. //
  74207. // For example, consider a situation where you make an initial request
  74208. // and the request times out. If you make the request again with the
  74209. // same request ID, the server can check if original operation with the
  74210. // same request ID was received, and if so, will ignore the second
  74211. // request. This prevents clients from accidentally creating duplicate
  74212. // commitments.
  74213. //
  74214. // The request ID must be a valid UUID with the exception that zero UUID
  74215. // is not supported (00000000-0000-0000-0000-000000000000).
  74216. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *RegionInstanceGroupManagersSetTargetPoolsCall {
  74217. c.urlParams_.Set("requestId", requestId)
  74218. return c
  74219. }
  74220. // Fields allows partial responses to be retrieved. See
  74221. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74222. // for more information.
  74223. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetTargetPoolsCall {
  74224. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74225. return c
  74226. }
  74227. // Context sets the context to be used in this call's Do method. Any
  74228. // pending HTTP request will be aborted if the provided context is
  74229. // canceled.
  74230. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetTargetPoolsCall {
  74231. c.ctx_ = ctx
  74232. return c
  74233. }
  74234. // Header returns an http.Header that can be modified by the caller to
  74235. // add HTTP headers to the request.
  74236. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  74237. if c.header_ == nil {
  74238. c.header_ = make(http.Header)
  74239. }
  74240. return c.header_
  74241. }
  74242. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  74243. reqHeaders := make(http.Header)
  74244. for k, v := range c.header_ {
  74245. reqHeaders[k] = v
  74246. }
  74247. reqHeaders.Set("User-Agent", c.s.userAgent())
  74248. var body io.Reader = nil
  74249. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest)
  74250. if err != nil {
  74251. return nil, err
  74252. }
  74253. reqHeaders.Set("Content-Type", "application/json")
  74254. c.urlParams_.Set("alt", alt)
  74255. c.urlParams_.Set("prettyPrint", "false")
  74256. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  74257. urls += "?" + c.urlParams_.Encode()
  74258. req, err := http.NewRequest("POST", urls, body)
  74259. if err != nil {
  74260. return nil, err
  74261. }
  74262. req.Header = reqHeaders
  74263. googleapi.Expand(req.URL, map[string]string{
  74264. "project": c.project,
  74265. "region": c.region,
  74266. "instanceGroupManager": c.instanceGroupManager,
  74267. })
  74268. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74269. }
  74270. // Do executes the "compute.regionInstanceGroupManagers.setTargetPools" call.
  74271. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74272. // status code is an error. Response headers are in either
  74273. // *Operation.ServerResponse.Header or (if a response was returned at
  74274. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74275. // to check whether the returned error was because
  74276. // http.StatusNotModified was returned.
  74277. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74278. gensupport.SetOptions(c.urlParams_, opts...)
  74279. res, err := c.doRequest("json")
  74280. if res != nil && res.StatusCode == http.StatusNotModified {
  74281. if res.Body != nil {
  74282. res.Body.Close()
  74283. }
  74284. return nil, &googleapi.Error{
  74285. Code: res.StatusCode,
  74286. Header: res.Header,
  74287. }
  74288. }
  74289. if err != nil {
  74290. return nil, err
  74291. }
  74292. defer googleapi.CloseBody(res)
  74293. if err := googleapi.CheckResponse(res); err != nil {
  74294. return nil, err
  74295. }
  74296. ret := &Operation{
  74297. ServerResponse: googleapi.ServerResponse{
  74298. Header: res.Header,
  74299. HTTPStatusCode: res.StatusCode,
  74300. },
  74301. }
  74302. target := &ret
  74303. if err := gensupport.DecodeResponse(target, res); err != nil {
  74304. return nil, err
  74305. }
  74306. return ret, nil
  74307. // {
  74308. // "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.",
  74309. // "httpMethod": "POST",
  74310. // "id": "compute.regionInstanceGroupManagers.setTargetPools",
  74311. // "parameterOrder": [
  74312. // "project",
  74313. // "region",
  74314. // "instanceGroupManager"
  74315. // ],
  74316. // "parameters": {
  74317. // "instanceGroupManager": {
  74318. // "description": "Name of the managed instance group.",
  74319. // "location": "path",
  74320. // "required": true,
  74321. // "type": "string"
  74322. // },
  74323. // "project": {
  74324. // "description": "Project ID for this request.",
  74325. // "location": "path",
  74326. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74327. // "required": true,
  74328. // "type": "string"
  74329. // },
  74330. // "region": {
  74331. // "description": "Name of the region scoping this request.",
  74332. // "location": "path",
  74333. // "required": true,
  74334. // "type": "string"
  74335. // },
  74336. // "requestId": {
  74337. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74338. // "location": "query",
  74339. // "type": "string"
  74340. // }
  74341. // },
  74342. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  74343. // "request": {
  74344. // "$ref": "RegionInstanceGroupManagersSetTargetPoolsRequest"
  74345. // },
  74346. // "response": {
  74347. // "$ref": "Operation"
  74348. // },
  74349. // "scopes": [
  74350. // "https://www.googleapis.com/auth/cloud-platform",
  74351. // "https://www.googleapis.com/auth/compute"
  74352. // ]
  74353. // }
  74354. }
  74355. // method id "compute.regionInstanceGroups.get":
  74356. type RegionInstanceGroupsGetCall struct {
  74357. s *Service
  74358. project string
  74359. region string
  74360. instanceGroup string
  74361. urlParams_ gensupport.URLParams
  74362. ifNoneMatch_ string
  74363. ctx_ context.Context
  74364. header_ http.Header
  74365. }
  74366. // Get: Returns the specified instance group resource.
  74367. func (r *RegionInstanceGroupsService) Get(project string, region string, instanceGroup string) *RegionInstanceGroupsGetCall {
  74368. c := &RegionInstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74369. c.project = project
  74370. c.region = region
  74371. c.instanceGroup = instanceGroup
  74372. return c
  74373. }
  74374. // Fields allows partial responses to be retrieved. See
  74375. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74376. // for more information.
  74377. func (c *RegionInstanceGroupsGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsGetCall {
  74378. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74379. return c
  74380. }
  74381. // IfNoneMatch sets the optional parameter which makes the operation
  74382. // fail if the object's ETag matches the given value. This is useful for
  74383. // getting updates only after the object has changed since the last
  74384. // request. Use googleapi.IsNotModified to check whether the response
  74385. // error from Do is the result of In-None-Match.
  74386. func (c *RegionInstanceGroupsGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsGetCall {
  74387. c.ifNoneMatch_ = entityTag
  74388. return c
  74389. }
  74390. // Context sets the context to be used in this call's Do method. Any
  74391. // pending HTTP request will be aborted if the provided context is
  74392. // canceled.
  74393. func (c *RegionInstanceGroupsGetCall) Context(ctx context.Context) *RegionInstanceGroupsGetCall {
  74394. c.ctx_ = ctx
  74395. return c
  74396. }
  74397. // Header returns an http.Header that can be modified by the caller to
  74398. // add HTTP headers to the request.
  74399. func (c *RegionInstanceGroupsGetCall) Header() http.Header {
  74400. if c.header_ == nil {
  74401. c.header_ = make(http.Header)
  74402. }
  74403. return c.header_
  74404. }
  74405. func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  74406. reqHeaders := make(http.Header)
  74407. for k, v := range c.header_ {
  74408. reqHeaders[k] = v
  74409. }
  74410. reqHeaders.Set("User-Agent", c.s.userAgent())
  74411. if c.ifNoneMatch_ != "" {
  74412. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74413. }
  74414. var body io.Reader = nil
  74415. c.urlParams_.Set("alt", alt)
  74416. c.urlParams_.Set("prettyPrint", "false")
  74417. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}")
  74418. urls += "?" + c.urlParams_.Encode()
  74419. req, err := http.NewRequest("GET", urls, body)
  74420. if err != nil {
  74421. return nil, err
  74422. }
  74423. req.Header = reqHeaders
  74424. googleapi.Expand(req.URL, map[string]string{
  74425. "project": c.project,
  74426. "region": c.region,
  74427. "instanceGroup": c.instanceGroup,
  74428. })
  74429. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74430. }
  74431. // Do executes the "compute.regionInstanceGroups.get" call.
  74432. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  74433. // status code is an error. Response headers are in either
  74434. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  74435. // at all) in error.(*googleapi.Error).Header. Use
  74436. // googleapi.IsNotModified to check whether the returned error was
  74437. // because http.StatusNotModified was returned.
  74438. func (c *RegionInstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  74439. gensupport.SetOptions(c.urlParams_, opts...)
  74440. res, err := c.doRequest("json")
  74441. if res != nil && res.StatusCode == http.StatusNotModified {
  74442. if res.Body != nil {
  74443. res.Body.Close()
  74444. }
  74445. return nil, &googleapi.Error{
  74446. Code: res.StatusCode,
  74447. Header: res.Header,
  74448. }
  74449. }
  74450. if err != nil {
  74451. return nil, err
  74452. }
  74453. defer googleapi.CloseBody(res)
  74454. if err := googleapi.CheckResponse(res); err != nil {
  74455. return nil, err
  74456. }
  74457. ret := &InstanceGroup{
  74458. ServerResponse: googleapi.ServerResponse{
  74459. Header: res.Header,
  74460. HTTPStatusCode: res.StatusCode,
  74461. },
  74462. }
  74463. target := &ret
  74464. if err := gensupport.DecodeResponse(target, res); err != nil {
  74465. return nil, err
  74466. }
  74467. return ret, nil
  74468. // {
  74469. // "description": "Returns the specified instance group resource.",
  74470. // "httpMethod": "GET",
  74471. // "id": "compute.regionInstanceGroups.get",
  74472. // "parameterOrder": [
  74473. // "project",
  74474. // "region",
  74475. // "instanceGroup"
  74476. // ],
  74477. // "parameters": {
  74478. // "instanceGroup": {
  74479. // "description": "Name of the instance group resource to return.",
  74480. // "location": "path",
  74481. // "required": true,
  74482. // "type": "string"
  74483. // },
  74484. // "project": {
  74485. // "description": "Project ID for this request.",
  74486. // "location": "path",
  74487. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74488. // "required": true,
  74489. // "type": "string"
  74490. // },
  74491. // "region": {
  74492. // "description": "Name of the region scoping this request.",
  74493. // "location": "path",
  74494. // "required": true,
  74495. // "type": "string"
  74496. // }
  74497. // },
  74498. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}",
  74499. // "response": {
  74500. // "$ref": "InstanceGroup"
  74501. // },
  74502. // "scopes": [
  74503. // "https://www.googleapis.com/auth/cloud-platform",
  74504. // "https://www.googleapis.com/auth/compute",
  74505. // "https://www.googleapis.com/auth/compute.readonly"
  74506. // ]
  74507. // }
  74508. }
  74509. // method id "compute.regionInstanceGroups.list":
  74510. type RegionInstanceGroupsListCall struct {
  74511. s *Service
  74512. project string
  74513. region string
  74514. urlParams_ gensupport.URLParams
  74515. ifNoneMatch_ string
  74516. ctx_ context.Context
  74517. header_ http.Header
  74518. }
  74519. // List: Retrieves the list of instance group resources contained within
  74520. // the specified region.
  74521. func (r *RegionInstanceGroupsService) List(project string, region string) *RegionInstanceGroupsListCall {
  74522. c := &RegionInstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74523. c.project = project
  74524. c.region = region
  74525. return c
  74526. }
  74527. // Filter sets the optional parameter "filter": A filter expression that
  74528. // filters resources listed in the response. The expression must specify
  74529. // the field name, a comparison operator, and the value that you want to
  74530. // use for filtering. The value must be a string, a number, or a
  74531. // boolean. The comparison operator must be either =, !=, >, or <.
  74532. //
  74533. // For example, if you are filtering Compute Engine instances, you can
  74534. // exclude instances named example-instance by specifying name !=
  74535. // example-instance.
  74536. //
  74537. // You can also filter nested fields. For example, you could specify
  74538. // scheduling.automaticRestart = false to include instances only if they
  74539. // are not scheduled for automatic restarts. You can use filtering on
  74540. // nested fields to filter based on resource labels.
  74541. //
  74542. // To filter on multiple expressions, provide each separate expression
  74543. // within parentheses. For example, (scheduling.automaticRestart = true)
  74544. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  74545. // AND expression. However, you can include AND and OR expressions
  74546. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  74547. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  74548. // true).
  74549. func (c *RegionInstanceGroupsListCall) Filter(filter string) *RegionInstanceGroupsListCall {
  74550. c.urlParams_.Set("filter", filter)
  74551. return c
  74552. }
  74553. // MaxResults sets the optional parameter "maxResults": The maximum
  74554. // number of results per page that should be returned. If the number of
  74555. // available results is larger than maxResults, Compute Engine returns a
  74556. // nextPageToken that can be used to get the next page of results in
  74557. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  74558. // (Default: 500)
  74559. func (c *RegionInstanceGroupsListCall) MaxResults(maxResults int64) *RegionInstanceGroupsListCall {
  74560. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  74561. return c
  74562. }
  74563. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  74564. // a certain order. By default, results are returned in alphanumerical
  74565. // order based on the resource name.
  74566. //
  74567. // You can also sort results in descending order based on the creation
  74568. // timestamp using orderBy="creationTimestamp desc". This sorts results
  74569. // based on the creationTimestamp field in reverse chronological order
  74570. // (newest result first). Use this to sort resources like operations so
  74571. // that the newest operation is returned first.
  74572. //
  74573. // Currently, only sorting by name or creationTimestamp desc is
  74574. // supported.
  74575. func (c *RegionInstanceGroupsListCall) OrderBy(orderBy string) *RegionInstanceGroupsListCall {
  74576. c.urlParams_.Set("orderBy", orderBy)
  74577. return c
  74578. }
  74579. // PageToken sets the optional parameter "pageToken": Specifies a page
  74580. // token to use. Set pageToken to the nextPageToken returned by a
  74581. // previous list request to get the next page of results.
  74582. func (c *RegionInstanceGroupsListCall) PageToken(pageToken string) *RegionInstanceGroupsListCall {
  74583. c.urlParams_.Set("pageToken", pageToken)
  74584. return c
  74585. }
  74586. // Fields allows partial responses to be retrieved. See
  74587. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74588. // for more information.
  74589. func (c *RegionInstanceGroupsListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListCall {
  74590. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74591. return c
  74592. }
  74593. // IfNoneMatch sets the optional parameter which makes the operation
  74594. // fail if the object's ETag matches the given value. This is useful for
  74595. // getting updates only after the object has changed since the last
  74596. // request. Use googleapi.IsNotModified to check whether the response
  74597. // error from Do is the result of In-None-Match.
  74598. func (c *RegionInstanceGroupsListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsListCall {
  74599. c.ifNoneMatch_ = entityTag
  74600. return c
  74601. }
  74602. // Context sets the context to be used in this call's Do method. Any
  74603. // pending HTTP request will be aborted if the provided context is
  74604. // canceled.
  74605. func (c *RegionInstanceGroupsListCall) Context(ctx context.Context) *RegionInstanceGroupsListCall {
  74606. c.ctx_ = ctx
  74607. return c
  74608. }
  74609. // Header returns an http.Header that can be modified by the caller to
  74610. // add HTTP headers to the request.
  74611. func (c *RegionInstanceGroupsListCall) Header() http.Header {
  74612. if c.header_ == nil {
  74613. c.header_ = make(http.Header)
  74614. }
  74615. return c.header_
  74616. }
  74617. func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  74618. reqHeaders := make(http.Header)
  74619. for k, v := range c.header_ {
  74620. reqHeaders[k] = v
  74621. }
  74622. reqHeaders.Set("User-Agent", c.s.userAgent())
  74623. if c.ifNoneMatch_ != "" {
  74624. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74625. }
  74626. var body io.Reader = nil
  74627. c.urlParams_.Set("alt", alt)
  74628. c.urlParams_.Set("prettyPrint", "false")
  74629. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups")
  74630. urls += "?" + c.urlParams_.Encode()
  74631. req, err := http.NewRequest("GET", urls, body)
  74632. if err != nil {
  74633. return nil, err
  74634. }
  74635. req.Header = reqHeaders
  74636. googleapi.Expand(req.URL, map[string]string{
  74637. "project": c.project,
  74638. "region": c.region,
  74639. })
  74640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74641. }
  74642. // Do executes the "compute.regionInstanceGroups.list" call.
  74643. // Exactly one of *RegionInstanceGroupList or error will be non-nil. Any
  74644. // non-2xx status code is an error. Response headers are in either
  74645. // *RegionInstanceGroupList.ServerResponse.Header or (if a response was
  74646. // returned at all) in error.(*googleapi.Error).Header. Use
  74647. // googleapi.IsNotModified to check whether the returned error was
  74648. // because http.StatusNotModified was returned.
  74649. func (c *RegionInstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupList, error) {
  74650. gensupport.SetOptions(c.urlParams_, opts...)
  74651. res, err := c.doRequest("json")
  74652. if res != nil && res.StatusCode == http.StatusNotModified {
  74653. if res.Body != nil {
  74654. res.Body.Close()
  74655. }
  74656. return nil, &googleapi.Error{
  74657. Code: res.StatusCode,
  74658. Header: res.Header,
  74659. }
  74660. }
  74661. if err != nil {
  74662. return nil, err
  74663. }
  74664. defer googleapi.CloseBody(res)
  74665. if err := googleapi.CheckResponse(res); err != nil {
  74666. return nil, err
  74667. }
  74668. ret := &RegionInstanceGroupList{
  74669. ServerResponse: googleapi.ServerResponse{
  74670. Header: res.Header,
  74671. HTTPStatusCode: res.StatusCode,
  74672. },
  74673. }
  74674. target := &ret
  74675. if err := gensupport.DecodeResponse(target, res); err != nil {
  74676. return nil, err
  74677. }
  74678. return ret, nil
  74679. // {
  74680. // "description": "Retrieves the list of instance group resources contained within the specified region.",
  74681. // "httpMethod": "GET",
  74682. // "id": "compute.regionInstanceGroups.list",
  74683. // "parameterOrder": [
  74684. // "project",
  74685. // "region"
  74686. // ],
  74687. // "parameters": {
  74688. // "filter": {
  74689. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  74690. // "location": "query",
  74691. // "type": "string"
  74692. // },
  74693. // "maxResults": {
  74694. // "default": "500",
  74695. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  74696. // "format": "uint32",
  74697. // "location": "query",
  74698. // "minimum": "0",
  74699. // "type": "integer"
  74700. // },
  74701. // "orderBy": {
  74702. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  74703. // "location": "query",
  74704. // "type": "string"
  74705. // },
  74706. // "pageToken": {
  74707. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  74708. // "location": "query",
  74709. // "type": "string"
  74710. // },
  74711. // "project": {
  74712. // "description": "Project ID for this request.",
  74713. // "location": "path",
  74714. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74715. // "required": true,
  74716. // "type": "string"
  74717. // },
  74718. // "region": {
  74719. // "description": "Name of the region scoping this request.",
  74720. // "location": "path",
  74721. // "required": true,
  74722. // "type": "string"
  74723. // }
  74724. // },
  74725. // "path": "{project}/regions/{region}/instanceGroups",
  74726. // "response": {
  74727. // "$ref": "RegionInstanceGroupList"
  74728. // },
  74729. // "scopes": [
  74730. // "https://www.googleapis.com/auth/cloud-platform",
  74731. // "https://www.googleapis.com/auth/compute",
  74732. // "https://www.googleapis.com/auth/compute.readonly"
  74733. // ]
  74734. // }
  74735. }
  74736. // Pages invokes f for each page of results.
  74737. // A non-nil error returned from f will halt the iteration.
  74738. // The provided context supersedes any context provided to the Context method.
  74739. func (c *RegionInstanceGroupsListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupList) error) error {
  74740. c.ctx_ = ctx
  74741. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  74742. for {
  74743. x, err := c.Do()
  74744. if err != nil {
  74745. return err
  74746. }
  74747. if err := f(x); err != nil {
  74748. return err
  74749. }
  74750. if x.NextPageToken == "" {
  74751. return nil
  74752. }
  74753. c.PageToken(x.NextPageToken)
  74754. }
  74755. }
  74756. // method id "compute.regionInstanceGroups.listInstances":
  74757. type RegionInstanceGroupsListInstancesCall struct {
  74758. s *Service
  74759. project string
  74760. region string
  74761. instanceGroup string
  74762. regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest
  74763. urlParams_ gensupport.URLParams
  74764. ctx_ context.Context
  74765. header_ http.Header
  74766. }
  74767. // ListInstances: Lists the instances in the specified instance group
  74768. // and displays information about the named ports. Depending on the
  74769. // specified options, this method can list all instances or only the
  74770. // instances that are running.
  74771. func (r *RegionInstanceGroupsService) ListInstances(project string, region string, instanceGroup string, regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest) *RegionInstanceGroupsListInstancesCall {
  74772. c := &RegionInstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74773. c.project = project
  74774. c.region = region
  74775. c.instanceGroup = instanceGroup
  74776. c.regioninstancegroupslistinstancesrequest = regioninstancegroupslistinstancesrequest
  74777. return c
  74778. }
  74779. // Filter sets the optional parameter "filter": A filter expression that
  74780. // filters resources listed in the response. The expression must specify
  74781. // the field name, a comparison operator, and the value that you want to
  74782. // use for filtering. The value must be a string, a number, or a
  74783. // boolean. The comparison operator must be either =, !=, >, or <.
  74784. //
  74785. // For example, if you are filtering Compute Engine instances, you can
  74786. // exclude instances named example-instance by specifying name !=
  74787. // example-instance.
  74788. //
  74789. // You can also filter nested fields. For example, you could specify
  74790. // scheduling.automaticRestart = false to include instances only if they
  74791. // are not scheduled for automatic restarts. You can use filtering on
  74792. // nested fields to filter based on resource labels.
  74793. //
  74794. // To filter on multiple expressions, provide each separate expression
  74795. // within parentheses. For example, (scheduling.automaticRestart = true)
  74796. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  74797. // AND expression. However, you can include AND and OR expressions
  74798. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  74799. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  74800. // true).
  74801. func (c *RegionInstanceGroupsListInstancesCall) Filter(filter string) *RegionInstanceGroupsListInstancesCall {
  74802. c.urlParams_.Set("filter", filter)
  74803. return c
  74804. }
  74805. // MaxResults sets the optional parameter "maxResults": The maximum
  74806. // number of results per page that should be returned. If the number of
  74807. // available results is larger than maxResults, Compute Engine returns a
  74808. // nextPageToken that can be used to get the next page of results in
  74809. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  74810. // (Default: 500)
  74811. func (c *RegionInstanceGroupsListInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupsListInstancesCall {
  74812. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  74813. return c
  74814. }
  74815. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  74816. // a certain order. By default, results are returned in alphanumerical
  74817. // order based on the resource name.
  74818. //
  74819. // You can also sort results in descending order based on the creation
  74820. // timestamp using orderBy="creationTimestamp desc". This sorts results
  74821. // based on the creationTimestamp field in reverse chronological order
  74822. // (newest result first). Use this to sort resources like operations so
  74823. // that the newest operation is returned first.
  74824. //
  74825. // Currently, only sorting by name or creationTimestamp desc is
  74826. // supported.
  74827. func (c *RegionInstanceGroupsListInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupsListInstancesCall {
  74828. c.urlParams_.Set("orderBy", orderBy)
  74829. return c
  74830. }
  74831. // PageToken sets the optional parameter "pageToken": Specifies a page
  74832. // token to use. Set pageToken to the nextPageToken returned by a
  74833. // previous list request to get the next page of results.
  74834. func (c *RegionInstanceGroupsListInstancesCall) PageToken(pageToken string) *RegionInstanceGroupsListInstancesCall {
  74835. c.urlParams_.Set("pageToken", pageToken)
  74836. return c
  74837. }
  74838. // Fields allows partial responses to be retrieved. See
  74839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74840. // for more information.
  74841. func (c *RegionInstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListInstancesCall {
  74842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74843. return c
  74844. }
  74845. // Context sets the context to be used in this call's Do method. Any
  74846. // pending HTTP request will be aborted if the provided context is
  74847. // canceled.
  74848. func (c *RegionInstanceGroupsListInstancesCall) Context(ctx context.Context) *RegionInstanceGroupsListInstancesCall {
  74849. c.ctx_ = ctx
  74850. return c
  74851. }
  74852. // Header returns an http.Header that can be modified by the caller to
  74853. // add HTTP headers to the request.
  74854. func (c *RegionInstanceGroupsListInstancesCall) Header() http.Header {
  74855. if c.header_ == nil {
  74856. c.header_ = make(http.Header)
  74857. }
  74858. return c.header_
  74859. }
  74860. func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  74861. reqHeaders := make(http.Header)
  74862. for k, v := range c.header_ {
  74863. reqHeaders[k] = v
  74864. }
  74865. reqHeaders.Set("User-Agent", c.s.userAgent())
  74866. var body io.Reader = nil
  74867. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest)
  74868. if err != nil {
  74869. return nil, err
  74870. }
  74871. reqHeaders.Set("Content-Type", "application/json")
  74872. c.urlParams_.Set("alt", alt)
  74873. c.urlParams_.Set("prettyPrint", "false")
  74874. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")
  74875. urls += "?" + c.urlParams_.Encode()
  74876. req, err := http.NewRequest("POST", urls, body)
  74877. if err != nil {
  74878. return nil, err
  74879. }
  74880. req.Header = reqHeaders
  74881. googleapi.Expand(req.URL, map[string]string{
  74882. "project": c.project,
  74883. "region": c.region,
  74884. "instanceGroup": c.instanceGroup,
  74885. })
  74886. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74887. }
  74888. // Do executes the "compute.regionInstanceGroups.listInstances" call.
  74889. // Exactly one of *RegionInstanceGroupsListInstances or error will be
  74890. // non-nil. Any non-2xx status code is an error. Response headers are in
  74891. // either *RegionInstanceGroupsListInstances.ServerResponse.Header or
  74892. // (if a response was returned at all) in
  74893. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  74894. // whether the returned error was because http.StatusNotModified was
  74895. // returned.
  74896. func (c *RegionInstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupsListInstances, error) {
  74897. gensupport.SetOptions(c.urlParams_, opts...)
  74898. res, err := c.doRequest("json")
  74899. if res != nil && res.StatusCode == http.StatusNotModified {
  74900. if res.Body != nil {
  74901. res.Body.Close()
  74902. }
  74903. return nil, &googleapi.Error{
  74904. Code: res.StatusCode,
  74905. Header: res.Header,
  74906. }
  74907. }
  74908. if err != nil {
  74909. return nil, err
  74910. }
  74911. defer googleapi.CloseBody(res)
  74912. if err := googleapi.CheckResponse(res); err != nil {
  74913. return nil, err
  74914. }
  74915. ret := &RegionInstanceGroupsListInstances{
  74916. ServerResponse: googleapi.ServerResponse{
  74917. Header: res.Header,
  74918. HTTPStatusCode: res.StatusCode,
  74919. },
  74920. }
  74921. target := &ret
  74922. if err := gensupport.DecodeResponse(target, res); err != nil {
  74923. return nil, err
  74924. }
  74925. return ret, nil
  74926. // {
  74927. // "description": "Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running.",
  74928. // "httpMethod": "POST",
  74929. // "id": "compute.regionInstanceGroups.listInstances",
  74930. // "parameterOrder": [
  74931. // "project",
  74932. // "region",
  74933. // "instanceGroup"
  74934. // ],
  74935. // "parameters": {
  74936. // "filter": {
  74937. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  74938. // "location": "query",
  74939. // "type": "string"
  74940. // },
  74941. // "instanceGroup": {
  74942. // "description": "Name of the regional instance group for which we want to list the instances.",
  74943. // "location": "path",
  74944. // "required": true,
  74945. // "type": "string"
  74946. // },
  74947. // "maxResults": {
  74948. // "default": "500",
  74949. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  74950. // "format": "uint32",
  74951. // "location": "query",
  74952. // "minimum": "0",
  74953. // "type": "integer"
  74954. // },
  74955. // "orderBy": {
  74956. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  74957. // "location": "query",
  74958. // "type": "string"
  74959. // },
  74960. // "pageToken": {
  74961. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  74962. // "location": "query",
  74963. // "type": "string"
  74964. // },
  74965. // "project": {
  74966. // "description": "Project ID for this request.",
  74967. // "location": "path",
  74968. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74969. // "required": true,
  74970. // "type": "string"
  74971. // },
  74972. // "region": {
  74973. // "description": "Name of the region scoping this request.",
  74974. // "location": "path",
  74975. // "required": true,
  74976. // "type": "string"
  74977. // }
  74978. // },
  74979. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances",
  74980. // "request": {
  74981. // "$ref": "RegionInstanceGroupsListInstancesRequest"
  74982. // },
  74983. // "response": {
  74984. // "$ref": "RegionInstanceGroupsListInstances"
  74985. // },
  74986. // "scopes": [
  74987. // "https://www.googleapis.com/auth/cloud-platform",
  74988. // "https://www.googleapis.com/auth/compute",
  74989. // "https://www.googleapis.com/auth/compute.readonly"
  74990. // ]
  74991. // }
  74992. }
  74993. // Pages invokes f for each page of results.
  74994. // A non-nil error returned from f will halt the iteration.
  74995. // The provided context supersedes any context provided to the Context method.
  74996. func (c *RegionInstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupsListInstances) error) error {
  74997. c.ctx_ = ctx
  74998. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  74999. for {
  75000. x, err := c.Do()
  75001. if err != nil {
  75002. return err
  75003. }
  75004. if err := f(x); err != nil {
  75005. return err
  75006. }
  75007. if x.NextPageToken == "" {
  75008. return nil
  75009. }
  75010. c.PageToken(x.NextPageToken)
  75011. }
  75012. }
  75013. // method id "compute.regionInstanceGroups.setNamedPorts":
  75014. type RegionInstanceGroupsSetNamedPortsCall struct {
  75015. s *Service
  75016. project string
  75017. region string
  75018. instanceGroup string
  75019. regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest
  75020. urlParams_ gensupport.URLParams
  75021. ctx_ context.Context
  75022. header_ http.Header
  75023. }
  75024. // SetNamedPorts: Sets the named ports for the specified regional
  75025. // instance group.
  75026. func (r *RegionInstanceGroupsService) SetNamedPorts(project string, region string, instanceGroup string, regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest) *RegionInstanceGroupsSetNamedPortsCall {
  75027. c := &RegionInstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75028. c.project = project
  75029. c.region = region
  75030. c.instanceGroup = instanceGroup
  75031. c.regioninstancegroupssetnamedportsrequest = regioninstancegroupssetnamedportsrequest
  75032. return c
  75033. }
  75034. // RequestId sets the optional parameter "requestId": An optional
  75035. // request ID to identify requests. Specify a unique request ID so that
  75036. // if you must retry your request, the server will know to ignore the
  75037. // request if it has already been completed.
  75038. //
  75039. // For example, consider a situation where you make an initial request
  75040. // and the request times out. If you make the request again with the
  75041. // same request ID, the server can check if original operation with the
  75042. // same request ID was received, and if so, will ignore the second
  75043. // request. This prevents clients from accidentally creating duplicate
  75044. // commitments.
  75045. //
  75046. // The request ID must be a valid UUID with the exception that zero UUID
  75047. // is not supported (00000000-0000-0000-0000-000000000000).
  75048. func (c *RegionInstanceGroupsSetNamedPortsCall) RequestId(requestId string) *RegionInstanceGroupsSetNamedPortsCall {
  75049. c.urlParams_.Set("requestId", requestId)
  75050. return c
  75051. }
  75052. // Fields allows partial responses to be retrieved. See
  75053. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75054. // for more information.
  75055. func (c *RegionInstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsSetNamedPortsCall {
  75056. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75057. return c
  75058. }
  75059. // Context sets the context to be used in this call's Do method. Any
  75060. // pending HTTP request will be aborted if the provided context is
  75061. // canceled.
  75062. func (c *RegionInstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *RegionInstanceGroupsSetNamedPortsCall {
  75063. c.ctx_ = ctx
  75064. return c
  75065. }
  75066. // Header returns an http.Header that can be modified by the caller to
  75067. // add HTTP headers to the request.
  75068. func (c *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header {
  75069. if c.header_ == nil {
  75070. c.header_ = make(http.Header)
  75071. }
  75072. return c.header_
  75073. }
  75074. func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  75075. reqHeaders := make(http.Header)
  75076. for k, v := range c.header_ {
  75077. reqHeaders[k] = v
  75078. }
  75079. reqHeaders.Set("User-Agent", c.s.userAgent())
  75080. var body io.Reader = nil
  75081. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest)
  75082. if err != nil {
  75083. return nil, err
  75084. }
  75085. reqHeaders.Set("Content-Type", "application/json")
  75086. c.urlParams_.Set("alt", alt)
  75087. c.urlParams_.Set("prettyPrint", "false")
  75088. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")
  75089. urls += "?" + c.urlParams_.Encode()
  75090. req, err := http.NewRequest("POST", urls, body)
  75091. if err != nil {
  75092. return nil, err
  75093. }
  75094. req.Header = reqHeaders
  75095. googleapi.Expand(req.URL, map[string]string{
  75096. "project": c.project,
  75097. "region": c.region,
  75098. "instanceGroup": c.instanceGroup,
  75099. })
  75100. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75101. }
  75102. // Do executes the "compute.regionInstanceGroups.setNamedPorts" call.
  75103. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75104. // status code is an error. Response headers are in either
  75105. // *Operation.ServerResponse.Header or (if a response was returned at
  75106. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75107. // to check whether the returned error was because
  75108. // http.StatusNotModified was returned.
  75109. func (c *RegionInstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75110. gensupport.SetOptions(c.urlParams_, opts...)
  75111. res, err := c.doRequest("json")
  75112. if res != nil && res.StatusCode == http.StatusNotModified {
  75113. if res.Body != nil {
  75114. res.Body.Close()
  75115. }
  75116. return nil, &googleapi.Error{
  75117. Code: res.StatusCode,
  75118. Header: res.Header,
  75119. }
  75120. }
  75121. if err != nil {
  75122. return nil, err
  75123. }
  75124. defer googleapi.CloseBody(res)
  75125. if err := googleapi.CheckResponse(res); err != nil {
  75126. return nil, err
  75127. }
  75128. ret := &Operation{
  75129. ServerResponse: googleapi.ServerResponse{
  75130. Header: res.Header,
  75131. HTTPStatusCode: res.StatusCode,
  75132. },
  75133. }
  75134. target := &ret
  75135. if err := gensupport.DecodeResponse(target, res); err != nil {
  75136. return nil, err
  75137. }
  75138. return ret, nil
  75139. // {
  75140. // "description": "Sets the named ports for the specified regional instance group.",
  75141. // "httpMethod": "POST",
  75142. // "id": "compute.regionInstanceGroups.setNamedPorts",
  75143. // "parameterOrder": [
  75144. // "project",
  75145. // "region",
  75146. // "instanceGroup"
  75147. // ],
  75148. // "parameters": {
  75149. // "instanceGroup": {
  75150. // "description": "The name of the regional instance group where the named ports are updated.",
  75151. // "location": "path",
  75152. // "required": true,
  75153. // "type": "string"
  75154. // },
  75155. // "project": {
  75156. // "description": "Project ID for this request.",
  75157. // "location": "path",
  75158. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75159. // "required": true,
  75160. // "type": "string"
  75161. // },
  75162. // "region": {
  75163. // "description": "Name of the region scoping this request.",
  75164. // "location": "path",
  75165. // "required": true,
  75166. // "type": "string"
  75167. // },
  75168. // "requestId": {
  75169. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75170. // "location": "query",
  75171. // "type": "string"
  75172. // }
  75173. // },
  75174. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts",
  75175. // "request": {
  75176. // "$ref": "RegionInstanceGroupsSetNamedPortsRequest"
  75177. // },
  75178. // "response": {
  75179. // "$ref": "Operation"
  75180. // },
  75181. // "scopes": [
  75182. // "https://www.googleapis.com/auth/cloud-platform",
  75183. // "https://www.googleapis.com/auth/compute"
  75184. // ]
  75185. // }
  75186. }
  75187. // method id "compute.regionOperations.delete":
  75188. type RegionOperationsDeleteCall struct {
  75189. s *Service
  75190. project string
  75191. region string
  75192. operation string
  75193. urlParams_ gensupport.URLParams
  75194. ctx_ context.Context
  75195. header_ http.Header
  75196. }
  75197. // Delete: Deletes the specified region-specific Operations resource.
  75198. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete
  75199. func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall {
  75200. c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75201. c.project = project
  75202. c.region = region
  75203. c.operation = operation
  75204. return c
  75205. }
  75206. // Fields allows partial responses to be retrieved. See
  75207. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75208. // for more information.
  75209. func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall {
  75210. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75211. return c
  75212. }
  75213. // Context sets the context to be used in this call's Do method. Any
  75214. // pending HTTP request will be aborted if the provided context is
  75215. // canceled.
  75216. func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall {
  75217. c.ctx_ = ctx
  75218. return c
  75219. }
  75220. // Header returns an http.Header that can be modified by the caller to
  75221. // add HTTP headers to the request.
  75222. func (c *RegionOperationsDeleteCall) Header() http.Header {
  75223. if c.header_ == nil {
  75224. c.header_ = make(http.Header)
  75225. }
  75226. return c.header_
  75227. }
  75228. func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  75229. reqHeaders := make(http.Header)
  75230. for k, v := range c.header_ {
  75231. reqHeaders[k] = v
  75232. }
  75233. reqHeaders.Set("User-Agent", c.s.userAgent())
  75234. var body io.Reader = nil
  75235. c.urlParams_.Set("alt", alt)
  75236. c.urlParams_.Set("prettyPrint", "false")
  75237. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  75238. urls += "?" + c.urlParams_.Encode()
  75239. req, err := http.NewRequest("DELETE", urls, body)
  75240. if err != nil {
  75241. return nil, err
  75242. }
  75243. req.Header = reqHeaders
  75244. googleapi.Expand(req.URL, map[string]string{
  75245. "project": c.project,
  75246. "region": c.region,
  75247. "operation": c.operation,
  75248. })
  75249. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75250. }
  75251. // Do executes the "compute.regionOperations.delete" call.
  75252. func (c *RegionOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  75253. gensupport.SetOptions(c.urlParams_, opts...)
  75254. res, err := c.doRequest("json")
  75255. if err != nil {
  75256. return err
  75257. }
  75258. defer googleapi.CloseBody(res)
  75259. if err := googleapi.CheckResponse(res); err != nil {
  75260. return err
  75261. }
  75262. return nil
  75263. // {
  75264. // "description": "Deletes the specified region-specific Operations resource.",
  75265. // "httpMethod": "DELETE",
  75266. // "id": "compute.regionOperations.delete",
  75267. // "parameterOrder": [
  75268. // "project",
  75269. // "region",
  75270. // "operation"
  75271. // ],
  75272. // "parameters": {
  75273. // "operation": {
  75274. // "description": "Name of the Operations resource to delete.",
  75275. // "location": "path",
  75276. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75277. // "required": true,
  75278. // "type": "string"
  75279. // },
  75280. // "project": {
  75281. // "description": "Project ID for this request.",
  75282. // "location": "path",
  75283. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75284. // "required": true,
  75285. // "type": "string"
  75286. // },
  75287. // "region": {
  75288. // "description": "Name of the region for this request.",
  75289. // "location": "path",
  75290. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75291. // "required": true,
  75292. // "type": "string"
  75293. // }
  75294. // },
  75295. // "path": "{project}/regions/{region}/operations/{operation}",
  75296. // "scopes": [
  75297. // "https://www.googleapis.com/auth/cloud-platform",
  75298. // "https://www.googleapis.com/auth/compute"
  75299. // ]
  75300. // }
  75301. }
  75302. // method id "compute.regionOperations.get":
  75303. type RegionOperationsGetCall struct {
  75304. s *Service
  75305. project string
  75306. region string
  75307. operation string
  75308. urlParams_ gensupport.URLParams
  75309. ifNoneMatch_ string
  75310. ctx_ context.Context
  75311. header_ http.Header
  75312. }
  75313. // Get: Retrieves the specified region-specific Operations resource.
  75314. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get
  75315. func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall {
  75316. c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75317. c.project = project
  75318. c.region = region
  75319. c.operation = operation
  75320. return c
  75321. }
  75322. // Fields allows partial responses to be retrieved. See
  75323. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75324. // for more information.
  75325. func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall {
  75326. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75327. return c
  75328. }
  75329. // IfNoneMatch sets the optional parameter which makes the operation
  75330. // fail if the object's ETag matches the given value. This is useful for
  75331. // getting updates only after the object has changed since the last
  75332. // request. Use googleapi.IsNotModified to check whether the response
  75333. // error from Do is the result of In-None-Match.
  75334. func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall {
  75335. c.ifNoneMatch_ = entityTag
  75336. return c
  75337. }
  75338. // Context sets the context to be used in this call's Do method. Any
  75339. // pending HTTP request will be aborted if the provided context is
  75340. // canceled.
  75341. func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall {
  75342. c.ctx_ = ctx
  75343. return c
  75344. }
  75345. // Header returns an http.Header that can be modified by the caller to
  75346. // add HTTP headers to the request.
  75347. func (c *RegionOperationsGetCall) Header() http.Header {
  75348. if c.header_ == nil {
  75349. c.header_ = make(http.Header)
  75350. }
  75351. return c.header_
  75352. }
  75353. func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  75354. reqHeaders := make(http.Header)
  75355. for k, v := range c.header_ {
  75356. reqHeaders[k] = v
  75357. }
  75358. reqHeaders.Set("User-Agent", c.s.userAgent())
  75359. if c.ifNoneMatch_ != "" {
  75360. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75361. }
  75362. var body io.Reader = nil
  75363. c.urlParams_.Set("alt", alt)
  75364. c.urlParams_.Set("prettyPrint", "false")
  75365. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  75366. urls += "?" + c.urlParams_.Encode()
  75367. req, err := http.NewRequest("GET", urls, body)
  75368. if err != nil {
  75369. return nil, err
  75370. }
  75371. req.Header = reqHeaders
  75372. googleapi.Expand(req.URL, map[string]string{
  75373. "project": c.project,
  75374. "region": c.region,
  75375. "operation": c.operation,
  75376. })
  75377. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75378. }
  75379. // Do executes the "compute.regionOperations.get" call.
  75380. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75381. // status code is an error. Response headers are in either
  75382. // *Operation.ServerResponse.Header or (if a response was returned at
  75383. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75384. // to check whether the returned error was because
  75385. // http.StatusNotModified was returned.
  75386. func (c *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75387. gensupport.SetOptions(c.urlParams_, opts...)
  75388. res, err := c.doRequest("json")
  75389. if res != nil && res.StatusCode == http.StatusNotModified {
  75390. if res.Body != nil {
  75391. res.Body.Close()
  75392. }
  75393. return nil, &googleapi.Error{
  75394. Code: res.StatusCode,
  75395. Header: res.Header,
  75396. }
  75397. }
  75398. if err != nil {
  75399. return nil, err
  75400. }
  75401. defer googleapi.CloseBody(res)
  75402. if err := googleapi.CheckResponse(res); err != nil {
  75403. return nil, err
  75404. }
  75405. ret := &Operation{
  75406. ServerResponse: googleapi.ServerResponse{
  75407. Header: res.Header,
  75408. HTTPStatusCode: res.StatusCode,
  75409. },
  75410. }
  75411. target := &ret
  75412. if err := gensupport.DecodeResponse(target, res); err != nil {
  75413. return nil, err
  75414. }
  75415. return ret, nil
  75416. // {
  75417. // "description": "Retrieves the specified region-specific Operations resource.",
  75418. // "httpMethod": "GET",
  75419. // "id": "compute.regionOperations.get",
  75420. // "parameterOrder": [
  75421. // "project",
  75422. // "region",
  75423. // "operation"
  75424. // ],
  75425. // "parameters": {
  75426. // "operation": {
  75427. // "description": "Name of the Operations resource to return.",
  75428. // "location": "path",
  75429. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75430. // "required": true,
  75431. // "type": "string"
  75432. // },
  75433. // "project": {
  75434. // "description": "Project ID for this request.",
  75435. // "location": "path",
  75436. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75437. // "required": true,
  75438. // "type": "string"
  75439. // },
  75440. // "region": {
  75441. // "description": "Name of the region for this request.",
  75442. // "location": "path",
  75443. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75444. // "required": true,
  75445. // "type": "string"
  75446. // }
  75447. // },
  75448. // "path": "{project}/regions/{region}/operations/{operation}",
  75449. // "response": {
  75450. // "$ref": "Operation"
  75451. // },
  75452. // "scopes": [
  75453. // "https://www.googleapis.com/auth/cloud-platform",
  75454. // "https://www.googleapis.com/auth/compute",
  75455. // "https://www.googleapis.com/auth/compute.readonly"
  75456. // ]
  75457. // }
  75458. }
  75459. // method id "compute.regionOperations.list":
  75460. type RegionOperationsListCall struct {
  75461. s *Service
  75462. project string
  75463. region string
  75464. urlParams_ gensupport.URLParams
  75465. ifNoneMatch_ string
  75466. ctx_ context.Context
  75467. header_ http.Header
  75468. }
  75469. // List: Retrieves a list of Operation resources contained within the
  75470. // specified region.
  75471. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list
  75472. func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall {
  75473. c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75474. c.project = project
  75475. c.region = region
  75476. return c
  75477. }
  75478. // Filter sets the optional parameter "filter": A filter expression that
  75479. // filters resources listed in the response. The expression must specify
  75480. // the field name, a comparison operator, and the value that you want to
  75481. // use for filtering. The value must be a string, a number, or a
  75482. // boolean. The comparison operator must be either =, !=, >, or <.
  75483. //
  75484. // For example, if you are filtering Compute Engine instances, you can
  75485. // exclude instances named example-instance by specifying name !=
  75486. // example-instance.
  75487. //
  75488. // You can also filter nested fields. For example, you could specify
  75489. // scheduling.automaticRestart = false to include instances only if they
  75490. // are not scheduled for automatic restarts. You can use filtering on
  75491. // nested fields to filter based on resource labels.
  75492. //
  75493. // To filter on multiple expressions, provide each separate expression
  75494. // within parentheses. For example, (scheduling.automaticRestart = true)
  75495. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  75496. // AND expression. However, you can include AND and OR expressions
  75497. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  75498. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  75499. // true).
  75500. func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall {
  75501. c.urlParams_.Set("filter", filter)
  75502. return c
  75503. }
  75504. // MaxResults sets the optional parameter "maxResults": The maximum
  75505. // number of results per page that should be returned. If the number of
  75506. // available results is larger than maxResults, Compute Engine returns a
  75507. // nextPageToken that can be used to get the next page of results in
  75508. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  75509. // (Default: 500)
  75510. func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall {
  75511. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  75512. return c
  75513. }
  75514. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  75515. // a certain order. By default, results are returned in alphanumerical
  75516. // order based on the resource name.
  75517. //
  75518. // You can also sort results in descending order based on the creation
  75519. // timestamp using orderBy="creationTimestamp desc". This sorts results
  75520. // based on the creationTimestamp field in reverse chronological order
  75521. // (newest result first). Use this to sort resources like operations so
  75522. // that the newest operation is returned first.
  75523. //
  75524. // Currently, only sorting by name or creationTimestamp desc is
  75525. // supported.
  75526. func (c *RegionOperationsListCall) OrderBy(orderBy string) *RegionOperationsListCall {
  75527. c.urlParams_.Set("orderBy", orderBy)
  75528. return c
  75529. }
  75530. // PageToken sets the optional parameter "pageToken": Specifies a page
  75531. // token to use. Set pageToken to the nextPageToken returned by a
  75532. // previous list request to get the next page of results.
  75533. func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall {
  75534. c.urlParams_.Set("pageToken", pageToken)
  75535. return c
  75536. }
  75537. // Fields allows partial responses to be retrieved. See
  75538. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75539. // for more information.
  75540. func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall {
  75541. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75542. return c
  75543. }
  75544. // IfNoneMatch sets the optional parameter which makes the operation
  75545. // fail if the object's ETag matches the given value. This is useful for
  75546. // getting updates only after the object has changed since the last
  75547. // request. Use googleapi.IsNotModified to check whether the response
  75548. // error from Do is the result of In-None-Match.
  75549. func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall {
  75550. c.ifNoneMatch_ = entityTag
  75551. return c
  75552. }
  75553. // Context sets the context to be used in this call's Do method. Any
  75554. // pending HTTP request will be aborted if the provided context is
  75555. // canceled.
  75556. func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall {
  75557. c.ctx_ = ctx
  75558. return c
  75559. }
  75560. // Header returns an http.Header that can be modified by the caller to
  75561. // add HTTP headers to the request.
  75562. func (c *RegionOperationsListCall) Header() http.Header {
  75563. if c.header_ == nil {
  75564. c.header_ = make(http.Header)
  75565. }
  75566. return c.header_
  75567. }
  75568. func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) {
  75569. reqHeaders := make(http.Header)
  75570. for k, v := range c.header_ {
  75571. reqHeaders[k] = v
  75572. }
  75573. reqHeaders.Set("User-Agent", c.s.userAgent())
  75574. if c.ifNoneMatch_ != "" {
  75575. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75576. }
  75577. var body io.Reader = nil
  75578. c.urlParams_.Set("alt", alt)
  75579. c.urlParams_.Set("prettyPrint", "false")
  75580. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations")
  75581. urls += "?" + c.urlParams_.Encode()
  75582. req, err := http.NewRequest("GET", urls, body)
  75583. if err != nil {
  75584. return nil, err
  75585. }
  75586. req.Header = reqHeaders
  75587. googleapi.Expand(req.URL, map[string]string{
  75588. "project": c.project,
  75589. "region": c.region,
  75590. })
  75591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75592. }
  75593. // Do executes the "compute.regionOperations.list" call.
  75594. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  75595. // status code is an error. Response headers are in either
  75596. // *OperationList.ServerResponse.Header or (if a response was returned
  75597. // at all) in error.(*googleapi.Error).Header. Use
  75598. // googleapi.IsNotModified to check whether the returned error was
  75599. // because http.StatusNotModified was returned.
  75600. func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  75601. gensupport.SetOptions(c.urlParams_, opts...)
  75602. res, err := c.doRequest("json")
  75603. if res != nil && res.StatusCode == http.StatusNotModified {
  75604. if res.Body != nil {
  75605. res.Body.Close()
  75606. }
  75607. return nil, &googleapi.Error{
  75608. Code: res.StatusCode,
  75609. Header: res.Header,
  75610. }
  75611. }
  75612. if err != nil {
  75613. return nil, err
  75614. }
  75615. defer googleapi.CloseBody(res)
  75616. if err := googleapi.CheckResponse(res); err != nil {
  75617. return nil, err
  75618. }
  75619. ret := &OperationList{
  75620. ServerResponse: googleapi.ServerResponse{
  75621. Header: res.Header,
  75622. HTTPStatusCode: res.StatusCode,
  75623. },
  75624. }
  75625. target := &ret
  75626. if err := gensupport.DecodeResponse(target, res); err != nil {
  75627. return nil, err
  75628. }
  75629. return ret, nil
  75630. // {
  75631. // "description": "Retrieves a list of Operation resources contained within the specified region.",
  75632. // "httpMethod": "GET",
  75633. // "id": "compute.regionOperations.list",
  75634. // "parameterOrder": [
  75635. // "project",
  75636. // "region"
  75637. // ],
  75638. // "parameters": {
  75639. // "filter": {
  75640. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  75641. // "location": "query",
  75642. // "type": "string"
  75643. // },
  75644. // "maxResults": {
  75645. // "default": "500",
  75646. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  75647. // "format": "uint32",
  75648. // "location": "query",
  75649. // "minimum": "0",
  75650. // "type": "integer"
  75651. // },
  75652. // "orderBy": {
  75653. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  75654. // "location": "query",
  75655. // "type": "string"
  75656. // },
  75657. // "pageToken": {
  75658. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  75659. // "location": "query",
  75660. // "type": "string"
  75661. // },
  75662. // "project": {
  75663. // "description": "Project ID for this request.",
  75664. // "location": "path",
  75665. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75666. // "required": true,
  75667. // "type": "string"
  75668. // },
  75669. // "region": {
  75670. // "description": "Name of the region for this request.",
  75671. // "location": "path",
  75672. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75673. // "required": true,
  75674. // "type": "string"
  75675. // }
  75676. // },
  75677. // "path": "{project}/regions/{region}/operations",
  75678. // "response": {
  75679. // "$ref": "OperationList"
  75680. // },
  75681. // "scopes": [
  75682. // "https://www.googleapis.com/auth/cloud-platform",
  75683. // "https://www.googleapis.com/auth/compute",
  75684. // "https://www.googleapis.com/auth/compute.readonly"
  75685. // ]
  75686. // }
  75687. }
  75688. // Pages invokes f for each page of results.
  75689. // A non-nil error returned from f will halt the iteration.
  75690. // The provided context supersedes any context provided to the Context method.
  75691. func (c *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  75692. c.ctx_ = ctx
  75693. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  75694. for {
  75695. x, err := c.Do()
  75696. if err != nil {
  75697. return err
  75698. }
  75699. if err := f(x); err != nil {
  75700. return err
  75701. }
  75702. if x.NextPageToken == "" {
  75703. return nil
  75704. }
  75705. c.PageToken(x.NextPageToken)
  75706. }
  75707. }
  75708. // method id "compute.regions.get":
  75709. type RegionsGetCall struct {
  75710. s *Service
  75711. project string
  75712. region string
  75713. urlParams_ gensupport.URLParams
  75714. ifNoneMatch_ string
  75715. ctx_ context.Context
  75716. header_ http.Header
  75717. }
  75718. // Get: Returns the specified Region resource. Gets a list of available
  75719. // regions by making a list() request.
  75720. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get
  75721. func (r *RegionsService) Get(project string, region string) *RegionsGetCall {
  75722. c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75723. c.project = project
  75724. c.region = region
  75725. return c
  75726. }
  75727. // Fields allows partial responses to be retrieved. See
  75728. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75729. // for more information.
  75730. func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall {
  75731. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75732. return c
  75733. }
  75734. // IfNoneMatch sets the optional parameter which makes the operation
  75735. // fail if the object's ETag matches the given value. This is useful for
  75736. // getting updates only after the object has changed since the last
  75737. // request. Use googleapi.IsNotModified to check whether the response
  75738. // error from Do is the result of In-None-Match.
  75739. func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall {
  75740. c.ifNoneMatch_ = entityTag
  75741. return c
  75742. }
  75743. // Context sets the context to be used in this call's Do method. Any
  75744. // pending HTTP request will be aborted if the provided context is
  75745. // canceled.
  75746. func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall {
  75747. c.ctx_ = ctx
  75748. return c
  75749. }
  75750. // Header returns an http.Header that can be modified by the caller to
  75751. // add HTTP headers to the request.
  75752. func (c *RegionsGetCall) Header() http.Header {
  75753. if c.header_ == nil {
  75754. c.header_ = make(http.Header)
  75755. }
  75756. return c.header_
  75757. }
  75758. func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) {
  75759. reqHeaders := make(http.Header)
  75760. for k, v := range c.header_ {
  75761. reqHeaders[k] = v
  75762. }
  75763. reqHeaders.Set("User-Agent", c.s.userAgent())
  75764. if c.ifNoneMatch_ != "" {
  75765. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75766. }
  75767. var body io.Reader = nil
  75768. c.urlParams_.Set("alt", alt)
  75769. c.urlParams_.Set("prettyPrint", "false")
  75770. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}")
  75771. urls += "?" + c.urlParams_.Encode()
  75772. req, err := http.NewRequest("GET", urls, body)
  75773. if err != nil {
  75774. return nil, err
  75775. }
  75776. req.Header = reqHeaders
  75777. googleapi.Expand(req.URL, map[string]string{
  75778. "project": c.project,
  75779. "region": c.region,
  75780. })
  75781. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75782. }
  75783. // Do executes the "compute.regions.get" call.
  75784. // Exactly one of *Region or error will be non-nil. Any non-2xx status
  75785. // code is an error. Response headers are in either
  75786. // *Region.ServerResponse.Header or (if a response was returned at all)
  75787. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  75788. // check whether the returned error was because http.StatusNotModified
  75789. // was returned.
  75790. func (c *RegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, error) {
  75791. gensupport.SetOptions(c.urlParams_, opts...)
  75792. res, err := c.doRequest("json")
  75793. if res != nil && res.StatusCode == http.StatusNotModified {
  75794. if res.Body != nil {
  75795. res.Body.Close()
  75796. }
  75797. return nil, &googleapi.Error{
  75798. Code: res.StatusCode,
  75799. Header: res.Header,
  75800. }
  75801. }
  75802. if err != nil {
  75803. return nil, err
  75804. }
  75805. defer googleapi.CloseBody(res)
  75806. if err := googleapi.CheckResponse(res); err != nil {
  75807. return nil, err
  75808. }
  75809. ret := &Region{
  75810. ServerResponse: googleapi.ServerResponse{
  75811. Header: res.Header,
  75812. HTTPStatusCode: res.StatusCode,
  75813. },
  75814. }
  75815. target := &ret
  75816. if err := gensupport.DecodeResponse(target, res); err != nil {
  75817. return nil, err
  75818. }
  75819. return ret, nil
  75820. // {
  75821. // "description": "Returns the specified Region resource. Gets a list of available regions by making a list() request.",
  75822. // "httpMethod": "GET",
  75823. // "id": "compute.regions.get",
  75824. // "parameterOrder": [
  75825. // "project",
  75826. // "region"
  75827. // ],
  75828. // "parameters": {
  75829. // "project": {
  75830. // "description": "Project ID for this request.",
  75831. // "location": "path",
  75832. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75833. // "required": true,
  75834. // "type": "string"
  75835. // },
  75836. // "region": {
  75837. // "description": "Name of the region resource to return.",
  75838. // "location": "path",
  75839. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75840. // "required": true,
  75841. // "type": "string"
  75842. // }
  75843. // },
  75844. // "path": "{project}/regions/{region}",
  75845. // "response": {
  75846. // "$ref": "Region"
  75847. // },
  75848. // "scopes": [
  75849. // "https://www.googleapis.com/auth/cloud-platform",
  75850. // "https://www.googleapis.com/auth/compute",
  75851. // "https://www.googleapis.com/auth/compute.readonly"
  75852. // ]
  75853. // }
  75854. }
  75855. // method id "compute.regions.list":
  75856. type RegionsListCall struct {
  75857. s *Service
  75858. project string
  75859. urlParams_ gensupport.URLParams
  75860. ifNoneMatch_ string
  75861. ctx_ context.Context
  75862. header_ http.Header
  75863. }
  75864. // List: Retrieves the list of region resources available to the
  75865. // specified project.
  75866. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list
  75867. func (r *RegionsService) List(project string) *RegionsListCall {
  75868. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75869. c.project = project
  75870. return c
  75871. }
  75872. // Filter sets the optional parameter "filter": A filter expression that
  75873. // filters resources listed in the response. The expression must specify
  75874. // the field name, a comparison operator, and the value that you want to
  75875. // use for filtering. The value must be a string, a number, or a
  75876. // boolean. The comparison operator must be either =, !=, >, or <.
  75877. //
  75878. // For example, if you are filtering Compute Engine instances, you can
  75879. // exclude instances named example-instance by specifying name !=
  75880. // example-instance.
  75881. //
  75882. // You can also filter nested fields. For example, you could specify
  75883. // scheduling.automaticRestart = false to include instances only if they
  75884. // are not scheduled for automatic restarts. You can use filtering on
  75885. // nested fields to filter based on resource labels.
  75886. //
  75887. // To filter on multiple expressions, provide each separate expression
  75888. // within parentheses. For example, (scheduling.automaticRestart = true)
  75889. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  75890. // AND expression. However, you can include AND and OR expressions
  75891. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  75892. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  75893. // true).
  75894. func (c *RegionsListCall) Filter(filter string) *RegionsListCall {
  75895. c.urlParams_.Set("filter", filter)
  75896. return c
  75897. }
  75898. // MaxResults sets the optional parameter "maxResults": The maximum
  75899. // number of results per page that should be returned. If the number of
  75900. // available results is larger than maxResults, Compute Engine returns a
  75901. // nextPageToken that can be used to get the next page of results in
  75902. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  75903. // (Default: 500)
  75904. func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall {
  75905. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  75906. return c
  75907. }
  75908. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  75909. // a certain order. By default, results are returned in alphanumerical
  75910. // order based on the resource name.
  75911. //
  75912. // You can also sort results in descending order based on the creation
  75913. // timestamp using orderBy="creationTimestamp desc". This sorts results
  75914. // based on the creationTimestamp field in reverse chronological order
  75915. // (newest result first). Use this to sort resources like operations so
  75916. // that the newest operation is returned first.
  75917. //
  75918. // Currently, only sorting by name or creationTimestamp desc is
  75919. // supported.
  75920. func (c *RegionsListCall) OrderBy(orderBy string) *RegionsListCall {
  75921. c.urlParams_.Set("orderBy", orderBy)
  75922. return c
  75923. }
  75924. // PageToken sets the optional parameter "pageToken": Specifies a page
  75925. // token to use. Set pageToken to the nextPageToken returned by a
  75926. // previous list request to get the next page of results.
  75927. func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall {
  75928. c.urlParams_.Set("pageToken", pageToken)
  75929. return c
  75930. }
  75931. // Fields allows partial responses to be retrieved. See
  75932. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75933. // for more information.
  75934. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  75935. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75936. return c
  75937. }
  75938. // IfNoneMatch sets the optional parameter which makes the operation
  75939. // fail if the object's ETag matches the given value. This is useful for
  75940. // getting updates only after the object has changed since the last
  75941. // request. Use googleapi.IsNotModified to check whether the response
  75942. // error from Do is the result of In-None-Match.
  75943. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  75944. c.ifNoneMatch_ = entityTag
  75945. return c
  75946. }
  75947. // Context sets the context to be used in this call's Do method. Any
  75948. // pending HTTP request will be aborted if the provided context is
  75949. // canceled.
  75950. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  75951. c.ctx_ = ctx
  75952. return c
  75953. }
  75954. // Header returns an http.Header that can be modified by the caller to
  75955. // add HTTP headers to the request.
  75956. func (c *RegionsListCall) Header() http.Header {
  75957. if c.header_ == nil {
  75958. c.header_ = make(http.Header)
  75959. }
  75960. return c.header_
  75961. }
  75962. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  75963. reqHeaders := make(http.Header)
  75964. for k, v := range c.header_ {
  75965. reqHeaders[k] = v
  75966. }
  75967. reqHeaders.Set("User-Agent", c.s.userAgent())
  75968. if c.ifNoneMatch_ != "" {
  75969. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75970. }
  75971. var body io.Reader = nil
  75972. c.urlParams_.Set("alt", alt)
  75973. c.urlParams_.Set("prettyPrint", "false")
  75974. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions")
  75975. urls += "?" + c.urlParams_.Encode()
  75976. req, err := http.NewRequest("GET", urls, body)
  75977. if err != nil {
  75978. return nil, err
  75979. }
  75980. req.Header = reqHeaders
  75981. googleapi.Expand(req.URL, map[string]string{
  75982. "project": c.project,
  75983. })
  75984. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75985. }
  75986. // Do executes the "compute.regions.list" call.
  75987. // Exactly one of *RegionList or error will be non-nil. Any non-2xx
  75988. // status code is an error. Response headers are in either
  75989. // *RegionList.ServerResponse.Header or (if a response was returned at
  75990. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75991. // to check whether the returned error was because
  75992. // http.StatusNotModified was returned.
  75993. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, error) {
  75994. gensupport.SetOptions(c.urlParams_, opts...)
  75995. res, err := c.doRequest("json")
  75996. if res != nil && res.StatusCode == http.StatusNotModified {
  75997. if res.Body != nil {
  75998. res.Body.Close()
  75999. }
  76000. return nil, &googleapi.Error{
  76001. Code: res.StatusCode,
  76002. Header: res.Header,
  76003. }
  76004. }
  76005. if err != nil {
  76006. return nil, err
  76007. }
  76008. defer googleapi.CloseBody(res)
  76009. if err := googleapi.CheckResponse(res); err != nil {
  76010. return nil, err
  76011. }
  76012. ret := &RegionList{
  76013. ServerResponse: googleapi.ServerResponse{
  76014. Header: res.Header,
  76015. HTTPStatusCode: res.StatusCode,
  76016. },
  76017. }
  76018. target := &ret
  76019. if err := gensupport.DecodeResponse(target, res); err != nil {
  76020. return nil, err
  76021. }
  76022. return ret, nil
  76023. // {
  76024. // "description": "Retrieves the list of region resources available to the specified project.",
  76025. // "httpMethod": "GET",
  76026. // "id": "compute.regions.list",
  76027. // "parameterOrder": [
  76028. // "project"
  76029. // ],
  76030. // "parameters": {
  76031. // "filter": {
  76032. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  76033. // "location": "query",
  76034. // "type": "string"
  76035. // },
  76036. // "maxResults": {
  76037. // "default": "500",
  76038. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  76039. // "format": "uint32",
  76040. // "location": "query",
  76041. // "minimum": "0",
  76042. // "type": "integer"
  76043. // },
  76044. // "orderBy": {
  76045. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  76046. // "location": "query",
  76047. // "type": "string"
  76048. // },
  76049. // "pageToken": {
  76050. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  76051. // "location": "query",
  76052. // "type": "string"
  76053. // },
  76054. // "project": {
  76055. // "description": "Project ID for this request.",
  76056. // "location": "path",
  76057. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76058. // "required": true,
  76059. // "type": "string"
  76060. // }
  76061. // },
  76062. // "path": "{project}/regions",
  76063. // "response": {
  76064. // "$ref": "RegionList"
  76065. // },
  76066. // "scopes": [
  76067. // "https://www.googleapis.com/auth/cloud-platform",
  76068. // "https://www.googleapis.com/auth/compute",
  76069. // "https://www.googleapis.com/auth/compute.readonly"
  76070. // ]
  76071. // }
  76072. }
  76073. // Pages invokes f for each page of results.
  76074. // A non-nil error returned from f will halt the iteration.
  76075. // The provided context supersedes any context provided to the Context method.
  76076. func (c *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) error) error {
  76077. c.ctx_ = ctx
  76078. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  76079. for {
  76080. x, err := c.Do()
  76081. if err != nil {
  76082. return err
  76083. }
  76084. if err := f(x); err != nil {
  76085. return err
  76086. }
  76087. if x.NextPageToken == "" {
  76088. return nil
  76089. }
  76090. c.PageToken(x.NextPageToken)
  76091. }
  76092. }
  76093. // method id "compute.routers.aggregatedList":
  76094. type RoutersAggregatedListCall struct {
  76095. s *Service
  76096. project string
  76097. urlParams_ gensupport.URLParams
  76098. ifNoneMatch_ string
  76099. ctx_ context.Context
  76100. header_ http.Header
  76101. }
  76102. // AggregatedList: Retrieves an aggregated list of routers.
  76103. func (r *RoutersService) AggregatedList(project string) *RoutersAggregatedListCall {
  76104. c := &RoutersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76105. c.project = project
  76106. return c
  76107. }
  76108. // Filter sets the optional parameter "filter": A filter expression that
  76109. // filters resources listed in the response. The expression must specify
  76110. // the field name, a comparison operator, and the value that you want to
  76111. // use for filtering. The value must be a string, a number, or a
  76112. // boolean. The comparison operator must be either =, !=, >, or <.
  76113. //
  76114. // For example, if you are filtering Compute Engine instances, you can
  76115. // exclude instances named example-instance by specifying name !=
  76116. // example-instance.
  76117. //
  76118. // You can also filter nested fields. For example, you could specify
  76119. // scheduling.automaticRestart = false to include instances only if they
  76120. // are not scheduled for automatic restarts. You can use filtering on
  76121. // nested fields to filter based on resource labels.
  76122. //
  76123. // To filter on multiple expressions, provide each separate expression
  76124. // within parentheses. For example, (scheduling.automaticRestart = true)
  76125. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  76126. // AND expression. However, you can include AND and OR expressions
  76127. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  76128. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  76129. // true).
  76130. func (c *RoutersAggregatedListCall) Filter(filter string) *RoutersAggregatedListCall {
  76131. c.urlParams_.Set("filter", filter)
  76132. return c
  76133. }
  76134. // MaxResults sets the optional parameter "maxResults": The maximum
  76135. // number of results per page that should be returned. If the number of
  76136. // available results is larger than maxResults, Compute Engine returns a
  76137. // nextPageToken that can be used to get the next page of results in
  76138. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  76139. // (Default: 500)
  76140. func (c *RoutersAggregatedListCall) MaxResults(maxResults int64) *RoutersAggregatedListCall {
  76141. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  76142. return c
  76143. }
  76144. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  76145. // a certain order. By default, results are returned in alphanumerical
  76146. // order based on the resource name.
  76147. //
  76148. // You can also sort results in descending order based on the creation
  76149. // timestamp using orderBy="creationTimestamp desc". This sorts results
  76150. // based on the creationTimestamp field in reverse chronological order
  76151. // (newest result first). Use this to sort resources like operations so
  76152. // that the newest operation is returned first.
  76153. //
  76154. // Currently, only sorting by name or creationTimestamp desc is
  76155. // supported.
  76156. func (c *RoutersAggregatedListCall) OrderBy(orderBy string) *RoutersAggregatedListCall {
  76157. c.urlParams_.Set("orderBy", orderBy)
  76158. return c
  76159. }
  76160. // PageToken sets the optional parameter "pageToken": Specifies a page
  76161. // token to use. Set pageToken to the nextPageToken returned by a
  76162. // previous list request to get the next page of results.
  76163. func (c *RoutersAggregatedListCall) PageToken(pageToken string) *RoutersAggregatedListCall {
  76164. c.urlParams_.Set("pageToken", pageToken)
  76165. return c
  76166. }
  76167. // Fields allows partial responses to be retrieved. See
  76168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76169. // for more information.
  76170. func (c *RoutersAggregatedListCall) Fields(s ...googleapi.Field) *RoutersAggregatedListCall {
  76171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76172. return c
  76173. }
  76174. // IfNoneMatch sets the optional parameter which makes the operation
  76175. // fail if the object's ETag matches the given value. This is useful for
  76176. // getting updates only after the object has changed since the last
  76177. // request. Use googleapi.IsNotModified to check whether the response
  76178. // error from Do is the result of In-None-Match.
  76179. func (c *RoutersAggregatedListCall) IfNoneMatch(entityTag string) *RoutersAggregatedListCall {
  76180. c.ifNoneMatch_ = entityTag
  76181. return c
  76182. }
  76183. // Context sets the context to be used in this call's Do method. Any
  76184. // pending HTTP request will be aborted if the provided context is
  76185. // canceled.
  76186. func (c *RoutersAggregatedListCall) Context(ctx context.Context) *RoutersAggregatedListCall {
  76187. c.ctx_ = ctx
  76188. return c
  76189. }
  76190. // Header returns an http.Header that can be modified by the caller to
  76191. // add HTTP headers to the request.
  76192. func (c *RoutersAggregatedListCall) Header() http.Header {
  76193. if c.header_ == nil {
  76194. c.header_ = make(http.Header)
  76195. }
  76196. return c.header_
  76197. }
  76198. func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  76199. reqHeaders := make(http.Header)
  76200. for k, v := range c.header_ {
  76201. reqHeaders[k] = v
  76202. }
  76203. reqHeaders.Set("User-Agent", c.s.userAgent())
  76204. if c.ifNoneMatch_ != "" {
  76205. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76206. }
  76207. var body io.Reader = nil
  76208. c.urlParams_.Set("alt", alt)
  76209. c.urlParams_.Set("prettyPrint", "false")
  76210. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/routers")
  76211. urls += "?" + c.urlParams_.Encode()
  76212. req, err := http.NewRequest("GET", urls, body)
  76213. if err != nil {
  76214. return nil, err
  76215. }
  76216. req.Header = reqHeaders
  76217. googleapi.Expand(req.URL, map[string]string{
  76218. "project": c.project,
  76219. })
  76220. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76221. }
  76222. // Do executes the "compute.routers.aggregatedList" call.
  76223. // Exactly one of *RouterAggregatedList or error will be non-nil. Any
  76224. // non-2xx status code is an error. Response headers are in either
  76225. // *RouterAggregatedList.ServerResponse.Header or (if a response was
  76226. // returned at all) in error.(*googleapi.Error).Header. Use
  76227. // googleapi.IsNotModified to check whether the returned error was
  76228. // because http.StatusNotModified was returned.
  76229. func (c *RoutersAggregatedListCall) Do(opts ...googleapi.CallOption) (*RouterAggregatedList, error) {
  76230. gensupport.SetOptions(c.urlParams_, opts...)
  76231. res, err := c.doRequest("json")
  76232. if res != nil && res.StatusCode == http.StatusNotModified {
  76233. if res.Body != nil {
  76234. res.Body.Close()
  76235. }
  76236. return nil, &googleapi.Error{
  76237. Code: res.StatusCode,
  76238. Header: res.Header,
  76239. }
  76240. }
  76241. if err != nil {
  76242. return nil, err
  76243. }
  76244. defer googleapi.CloseBody(res)
  76245. if err := googleapi.CheckResponse(res); err != nil {
  76246. return nil, err
  76247. }
  76248. ret := &RouterAggregatedList{
  76249. ServerResponse: googleapi.ServerResponse{
  76250. Header: res.Header,
  76251. HTTPStatusCode: res.StatusCode,
  76252. },
  76253. }
  76254. target := &ret
  76255. if err := gensupport.DecodeResponse(target, res); err != nil {
  76256. return nil, err
  76257. }
  76258. return ret, nil
  76259. // {
  76260. // "description": "Retrieves an aggregated list of routers.",
  76261. // "httpMethod": "GET",
  76262. // "id": "compute.routers.aggregatedList",
  76263. // "parameterOrder": [
  76264. // "project"
  76265. // ],
  76266. // "parameters": {
  76267. // "filter": {
  76268. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  76269. // "location": "query",
  76270. // "type": "string"
  76271. // },
  76272. // "maxResults": {
  76273. // "default": "500",
  76274. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  76275. // "format": "uint32",
  76276. // "location": "query",
  76277. // "minimum": "0",
  76278. // "type": "integer"
  76279. // },
  76280. // "orderBy": {
  76281. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  76282. // "location": "query",
  76283. // "type": "string"
  76284. // },
  76285. // "pageToken": {
  76286. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  76287. // "location": "query",
  76288. // "type": "string"
  76289. // },
  76290. // "project": {
  76291. // "description": "Project ID for this request.",
  76292. // "location": "path",
  76293. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76294. // "required": true,
  76295. // "type": "string"
  76296. // }
  76297. // },
  76298. // "path": "{project}/aggregated/routers",
  76299. // "response": {
  76300. // "$ref": "RouterAggregatedList"
  76301. // },
  76302. // "scopes": [
  76303. // "https://www.googleapis.com/auth/cloud-platform",
  76304. // "https://www.googleapis.com/auth/compute",
  76305. // "https://www.googleapis.com/auth/compute.readonly"
  76306. // ]
  76307. // }
  76308. }
  76309. // Pages invokes f for each page of results.
  76310. // A non-nil error returned from f will halt the iteration.
  76311. // The provided context supersedes any context provided to the Context method.
  76312. func (c *RoutersAggregatedListCall) Pages(ctx context.Context, f func(*RouterAggregatedList) error) error {
  76313. c.ctx_ = ctx
  76314. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  76315. for {
  76316. x, err := c.Do()
  76317. if err != nil {
  76318. return err
  76319. }
  76320. if err := f(x); err != nil {
  76321. return err
  76322. }
  76323. if x.NextPageToken == "" {
  76324. return nil
  76325. }
  76326. c.PageToken(x.NextPageToken)
  76327. }
  76328. }
  76329. // method id "compute.routers.delete":
  76330. type RoutersDeleteCall struct {
  76331. s *Service
  76332. project string
  76333. region string
  76334. router string
  76335. urlParams_ gensupport.URLParams
  76336. ctx_ context.Context
  76337. header_ http.Header
  76338. }
  76339. // Delete: Deletes the specified Router resource.
  76340. func (r *RoutersService) Delete(project string, region string, router string) *RoutersDeleteCall {
  76341. c := &RoutersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76342. c.project = project
  76343. c.region = region
  76344. c.router = router
  76345. return c
  76346. }
  76347. // RequestId sets the optional parameter "requestId": An optional
  76348. // request ID to identify requests. Specify a unique request ID so that
  76349. // if you must retry your request, the server will know to ignore the
  76350. // request if it has already been completed.
  76351. //
  76352. // For example, consider a situation where you make an initial request
  76353. // and the request times out. If you make the request again with the
  76354. // same request ID, the server can check if original operation with the
  76355. // same request ID was received, and if so, will ignore the second
  76356. // request. This prevents clients from accidentally creating duplicate
  76357. // commitments.
  76358. //
  76359. // The request ID must be a valid UUID with the exception that zero UUID
  76360. // is not supported (00000000-0000-0000-0000-000000000000).
  76361. func (c *RoutersDeleteCall) RequestId(requestId string) *RoutersDeleteCall {
  76362. c.urlParams_.Set("requestId", requestId)
  76363. return c
  76364. }
  76365. // Fields allows partial responses to be retrieved. See
  76366. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76367. // for more information.
  76368. func (c *RoutersDeleteCall) Fields(s ...googleapi.Field) *RoutersDeleteCall {
  76369. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76370. return c
  76371. }
  76372. // Context sets the context to be used in this call's Do method. Any
  76373. // pending HTTP request will be aborted if the provided context is
  76374. // canceled.
  76375. func (c *RoutersDeleteCall) Context(ctx context.Context) *RoutersDeleteCall {
  76376. c.ctx_ = ctx
  76377. return c
  76378. }
  76379. // Header returns an http.Header that can be modified by the caller to
  76380. // add HTTP headers to the request.
  76381. func (c *RoutersDeleteCall) Header() http.Header {
  76382. if c.header_ == nil {
  76383. c.header_ = make(http.Header)
  76384. }
  76385. return c.header_
  76386. }
  76387. func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) {
  76388. reqHeaders := make(http.Header)
  76389. for k, v := range c.header_ {
  76390. reqHeaders[k] = v
  76391. }
  76392. reqHeaders.Set("User-Agent", c.s.userAgent())
  76393. var body io.Reader = nil
  76394. c.urlParams_.Set("alt", alt)
  76395. c.urlParams_.Set("prettyPrint", "false")
  76396. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  76397. urls += "?" + c.urlParams_.Encode()
  76398. req, err := http.NewRequest("DELETE", urls, body)
  76399. if err != nil {
  76400. return nil, err
  76401. }
  76402. req.Header = reqHeaders
  76403. googleapi.Expand(req.URL, map[string]string{
  76404. "project": c.project,
  76405. "region": c.region,
  76406. "router": c.router,
  76407. })
  76408. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76409. }
  76410. // Do executes the "compute.routers.delete" call.
  76411. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76412. // status code is an error. Response headers are in either
  76413. // *Operation.ServerResponse.Header or (if a response was returned at
  76414. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76415. // to check whether the returned error was because
  76416. // http.StatusNotModified was returned.
  76417. func (c *RoutersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76418. gensupport.SetOptions(c.urlParams_, opts...)
  76419. res, err := c.doRequest("json")
  76420. if res != nil && res.StatusCode == http.StatusNotModified {
  76421. if res.Body != nil {
  76422. res.Body.Close()
  76423. }
  76424. return nil, &googleapi.Error{
  76425. Code: res.StatusCode,
  76426. Header: res.Header,
  76427. }
  76428. }
  76429. if err != nil {
  76430. return nil, err
  76431. }
  76432. defer googleapi.CloseBody(res)
  76433. if err := googleapi.CheckResponse(res); err != nil {
  76434. return nil, err
  76435. }
  76436. ret := &Operation{
  76437. ServerResponse: googleapi.ServerResponse{
  76438. Header: res.Header,
  76439. HTTPStatusCode: res.StatusCode,
  76440. },
  76441. }
  76442. target := &ret
  76443. if err := gensupport.DecodeResponse(target, res); err != nil {
  76444. return nil, err
  76445. }
  76446. return ret, nil
  76447. // {
  76448. // "description": "Deletes the specified Router resource.",
  76449. // "httpMethod": "DELETE",
  76450. // "id": "compute.routers.delete",
  76451. // "parameterOrder": [
  76452. // "project",
  76453. // "region",
  76454. // "router"
  76455. // ],
  76456. // "parameters": {
  76457. // "project": {
  76458. // "description": "Project ID for this request.",
  76459. // "location": "path",
  76460. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76461. // "required": true,
  76462. // "type": "string"
  76463. // },
  76464. // "region": {
  76465. // "description": "Name of the region for this request.",
  76466. // "location": "path",
  76467. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76468. // "required": true,
  76469. // "type": "string"
  76470. // },
  76471. // "requestId": {
  76472. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76473. // "location": "query",
  76474. // "type": "string"
  76475. // },
  76476. // "router": {
  76477. // "description": "Name of the Router resource to delete.",
  76478. // "location": "path",
  76479. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76480. // "required": true,
  76481. // "type": "string"
  76482. // }
  76483. // },
  76484. // "path": "{project}/regions/{region}/routers/{router}",
  76485. // "response": {
  76486. // "$ref": "Operation"
  76487. // },
  76488. // "scopes": [
  76489. // "https://www.googleapis.com/auth/cloud-platform",
  76490. // "https://www.googleapis.com/auth/compute"
  76491. // ]
  76492. // }
  76493. }
  76494. // method id "compute.routers.get":
  76495. type RoutersGetCall struct {
  76496. s *Service
  76497. project string
  76498. region string
  76499. router string
  76500. urlParams_ gensupport.URLParams
  76501. ifNoneMatch_ string
  76502. ctx_ context.Context
  76503. header_ http.Header
  76504. }
  76505. // Get: Returns the specified Router resource. Gets a list of available
  76506. // routers by making a list() request.
  76507. func (r *RoutersService) Get(project string, region string, router string) *RoutersGetCall {
  76508. c := &RoutersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76509. c.project = project
  76510. c.region = region
  76511. c.router = router
  76512. return c
  76513. }
  76514. // Fields allows partial responses to be retrieved. See
  76515. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76516. // for more information.
  76517. func (c *RoutersGetCall) Fields(s ...googleapi.Field) *RoutersGetCall {
  76518. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76519. return c
  76520. }
  76521. // IfNoneMatch sets the optional parameter which makes the operation
  76522. // fail if the object's ETag matches the given value. This is useful for
  76523. // getting updates only after the object has changed since the last
  76524. // request. Use googleapi.IsNotModified to check whether the response
  76525. // error from Do is the result of In-None-Match.
  76526. func (c *RoutersGetCall) IfNoneMatch(entityTag string) *RoutersGetCall {
  76527. c.ifNoneMatch_ = entityTag
  76528. return c
  76529. }
  76530. // Context sets the context to be used in this call's Do method. Any
  76531. // pending HTTP request will be aborted if the provided context is
  76532. // canceled.
  76533. func (c *RoutersGetCall) Context(ctx context.Context) *RoutersGetCall {
  76534. c.ctx_ = ctx
  76535. return c
  76536. }
  76537. // Header returns an http.Header that can be modified by the caller to
  76538. // add HTTP headers to the request.
  76539. func (c *RoutersGetCall) Header() http.Header {
  76540. if c.header_ == nil {
  76541. c.header_ = make(http.Header)
  76542. }
  76543. return c.header_
  76544. }
  76545. func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) {
  76546. reqHeaders := make(http.Header)
  76547. for k, v := range c.header_ {
  76548. reqHeaders[k] = v
  76549. }
  76550. reqHeaders.Set("User-Agent", c.s.userAgent())
  76551. if c.ifNoneMatch_ != "" {
  76552. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76553. }
  76554. var body io.Reader = nil
  76555. c.urlParams_.Set("alt", alt)
  76556. c.urlParams_.Set("prettyPrint", "false")
  76557. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  76558. urls += "?" + c.urlParams_.Encode()
  76559. req, err := http.NewRequest("GET", urls, body)
  76560. if err != nil {
  76561. return nil, err
  76562. }
  76563. req.Header = reqHeaders
  76564. googleapi.Expand(req.URL, map[string]string{
  76565. "project": c.project,
  76566. "region": c.region,
  76567. "router": c.router,
  76568. })
  76569. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76570. }
  76571. // Do executes the "compute.routers.get" call.
  76572. // Exactly one of *Router or error will be non-nil. Any non-2xx status
  76573. // code is an error. Response headers are in either
  76574. // *Router.ServerResponse.Header or (if a response was returned at all)
  76575. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  76576. // check whether the returned error was because http.StatusNotModified
  76577. // was returned.
  76578. func (c *RoutersGetCall) Do(opts ...googleapi.CallOption) (*Router, error) {
  76579. gensupport.SetOptions(c.urlParams_, opts...)
  76580. res, err := c.doRequest("json")
  76581. if res != nil && res.StatusCode == http.StatusNotModified {
  76582. if res.Body != nil {
  76583. res.Body.Close()
  76584. }
  76585. return nil, &googleapi.Error{
  76586. Code: res.StatusCode,
  76587. Header: res.Header,
  76588. }
  76589. }
  76590. if err != nil {
  76591. return nil, err
  76592. }
  76593. defer googleapi.CloseBody(res)
  76594. if err := googleapi.CheckResponse(res); err != nil {
  76595. return nil, err
  76596. }
  76597. ret := &Router{
  76598. ServerResponse: googleapi.ServerResponse{
  76599. Header: res.Header,
  76600. HTTPStatusCode: res.StatusCode,
  76601. },
  76602. }
  76603. target := &ret
  76604. if err := gensupport.DecodeResponse(target, res); err != nil {
  76605. return nil, err
  76606. }
  76607. return ret, nil
  76608. // {
  76609. // "description": "Returns the specified Router resource. Gets a list of available routers by making a list() request.",
  76610. // "httpMethod": "GET",
  76611. // "id": "compute.routers.get",
  76612. // "parameterOrder": [
  76613. // "project",
  76614. // "region",
  76615. // "router"
  76616. // ],
  76617. // "parameters": {
  76618. // "project": {
  76619. // "description": "Project ID for this request.",
  76620. // "location": "path",
  76621. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76622. // "required": true,
  76623. // "type": "string"
  76624. // },
  76625. // "region": {
  76626. // "description": "Name of the region for this request.",
  76627. // "location": "path",
  76628. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76629. // "required": true,
  76630. // "type": "string"
  76631. // },
  76632. // "router": {
  76633. // "description": "Name of the Router resource to return.",
  76634. // "location": "path",
  76635. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76636. // "required": true,
  76637. // "type": "string"
  76638. // }
  76639. // },
  76640. // "path": "{project}/regions/{region}/routers/{router}",
  76641. // "response": {
  76642. // "$ref": "Router"
  76643. // },
  76644. // "scopes": [
  76645. // "https://www.googleapis.com/auth/cloud-platform",
  76646. // "https://www.googleapis.com/auth/compute",
  76647. // "https://www.googleapis.com/auth/compute.readonly"
  76648. // ]
  76649. // }
  76650. }
  76651. // method id "compute.routers.getNatMappingInfo":
  76652. type RoutersGetNatMappingInfoCall struct {
  76653. s *Service
  76654. project string
  76655. region string
  76656. router string
  76657. urlParams_ gensupport.URLParams
  76658. ifNoneMatch_ string
  76659. ctx_ context.Context
  76660. header_ http.Header
  76661. }
  76662. // GetNatMappingInfo: Retrieves runtime Nat mapping information of VM
  76663. // endpoints.
  76664. func (r *RoutersService) GetNatMappingInfo(project string, region string, router string) *RoutersGetNatMappingInfoCall {
  76665. c := &RoutersGetNatMappingInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76666. c.project = project
  76667. c.region = region
  76668. c.router = router
  76669. return c
  76670. }
  76671. // Filter sets the optional parameter "filter": A filter expression that
  76672. // filters resources listed in the response. The expression must specify
  76673. // the field name, a comparison operator, and the value that you want to
  76674. // use for filtering. The value must be a string, a number, or a
  76675. // boolean. The comparison operator must be either =, !=, >, or <.
  76676. //
  76677. // For example, if you are filtering Compute Engine instances, you can
  76678. // exclude instances named example-instance by specifying name !=
  76679. // example-instance.
  76680. //
  76681. // You can also filter nested fields. For example, you could specify
  76682. // scheduling.automaticRestart = false to include instances only if they
  76683. // are not scheduled for automatic restarts. You can use filtering on
  76684. // nested fields to filter based on resource labels.
  76685. //
  76686. // To filter on multiple expressions, provide each separate expression
  76687. // within parentheses. For example, (scheduling.automaticRestart = true)
  76688. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  76689. // AND expression. However, you can include AND and OR expressions
  76690. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  76691. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  76692. // true).
  76693. func (c *RoutersGetNatMappingInfoCall) Filter(filter string) *RoutersGetNatMappingInfoCall {
  76694. c.urlParams_.Set("filter", filter)
  76695. return c
  76696. }
  76697. // MaxResults sets the optional parameter "maxResults": The maximum
  76698. // number of results per page that should be returned. If the number of
  76699. // available results is larger than maxResults, Compute Engine returns a
  76700. // nextPageToken that can be used to get the next page of results in
  76701. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  76702. // (Default: 500)
  76703. func (c *RoutersGetNatMappingInfoCall) MaxResults(maxResults int64) *RoutersGetNatMappingInfoCall {
  76704. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  76705. return c
  76706. }
  76707. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  76708. // a certain order. By default, results are returned in alphanumerical
  76709. // order based on the resource name.
  76710. //
  76711. // You can also sort results in descending order based on the creation
  76712. // timestamp using orderBy="creationTimestamp desc". This sorts results
  76713. // based on the creationTimestamp field in reverse chronological order
  76714. // (newest result first). Use this to sort resources like operations so
  76715. // that the newest operation is returned first.
  76716. //
  76717. // Currently, only sorting by name or creationTimestamp desc is
  76718. // supported.
  76719. func (c *RoutersGetNatMappingInfoCall) OrderBy(orderBy string) *RoutersGetNatMappingInfoCall {
  76720. c.urlParams_.Set("orderBy", orderBy)
  76721. return c
  76722. }
  76723. // PageToken sets the optional parameter "pageToken": Specifies a page
  76724. // token to use. Set pageToken to the nextPageToken returned by a
  76725. // previous list request to get the next page of results.
  76726. func (c *RoutersGetNatMappingInfoCall) PageToken(pageToken string) *RoutersGetNatMappingInfoCall {
  76727. c.urlParams_.Set("pageToken", pageToken)
  76728. return c
  76729. }
  76730. // Fields allows partial responses to be retrieved. See
  76731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76732. // for more information.
  76733. func (c *RoutersGetNatMappingInfoCall) Fields(s ...googleapi.Field) *RoutersGetNatMappingInfoCall {
  76734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76735. return c
  76736. }
  76737. // IfNoneMatch sets the optional parameter which makes the operation
  76738. // fail if the object's ETag matches the given value. This is useful for
  76739. // getting updates only after the object has changed since the last
  76740. // request. Use googleapi.IsNotModified to check whether the response
  76741. // error from Do is the result of In-None-Match.
  76742. func (c *RoutersGetNatMappingInfoCall) IfNoneMatch(entityTag string) *RoutersGetNatMappingInfoCall {
  76743. c.ifNoneMatch_ = entityTag
  76744. return c
  76745. }
  76746. // Context sets the context to be used in this call's Do method. Any
  76747. // pending HTTP request will be aborted if the provided context is
  76748. // canceled.
  76749. func (c *RoutersGetNatMappingInfoCall) Context(ctx context.Context) *RoutersGetNatMappingInfoCall {
  76750. c.ctx_ = ctx
  76751. return c
  76752. }
  76753. // Header returns an http.Header that can be modified by the caller to
  76754. // add HTTP headers to the request.
  76755. func (c *RoutersGetNatMappingInfoCall) Header() http.Header {
  76756. if c.header_ == nil {
  76757. c.header_ = make(http.Header)
  76758. }
  76759. return c.header_
  76760. }
  76761. func (c *RoutersGetNatMappingInfoCall) doRequest(alt string) (*http.Response, error) {
  76762. reqHeaders := make(http.Header)
  76763. for k, v := range c.header_ {
  76764. reqHeaders[k] = v
  76765. }
  76766. reqHeaders.Set("User-Agent", c.s.userAgent())
  76767. if c.ifNoneMatch_ != "" {
  76768. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76769. }
  76770. var body io.Reader = nil
  76771. c.urlParams_.Set("alt", alt)
  76772. c.urlParams_.Set("prettyPrint", "false")
  76773. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getNatMappingInfo")
  76774. urls += "?" + c.urlParams_.Encode()
  76775. req, err := http.NewRequest("GET", urls, body)
  76776. if err != nil {
  76777. return nil, err
  76778. }
  76779. req.Header = reqHeaders
  76780. googleapi.Expand(req.URL, map[string]string{
  76781. "project": c.project,
  76782. "region": c.region,
  76783. "router": c.router,
  76784. })
  76785. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76786. }
  76787. // Do executes the "compute.routers.getNatMappingInfo" call.
  76788. // Exactly one of *VmEndpointNatMappingsList or error will be non-nil.
  76789. // Any non-2xx status code is an error. Response headers are in either
  76790. // *VmEndpointNatMappingsList.ServerResponse.Header or (if a response
  76791. // was returned at all) in error.(*googleapi.Error).Header. Use
  76792. // googleapi.IsNotModified to check whether the returned error was
  76793. // because http.StatusNotModified was returned.
  76794. func (c *RoutersGetNatMappingInfoCall) Do(opts ...googleapi.CallOption) (*VmEndpointNatMappingsList, error) {
  76795. gensupport.SetOptions(c.urlParams_, opts...)
  76796. res, err := c.doRequest("json")
  76797. if res != nil && res.StatusCode == http.StatusNotModified {
  76798. if res.Body != nil {
  76799. res.Body.Close()
  76800. }
  76801. return nil, &googleapi.Error{
  76802. Code: res.StatusCode,
  76803. Header: res.Header,
  76804. }
  76805. }
  76806. if err != nil {
  76807. return nil, err
  76808. }
  76809. defer googleapi.CloseBody(res)
  76810. if err := googleapi.CheckResponse(res); err != nil {
  76811. return nil, err
  76812. }
  76813. ret := &VmEndpointNatMappingsList{
  76814. ServerResponse: googleapi.ServerResponse{
  76815. Header: res.Header,
  76816. HTTPStatusCode: res.StatusCode,
  76817. },
  76818. }
  76819. target := &ret
  76820. if err := gensupport.DecodeResponse(target, res); err != nil {
  76821. return nil, err
  76822. }
  76823. return ret, nil
  76824. // {
  76825. // "description": "Retrieves runtime Nat mapping information of VM endpoints.",
  76826. // "httpMethod": "GET",
  76827. // "id": "compute.routers.getNatMappingInfo",
  76828. // "parameterOrder": [
  76829. // "project",
  76830. // "region",
  76831. // "router"
  76832. // ],
  76833. // "parameters": {
  76834. // "filter": {
  76835. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  76836. // "location": "query",
  76837. // "type": "string"
  76838. // },
  76839. // "maxResults": {
  76840. // "default": "500",
  76841. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  76842. // "format": "uint32",
  76843. // "location": "query",
  76844. // "minimum": "0",
  76845. // "type": "integer"
  76846. // },
  76847. // "orderBy": {
  76848. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  76849. // "location": "query",
  76850. // "type": "string"
  76851. // },
  76852. // "pageToken": {
  76853. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  76854. // "location": "query",
  76855. // "type": "string"
  76856. // },
  76857. // "project": {
  76858. // "description": "Project ID for this request.",
  76859. // "location": "path",
  76860. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76861. // "required": true,
  76862. // "type": "string"
  76863. // },
  76864. // "region": {
  76865. // "description": "Name of the region for this request.",
  76866. // "location": "path",
  76867. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76868. // "required": true,
  76869. // "type": "string"
  76870. // },
  76871. // "router": {
  76872. // "description": "Name of the Router resource to query for Nat Mapping information of VM endpoints.",
  76873. // "location": "path",
  76874. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76875. // "required": true,
  76876. // "type": "string"
  76877. // }
  76878. // },
  76879. // "path": "{project}/regions/{region}/routers/{router}/getNatMappingInfo",
  76880. // "response": {
  76881. // "$ref": "VmEndpointNatMappingsList"
  76882. // },
  76883. // "scopes": [
  76884. // "https://www.googleapis.com/auth/cloud-platform",
  76885. // "https://www.googleapis.com/auth/compute",
  76886. // "https://www.googleapis.com/auth/compute.readonly"
  76887. // ]
  76888. // }
  76889. }
  76890. // Pages invokes f for each page of results.
  76891. // A non-nil error returned from f will halt the iteration.
  76892. // The provided context supersedes any context provided to the Context method.
  76893. func (c *RoutersGetNatMappingInfoCall) Pages(ctx context.Context, f func(*VmEndpointNatMappingsList) error) error {
  76894. c.ctx_ = ctx
  76895. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  76896. for {
  76897. x, err := c.Do()
  76898. if err != nil {
  76899. return err
  76900. }
  76901. if err := f(x); err != nil {
  76902. return err
  76903. }
  76904. if x.NextPageToken == "" {
  76905. return nil
  76906. }
  76907. c.PageToken(x.NextPageToken)
  76908. }
  76909. }
  76910. // method id "compute.routers.getRouterStatus":
  76911. type RoutersGetRouterStatusCall struct {
  76912. s *Service
  76913. project string
  76914. region string
  76915. router string
  76916. urlParams_ gensupport.URLParams
  76917. ifNoneMatch_ string
  76918. ctx_ context.Context
  76919. header_ http.Header
  76920. }
  76921. // GetRouterStatus: Retrieves runtime information of the specified
  76922. // router.
  76923. func (r *RoutersService) GetRouterStatus(project string, region string, router string) *RoutersGetRouterStatusCall {
  76924. c := &RoutersGetRouterStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76925. c.project = project
  76926. c.region = region
  76927. c.router = router
  76928. return c
  76929. }
  76930. // Fields allows partial responses to be retrieved. See
  76931. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76932. // for more information.
  76933. func (c *RoutersGetRouterStatusCall) Fields(s ...googleapi.Field) *RoutersGetRouterStatusCall {
  76934. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76935. return c
  76936. }
  76937. // IfNoneMatch sets the optional parameter which makes the operation
  76938. // fail if the object's ETag matches the given value. This is useful for
  76939. // getting updates only after the object has changed since the last
  76940. // request. Use googleapi.IsNotModified to check whether the response
  76941. // error from Do is the result of In-None-Match.
  76942. func (c *RoutersGetRouterStatusCall) IfNoneMatch(entityTag string) *RoutersGetRouterStatusCall {
  76943. c.ifNoneMatch_ = entityTag
  76944. return c
  76945. }
  76946. // Context sets the context to be used in this call's Do method. Any
  76947. // pending HTTP request will be aborted if the provided context is
  76948. // canceled.
  76949. func (c *RoutersGetRouterStatusCall) Context(ctx context.Context) *RoutersGetRouterStatusCall {
  76950. c.ctx_ = ctx
  76951. return c
  76952. }
  76953. // Header returns an http.Header that can be modified by the caller to
  76954. // add HTTP headers to the request.
  76955. func (c *RoutersGetRouterStatusCall) Header() http.Header {
  76956. if c.header_ == nil {
  76957. c.header_ = make(http.Header)
  76958. }
  76959. return c.header_
  76960. }
  76961. func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, error) {
  76962. reqHeaders := make(http.Header)
  76963. for k, v := range c.header_ {
  76964. reqHeaders[k] = v
  76965. }
  76966. reqHeaders.Set("User-Agent", c.s.userAgent())
  76967. if c.ifNoneMatch_ != "" {
  76968. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76969. }
  76970. var body io.Reader = nil
  76971. c.urlParams_.Set("alt", alt)
  76972. c.urlParams_.Set("prettyPrint", "false")
  76973. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getRouterStatus")
  76974. urls += "?" + c.urlParams_.Encode()
  76975. req, err := http.NewRequest("GET", urls, body)
  76976. if err != nil {
  76977. return nil, err
  76978. }
  76979. req.Header = reqHeaders
  76980. googleapi.Expand(req.URL, map[string]string{
  76981. "project": c.project,
  76982. "region": c.region,
  76983. "router": c.router,
  76984. })
  76985. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76986. }
  76987. // Do executes the "compute.routers.getRouterStatus" call.
  76988. // Exactly one of *RouterStatusResponse or error will be non-nil. Any
  76989. // non-2xx status code is an error. Response headers are in either
  76990. // *RouterStatusResponse.ServerResponse.Header or (if a response was
  76991. // returned at all) in error.(*googleapi.Error).Header. Use
  76992. // googleapi.IsNotModified to check whether the returned error was
  76993. // because http.StatusNotModified was returned.
  76994. func (c *RoutersGetRouterStatusCall) Do(opts ...googleapi.CallOption) (*RouterStatusResponse, error) {
  76995. gensupport.SetOptions(c.urlParams_, opts...)
  76996. res, err := c.doRequest("json")
  76997. if res != nil && res.StatusCode == http.StatusNotModified {
  76998. if res.Body != nil {
  76999. res.Body.Close()
  77000. }
  77001. return nil, &googleapi.Error{
  77002. Code: res.StatusCode,
  77003. Header: res.Header,
  77004. }
  77005. }
  77006. if err != nil {
  77007. return nil, err
  77008. }
  77009. defer googleapi.CloseBody(res)
  77010. if err := googleapi.CheckResponse(res); err != nil {
  77011. return nil, err
  77012. }
  77013. ret := &RouterStatusResponse{
  77014. ServerResponse: googleapi.ServerResponse{
  77015. Header: res.Header,
  77016. HTTPStatusCode: res.StatusCode,
  77017. },
  77018. }
  77019. target := &ret
  77020. if err := gensupport.DecodeResponse(target, res); err != nil {
  77021. return nil, err
  77022. }
  77023. return ret, nil
  77024. // {
  77025. // "description": "Retrieves runtime information of the specified router.",
  77026. // "httpMethod": "GET",
  77027. // "id": "compute.routers.getRouterStatus",
  77028. // "parameterOrder": [
  77029. // "project",
  77030. // "region",
  77031. // "router"
  77032. // ],
  77033. // "parameters": {
  77034. // "project": {
  77035. // "description": "Project ID for this request.",
  77036. // "location": "path",
  77037. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77038. // "required": true,
  77039. // "type": "string"
  77040. // },
  77041. // "region": {
  77042. // "description": "Name of the region for this request.",
  77043. // "location": "path",
  77044. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77045. // "required": true,
  77046. // "type": "string"
  77047. // },
  77048. // "router": {
  77049. // "description": "Name of the Router resource to query.",
  77050. // "location": "path",
  77051. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77052. // "required": true,
  77053. // "type": "string"
  77054. // }
  77055. // },
  77056. // "path": "{project}/regions/{region}/routers/{router}/getRouterStatus",
  77057. // "response": {
  77058. // "$ref": "RouterStatusResponse"
  77059. // },
  77060. // "scopes": [
  77061. // "https://www.googleapis.com/auth/cloud-platform",
  77062. // "https://www.googleapis.com/auth/compute",
  77063. // "https://www.googleapis.com/auth/compute.readonly"
  77064. // ]
  77065. // }
  77066. }
  77067. // method id "compute.routers.insert":
  77068. type RoutersInsertCall struct {
  77069. s *Service
  77070. project string
  77071. region string
  77072. router *Router
  77073. urlParams_ gensupport.URLParams
  77074. ctx_ context.Context
  77075. header_ http.Header
  77076. }
  77077. // Insert: Creates a Router resource in the specified project and region
  77078. // using the data included in the request.
  77079. func (r *RoutersService) Insert(project string, region string, router *Router) *RoutersInsertCall {
  77080. c := &RoutersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77081. c.project = project
  77082. c.region = region
  77083. c.router = router
  77084. return c
  77085. }
  77086. // RequestId sets the optional parameter "requestId": An optional
  77087. // request ID to identify requests. Specify a unique request ID so that
  77088. // if you must retry your request, the server will know to ignore the
  77089. // request if it has already been completed.
  77090. //
  77091. // For example, consider a situation where you make an initial request
  77092. // and the request times out. If you make the request again with the
  77093. // same request ID, the server can check if original operation with the
  77094. // same request ID was received, and if so, will ignore the second
  77095. // request. This prevents clients from accidentally creating duplicate
  77096. // commitments.
  77097. //
  77098. // The request ID must be a valid UUID with the exception that zero UUID
  77099. // is not supported (00000000-0000-0000-0000-000000000000).
  77100. func (c *RoutersInsertCall) RequestId(requestId string) *RoutersInsertCall {
  77101. c.urlParams_.Set("requestId", requestId)
  77102. return c
  77103. }
  77104. // Fields allows partial responses to be retrieved. See
  77105. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77106. // for more information.
  77107. func (c *RoutersInsertCall) Fields(s ...googleapi.Field) *RoutersInsertCall {
  77108. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77109. return c
  77110. }
  77111. // Context sets the context to be used in this call's Do method. Any
  77112. // pending HTTP request will be aborted if the provided context is
  77113. // canceled.
  77114. func (c *RoutersInsertCall) Context(ctx context.Context) *RoutersInsertCall {
  77115. c.ctx_ = ctx
  77116. return c
  77117. }
  77118. // Header returns an http.Header that can be modified by the caller to
  77119. // add HTTP headers to the request.
  77120. func (c *RoutersInsertCall) Header() http.Header {
  77121. if c.header_ == nil {
  77122. c.header_ = make(http.Header)
  77123. }
  77124. return c.header_
  77125. }
  77126. func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) {
  77127. reqHeaders := make(http.Header)
  77128. for k, v := range c.header_ {
  77129. reqHeaders[k] = v
  77130. }
  77131. reqHeaders.Set("User-Agent", c.s.userAgent())
  77132. var body io.Reader = nil
  77133. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router)
  77134. if err != nil {
  77135. return nil, err
  77136. }
  77137. reqHeaders.Set("Content-Type", "application/json")
  77138. c.urlParams_.Set("alt", alt)
  77139. c.urlParams_.Set("prettyPrint", "false")
  77140. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  77141. urls += "?" + c.urlParams_.Encode()
  77142. req, err := http.NewRequest("POST", urls, body)
  77143. if err != nil {
  77144. return nil, err
  77145. }
  77146. req.Header = reqHeaders
  77147. googleapi.Expand(req.URL, map[string]string{
  77148. "project": c.project,
  77149. "region": c.region,
  77150. })
  77151. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77152. }
  77153. // Do executes the "compute.routers.insert" call.
  77154. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77155. // status code is an error. Response headers are in either
  77156. // *Operation.ServerResponse.Header or (if a response was returned at
  77157. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77158. // to check whether the returned error was because
  77159. // http.StatusNotModified was returned.
  77160. func (c *RoutersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77161. gensupport.SetOptions(c.urlParams_, opts...)
  77162. res, err := c.doRequest("json")
  77163. if res != nil && res.StatusCode == http.StatusNotModified {
  77164. if res.Body != nil {
  77165. res.Body.Close()
  77166. }
  77167. return nil, &googleapi.Error{
  77168. Code: res.StatusCode,
  77169. Header: res.Header,
  77170. }
  77171. }
  77172. if err != nil {
  77173. return nil, err
  77174. }
  77175. defer googleapi.CloseBody(res)
  77176. if err := googleapi.CheckResponse(res); err != nil {
  77177. return nil, err
  77178. }
  77179. ret := &Operation{
  77180. ServerResponse: googleapi.ServerResponse{
  77181. Header: res.Header,
  77182. HTTPStatusCode: res.StatusCode,
  77183. },
  77184. }
  77185. target := &ret
  77186. if err := gensupport.DecodeResponse(target, res); err != nil {
  77187. return nil, err
  77188. }
  77189. return ret, nil
  77190. // {
  77191. // "description": "Creates a Router resource in the specified project and region using the data included in the request.",
  77192. // "httpMethod": "POST",
  77193. // "id": "compute.routers.insert",
  77194. // "parameterOrder": [
  77195. // "project",
  77196. // "region"
  77197. // ],
  77198. // "parameters": {
  77199. // "project": {
  77200. // "description": "Project ID for this request.",
  77201. // "location": "path",
  77202. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77203. // "required": true,
  77204. // "type": "string"
  77205. // },
  77206. // "region": {
  77207. // "description": "Name of the region for this request.",
  77208. // "location": "path",
  77209. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77210. // "required": true,
  77211. // "type": "string"
  77212. // },
  77213. // "requestId": {
  77214. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77215. // "location": "query",
  77216. // "type": "string"
  77217. // }
  77218. // },
  77219. // "path": "{project}/regions/{region}/routers",
  77220. // "request": {
  77221. // "$ref": "Router"
  77222. // },
  77223. // "response": {
  77224. // "$ref": "Operation"
  77225. // },
  77226. // "scopes": [
  77227. // "https://www.googleapis.com/auth/cloud-platform",
  77228. // "https://www.googleapis.com/auth/compute"
  77229. // ]
  77230. // }
  77231. }
  77232. // method id "compute.routers.list":
  77233. type RoutersListCall struct {
  77234. s *Service
  77235. project string
  77236. region string
  77237. urlParams_ gensupport.URLParams
  77238. ifNoneMatch_ string
  77239. ctx_ context.Context
  77240. header_ http.Header
  77241. }
  77242. // List: Retrieves a list of Router resources available to the specified
  77243. // project.
  77244. func (r *RoutersService) List(project string, region string) *RoutersListCall {
  77245. c := &RoutersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77246. c.project = project
  77247. c.region = region
  77248. return c
  77249. }
  77250. // Filter sets the optional parameter "filter": A filter expression that
  77251. // filters resources listed in the response. The expression must specify
  77252. // the field name, a comparison operator, and the value that you want to
  77253. // use for filtering. The value must be a string, a number, or a
  77254. // boolean. The comparison operator must be either =, !=, >, or <.
  77255. //
  77256. // For example, if you are filtering Compute Engine instances, you can
  77257. // exclude instances named example-instance by specifying name !=
  77258. // example-instance.
  77259. //
  77260. // You can also filter nested fields. For example, you could specify
  77261. // scheduling.automaticRestart = false to include instances only if they
  77262. // are not scheduled for automatic restarts. You can use filtering on
  77263. // nested fields to filter based on resource labels.
  77264. //
  77265. // To filter on multiple expressions, provide each separate expression
  77266. // within parentheses. For example, (scheduling.automaticRestart = true)
  77267. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  77268. // AND expression. However, you can include AND and OR expressions
  77269. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  77270. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  77271. // true).
  77272. func (c *RoutersListCall) Filter(filter string) *RoutersListCall {
  77273. c.urlParams_.Set("filter", filter)
  77274. return c
  77275. }
  77276. // MaxResults sets the optional parameter "maxResults": The maximum
  77277. // number of results per page that should be returned. If the number of
  77278. // available results is larger than maxResults, Compute Engine returns a
  77279. // nextPageToken that can be used to get the next page of results in
  77280. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  77281. // (Default: 500)
  77282. func (c *RoutersListCall) MaxResults(maxResults int64) *RoutersListCall {
  77283. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  77284. return c
  77285. }
  77286. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  77287. // a certain order. By default, results are returned in alphanumerical
  77288. // order based on the resource name.
  77289. //
  77290. // You can also sort results in descending order based on the creation
  77291. // timestamp using orderBy="creationTimestamp desc". This sorts results
  77292. // based on the creationTimestamp field in reverse chronological order
  77293. // (newest result first). Use this to sort resources like operations so
  77294. // that the newest operation is returned first.
  77295. //
  77296. // Currently, only sorting by name or creationTimestamp desc is
  77297. // supported.
  77298. func (c *RoutersListCall) OrderBy(orderBy string) *RoutersListCall {
  77299. c.urlParams_.Set("orderBy", orderBy)
  77300. return c
  77301. }
  77302. // PageToken sets the optional parameter "pageToken": Specifies a page
  77303. // token to use. Set pageToken to the nextPageToken returned by a
  77304. // previous list request to get the next page of results.
  77305. func (c *RoutersListCall) PageToken(pageToken string) *RoutersListCall {
  77306. c.urlParams_.Set("pageToken", pageToken)
  77307. return c
  77308. }
  77309. // Fields allows partial responses to be retrieved. See
  77310. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77311. // for more information.
  77312. func (c *RoutersListCall) Fields(s ...googleapi.Field) *RoutersListCall {
  77313. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77314. return c
  77315. }
  77316. // IfNoneMatch sets the optional parameter which makes the operation
  77317. // fail if the object's ETag matches the given value. This is useful for
  77318. // getting updates only after the object has changed since the last
  77319. // request. Use googleapi.IsNotModified to check whether the response
  77320. // error from Do is the result of In-None-Match.
  77321. func (c *RoutersListCall) IfNoneMatch(entityTag string) *RoutersListCall {
  77322. c.ifNoneMatch_ = entityTag
  77323. return c
  77324. }
  77325. // Context sets the context to be used in this call's Do method. Any
  77326. // pending HTTP request will be aborted if the provided context is
  77327. // canceled.
  77328. func (c *RoutersListCall) Context(ctx context.Context) *RoutersListCall {
  77329. c.ctx_ = ctx
  77330. return c
  77331. }
  77332. // Header returns an http.Header that can be modified by the caller to
  77333. // add HTTP headers to the request.
  77334. func (c *RoutersListCall) Header() http.Header {
  77335. if c.header_ == nil {
  77336. c.header_ = make(http.Header)
  77337. }
  77338. return c.header_
  77339. }
  77340. func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) {
  77341. reqHeaders := make(http.Header)
  77342. for k, v := range c.header_ {
  77343. reqHeaders[k] = v
  77344. }
  77345. reqHeaders.Set("User-Agent", c.s.userAgent())
  77346. if c.ifNoneMatch_ != "" {
  77347. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77348. }
  77349. var body io.Reader = nil
  77350. c.urlParams_.Set("alt", alt)
  77351. c.urlParams_.Set("prettyPrint", "false")
  77352. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  77353. urls += "?" + c.urlParams_.Encode()
  77354. req, err := http.NewRequest("GET", urls, body)
  77355. if err != nil {
  77356. return nil, err
  77357. }
  77358. req.Header = reqHeaders
  77359. googleapi.Expand(req.URL, map[string]string{
  77360. "project": c.project,
  77361. "region": c.region,
  77362. })
  77363. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77364. }
  77365. // Do executes the "compute.routers.list" call.
  77366. // Exactly one of *RouterList or error will be non-nil. Any non-2xx
  77367. // status code is an error. Response headers are in either
  77368. // *RouterList.ServerResponse.Header or (if a response was returned at
  77369. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77370. // to check whether the returned error was because
  77371. // http.StatusNotModified was returned.
  77372. func (c *RoutersListCall) Do(opts ...googleapi.CallOption) (*RouterList, error) {
  77373. gensupport.SetOptions(c.urlParams_, opts...)
  77374. res, err := c.doRequest("json")
  77375. if res != nil && res.StatusCode == http.StatusNotModified {
  77376. if res.Body != nil {
  77377. res.Body.Close()
  77378. }
  77379. return nil, &googleapi.Error{
  77380. Code: res.StatusCode,
  77381. Header: res.Header,
  77382. }
  77383. }
  77384. if err != nil {
  77385. return nil, err
  77386. }
  77387. defer googleapi.CloseBody(res)
  77388. if err := googleapi.CheckResponse(res); err != nil {
  77389. return nil, err
  77390. }
  77391. ret := &RouterList{
  77392. ServerResponse: googleapi.ServerResponse{
  77393. Header: res.Header,
  77394. HTTPStatusCode: res.StatusCode,
  77395. },
  77396. }
  77397. target := &ret
  77398. if err := gensupport.DecodeResponse(target, res); err != nil {
  77399. return nil, err
  77400. }
  77401. return ret, nil
  77402. // {
  77403. // "description": "Retrieves a list of Router resources available to the specified project.",
  77404. // "httpMethod": "GET",
  77405. // "id": "compute.routers.list",
  77406. // "parameterOrder": [
  77407. // "project",
  77408. // "region"
  77409. // ],
  77410. // "parameters": {
  77411. // "filter": {
  77412. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  77413. // "location": "query",
  77414. // "type": "string"
  77415. // },
  77416. // "maxResults": {
  77417. // "default": "500",
  77418. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  77419. // "format": "uint32",
  77420. // "location": "query",
  77421. // "minimum": "0",
  77422. // "type": "integer"
  77423. // },
  77424. // "orderBy": {
  77425. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  77426. // "location": "query",
  77427. // "type": "string"
  77428. // },
  77429. // "pageToken": {
  77430. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  77431. // "location": "query",
  77432. // "type": "string"
  77433. // },
  77434. // "project": {
  77435. // "description": "Project ID for this request.",
  77436. // "location": "path",
  77437. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77438. // "required": true,
  77439. // "type": "string"
  77440. // },
  77441. // "region": {
  77442. // "description": "Name of the region for this request.",
  77443. // "location": "path",
  77444. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77445. // "required": true,
  77446. // "type": "string"
  77447. // }
  77448. // },
  77449. // "path": "{project}/regions/{region}/routers",
  77450. // "response": {
  77451. // "$ref": "RouterList"
  77452. // },
  77453. // "scopes": [
  77454. // "https://www.googleapis.com/auth/cloud-platform",
  77455. // "https://www.googleapis.com/auth/compute",
  77456. // "https://www.googleapis.com/auth/compute.readonly"
  77457. // ]
  77458. // }
  77459. }
  77460. // Pages invokes f for each page of results.
  77461. // A non-nil error returned from f will halt the iteration.
  77462. // The provided context supersedes any context provided to the Context method.
  77463. func (c *RoutersListCall) Pages(ctx context.Context, f func(*RouterList) error) error {
  77464. c.ctx_ = ctx
  77465. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  77466. for {
  77467. x, err := c.Do()
  77468. if err != nil {
  77469. return err
  77470. }
  77471. if err := f(x); err != nil {
  77472. return err
  77473. }
  77474. if x.NextPageToken == "" {
  77475. return nil
  77476. }
  77477. c.PageToken(x.NextPageToken)
  77478. }
  77479. }
  77480. // method id "compute.routers.patch":
  77481. type RoutersPatchCall struct {
  77482. s *Service
  77483. project string
  77484. region string
  77485. router string
  77486. router2 *Router
  77487. urlParams_ gensupport.URLParams
  77488. ctx_ context.Context
  77489. header_ http.Header
  77490. }
  77491. // Patch: Patches the specified Router resource with the data included
  77492. // in the request. This method supports PATCH semantics and uses JSON
  77493. // merge patch format and processing rules.
  77494. func (r *RoutersService) Patch(project string, region string, router string, router2 *Router) *RoutersPatchCall {
  77495. c := &RoutersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77496. c.project = project
  77497. c.region = region
  77498. c.router = router
  77499. c.router2 = router2
  77500. return c
  77501. }
  77502. // RequestId sets the optional parameter "requestId": An optional
  77503. // request ID to identify requests. Specify a unique request ID so that
  77504. // if you must retry your request, the server will know to ignore the
  77505. // request if it has already been completed.
  77506. //
  77507. // For example, consider a situation where you make an initial request
  77508. // and the request times out. If you make the request again with the
  77509. // same request ID, the server can check if original operation with the
  77510. // same request ID was received, and if so, will ignore the second
  77511. // request. This prevents clients from accidentally creating duplicate
  77512. // commitments.
  77513. //
  77514. // The request ID must be a valid UUID with the exception that zero UUID
  77515. // is not supported (00000000-0000-0000-0000-000000000000).
  77516. func (c *RoutersPatchCall) RequestId(requestId string) *RoutersPatchCall {
  77517. c.urlParams_.Set("requestId", requestId)
  77518. return c
  77519. }
  77520. // Fields allows partial responses to be retrieved. See
  77521. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77522. // for more information.
  77523. func (c *RoutersPatchCall) Fields(s ...googleapi.Field) *RoutersPatchCall {
  77524. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77525. return c
  77526. }
  77527. // Context sets the context to be used in this call's Do method. Any
  77528. // pending HTTP request will be aborted if the provided context is
  77529. // canceled.
  77530. func (c *RoutersPatchCall) Context(ctx context.Context) *RoutersPatchCall {
  77531. c.ctx_ = ctx
  77532. return c
  77533. }
  77534. // Header returns an http.Header that can be modified by the caller to
  77535. // add HTTP headers to the request.
  77536. func (c *RoutersPatchCall) Header() http.Header {
  77537. if c.header_ == nil {
  77538. c.header_ = make(http.Header)
  77539. }
  77540. return c.header_
  77541. }
  77542. func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) {
  77543. reqHeaders := make(http.Header)
  77544. for k, v := range c.header_ {
  77545. reqHeaders[k] = v
  77546. }
  77547. reqHeaders.Set("User-Agent", c.s.userAgent())
  77548. var body io.Reader = nil
  77549. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  77550. if err != nil {
  77551. return nil, err
  77552. }
  77553. reqHeaders.Set("Content-Type", "application/json")
  77554. c.urlParams_.Set("alt", alt)
  77555. c.urlParams_.Set("prettyPrint", "false")
  77556. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  77557. urls += "?" + c.urlParams_.Encode()
  77558. req, err := http.NewRequest("PATCH", urls, body)
  77559. if err != nil {
  77560. return nil, err
  77561. }
  77562. req.Header = reqHeaders
  77563. googleapi.Expand(req.URL, map[string]string{
  77564. "project": c.project,
  77565. "region": c.region,
  77566. "router": c.router,
  77567. })
  77568. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77569. }
  77570. // Do executes the "compute.routers.patch" call.
  77571. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77572. // status code is an error. Response headers are in either
  77573. // *Operation.ServerResponse.Header or (if a response was returned at
  77574. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77575. // to check whether the returned error was because
  77576. // http.StatusNotModified was returned.
  77577. func (c *RoutersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77578. gensupport.SetOptions(c.urlParams_, opts...)
  77579. res, err := c.doRequest("json")
  77580. if res != nil && res.StatusCode == http.StatusNotModified {
  77581. if res.Body != nil {
  77582. res.Body.Close()
  77583. }
  77584. return nil, &googleapi.Error{
  77585. Code: res.StatusCode,
  77586. Header: res.Header,
  77587. }
  77588. }
  77589. if err != nil {
  77590. return nil, err
  77591. }
  77592. defer googleapi.CloseBody(res)
  77593. if err := googleapi.CheckResponse(res); err != nil {
  77594. return nil, err
  77595. }
  77596. ret := &Operation{
  77597. ServerResponse: googleapi.ServerResponse{
  77598. Header: res.Header,
  77599. HTTPStatusCode: res.StatusCode,
  77600. },
  77601. }
  77602. target := &ret
  77603. if err := gensupport.DecodeResponse(target, res); err != nil {
  77604. return nil, err
  77605. }
  77606. return ret, nil
  77607. // {
  77608. // "description": "Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
  77609. // "httpMethod": "PATCH",
  77610. // "id": "compute.routers.patch",
  77611. // "parameterOrder": [
  77612. // "project",
  77613. // "region",
  77614. // "router"
  77615. // ],
  77616. // "parameters": {
  77617. // "project": {
  77618. // "description": "Project ID for this request.",
  77619. // "location": "path",
  77620. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77621. // "required": true,
  77622. // "type": "string"
  77623. // },
  77624. // "region": {
  77625. // "description": "Name of the region for this request.",
  77626. // "location": "path",
  77627. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77628. // "required": true,
  77629. // "type": "string"
  77630. // },
  77631. // "requestId": {
  77632. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77633. // "location": "query",
  77634. // "type": "string"
  77635. // },
  77636. // "router": {
  77637. // "description": "Name of the Router resource to patch.",
  77638. // "location": "path",
  77639. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77640. // "required": true,
  77641. // "type": "string"
  77642. // }
  77643. // },
  77644. // "path": "{project}/regions/{region}/routers/{router}",
  77645. // "request": {
  77646. // "$ref": "Router"
  77647. // },
  77648. // "response": {
  77649. // "$ref": "Operation"
  77650. // },
  77651. // "scopes": [
  77652. // "https://www.googleapis.com/auth/cloud-platform",
  77653. // "https://www.googleapis.com/auth/compute"
  77654. // ]
  77655. // }
  77656. }
  77657. // method id "compute.routers.preview":
  77658. type RoutersPreviewCall struct {
  77659. s *Service
  77660. project string
  77661. region string
  77662. router string
  77663. router2 *Router
  77664. urlParams_ gensupport.URLParams
  77665. ctx_ context.Context
  77666. header_ http.Header
  77667. }
  77668. // Preview: Preview fields auto-generated during router create and
  77669. // update operations. Calling this method does NOT create or update the
  77670. // router.
  77671. func (r *RoutersService) Preview(project string, region string, router string, router2 *Router) *RoutersPreviewCall {
  77672. c := &RoutersPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77673. c.project = project
  77674. c.region = region
  77675. c.router = router
  77676. c.router2 = router2
  77677. return c
  77678. }
  77679. // Fields allows partial responses to be retrieved. See
  77680. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77681. // for more information.
  77682. func (c *RoutersPreviewCall) Fields(s ...googleapi.Field) *RoutersPreviewCall {
  77683. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77684. return c
  77685. }
  77686. // Context sets the context to be used in this call's Do method. Any
  77687. // pending HTTP request will be aborted if the provided context is
  77688. // canceled.
  77689. func (c *RoutersPreviewCall) Context(ctx context.Context) *RoutersPreviewCall {
  77690. c.ctx_ = ctx
  77691. return c
  77692. }
  77693. // Header returns an http.Header that can be modified by the caller to
  77694. // add HTTP headers to the request.
  77695. func (c *RoutersPreviewCall) Header() http.Header {
  77696. if c.header_ == nil {
  77697. c.header_ = make(http.Header)
  77698. }
  77699. return c.header_
  77700. }
  77701. func (c *RoutersPreviewCall) doRequest(alt string) (*http.Response, error) {
  77702. reqHeaders := make(http.Header)
  77703. for k, v := range c.header_ {
  77704. reqHeaders[k] = v
  77705. }
  77706. reqHeaders.Set("User-Agent", c.s.userAgent())
  77707. var body io.Reader = nil
  77708. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  77709. if err != nil {
  77710. return nil, err
  77711. }
  77712. reqHeaders.Set("Content-Type", "application/json")
  77713. c.urlParams_.Set("alt", alt)
  77714. c.urlParams_.Set("prettyPrint", "false")
  77715. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/preview")
  77716. urls += "?" + c.urlParams_.Encode()
  77717. req, err := http.NewRequest("POST", urls, body)
  77718. if err != nil {
  77719. return nil, err
  77720. }
  77721. req.Header = reqHeaders
  77722. googleapi.Expand(req.URL, map[string]string{
  77723. "project": c.project,
  77724. "region": c.region,
  77725. "router": c.router,
  77726. })
  77727. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77728. }
  77729. // Do executes the "compute.routers.preview" call.
  77730. // Exactly one of *RoutersPreviewResponse or error will be non-nil. Any
  77731. // non-2xx status code is an error. Response headers are in either
  77732. // *RoutersPreviewResponse.ServerResponse.Header or (if a response was
  77733. // returned at all) in error.(*googleapi.Error).Header. Use
  77734. // googleapi.IsNotModified to check whether the returned error was
  77735. // because http.StatusNotModified was returned.
  77736. func (c *RoutersPreviewCall) Do(opts ...googleapi.CallOption) (*RoutersPreviewResponse, error) {
  77737. gensupport.SetOptions(c.urlParams_, opts...)
  77738. res, err := c.doRequest("json")
  77739. if res != nil && res.StatusCode == http.StatusNotModified {
  77740. if res.Body != nil {
  77741. res.Body.Close()
  77742. }
  77743. return nil, &googleapi.Error{
  77744. Code: res.StatusCode,
  77745. Header: res.Header,
  77746. }
  77747. }
  77748. if err != nil {
  77749. return nil, err
  77750. }
  77751. defer googleapi.CloseBody(res)
  77752. if err := googleapi.CheckResponse(res); err != nil {
  77753. return nil, err
  77754. }
  77755. ret := &RoutersPreviewResponse{
  77756. ServerResponse: googleapi.ServerResponse{
  77757. Header: res.Header,
  77758. HTTPStatusCode: res.StatusCode,
  77759. },
  77760. }
  77761. target := &ret
  77762. if err := gensupport.DecodeResponse(target, res); err != nil {
  77763. return nil, err
  77764. }
  77765. return ret, nil
  77766. // {
  77767. // "description": "Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.",
  77768. // "httpMethod": "POST",
  77769. // "id": "compute.routers.preview",
  77770. // "parameterOrder": [
  77771. // "project",
  77772. // "region",
  77773. // "router"
  77774. // ],
  77775. // "parameters": {
  77776. // "project": {
  77777. // "description": "Project ID for this request.",
  77778. // "location": "path",
  77779. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77780. // "required": true,
  77781. // "type": "string"
  77782. // },
  77783. // "region": {
  77784. // "description": "Name of the region for this request.",
  77785. // "location": "path",
  77786. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77787. // "required": true,
  77788. // "type": "string"
  77789. // },
  77790. // "router": {
  77791. // "description": "Name of the Router resource to query.",
  77792. // "location": "path",
  77793. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77794. // "required": true,
  77795. // "type": "string"
  77796. // }
  77797. // },
  77798. // "path": "{project}/regions/{region}/routers/{router}/preview",
  77799. // "request": {
  77800. // "$ref": "Router"
  77801. // },
  77802. // "response": {
  77803. // "$ref": "RoutersPreviewResponse"
  77804. // },
  77805. // "scopes": [
  77806. // "https://www.googleapis.com/auth/cloud-platform",
  77807. // "https://www.googleapis.com/auth/compute",
  77808. // "https://www.googleapis.com/auth/compute.readonly"
  77809. // ]
  77810. // }
  77811. }
  77812. // method id "compute.routers.update":
  77813. type RoutersUpdateCall struct {
  77814. s *Service
  77815. project string
  77816. region string
  77817. router string
  77818. router2 *Router
  77819. urlParams_ gensupport.URLParams
  77820. ctx_ context.Context
  77821. header_ http.Header
  77822. }
  77823. // Update: Updates the specified Router resource with the data included
  77824. // in the request.
  77825. func (r *RoutersService) Update(project string, region string, router string, router2 *Router) *RoutersUpdateCall {
  77826. c := &RoutersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77827. c.project = project
  77828. c.region = region
  77829. c.router = router
  77830. c.router2 = router2
  77831. return c
  77832. }
  77833. // RequestId sets the optional parameter "requestId": An optional
  77834. // request ID to identify requests. Specify a unique request ID so that
  77835. // if you must retry your request, the server will know to ignore the
  77836. // request if it has already been completed.
  77837. //
  77838. // For example, consider a situation where you make an initial request
  77839. // and the request times out. If you make the request again with the
  77840. // same request ID, the server can check if original operation with the
  77841. // same request ID was received, and if so, will ignore the second
  77842. // request. This prevents clients from accidentally creating duplicate
  77843. // commitments.
  77844. //
  77845. // The request ID must be a valid UUID with the exception that zero UUID
  77846. // is not supported (00000000-0000-0000-0000-000000000000).
  77847. func (c *RoutersUpdateCall) RequestId(requestId string) *RoutersUpdateCall {
  77848. c.urlParams_.Set("requestId", requestId)
  77849. return c
  77850. }
  77851. // Fields allows partial responses to be retrieved. See
  77852. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77853. // for more information.
  77854. func (c *RoutersUpdateCall) Fields(s ...googleapi.Field) *RoutersUpdateCall {
  77855. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77856. return c
  77857. }
  77858. // Context sets the context to be used in this call's Do method. Any
  77859. // pending HTTP request will be aborted if the provided context is
  77860. // canceled.
  77861. func (c *RoutersUpdateCall) Context(ctx context.Context) *RoutersUpdateCall {
  77862. c.ctx_ = ctx
  77863. return c
  77864. }
  77865. // Header returns an http.Header that can be modified by the caller to
  77866. // add HTTP headers to the request.
  77867. func (c *RoutersUpdateCall) Header() http.Header {
  77868. if c.header_ == nil {
  77869. c.header_ = make(http.Header)
  77870. }
  77871. return c.header_
  77872. }
  77873. func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) {
  77874. reqHeaders := make(http.Header)
  77875. for k, v := range c.header_ {
  77876. reqHeaders[k] = v
  77877. }
  77878. reqHeaders.Set("User-Agent", c.s.userAgent())
  77879. var body io.Reader = nil
  77880. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  77881. if err != nil {
  77882. return nil, err
  77883. }
  77884. reqHeaders.Set("Content-Type", "application/json")
  77885. c.urlParams_.Set("alt", alt)
  77886. c.urlParams_.Set("prettyPrint", "false")
  77887. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  77888. urls += "?" + c.urlParams_.Encode()
  77889. req, err := http.NewRequest("PUT", urls, body)
  77890. if err != nil {
  77891. return nil, err
  77892. }
  77893. req.Header = reqHeaders
  77894. googleapi.Expand(req.URL, map[string]string{
  77895. "project": c.project,
  77896. "region": c.region,
  77897. "router": c.router,
  77898. })
  77899. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77900. }
  77901. // Do executes the "compute.routers.update" call.
  77902. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77903. // status code is an error. Response headers are in either
  77904. // *Operation.ServerResponse.Header or (if a response was returned at
  77905. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77906. // to check whether the returned error was because
  77907. // http.StatusNotModified was returned.
  77908. func (c *RoutersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77909. gensupport.SetOptions(c.urlParams_, opts...)
  77910. res, err := c.doRequest("json")
  77911. if res != nil && res.StatusCode == http.StatusNotModified {
  77912. if res.Body != nil {
  77913. res.Body.Close()
  77914. }
  77915. return nil, &googleapi.Error{
  77916. Code: res.StatusCode,
  77917. Header: res.Header,
  77918. }
  77919. }
  77920. if err != nil {
  77921. return nil, err
  77922. }
  77923. defer googleapi.CloseBody(res)
  77924. if err := googleapi.CheckResponse(res); err != nil {
  77925. return nil, err
  77926. }
  77927. ret := &Operation{
  77928. ServerResponse: googleapi.ServerResponse{
  77929. Header: res.Header,
  77930. HTTPStatusCode: res.StatusCode,
  77931. },
  77932. }
  77933. target := &ret
  77934. if err := gensupport.DecodeResponse(target, res); err != nil {
  77935. return nil, err
  77936. }
  77937. return ret, nil
  77938. // {
  77939. // "description": "Updates the specified Router resource with the data included in the request.",
  77940. // "httpMethod": "PUT",
  77941. // "id": "compute.routers.update",
  77942. // "parameterOrder": [
  77943. // "project",
  77944. // "region",
  77945. // "router"
  77946. // ],
  77947. // "parameters": {
  77948. // "project": {
  77949. // "description": "Project ID for this request.",
  77950. // "location": "path",
  77951. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77952. // "required": true,
  77953. // "type": "string"
  77954. // },
  77955. // "region": {
  77956. // "description": "Name of the region for this request.",
  77957. // "location": "path",
  77958. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77959. // "required": true,
  77960. // "type": "string"
  77961. // },
  77962. // "requestId": {
  77963. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77964. // "location": "query",
  77965. // "type": "string"
  77966. // },
  77967. // "router": {
  77968. // "description": "Name of the Router resource to update.",
  77969. // "location": "path",
  77970. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77971. // "required": true,
  77972. // "type": "string"
  77973. // }
  77974. // },
  77975. // "path": "{project}/regions/{region}/routers/{router}",
  77976. // "request": {
  77977. // "$ref": "Router"
  77978. // },
  77979. // "response": {
  77980. // "$ref": "Operation"
  77981. // },
  77982. // "scopes": [
  77983. // "https://www.googleapis.com/auth/cloud-platform",
  77984. // "https://www.googleapis.com/auth/compute"
  77985. // ]
  77986. // }
  77987. }
  77988. // method id "compute.routes.delete":
  77989. type RoutesDeleteCall struct {
  77990. s *Service
  77991. project string
  77992. route string
  77993. urlParams_ gensupport.URLParams
  77994. ctx_ context.Context
  77995. header_ http.Header
  77996. }
  77997. // Delete: Deletes the specified Route resource.
  77998. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete
  77999. func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall {
  78000. c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78001. c.project = project
  78002. c.route = route
  78003. return c
  78004. }
  78005. // RequestId sets the optional parameter "requestId": An optional
  78006. // request ID to identify requests. Specify a unique request ID so that
  78007. // if you must retry your request, the server will know to ignore the
  78008. // request if it has already been completed.
  78009. //
  78010. // For example, consider a situation where you make an initial request
  78011. // and the request times out. If you make the request again with the
  78012. // same request ID, the server can check if original operation with the
  78013. // same request ID was received, and if so, will ignore the second
  78014. // request. This prevents clients from accidentally creating duplicate
  78015. // commitments.
  78016. //
  78017. // The request ID must be a valid UUID with the exception that zero UUID
  78018. // is not supported (00000000-0000-0000-0000-000000000000).
  78019. func (c *RoutesDeleteCall) RequestId(requestId string) *RoutesDeleteCall {
  78020. c.urlParams_.Set("requestId", requestId)
  78021. return c
  78022. }
  78023. // Fields allows partial responses to be retrieved. See
  78024. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78025. // for more information.
  78026. func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall {
  78027. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78028. return c
  78029. }
  78030. // Context sets the context to be used in this call's Do method. Any
  78031. // pending HTTP request will be aborted if the provided context is
  78032. // canceled.
  78033. func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall {
  78034. c.ctx_ = ctx
  78035. return c
  78036. }
  78037. // Header returns an http.Header that can be modified by the caller to
  78038. // add HTTP headers to the request.
  78039. func (c *RoutesDeleteCall) Header() http.Header {
  78040. if c.header_ == nil {
  78041. c.header_ = make(http.Header)
  78042. }
  78043. return c.header_
  78044. }
  78045. func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
  78046. reqHeaders := make(http.Header)
  78047. for k, v := range c.header_ {
  78048. reqHeaders[k] = v
  78049. }
  78050. reqHeaders.Set("User-Agent", c.s.userAgent())
  78051. var body io.Reader = nil
  78052. c.urlParams_.Set("alt", alt)
  78053. c.urlParams_.Set("prettyPrint", "false")
  78054. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  78055. urls += "?" + c.urlParams_.Encode()
  78056. req, err := http.NewRequest("DELETE", urls, body)
  78057. if err != nil {
  78058. return nil, err
  78059. }
  78060. req.Header = reqHeaders
  78061. googleapi.Expand(req.URL, map[string]string{
  78062. "project": c.project,
  78063. "route": c.route,
  78064. })
  78065. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78066. }
  78067. // Do executes the "compute.routes.delete" call.
  78068. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78069. // status code is an error. Response headers are in either
  78070. // *Operation.ServerResponse.Header or (if a response was returned at
  78071. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78072. // to check whether the returned error was because
  78073. // http.StatusNotModified was returned.
  78074. func (c *RoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78075. gensupport.SetOptions(c.urlParams_, opts...)
  78076. res, err := c.doRequest("json")
  78077. if res != nil && res.StatusCode == http.StatusNotModified {
  78078. if res.Body != nil {
  78079. res.Body.Close()
  78080. }
  78081. return nil, &googleapi.Error{
  78082. Code: res.StatusCode,
  78083. Header: res.Header,
  78084. }
  78085. }
  78086. if err != nil {
  78087. return nil, err
  78088. }
  78089. defer googleapi.CloseBody(res)
  78090. if err := googleapi.CheckResponse(res); err != nil {
  78091. return nil, err
  78092. }
  78093. ret := &Operation{
  78094. ServerResponse: googleapi.ServerResponse{
  78095. Header: res.Header,
  78096. HTTPStatusCode: res.StatusCode,
  78097. },
  78098. }
  78099. target := &ret
  78100. if err := gensupport.DecodeResponse(target, res); err != nil {
  78101. return nil, err
  78102. }
  78103. return ret, nil
  78104. // {
  78105. // "description": "Deletes the specified Route resource.",
  78106. // "httpMethod": "DELETE",
  78107. // "id": "compute.routes.delete",
  78108. // "parameterOrder": [
  78109. // "project",
  78110. // "route"
  78111. // ],
  78112. // "parameters": {
  78113. // "project": {
  78114. // "description": "Project ID for this request.",
  78115. // "location": "path",
  78116. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78117. // "required": true,
  78118. // "type": "string"
  78119. // },
  78120. // "requestId": {
  78121. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78122. // "location": "query",
  78123. // "type": "string"
  78124. // },
  78125. // "route": {
  78126. // "description": "Name of the Route resource to delete.",
  78127. // "location": "path",
  78128. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78129. // "required": true,
  78130. // "type": "string"
  78131. // }
  78132. // },
  78133. // "path": "{project}/global/routes/{route}",
  78134. // "response": {
  78135. // "$ref": "Operation"
  78136. // },
  78137. // "scopes": [
  78138. // "https://www.googleapis.com/auth/cloud-platform",
  78139. // "https://www.googleapis.com/auth/compute"
  78140. // ]
  78141. // }
  78142. }
  78143. // method id "compute.routes.get":
  78144. type RoutesGetCall struct {
  78145. s *Service
  78146. project string
  78147. route string
  78148. urlParams_ gensupport.URLParams
  78149. ifNoneMatch_ string
  78150. ctx_ context.Context
  78151. header_ http.Header
  78152. }
  78153. // Get: Returns the specified Route resource. Gets a list of available
  78154. // routes by making a list() request.
  78155. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get
  78156. func (r *RoutesService) Get(project string, route string) *RoutesGetCall {
  78157. c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78158. c.project = project
  78159. c.route = route
  78160. return c
  78161. }
  78162. // Fields allows partial responses to be retrieved. See
  78163. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78164. // for more information.
  78165. func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall {
  78166. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78167. return c
  78168. }
  78169. // IfNoneMatch sets the optional parameter which makes the operation
  78170. // fail if the object's ETag matches the given value. This is useful for
  78171. // getting updates only after the object has changed since the last
  78172. // request. Use googleapi.IsNotModified to check whether the response
  78173. // error from Do is the result of In-None-Match.
  78174. func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall {
  78175. c.ifNoneMatch_ = entityTag
  78176. return c
  78177. }
  78178. // Context sets the context to be used in this call's Do method. Any
  78179. // pending HTTP request will be aborted if the provided context is
  78180. // canceled.
  78181. func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall {
  78182. c.ctx_ = ctx
  78183. return c
  78184. }
  78185. // Header returns an http.Header that can be modified by the caller to
  78186. // add HTTP headers to the request.
  78187. func (c *RoutesGetCall) Header() http.Header {
  78188. if c.header_ == nil {
  78189. c.header_ = make(http.Header)
  78190. }
  78191. return c.header_
  78192. }
  78193. func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) {
  78194. reqHeaders := make(http.Header)
  78195. for k, v := range c.header_ {
  78196. reqHeaders[k] = v
  78197. }
  78198. reqHeaders.Set("User-Agent", c.s.userAgent())
  78199. if c.ifNoneMatch_ != "" {
  78200. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78201. }
  78202. var body io.Reader = nil
  78203. c.urlParams_.Set("alt", alt)
  78204. c.urlParams_.Set("prettyPrint", "false")
  78205. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  78206. urls += "?" + c.urlParams_.Encode()
  78207. req, err := http.NewRequest("GET", urls, body)
  78208. if err != nil {
  78209. return nil, err
  78210. }
  78211. req.Header = reqHeaders
  78212. googleapi.Expand(req.URL, map[string]string{
  78213. "project": c.project,
  78214. "route": c.route,
  78215. })
  78216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78217. }
  78218. // Do executes the "compute.routes.get" call.
  78219. // Exactly one of *Route or error will be non-nil. Any non-2xx status
  78220. // code is an error. Response headers are in either
  78221. // *Route.ServerResponse.Header or (if a response was returned at all)
  78222. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  78223. // check whether the returned error was because http.StatusNotModified
  78224. // was returned.
  78225. func (c *RoutesGetCall) Do(opts ...googleapi.CallOption) (*Route, error) {
  78226. gensupport.SetOptions(c.urlParams_, opts...)
  78227. res, err := c.doRequest("json")
  78228. if res != nil && res.StatusCode == http.StatusNotModified {
  78229. if res.Body != nil {
  78230. res.Body.Close()
  78231. }
  78232. return nil, &googleapi.Error{
  78233. Code: res.StatusCode,
  78234. Header: res.Header,
  78235. }
  78236. }
  78237. if err != nil {
  78238. return nil, err
  78239. }
  78240. defer googleapi.CloseBody(res)
  78241. if err := googleapi.CheckResponse(res); err != nil {
  78242. return nil, err
  78243. }
  78244. ret := &Route{
  78245. ServerResponse: googleapi.ServerResponse{
  78246. Header: res.Header,
  78247. HTTPStatusCode: res.StatusCode,
  78248. },
  78249. }
  78250. target := &ret
  78251. if err := gensupport.DecodeResponse(target, res); err != nil {
  78252. return nil, err
  78253. }
  78254. return ret, nil
  78255. // {
  78256. // "description": "Returns the specified Route resource. Gets a list of available routes by making a list() request.",
  78257. // "httpMethod": "GET",
  78258. // "id": "compute.routes.get",
  78259. // "parameterOrder": [
  78260. // "project",
  78261. // "route"
  78262. // ],
  78263. // "parameters": {
  78264. // "project": {
  78265. // "description": "Project ID for this request.",
  78266. // "location": "path",
  78267. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78268. // "required": true,
  78269. // "type": "string"
  78270. // },
  78271. // "route": {
  78272. // "description": "Name of the Route resource to return.",
  78273. // "location": "path",
  78274. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78275. // "required": true,
  78276. // "type": "string"
  78277. // }
  78278. // },
  78279. // "path": "{project}/global/routes/{route}",
  78280. // "response": {
  78281. // "$ref": "Route"
  78282. // },
  78283. // "scopes": [
  78284. // "https://www.googleapis.com/auth/cloud-platform",
  78285. // "https://www.googleapis.com/auth/compute",
  78286. // "https://www.googleapis.com/auth/compute.readonly"
  78287. // ]
  78288. // }
  78289. }
  78290. // method id "compute.routes.insert":
  78291. type RoutesInsertCall struct {
  78292. s *Service
  78293. project string
  78294. route *Route
  78295. urlParams_ gensupport.URLParams
  78296. ctx_ context.Context
  78297. header_ http.Header
  78298. }
  78299. // Insert: Creates a Route resource in the specified project using the
  78300. // data included in the request.
  78301. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert
  78302. func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall {
  78303. c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78304. c.project = project
  78305. c.route = route
  78306. return c
  78307. }
  78308. // RequestId sets the optional parameter "requestId": An optional
  78309. // request ID to identify requests. Specify a unique request ID so that
  78310. // if you must retry your request, the server will know to ignore the
  78311. // request if it has already been completed.
  78312. //
  78313. // For example, consider a situation where you make an initial request
  78314. // and the request times out. If you make the request again with the
  78315. // same request ID, the server can check if original operation with the
  78316. // same request ID was received, and if so, will ignore the second
  78317. // request. This prevents clients from accidentally creating duplicate
  78318. // commitments.
  78319. //
  78320. // The request ID must be a valid UUID with the exception that zero UUID
  78321. // is not supported (00000000-0000-0000-0000-000000000000).
  78322. func (c *RoutesInsertCall) RequestId(requestId string) *RoutesInsertCall {
  78323. c.urlParams_.Set("requestId", requestId)
  78324. return c
  78325. }
  78326. // Fields allows partial responses to be retrieved. See
  78327. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78328. // for more information.
  78329. func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall {
  78330. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78331. return c
  78332. }
  78333. // Context sets the context to be used in this call's Do method. Any
  78334. // pending HTTP request will be aborted if the provided context is
  78335. // canceled.
  78336. func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall {
  78337. c.ctx_ = ctx
  78338. return c
  78339. }
  78340. // Header returns an http.Header that can be modified by the caller to
  78341. // add HTTP headers to the request.
  78342. func (c *RoutesInsertCall) Header() http.Header {
  78343. if c.header_ == nil {
  78344. c.header_ = make(http.Header)
  78345. }
  78346. return c.header_
  78347. }
  78348. func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) {
  78349. reqHeaders := make(http.Header)
  78350. for k, v := range c.header_ {
  78351. reqHeaders[k] = v
  78352. }
  78353. reqHeaders.Set("User-Agent", c.s.userAgent())
  78354. var body io.Reader = nil
  78355. body, err := googleapi.WithoutDataWrapper.JSONReader(c.route)
  78356. if err != nil {
  78357. return nil, err
  78358. }
  78359. reqHeaders.Set("Content-Type", "application/json")
  78360. c.urlParams_.Set("alt", alt)
  78361. c.urlParams_.Set("prettyPrint", "false")
  78362. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  78363. urls += "?" + c.urlParams_.Encode()
  78364. req, err := http.NewRequest("POST", urls, body)
  78365. if err != nil {
  78366. return nil, err
  78367. }
  78368. req.Header = reqHeaders
  78369. googleapi.Expand(req.URL, map[string]string{
  78370. "project": c.project,
  78371. })
  78372. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78373. }
  78374. // Do executes the "compute.routes.insert" call.
  78375. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78376. // status code is an error. Response headers are in either
  78377. // *Operation.ServerResponse.Header or (if a response was returned at
  78378. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78379. // to check whether the returned error was because
  78380. // http.StatusNotModified was returned.
  78381. func (c *RoutesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78382. gensupport.SetOptions(c.urlParams_, opts...)
  78383. res, err := c.doRequest("json")
  78384. if res != nil && res.StatusCode == http.StatusNotModified {
  78385. if res.Body != nil {
  78386. res.Body.Close()
  78387. }
  78388. return nil, &googleapi.Error{
  78389. Code: res.StatusCode,
  78390. Header: res.Header,
  78391. }
  78392. }
  78393. if err != nil {
  78394. return nil, err
  78395. }
  78396. defer googleapi.CloseBody(res)
  78397. if err := googleapi.CheckResponse(res); err != nil {
  78398. return nil, err
  78399. }
  78400. ret := &Operation{
  78401. ServerResponse: googleapi.ServerResponse{
  78402. Header: res.Header,
  78403. HTTPStatusCode: res.StatusCode,
  78404. },
  78405. }
  78406. target := &ret
  78407. if err := gensupport.DecodeResponse(target, res); err != nil {
  78408. return nil, err
  78409. }
  78410. return ret, nil
  78411. // {
  78412. // "description": "Creates a Route resource in the specified project using the data included in the request.",
  78413. // "httpMethod": "POST",
  78414. // "id": "compute.routes.insert",
  78415. // "parameterOrder": [
  78416. // "project"
  78417. // ],
  78418. // "parameters": {
  78419. // "project": {
  78420. // "description": "Project ID for this request.",
  78421. // "location": "path",
  78422. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78423. // "required": true,
  78424. // "type": "string"
  78425. // },
  78426. // "requestId": {
  78427. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78428. // "location": "query",
  78429. // "type": "string"
  78430. // }
  78431. // },
  78432. // "path": "{project}/global/routes",
  78433. // "request": {
  78434. // "$ref": "Route"
  78435. // },
  78436. // "response": {
  78437. // "$ref": "Operation"
  78438. // },
  78439. // "scopes": [
  78440. // "https://www.googleapis.com/auth/cloud-platform",
  78441. // "https://www.googleapis.com/auth/compute"
  78442. // ]
  78443. // }
  78444. }
  78445. // method id "compute.routes.list":
  78446. type RoutesListCall struct {
  78447. s *Service
  78448. project string
  78449. urlParams_ gensupport.URLParams
  78450. ifNoneMatch_ string
  78451. ctx_ context.Context
  78452. header_ http.Header
  78453. }
  78454. // List: Retrieves the list of Route resources available to the
  78455. // specified project.
  78456. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list
  78457. func (r *RoutesService) List(project string) *RoutesListCall {
  78458. c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78459. c.project = project
  78460. return c
  78461. }
  78462. // Filter sets the optional parameter "filter": A filter expression that
  78463. // filters resources listed in the response. The expression must specify
  78464. // the field name, a comparison operator, and the value that you want to
  78465. // use for filtering. The value must be a string, a number, or a
  78466. // boolean. The comparison operator must be either =, !=, >, or <.
  78467. //
  78468. // For example, if you are filtering Compute Engine instances, you can
  78469. // exclude instances named example-instance by specifying name !=
  78470. // example-instance.
  78471. //
  78472. // You can also filter nested fields. For example, you could specify
  78473. // scheduling.automaticRestart = false to include instances only if they
  78474. // are not scheduled for automatic restarts. You can use filtering on
  78475. // nested fields to filter based on resource labels.
  78476. //
  78477. // To filter on multiple expressions, provide each separate expression
  78478. // within parentheses. For example, (scheduling.automaticRestart = true)
  78479. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  78480. // AND expression. However, you can include AND and OR expressions
  78481. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  78482. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  78483. // true).
  78484. func (c *RoutesListCall) Filter(filter string) *RoutesListCall {
  78485. c.urlParams_.Set("filter", filter)
  78486. return c
  78487. }
  78488. // MaxResults sets the optional parameter "maxResults": The maximum
  78489. // number of results per page that should be returned. If the number of
  78490. // available results is larger than maxResults, Compute Engine returns a
  78491. // nextPageToken that can be used to get the next page of results in
  78492. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  78493. // (Default: 500)
  78494. func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall {
  78495. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  78496. return c
  78497. }
  78498. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  78499. // a certain order. By default, results are returned in alphanumerical
  78500. // order based on the resource name.
  78501. //
  78502. // You can also sort results in descending order based on the creation
  78503. // timestamp using orderBy="creationTimestamp desc". This sorts results
  78504. // based on the creationTimestamp field in reverse chronological order
  78505. // (newest result first). Use this to sort resources like operations so
  78506. // that the newest operation is returned first.
  78507. //
  78508. // Currently, only sorting by name or creationTimestamp desc is
  78509. // supported.
  78510. func (c *RoutesListCall) OrderBy(orderBy string) *RoutesListCall {
  78511. c.urlParams_.Set("orderBy", orderBy)
  78512. return c
  78513. }
  78514. // PageToken sets the optional parameter "pageToken": Specifies a page
  78515. // token to use. Set pageToken to the nextPageToken returned by a
  78516. // previous list request to get the next page of results.
  78517. func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall {
  78518. c.urlParams_.Set("pageToken", pageToken)
  78519. return c
  78520. }
  78521. // Fields allows partial responses to be retrieved. See
  78522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78523. // for more information.
  78524. func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall {
  78525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78526. return c
  78527. }
  78528. // IfNoneMatch sets the optional parameter which makes the operation
  78529. // fail if the object's ETag matches the given value. This is useful for
  78530. // getting updates only after the object has changed since the last
  78531. // request. Use googleapi.IsNotModified to check whether the response
  78532. // error from Do is the result of In-None-Match.
  78533. func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall {
  78534. c.ifNoneMatch_ = entityTag
  78535. return c
  78536. }
  78537. // Context sets the context to be used in this call's Do method. Any
  78538. // pending HTTP request will be aborted if the provided context is
  78539. // canceled.
  78540. func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall {
  78541. c.ctx_ = ctx
  78542. return c
  78543. }
  78544. // Header returns an http.Header that can be modified by the caller to
  78545. // add HTTP headers to the request.
  78546. func (c *RoutesListCall) Header() http.Header {
  78547. if c.header_ == nil {
  78548. c.header_ = make(http.Header)
  78549. }
  78550. return c.header_
  78551. }
  78552. func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) {
  78553. reqHeaders := make(http.Header)
  78554. for k, v := range c.header_ {
  78555. reqHeaders[k] = v
  78556. }
  78557. reqHeaders.Set("User-Agent", c.s.userAgent())
  78558. if c.ifNoneMatch_ != "" {
  78559. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78560. }
  78561. var body io.Reader = nil
  78562. c.urlParams_.Set("alt", alt)
  78563. c.urlParams_.Set("prettyPrint", "false")
  78564. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  78565. urls += "?" + c.urlParams_.Encode()
  78566. req, err := http.NewRequest("GET", urls, body)
  78567. if err != nil {
  78568. return nil, err
  78569. }
  78570. req.Header = reqHeaders
  78571. googleapi.Expand(req.URL, map[string]string{
  78572. "project": c.project,
  78573. })
  78574. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78575. }
  78576. // Do executes the "compute.routes.list" call.
  78577. // Exactly one of *RouteList or error will be non-nil. Any non-2xx
  78578. // status code is an error. Response headers are in either
  78579. // *RouteList.ServerResponse.Header or (if a response was returned at
  78580. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78581. // to check whether the returned error was because
  78582. // http.StatusNotModified was returned.
  78583. func (c *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, error) {
  78584. gensupport.SetOptions(c.urlParams_, opts...)
  78585. res, err := c.doRequest("json")
  78586. if res != nil && res.StatusCode == http.StatusNotModified {
  78587. if res.Body != nil {
  78588. res.Body.Close()
  78589. }
  78590. return nil, &googleapi.Error{
  78591. Code: res.StatusCode,
  78592. Header: res.Header,
  78593. }
  78594. }
  78595. if err != nil {
  78596. return nil, err
  78597. }
  78598. defer googleapi.CloseBody(res)
  78599. if err := googleapi.CheckResponse(res); err != nil {
  78600. return nil, err
  78601. }
  78602. ret := &RouteList{
  78603. ServerResponse: googleapi.ServerResponse{
  78604. Header: res.Header,
  78605. HTTPStatusCode: res.StatusCode,
  78606. },
  78607. }
  78608. target := &ret
  78609. if err := gensupport.DecodeResponse(target, res); err != nil {
  78610. return nil, err
  78611. }
  78612. return ret, nil
  78613. // {
  78614. // "description": "Retrieves the list of Route resources available to the specified project.",
  78615. // "httpMethod": "GET",
  78616. // "id": "compute.routes.list",
  78617. // "parameterOrder": [
  78618. // "project"
  78619. // ],
  78620. // "parameters": {
  78621. // "filter": {
  78622. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  78623. // "location": "query",
  78624. // "type": "string"
  78625. // },
  78626. // "maxResults": {
  78627. // "default": "500",
  78628. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  78629. // "format": "uint32",
  78630. // "location": "query",
  78631. // "minimum": "0",
  78632. // "type": "integer"
  78633. // },
  78634. // "orderBy": {
  78635. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  78636. // "location": "query",
  78637. // "type": "string"
  78638. // },
  78639. // "pageToken": {
  78640. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  78641. // "location": "query",
  78642. // "type": "string"
  78643. // },
  78644. // "project": {
  78645. // "description": "Project ID for this request.",
  78646. // "location": "path",
  78647. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78648. // "required": true,
  78649. // "type": "string"
  78650. // }
  78651. // },
  78652. // "path": "{project}/global/routes",
  78653. // "response": {
  78654. // "$ref": "RouteList"
  78655. // },
  78656. // "scopes": [
  78657. // "https://www.googleapis.com/auth/cloud-platform",
  78658. // "https://www.googleapis.com/auth/compute",
  78659. // "https://www.googleapis.com/auth/compute.readonly"
  78660. // ]
  78661. // }
  78662. }
  78663. // Pages invokes f for each page of results.
  78664. // A non-nil error returned from f will halt the iteration.
  78665. // The provided context supersedes any context provided to the Context method.
  78666. func (c *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) error) error {
  78667. c.ctx_ = ctx
  78668. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78669. for {
  78670. x, err := c.Do()
  78671. if err != nil {
  78672. return err
  78673. }
  78674. if err := f(x); err != nil {
  78675. return err
  78676. }
  78677. if x.NextPageToken == "" {
  78678. return nil
  78679. }
  78680. c.PageToken(x.NextPageToken)
  78681. }
  78682. }
  78683. // method id "compute.securityPolicies.addRule":
  78684. type SecurityPoliciesAddRuleCall struct {
  78685. s *Service
  78686. project string
  78687. securityPolicy string
  78688. securitypolicyrule *SecurityPolicyRule
  78689. urlParams_ gensupport.URLParams
  78690. ctx_ context.Context
  78691. header_ http.Header
  78692. }
  78693. // AddRule: Inserts a rule into a security policy.
  78694. func (r *SecurityPoliciesService) AddRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesAddRuleCall {
  78695. c := &SecurityPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78696. c.project = project
  78697. c.securityPolicy = securityPolicy
  78698. c.securitypolicyrule = securitypolicyrule
  78699. return c
  78700. }
  78701. // Fields allows partial responses to be retrieved. See
  78702. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78703. // for more information.
  78704. func (c *SecurityPoliciesAddRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesAddRuleCall {
  78705. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78706. return c
  78707. }
  78708. // Context sets the context to be used in this call's Do method. Any
  78709. // pending HTTP request will be aborted if the provided context is
  78710. // canceled.
  78711. func (c *SecurityPoliciesAddRuleCall) Context(ctx context.Context) *SecurityPoliciesAddRuleCall {
  78712. c.ctx_ = ctx
  78713. return c
  78714. }
  78715. // Header returns an http.Header that can be modified by the caller to
  78716. // add HTTP headers to the request.
  78717. func (c *SecurityPoliciesAddRuleCall) Header() http.Header {
  78718. if c.header_ == nil {
  78719. c.header_ = make(http.Header)
  78720. }
  78721. return c.header_
  78722. }
  78723. func (c *SecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
  78724. reqHeaders := make(http.Header)
  78725. for k, v := range c.header_ {
  78726. reqHeaders[k] = v
  78727. }
  78728. reqHeaders.Set("User-Agent", c.s.userAgent())
  78729. var body io.Reader = nil
  78730. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  78731. if err != nil {
  78732. return nil, err
  78733. }
  78734. reqHeaders.Set("Content-Type", "application/json")
  78735. c.urlParams_.Set("alt", alt)
  78736. c.urlParams_.Set("prettyPrint", "false")
  78737. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/addRule")
  78738. urls += "?" + c.urlParams_.Encode()
  78739. req, err := http.NewRequest("POST", urls, body)
  78740. if err != nil {
  78741. return nil, err
  78742. }
  78743. req.Header = reqHeaders
  78744. googleapi.Expand(req.URL, map[string]string{
  78745. "project": c.project,
  78746. "securityPolicy": c.securityPolicy,
  78747. })
  78748. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78749. }
  78750. // Do executes the "compute.securityPolicies.addRule" call.
  78751. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78752. // status code is an error. Response headers are in either
  78753. // *Operation.ServerResponse.Header or (if a response was returned at
  78754. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78755. // to check whether the returned error was because
  78756. // http.StatusNotModified was returned.
  78757. func (c *SecurityPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78758. gensupport.SetOptions(c.urlParams_, opts...)
  78759. res, err := c.doRequest("json")
  78760. if res != nil && res.StatusCode == http.StatusNotModified {
  78761. if res.Body != nil {
  78762. res.Body.Close()
  78763. }
  78764. return nil, &googleapi.Error{
  78765. Code: res.StatusCode,
  78766. Header: res.Header,
  78767. }
  78768. }
  78769. if err != nil {
  78770. return nil, err
  78771. }
  78772. defer googleapi.CloseBody(res)
  78773. if err := googleapi.CheckResponse(res); err != nil {
  78774. return nil, err
  78775. }
  78776. ret := &Operation{
  78777. ServerResponse: googleapi.ServerResponse{
  78778. Header: res.Header,
  78779. HTTPStatusCode: res.StatusCode,
  78780. },
  78781. }
  78782. target := &ret
  78783. if err := gensupport.DecodeResponse(target, res); err != nil {
  78784. return nil, err
  78785. }
  78786. return ret, nil
  78787. // {
  78788. // "description": "Inserts a rule into a security policy.",
  78789. // "httpMethod": "POST",
  78790. // "id": "compute.securityPolicies.addRule",
  78791. // "parameterOrder": [
  78792. // "project",
  78793. // "securityPolicy"
  78794. // ],
  78795. // "parameters": {
  78796. // "project": {
  78797. // "description": "Project ID for this request.",
  78798. // "location": "path",
  78799. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78800. // "required": true,
  78801. // "type": "string"
  78802. // },
  78803. // "securityPolicy": {
  78804. // "description": "Name of the security policy to update.",
  78805. // "location": "path",
  78806. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78807. // "required": true,
  78808. // "type": "string"
  78809. // }
  78810. // },
  78811. // "path": "{project}/global/securityPolicies/{securityPolicy}/addRule",
  78812. // "request": {
  78813. // "$ref": "SecurityPolicyRule"
  78814. // },
  78815. // "response": {
  78816. // "$ref": "Operation"
  78817. // },
  78818. // "scopes": [
  78819. // "https://www.googleapis.com/auth/cloud-platform",
  78820. // "https://www.googleapis.com/auth/compute"
  78821. // ]
  78822. // }
  78823. }
  78824. // method id "compute.securityPolicies.delete":
  78825. type SecurityPoliciesDeleteCall struct {
  78826. s *Service
  78827. project string
  78828. securityPolicy string
  78829. urlParams_ gensupport.URLParams
  78830. ctx_ context.Context
  78831. header_ http.Header
  78832. }
  78833. // Delete: Deletes the specified policy.
  78834. func (r *SecurityPoliciesService) Delete(project string, securityPolicy string) *SecurityPoliciesDeleteCall {
  78835. c := &SecurityPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78836. c.project = project
  78837. c.securityPolicy = securityPolicy
  78838. return c
  78839. }
  78840. // RequestId sets the optional parameter "requestId": An optional
  78841. // request ID to identify requests. Specify a unique request ID so that
  78842. // if you must retry your request, the server will know to ignore the
  78843. // request if it has already been completed.
  78844. //
  78845. // For example, consider a situation where you make an initial request
  78846. // and the request times out. If you make the request again with the
  78847. // same request ID, the server can check if original operation with the
  78848. // same request ID was received, and if so, will ignore the second
  78849. // request. This prevents clients from accidentally creating duplicate
  78850. // commitments.
  78851. //
  78852. // The request ID must be a valid UUID with the exception that zero UUID
  78853. // is not supported (00000000-0000-0000-0000-000000000000).
  78854. func (c *SecurityPoliciesDeleteCall) RequestId(requestId string) *SecurityPoliciesDeleteCall {
  78855. c.urlParams_.Set("requestId", requestId)
  78856. return c
  78857. }
  78858. // Fields allows partial responses to be retrieved. See
  78859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78860. // for more information.
  78861. func (c *SecurityPoliciesDeleteCall) Fields(s ...googleapi.Field) *SecurityPoliciesDeleteCall {
  78862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78863. return c
  78864. }
  78865. // Context sets the context to be used in this call's Do method. Any
  78866. // pending HTTP request will be aborted if the provided context is
  78867. // canceled.
  78868. func (c *SecurityPoliciesDeleteCall) Context(ctx context.Context) *SecurityPoliciesDeleteCall {
  78869. c.ctx_ = ctx
  78870. return c
  78871. }
  78872. // Header returns an http.Header that can be modified by the caller to
  78873. // add HTTP headers to the request.
  78874. func (c *SecurityPoliciesDeleteCall) Header() http.Header {
  78875. if c.header_ == nil {
  78876. c.header_ = make(http.Header)
  78877. }
  78878. return c.header_
  78879. }
  78880. func (c *SecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  78881. reqHeaders := make(http.Header)
  78882. for k, v := range c.header_ {
  78883. reqHeaders[k] = v
  78884. }
  78885. reqHeaders.Set("User-Agent", c.s.userAgent())
  78886. var body io.Reader = nil
  78887. c.urlParams_.Set("alt", alt)
  78888. c.urlParams_.Set("prettyPrint", "false")
  78889. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  78890. urls += "?" + c.urlParams_.Encode()
  78891. req, err := http.NewRequest("DELETE", urls, body)
  78892. if err != nil {
  78893. return nil, err
  78894. }
  78895. req.Header = reqHeaders
  78896. googleapi.Expand(req.URL, map[string]string{
  78897. "project": c.project,
  78898. "securityPolicy": c.securityPolicy,
  78899. })
  78900. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78901. }
  78902. // Do executes the "compute.securityPolicies.delete" call.
  78903. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78904. // status code is an error. Response headers are in either
  78905. // *Operation.ServerResponse.Header or (if a response was returned at
  78906. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78907. // to check whether the returned error was because
  78908. // http.StatusNotModified was returned.
  78909. func (c *SecurityPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78910. gensupport.SetOptions(c.urlParams_, opts...)
  78911. res, err := c.doRequest("json")
  78912. if res != nil && res.StatusCode == http.StatusNotModified {
  78913. if res.Body != nil {
  78914. res.Body.Close()
  78915. }
  78916. return nil, &googleapi.Error{
  78917. Code: res.StatusCode,
  78918. Header: res.Header,
  78919. }
  78920. }
  78921. if err != nil {
  78922. return nil, err
  78923. }
  78924. defer googleapi.CloseBody(res)
  78925. if err := googleapi.CheckResponse(res); err != nil {
  78926. return nil, err
  78927. }
  78928. ret := &Operation{
  78929. ServerResponse: googleapi.ServerResponse{
  78930. Header: res.Header,
  78931. HTTPStatusCode: res.StatusCode,
  78932. },
  78933. }
  78934. target := &ret
  78935. if err := gensupport.DecodeResponse(target, res); err != nil {
  78936. return nil, err
  78937. }
  78938. return ret, nil
  78939. // {
  78940. // "description": "Deletes the specified policy.",
  78941. // "httpMethod": "DELETE",
  78942. // "id": "compute.securityPolicies.delete",
  78943. // "parameterOrder": [
  78944. // "project",
  78945. // "securityPolicy"
  78946. // ],
  78947. // "parameters": {
  78948. // "project": {
  78949. // "description": "Project ID for this request.",
  78950. // "location": "path",
  78951. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78952. // "required": true,
  78953. // "type": "string"
  78954. // },
  78955. // "requestId": {
  78956. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78957. // "location": "query",
  78958. // "type": "string"
  78959. // },
  78960. // "securityPolicy": {
  78961. // "description": "Name of the security policy to delete.",
  78962. // "location": "path",
  78963. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78964. // "required": true,
  78965. // "type": "string"
  78966. // }
  78967. // },
  78968. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  78969. // "response": {
  78970. // "$ref": "Operation"
  78971. // },
  78972. // "scopes": [
  78973. // "https://www.googleapis.com/auth/cloud-platform",
  78974. // "https://www.googleapis.com/auth/compute"
  78975. // ]
  78976. // }
  78977. }
  78978. // method id "compute.securityPolicies.get":
  78979. type SecurityPoliciesGetCall struct {
  78980. s *Service
  78981. project string
  78982. securityPolicy string
  78983. urlParams_ gensupport.URLParams
  78984. ifNoneMatch_ string
  78985. ctx_ context.Context
  78986. header_ http.Header
  78987. }
  78988. // Get: List all of the ordered rules present in a single specified
  78989. // policy.
  78990. func (r *SecurityPoliciesService) Get(project string, securityPolicy string) *SecurityPoliciesGetCall {
  78991. c := &SecurityPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78992. c.project = project
  78993. c.securityPolicy = securityPolicy
  78994. return c
  78995. }
  78996. // Fields allows partial responses to be retrieved. See
  78997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78998. // for more information.
  78999. func (c *SecurityPoliciesGetCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetCall {
  79000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79001. return c
  79002. }
  79003. // IfNoneMatch sets the optional parameter which makes the operation
  79004. // fail if the object's ETag matches the given value. This is useful for
  79005. // getting updates only after the object has changed since the last
  79006. // request. Use googleapi.IsNotModified to check whether the response
  79007. // error from Do is the result of In-None-Match.
  79008. func (c *SecurityPoliciesGetCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetCall {
  79009. c.ifNoneMatch_ = entityTag
  79010. return c
  79011. }
  79012. // Context sets the context to be used in this call's Do method. Any
  79013. // pending HTTP request will be aborted if the provided context is
  79014. // canceled.
  79015. func (c *SecurityPoliciesGetCall) Context(ctx context.Context) *SecurityPoliciesGetCall {
  79016. c.ctx_ = ctx
  79017. return c
  79018. }
  79019. // Header returns an http.Header that can be modified by the caller to
  79020. // add HTTP headers to the request.
  79021. func (c *SecurityPoliciesGetCall) Header() http.Header {
  79022. if c.header_ == nil {
  79023. c.header_ = make(http.Header)
  79024. }
  79025. return c.header_
  79026. }
  79027. func (c *SecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  79028. reqHeaders := make(http.Header)
  79029. for k, v := range c.header_ {
  79030. reqHeaders[k] = v
  79031. }
  79032. reqHeaders.Set("User-Agent", c.s.userAgent())
  79033. if c.ifNoneMatch_ != "" {
  79034. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79035. }
  79036. var body io.Reader = nil
  79037. c.urlParams_.Set("alt", alt)
  79038. c.urlParams_.Set("prettyPrint", "false")
  79039. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  79040. urls += "?" + c.urlParams_.Encode()
  79041. req, err := http.NewRequest("GET", urls, body)
  79042. if err != nil {
  79043. return nil, err
  79044. }
  79045. req.Header = reqHeaders
  79046. googleapi.Expand(req.URL, map[string]string{
  79047. "project": c.project,
  79048. "securityPolicy": c.securityPolicy,
  79049. })
  79050. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79051. }
  79052. // Do executes the "compute.securityPolicies.get" call.
  79053. // Exactly one of *SecurityPolicy or error will be non-nil. Any non-2xx
  79054. // status code is an error. Response headers are in either
  79055. // *SecurityPolicy.ServerResponse.Header or (if a response was returned
  79056. // at all) in error.(*googleapi.Error).Header. Use
  79057. // googleapi.IsNotModified to check whether the returned error was
  79058. // because http.StatusNotModified was returned.
  79059. func (c *SecurityPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SecurityPolicy, error) {
  79060. gensupport.SetOptions(c.urlParams_, opts...)
  79061. res, err := c.doRequest("json")
  79062. if res != nil && res.StatusCode == http.StatusNotModified {
  79063. if res.Body != nil {
  79064. res.Body.Close()
  79065. }
  79066. return nil, &googleapi.Error{
  79067. Code: res.StatusCode,
  79068. Header: res.Header,
  79069. }
  79070. }
  79071. if err != nil {
  79072. return nil, err
  79073. }
  79074. defer googleapi.CloseBody(res)
  79075. if err := googleapi.CheckResponse(res); err != nil {
  79076. return nil, err
  79077. }
  79078. ret := &SecurityPolicy{
  79079. ServerResponse: googleapi.ServerResponse{
  79080. Header: res.Header,
  79081. HTTPStatusCode: res.StatusCode,
  79082. },
  79083. }
  79084. target := &ret
  79085. if err := gensupport.DecodeResponse(target, res); err != nil {
  79086. return nil, err
  79087. }
  79088. return ret, nil
  79089. // {
  79090. // "description": "List all of the ordered rules present in a single specified policy.",
  79091. // "httpMethod": "GET",
  79092. // "id": "compute.securityPolicies.get",
  79093. // "parameterOrder": [
  79094. // "project",
  79095. // "securityPolicy"
  79096. // ],
  79097. // "parameters": {
  79098. // "project": {
  79099. // "description": "Project ID for this request.",
  79100. // "location": "path",
  79101. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79102. // "required": true,
  79103. // "type": "string"
  79104. // },
  79105. // "securityPolicy": {
  79106. // "description": "Name of the security policy to get.",
  79107. // "location": "path",
  79108. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79109. // "required": true,
  79110. // "type": "string"
  79111. // }
  79112. // },
  79113. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  79114. // "response": {
  79115. // "$ref": "SecurityPolicy"
  79116. // },
  79117. // "scopes": [
  79118. // "https://www.googleapis.com/auth/cloud-platform",
  79119. // "https://www.googleapis.com/auth/compute",
  79120. // "https://www.googleapis.com/auth/compute.readonly"
  79121. // ]
  79122. // }
  79123. }
  79124. // method id "compute.securityPolicies.getRule":
  79125. type SecurityPoliciesGetRuleCall struct {
  79126. s *Service
  79127. project string
  79128. securityPolicy string
  79129. urlParams_ gensupport.URLParams
  79130. ifNoneMatch_ string
  79131. ctx_ context.Context
  79132. header_ http.Header
  79133. }
  79134. // GetRule: Gets a rule at the specified priority.
  79135. func (r *SecurityPoliciesService) GetRule(project string, securityPolicy string) *SecurityPoliciesGetRuleCall {
  79136. c := &SecurityPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79137. c.project = project
  79138. c.securityPolicy = securityPolicy
  79139. return c
  79140. }
  79141. // Priority sets the optional parameter "priority": The priority of the
  79142. // rule to get from the security policy.
  79143. func (c *SecurityPoliciesGetRuleCall) Priority(priority int64) *SecurityPoliciesGetRuleCall {
  79144. c.urlParams_.Set("priority", fmt.Sprint(priority))
  79145. return c
  79146. }
  79147. // Fields allows partial responses to be retrieved. See
  79148. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79149. // for more information.
  79150. func (c *SecurityPoliciesGetRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetRuleCall {
  79151. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79152. return c
  79153. }
  79154. // IfNoneMatch sets the optional parameter which makes the operation
  79155. // fail if the object's ETag matches the given value. This is useful for
  79156. // getting updates only after the object has changed since the last
  79157. // request. Use googleapi.IsNotModified to check whether the response
  79158. // error from Do is the result of In-None-Match.
  79159. func (c *SecurityPoliciesGetRuleCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetRuleCall {
  79160. c.ifNoneMatch_ = entityTag
  79161. return c
  79162. }
  79163. // Context sets the context to be used in this call's Do method. Any
  79164. // pending HTTP request will be aborted if the provided context is
  79165. // canceled.
  79166. func (c *SecurityPoliciesGetRuleCall) Context(ctx context.Context) *SecurityPoliciesGetRuleCall {
  79167. c.ctx_ = ctx
  79168. return c
  79169. }
  79170. // Header returns an http.Header that can be modified by the caller to
  79171. // add HTTP headers to the request.
  79172. func (c *SecurityPoliciesGetRuleCall) Header() http.Header {
  79173. if c.header_ == nil {
  79174. c.header_ = make(http.Header)
  79175. }
  79176. return c.header_
  79177. }
  79178. func (c *SecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
  79179. reqHeaders := make(http.Header)
  79180. for k, v := range c.header_ {
  79181. reqHeaders[k] = v
  79182. }
  79183. reqHeaders.Set("User-Agent", c.s.userAgent())
  79184. if c.ifNoneMatch_ != "" {
  79185. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79186. }
  79187. var body io.Reader = nil
  79188. c.urlParams_.Set("alt", alt)
  79189. c.urlParams_.Set("prettyPrint", "false")
  79190. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/getRule")
  79191. urls += "?" + c.urlParams_.Encode()
  79192. req, err := http.NewRequest("GET", urls, body)
  79193. if err != nil {
  79194. return nil, err
  79195. }
  79196. req.Header = reqHeaders
  79197. googleapi.Expand(req.URL, map[string]string{
  79198. "project": c.project,
  79199. "securityPolicy": c.securityPolicy,
  79200. })
  79201. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79202. }
  79203. // Do executes the "compute.securityPolicies.getRule" call.
  79204. // Exactly one of *SecurityPolicyRule or error will be non-nil. Any
  79205. // non-2xx status code is an error. Response headers are in either
  79206. // *SecurityPolicyRule.ServerResponse.Header or (if a response was
  79207. // returned at all) in error.(*googleapi.Error).Header. Use
  79208. // googleapi.IsNotModified to check whether the returned error was
  79209. // because http.StatusNotModified was returned.
  79210. func (c *SecurityPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyRule, error) {
  79211. gensupport.SetOptions(c.urlParams_, opts...)
  79212. res, err := c.doRequest("json")
  79213. if res != nil && res.StatusCode == http.StatusNotModified {
  79214. if res.Body != nil {
  79215. res.Body.Close()
  79216. }
  79217. return nil, &googleapi.Error{
  79218. Code: res.StatusCode,
  79219. Header: res.Header,
  79220. }
  79221. }
  79222. if err != nil {
  79223. return nil, err
  79224. }
  79225. defer googleapi.CloseBody(res)
  79226. if err := googleapi.CheckResponse(res); err != nil {
  79227. return nil, err
  79228. }
  79229. ret := &SecurityPolicyRule{
  79230. ServerResponse: googleapi.ServerResponse{
  79231. Header: res.Header,
  79232. HTTPStatusCode: res.StatusCode,
  79233. },
  79234. }
  79235. target := &ret
  79236. if err := gensupport.DecodeResponse(target, res); err != nil {
  79237. return nil, err
  79238. }
  79239. return ret, nil
  79240. // {
  79241. // "description": "Gets a rule at the specified priority.",
  79242. // "httpMethod": "GET",
  79243. // "id": "compute.securityPolicies.getRule",
  79244. // "parameterOrder": [
  79245. // "project",
  79246. // "securityPolicy"
  79247. // ],
  79248. // "parameters": {
  79249. // "priority": {
  79250. // "description": "The priority of the rule to get from the security policy.",
  79251. // "format": "int32",
  79252. // "location": "query",
  79253. // "type": "integer"
  79254. // },
  79255. // "project": {
  79256. // "description": "Project ID for this request.",
  79257. // "location": "path",
  79258. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79259. // "required": true,
  79260. // "type": "string"
  79261. // },
  79262. // "securityPolicy": {
  79263. // "description": "Name of the security policy to which the queried rule belongs.",
  79264. // "location": "path",
  79265. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79266. // "required": true,
  79267. // "type": "string"
  79268. // }
  79269. // },
  79270. // "path": "{project}/global/securityPolicies/{securityPolicy}/getRule",
  79271. // "response": {
  79272. // "$ref": "SecurityPolicyRule"
  79273. // },
  79274. // "scopes": [
  79275. // "https://www.googleapis.com/auth/cloud-platform",
  79276. // "https://www.googleapis.com/auth/compute",
  79277. // "https://www.googleapis.com/auth/compute.readonly"
  79278. // ]
  79279. // }
  79280. }
  79281. // method id "compute.securityPolicies.insert":
  79282. type SecurityPoliciesInsertCall struct {
  79283. s *Service
  79284. project string
  79285. securitypolicy *SecurityPolicy
  79286. urlParams_ gensupport.URLParams
  79287. ctx_ context.Context
  79288. header_ http.Header
  79289. }
  79290. // Insert: Creates a new policy in the specified project using the data
  79291. // included in the request.
  79292. func (r *SecurityPoliciesService) Insert(project string, securitypolicy *SecurityPolicy) *SecurityPoliciesInsertCall {
  79293. c := &SecurityPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79294. c.project = project
  79295. c.securitypolicy = securitypolicy
  79296. return c
  79297. }
  79298. // RequestId sets the optional parameter "requestId": An optional
  79299. // request ID to identify requests. Specify a unique request ID so that
  79300. // if you must retry your request, the server will know to ignore the
  79301. // request if it has already been completed.
  79302. //
  79303. // For example, consider a situation where you make an initial request
  79304. // and the request times out. If you make the request again with the
  79305. // same request ID, the server can check if original operation with the
  79306. // same request ID was received, and if so, will ignore the second
  79307. // request. This prevents clients from accidentally creating duplicate
  79308. // commitments.
  79309. //
  79310. // The request ID must be a valid UUID with the exception that zero UUID
  79311. // is not supported (00000000-0000-0000-0000-000000000000).
  79312. func (c *SecurityPoliciesInsertCall) RequestId(requestId string) *SecurityPoliciesInsertCall {
  79313. c.urlParams_.Set("requestId", requestId)
  79314. return c
  79315. }
  79316. // Fields allows partial responses to be retrieved. See
  79317. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79318. // for more information.
  79319. func (c *SecurityPoliciesInsertCall) Fields(s ...googleapi.Field) *SecurityPoliciesInsertCall {
  79320. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79321. return c
  79322. }
  79323. // Context sets the context to be used in this call's Do method. Any
  79324. // pending HTTP request will be aborted if the provided context is
  79325. // canceled.
  79326. func (c *SecurityPoliciesInsertCall) Context(ctx context.Context) *SecurityPoliciesInsertCall {
  79327. c.ctx_ = ctx
  79328. return c
  79329. }
  79330. // Header returns an http.Header that can be modified by the caller to
  79331. // add HTTP headers to the request.
  79332. func (c *SecurityPoliciesInsertCall) Header() http.Header {
  79333. if c.header_ == nil {
  79334. c.header_ = make(http.Header)
  79335. }
  79336. return c.header_
  79337. }
  79338. func (c *SecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  79339. reqHeaders := make(http.Header)
  79340. for k, v := range c.header_ {
  79341. reqHeaders[k] = v
  79342. }
  79343. reqHeaders.Set("User-Agent", c.s.userAgent())
  79344. var body io.Reader = nil
  79345. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  79346. if err != nil {
  79347. return nil, err
  79348. }
  79349. reqHeaders.Set("Content-Type", "application/json")
  79350. c.urlParams_.Set("alt", alt)
  79351. c.urlParams_.Set("prettyPrint", "false")
  79352. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  79353. urls += "?" + c.urlParams_.Encode()
  79354. req, err := http.NewRequest("POST", urls, body)
  79355. if err != nil {
  79356. return nil, err
  79357. }
  79358. req.Header = reqHeaders
  79359. googleapi.Expand(req.URL, map[string]string{
  79360. "project": c.project,
  79361. })
  79362. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79363. }
  79364. // Do executes the "compute.securityPolicies.insert" call.
  79365. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79366. // status code is an error. Response headers are in either
  79367. // *Operation.ServerResponse.Header or (if a response was returned at
  79368. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79369. // to check whether the returned error was because
  79370. // http.StatusNotModified was returned.
  79371. func (c *SecurityPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79372. gensupport.SetOptions(c.urlParams_, opts...)
  79373. res, err := c.doRequest("json")
  79374. if res != nil && res.StatusCode == http.StatusNotModified {
  79375. if res.Body != nil {
  79376. res.Body.Close()
  79377. }
  79378. return nil, &googleapi.Error{
  79379. Code: res.StatusCode,
  79380. Header: res.Header,
  79381. }
  79382. }
  79383. if err != nil {
  79384. return nil, err
  79385. }
  79386. defer googleapi.CloseBody(res)
  79387. if err := googleapi.CheckResponse(res); err != nil {
  79388. return nil, err
  79389. }
  79390. ret := &Operation{
  79391. ServerResponse: googleapi.ServerResponse{
  79392. Header: res.Header,
  79393. HTTPStatusCode: res.StatusCode,
  79394. },
  79395. }
  79396. target := &ret
  79397. if err := gensupport.DecodeResponse(target, res); err != nil {
  79398. return nil, err
  79399. }
  79400. return ret, nil
  79401. // {
  79402. // "description": "Creates a new policy in the specified project using the data included in the request.",
  79403. // "httpMethod": "POST",
  79404. // "id": "compute.securityPolicies.insert",
  79405. // "parameterOrder": [
  79406. // "project"
  79407. // ],
  79408. // "parameters": {
  79409. // "project": {
  79410. // "description": "Project ID for this request.",
  79411. // "location": "path",
  79412. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79413. // "required": true,
  79414. // "type": "string"
  79415. // },
  79416. // "requestId": {
  79417. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  79418. // "location": "query",
  79419. // "type": "string"
  79420. // }
  79421. // },
  79422. // "path": "{project}/global/securityPolicies",
  79423. // "request": {
  79424. // "$ref": "SecurityPolicy"
  79425. // },
  79426. // "response": {
  79427. // "$ref": "Operation"
  79428. // },
  79429. // "scopes": [
  79430. // "https://www.googleapis.com/auth/cloud-platform",
  79431. // "https://www.googleapis.com/auth/compute"
  79432. // ]
  79433. // }
  79434. }
  79435. // method id "compute.securityPolicies.list":
  79436. type SecurityPoliciesListCall struct {
  79437. s *Service
  79438. project string
  79439. urlParams_ gensupport.URLParams
  79440. ifNoneMatch_ string
  79441. ctx_ context.Context
  79442. header_ http.Header
  79443. }
  79444. // List: List all the policies that have been configured for the
  79445. // specified project.
  79446. func (r *SecurityPoliciesService) List(project string) *SecurityPoliciesListCall {
  79447. c := &SecurityPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79448. c.project = project
  79449. return c
  79450. }
  79451. // Filter sets the optional parameter "filter": A filter expression that
  79452. // filters resources listed in the response. The expression must specify
  79453. // the field name, a comparison operator, and the value that you want to
  79454. // use for filtering. The value must be a string, a number, or a
  79455. // boolean. The comparison operator must be either =, !=, >, or <.
  79456. //
  79457. // For example, if you are filtering Compute Engine instances, you can
  79458. // exclude instances named example-instance by specifying name !=
  79459. // example-instance.
  79460. //
  79461. // You can also filter nested fields. For example, you could specify
  79462. // scheduling.automaticRestart = false to include instances only if they
  79463. // are not scheduled for automatic restarts. You can use filtering on
  79464. // nested fields to filter based on resource labels.
  79465. //
  79466. // To filter on multiple expressions, provide each separate expression
  79467. // within parentheses. For example, (scheduling.automaticRestart = true)
  79468. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79469. // AND expression. However, you can include AND and OR expressions
  79470. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79471. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79472. // true).
  79473. func (c *SecurityPoliciesListCall) Filter(filter string) *SecurityPoliciesListCall {
  79474. c.urlParams_.Set("filter", filter)
  79475. return c
  79476. }
  79477. // MaxResults sets the optional parameter "maxResults": The maximum
  79478. // number of results per page that should be returned. If the number of
  79479. // available results is larger than maxResults, Compute Engine returns a
  79480. // nextPageToken that can be used to get the next page of results in
  79481. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79482. // (Default: 500)
  79483. func (c *SecurityPoliciesListCall) MaxResults(maxResults int64) *SecurityPoliciesListCall {
  79484. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79485. return c
  79486. }
  79487. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79488. // a certain order. By default, results are returned in alphanumerical
  79489. // order based on the resource name.
  79490. //
  79491. // You can also sort results in descending order based on the creation
  79492. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79493. // based on the creationTimestamp field in reverse chronological order
  79494. // (newest result first). Use this to sort resources like operations so
  79495. // that the newest operation is returned first.
  79496. //
  79497. // Currently, only sorting by name or creationTimestamp desc is
  79498. // supported.
  79499. func (c *SecurityPoliciesListCall) OrderBy(orderBy string) *SecurityPoliciesListCall {
  79500. c.urlParams_.Set("orderBy", orderBy)
  79501. return c
  79502. }
  79503. // PageToken sets the optional parameter "pageToken": Specifies a page
  79504. // token to use. Set pageToken to the nextPageToken returned by a
  79505. // previous list request to get the next page of results.
  79506. func (c *SecurityPoliciesListCall) PageToken(pageToken string) *SecurityPoliciesListCall {
  79507. c.urlParams_.Set("pageToken", pageToken)
  79508. return c
  79509. }
  79510. // Fields allows partial responses to be retrieved. See
  79511. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79512. // for more information.
  79513. func (c *SecurityPoliciesListCall) Fields(s ...googleapi.Field) *SecurityPoliciesListCall {
  79514. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79515. return c
  79516. }
  79517. // IfNoneMatch sets the optional parameter which makes the operation
  79518. // fail if the object's ETag matches the given value. This is useful for
  79519. // getting updates only after the object has changed since the last
  79520. // request. Use googleapi.IsNotModified to check whether the response
  79521. // error from Do is the result of In-None-Match.
  79522. func (c *SecurityPoliciesListCall) IfNoneMatch(entityTag string) *SecurityPoliciesListCall {
  79523. c.ifNoneMatch_ = entityTag
  79524. return c
  79525. }
  79526. // Context sets the context to be used in this call's Do method. Any
  79527. // pending HTTP request will be aborted if the provided context is
  79528. // canceled.
  79529. func (c *SecurityPoliciesListCall) Context(ctx context.Context) *SecurityPoliciesListCall {
  79530. c.ctx_ = ctx
  79531. return c
  79532. }
  79533. // Header returns an http.Header that can be modified by the caller to
  79534. // add HTTP headers to the request.
  79535. func (c *SecurityPoliciesListCall) Header() http.Header {
  79536. if c.header_ == nil {
  79537. c.header_ = make(http.Header)
  79538. }
  79539. return c.header_
  79540. }
  79541. func (c *SecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  79542. reqHeaders := make(http.Header)
  79543. for k, v := range c.header_ {
  79544. reqHeaders[k] = v
  79545. }
  79546. reqHeaders.Set("User-Agent", c.s.userAgent())
  79547. if c.ifNoneMatch_ != "" {
  79548. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79549. }
  79550. var body io.Reader = nil
  79551. c.urlParams_.Set("alt", alt)
  79552. c.urlParams_.Set("prettyPrint", "false")
  79553. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  79554. urls += "?" + c.urlParams_.Encode()
  79555. req, err := http.NewRequest("GET", urls, body)
  79556. if err != nil {
  79557. return nil, err
  79558. }
  79559. req.Header = reqHeaders
  79560. googleapi.Expand(req.URL, map[string]string{
  79561. "project": c.project,
  79562. })
  79563. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79564. }
  79565. // Do executes the "compute.securityPolicies.list" call.
  79566. // Exactly one of *SecurityPolicyList or error will be non-nil. Any
  79567. // non-2xx status code is an error. Response headers are in either
  79568. // *SecurityPolicyList.ServerResponse.Header or (if a response was
  79569. // returned at all) in error.(*googleapi.Error).Header. Use
  79570. // googleapi.IsNotModified to check whether the returned error was
  79571. // because http.StatusNotModified was returned.
  79572. func (c *SecurityPoliciesListCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyList, error) {
  79573. gensupport.SetOptions(c.urlParams_, opts...)
  79574. res, err := c.doRequest("json")
  79575. if res != nil && res.StatusCode == http.StatusNotModified {
  79576. if res.Body != nil {
  79577. res.Body.Close()
  79578. }
  79579. return nil, &googleapi.Error{
  79580. Code: res.StatusCode,
  79581. Header: res.Header,
  79582. }
  79583. }
  79584. if err != nil {
  79585. return nil, err
  79586. }
  79587. defer googleapi.CloseBody(res)
  79588. if err := googleapi.CheckResponse(res); err != nil {
  79589. return nil, err
  79590. }
  79591. ret := &SecurityPolicyList{
  79592. ServerResponse: googleapi.ServerResponse{
  79593. Header: res.Header,
  79594. HTTPStatusCode: res.StatusCode,
  79595. },
  79596. }
  79597. target := &ret
  79598. if err := gensupport.DecodeResponse(target, res); err != nil {
  79599. return nil, err
  79600. }
  79601. return ret, nil
  79602. // {
  79603. // "description": "List all the policies that have been configured for the specified project.",
  79604. // "httpMethod": "GET",
  79605. // "id": "compute.securityPolicies.list",
  79606. // "parameterOrder": [
  79607. // "project"
  79608. // ],
  79609. // "parameters": {
  79610. // "filter": {
  79611. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  79612. // "location": "query",
  79613. // "type": "string"
  79614. // },
  79615. // "maxResults": {
  79616. // "default": "500",
  79617. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  79618. // "format": "uint32",
  79619. // "location": "query",
  79620. // "minimum": "0",
  79621. // "type": "integer"
  79622. // },
  79623. // "orderBy": {
  79624. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  79625. // "location": "query",
  79626. // "type": "string"
  79627. // },
  79628. // "pageToken": {
  79629. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  79630. // "location": "query",
  79631. // "type": "string"
  79632. // },
  79633. // "project": {
  79634. // "description": "Project ID for this request.",
  79635. // "location": "path",
  79636. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79637. // "required": true,
  79638. // "type": "string"
  79639. // }
  79640. // },
  79641. // "path": "{project}/global/securityPolicies",
  79642. // "response": {
  79643. // "$ref": "SecurityPolicyList"
  79644. // },
  79645. // "scopes": [
  79646. // "https://www.googleapis.com/auth/cloud-platform",
  79647. // "https://www.googleapis.com/auth/compute",
  79648. // "https://www.googleapis.com/auth/compute.readonly"
  79649. // ]
  79650. // }
  79651. }
  79652. // Pages invokes f for each page of results.
  79653. // A non-nil error returned from f will halt the iteration.
  79654. // The provided context supersedes any context provided to the Context method.
  79655. func (c *SecurityPoliciesListCall) Pages(ctx context.Context, f func(*SecurityPolicyList) error) error {
  79656. c.ctx_ = ctx
  79657. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79658. for {
  79659. x, err := c.Do()
  79660. if err != nil {
  79661. return err
  79662. }
  79663. if err := f(x); err != nil {
  79664. return err
  79665. }
  79666. if x.NextPageToken == "" {
  79667. return nil
  79668. }
  79669. c.PageToken(x.NextPageToken)
  79670. }
  79671. }
  79672. // method id "compute.securityPolicies.patch":
  79673. type SecurityPoliciesPatchCall struct {
  79674. s *Service
  79675. project string
  79676. securityPolicy string
  79677. securitypolicy *SecurityPolicy
  79678. urlParams_ gensupport.URLParams
  79679. ctx_ context.Context
  79680. header_ http.Header
  79681. }
  79682. // Patch: Patches the specified policy with the data included in the
  79683. // request.
  79684. func (r *SecurityPoliciesService) Patch(project string, securityPolicy string, securitypolicy *SecurityPolicy) *SecurityPoliciesPatchCall {
  79685. c := &SecurityPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79686. c.project = project
  79687. c.securityPolicy = securityPolicy
  79688. c.securitypolicy = securitypolicy
  79689. return c
  79690. }
  79691. // RequestId sets the optional parameter "requestId": An optional
  79692. // request ID to identify requests. Specify a unique request ID so that
  79693. // if you must retry your request, the server will know to ignore the
  79694. // request if it has already been completed.
  79695. //
  79696. // For example, consider a situation where you make an initial request
  79697. // and the request times out. If you make the request again with the
  79698. // same request ID, the server can check if original operation with the
  79699. // same request ID was received, and if so, will ignore the second
  79700. // request. This prevents clients from accidentally creating duplicate
  79701. // commitments.
  79702. //
  79703. // The request ID must be a valid UUID with the exception that zero UUID
  79704. // is not supported (00000000-0000-0000-0000-000000000000).
  79705. func (c *SecurityPoliciesPatchCall) RequestId(requestId string) *SecurityPoliciesPatchCall {
  79706. c.urlParams_.Set("requestId", requestId)
  79707. return c
  79708. }
  79709. // Fields allows partial responses to be retrieved. See
  79710. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79711. // for more information.
  79712. func (c *SecurityPoliciesPatchCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchCall {
  79713. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79714. return c
  79715. }
  79716. // Context sets the context to be used in this call's Do method. Any
  79717. // pending HTTP request will be aborted if the provided context is
  79718. // canceled.
  79719. func (c *SecurityPoliciesPatchCall) Context(ctx context.Context) *SecurityPoliciesPatchCall {
  79720. c.ctx_ = ctx
  79721. return c
  79722. }
  79723. // Header returns an http.Header that can be modified by the caller to
  79724. // add HTTP headers to the request.
  79725. func (c *SecurityPoliciesPatchCall) Header() http.Header {
  79726. if c.header_ == nil {
  79727. c.header_ = make(http.Header)
  79728. }
  79729. return c.header_
  79730. }
  79731. func (c *SecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  79732. reqHeaders := make(http.Header)
  79733. for k, v := range c.header_ {
  79734. reqHeaders[k] = v
  79735. }
  79736. reqHeaders.Set("User-Agent", c.s.userAgent())
  79737. var body io.Reader = nil
  79738. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  79739. if err != nil {
  79740. return nil, err
  79741. }
  79742. reqHeaders.Set("Content-Type", "application/json")
  79743. c.urlParams_.Set("alt", alt)
  79744. c.urlParams_.Set("prettyPrint", "false")
  79745. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  79746. urls += "?" + c.urlParams_.Encode()
  79747. req, err := http.NewRequest("PATCH", urls, body)
  79748. if err != nil {
  79749. return nil, err
  79750. }
  79751. req.Header = reqHeaders
  79752. googleapi.Expand(req.URL, map[string]string{
  79753. "project": c.project,
  79754. "securityPolicy": c.securityPolicy,
  79755. })
  79756. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79757. }
  79758. // Do executes the "compute.securityPolicies.patch" call.
  79759. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79760. // status code is an error. Response headers are in either
  79761. // *Operation.ServerResponse.Header or (if a response was returned at
  79762. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79763. // to check whether the returned error was because
  79764. // http.StatusNotModified was returned.
  79765. func (c *SecurityPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79766. gensupport.SetOptions(c.urlParams_, opts...)
  79767. res, err := c.doRequest("json")
  79768. if res != nil && res.StatusCode == http.StatusNotModified {
  79769. if res.Body != nil {
  79770. res.Body.Close()
  79771. }
  79772. return nil, &googleapi.Error{
  79773. Code: res.StatusCode,
  79774. Header: res.Header,
  79775. }
  79776. }
  79777. if err != nil {
  79778. return nil, err
  79779. }
  79780. defer googleapi.CloseBody(res)
  79781. if err := googleapi.CheckResponse(res); err != nil {
  79782. return nil, err
  79783. }
  79784. ret := &Operation{
  79785. ServerResponse: googleapi.ServerResponse{
  79786. Header: res.Header,
  79787. HTTPStatusCode: res.StatusCode,
  79788. },
  79789. }
  79790. target := &ret
  79791. if err := gensupport.DecodeResponse(target, res); err != nil {
  79792. return nil, err
  79793. }
  79794. return ret, nil
  79795. // {
  79796. // "description": "Patches the specified policy with the data included in the request.",
  79797. // "httpMethod": "PATCH",
  79798. // "id": "compute.securityPolicies.patch",
  79799. // "parameterOrder": [
  79800. // "project",
  79801. // "securityPolicy"
  79802. // ],
  79803. // "parameters": {
  79804. // "project": {
  79805. // "description": "Project ID for this request.",
  79806. // "location": "path",
  79807. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79808. // "required": true,
  79809. // "type": "string"
  79810. // },
  79811. // "requestId": {
  79812. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  79813. // "location": "query",
  79814. // "type": "string"
  79815. // },
  79816. // "securityPolicy": {
  79817. // "description": "Name of the security policy to update.",
  79818. // "location": "path",
  79819. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79820. // "required": true,
  79821. // "type": "string"
  79822. // }
  79823. // },
  79824. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  79825. // "request": {
  79826. // "$ref": "SecurityPolicy"
  79827. // },
  79828. // "response": {
  79829. // "$ref": "Operation"
  79830. // },
  79831. // "scopes": [
  79832. // "https://www.googleapis.com/auth/cloud-platform",
  79833. // "https://www.googleapis.com/auth/compute"
  79834. // ]
  79835. // }
  79836. }
  79837. // method id "compute.securityPolicies.patchRule":
  79838. type SecurityPoliciesPatchRuleCall struct {
  79839. s *Service
  79840. project string
  79841. securityPolicy string
  79842. securitypolicyrule *SecurityPolicyRule
  79843. urlParams_ gensupport.URLParams
  79844. ctx_ context.Context
  79845. header_ http.Header
  79846. }
  79847. // PatchRule: Patches a rule at the specified priority.
  79848. func (r *SecurityPoliciesService) PatchRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesPatchRuleCall {
  79849. c := &SecurityPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79850. c.project = project
  79851. c.securityPolicy = securityPolicy
  79852. c.securitypolicyrule = securitypolicyrule
  79853. return c
  79854. }
  79855. // Priority sets the optional parameter "priority": The priority of the
  79856. // rule to patch.
  79857. func (c *SecurityPoliciesPatchRuleCall) Priority(priority int64) *SecurityPoliciesPatchRuleCall {
  79858. c.urlParams_.Set("priority", fmt.Sprint(priority))
  79859. return c
  79860. }
  79861. // Fields allows partial responses to be retrieved. See
  79862. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79863. // for more information.
  79864. func (c *SecurityPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchRuleCall {
  79865. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79866. return c
  79867. }
  79868. // Context sets the context to be used in this call's Do method. Any
  79869. // pending HTTP request will be aborted if the provided context is
  79870. // canceled.
  79871. func (c *SecurityPoliciesPatchRuleCall) Context(ctx context.Context) *SecurityPoliciesPatchRuleCall {
  79872. c.ctx_ = ctx
  79873. return c
  79874. }
  79875. // Header returns an http.Header that can be modified by the caller to
  79876. // add HTTP headers to the request.
  79877. func (c *SecurityPoliciesPatchRuleCall) Header() http.Header {
  79878. if c.header_ == nil {
  79879. c.header_ = make(http.Header)
  79880. }
  79881. return c.header_
  79882. }
  79883. func (c *SecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
  79884. reqHeaders := make(http.Header)
  79885. for k, v := range c.header_ {
  79886. reqHeaders[k] = v
  79887. }
  79888. reqHeaders.Set("User-Agent", c.s.userAgent())
  79889. var body io.Reader = nil
  79890. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  79891. if err != nil {
  79892. return nil, err
  79893. }
  79894. reqHeaders.Set("Content-Type", "application/json")
  79895. c.urlParams_.Set("alt", alt)
  79896. c.urlParams_.Set("prettyPrint", "false")
  79897. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/patchRule")
  79898. urls += "?" + c.urlParams_.Encode()
  79899. req, err := http.NewRequest("POST", urls, body)
  79900. if err != nil {
  79901. return nil, err
  79902. }
  79903. req.Header = reqHeaders
  79904. googleapi.Expand(req.URL, map[string]string{
  79905. "project": c.project,
  79906. "securityPolicy": c.securityPolicy,
  79907. })
  79908. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79909. }
  79910. // Do executes the "compute.securityPolicies.patchRule" call.
  79911. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79912. // status code is an error. Response headers are in either
  79913. // *Operation.ServerResponse.Header or (if a response was returned at
  79914. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79915. // to check whether the returned error was because
  79916. // http.StatusNotModified was returned.
  79917. func (c *SecurityPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79918. gensupport.SetOptions(c.urlParams_, opts...)
  79919. res, err := c.doRequest("json")
  79920. if res != nil && res.StatusCode == http.StatusNotModified {
  79921. if res.Body != nil {
  79922. res.Body.Close()
  79923. }
  79924. return nil, &googleapi.Error{
  79925. Code: res.StatusCode,
  79926. Header: res.Header,
  79927. }
  79928. }
  79929. if err != nil {
  79930. return nil, err
  79931. }
  79932. defer googleapi.CloseBody(res)
  79933. if err := googleapi.CheckResponse(res); err != nil {
  79934. return nil, err
  79935. }
  79936. ret := &Operation{
  79937. ServerResponse: googleapi.ServerResponse{
  79938. Header: res.Header,
  79939. HTTPStatusCode: res.StatusCode,
  79940. },
  79941. }
  79942. target := &ret
  79943. if err := gensupport.DecodeResponse(target, res); err != nil {
  79944. return nil, err
  79945. }
  79946. return ret, nil
  79947. // {
  79948. // "description": "Patches a rule at the specified priority.",
  79949. // "httpMethod": "POST",
  79950. // "id": "compute.securityPolicies.patchRule",
  79951. // "parameterOrder": [
  79952. // "project",
  79953. // "securityPolicy"
  79954. // ],
  79955. // "parameters": {
  79956. // "priority": {
  79957. // "description": "The priority of the rule to patch.",
  79958. // "format": "int32",
  79959. // "location": "query",
  79960. // "type": "integer"
  79961. // },
  79962. // "project": {
  79963. // "description": "Project ID for this request.",
  79964. // "location": "path",
  79965. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79966. // "required": true,
  79967. // "type": "string"
  79968. // },
  79969. // "securityPolicy": {
  79970. // "description": "Name of the security policy to update.",
  79971. // "location": "path",
  79972. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79973. // "required": true,
  79974. // "type": "string"
  79975. // }
  79976. // },
  79977. // "path": "{project}/global/securityPolicies/{securityPolicy}/patchRule",
  79978. // "request": {
  79979. // "$ref": "SecurityPolicyRule"
  79980. // },
  79981. // "response": {
  79982. // "$ref": "Operation"
  79983. // },
  79984. // "scopes": [
  79985. // "https://www.googleapis.com/auth/cloud-platform",
  79986. // "https://www.googleapis.com/auth/compute"
  79987. // ]
  79988. // }
  79989. }
  79990. // method id "compute.securityPolicies.removeRule":
  79991. type SecurityPoliciesRemoveRuleCall struct {
  79992. s *Service
  79993. project string
  79994. securityPolicy string
  79995. urlParams_ gensupport.URLParams
  79996. ctx_ context.Context
  79997. header_ http.Header
  79998. }
  79999. // RemoveRule: Deletes a rule at the specified priority.
  80000. func (r *SecurityPoliciesService) RemoveRule(project string, securityPolicy string) *SecurityPoliciesRemoveRuleCall {
  80001. c := &SecurityPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80002. c.project = project
  80003. c.securityPolicy = securityPolicy
  80004. return c
  80005. }
  80006. // Priority sets the optional parameter "priority": The priority of the
  80007. // rule to remove from the security policy.
  80008. func (c *SecurityPoliciesRemoveRuleCall) Priority(priority int64) *SecurityPoliciesRemoveRuleCall {
  80009. c.urlParams_.Set("priority", fmt.Sprint(priority))
  80010. return c
  80011. }
  80012. // Fields allows partial responses to be retrieved. See
  80013. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80014. // for more information.
  80015. func (c *SecurityPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesRemoveRuleCall {
  80016. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80017. return c
  80018. }
  80019. // Context sets the context to be used in this call's Do method. Any
  80020. // pending HTTP request will be aborted if the provided context is
  80021. // canceled.
  80022. func (c *SecurityPoliciesRemoveRuleCall) Context(ctx context.Context) *SecurityPoliciesRemoveRuleCall {
  80023. c.ctx_ = ctx
  80024. return c
  80025. }
  80026. // Header returns an http.Header that can be modified by the caller to
  80027. // add HTTP headers to the request.
  80028. func (c *SecurityPoliciesRemoveRuleCall) Header() http.Header {
  80029. if c.header_ == nil {
  80030. c.header_ = make(http.Header)
  80031. }
  80032. return c.header_
  80033. }
  80034. func (c *SecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
  80035. reqHeaders := make(http.Header)
  80036. for k, v := range c.header_ {
  80037. reqHeaders[k] = v
  80038. }
  80039. reqHeaders.Set("User-Agent", c.s.userAgent())
  80040. var body io.Reader = nil
  80041. c.urlParams_.Set("alt", alt)
  80042. c.urlParams_.Set("prettyPrint", "false")
  80043. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/removeRule")
  80044. urls += "?" + c.urlParams_.Encode()
  80045. req, err := http.NewRequest("POST", urls, body)
  80046. if err != nil {
  80047. return nil, err
  80048. }
  80049. req.Header = reqHeaders
  80050. googleapi.Expand(req.URL, map[string]string{
  80051. "project": c.project,
  80052. "securityPolicy": c.securityPolicy,
  80053. })
  80054. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80055. }
  80056. // Do executes the "compute.securityPolicies.removeRule" call.
  80057. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80058. // status code is an error. Response headers are in either
  80059. // *Operation.ServerResponse.Header or (if a response was returned at
  80060. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80061. // to check whether the returned error was because
  80062. // http.StatusNotModified was returned.
  80063. func (c *SecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80064. gensupport.SetOptions(c.urlParams_, opts...)
  80065. res, err := c.doRequest("json")
  80066. if res != nil && res.StatusCode == http.StatusNotModified {
  80067. if res.Body != nil {
  80068. res.Body.Close()
  80069. }
  80070. return nil, &googleapi.Error{
  80071. Code: res.StatusCode,
  80072. Header: res.Header,
  80073. }
  80074. }
  80075. if err != nil {
  80076. return nil, err
  80077. }
  80078. defer googleapi.CloseBody(res)
  80079. if err := googleapi.CheckResponse(res); err != nil {
  80080. return nil, err
  80081. }
  80082. ret := &Operation{
  80083. ServerResponse: googleapi.ServerResponse{
  80084. Header: res.Header,
  80085. HTTPStatusCode: res.StatusCode,
  80086. },
  80087. }
  80088. target := &ret
  80089. if err := gensupport.DecodeResponse(target, res); err != nil {
  80090. return nil, err
  80091. }
  80092. return ret, nil
  80093. // {
  80094. // "description": "Deletes a rule at the specified priority.",
  80095. // "httpMethod": "POST",
  80096. // "id": "compute.securityPolicies.removeRule",
  80097. // "parameterOrder": [
  80098. // "project",
  80099. // "securityPolicy"
  80100. // ],
  80101. // "parameters": {
  80102. // "priority": {
  80103. // "description": "The priority of the rule to remove from the security policy.",
  80104. // "format": "int32",
  80105. // "location": "query",
  80106. // "type": "integer"
  80107. // },
  80108. // "project": {
  80109. // "description": "Project ID for this request.",
  80110. // "location": "path",
  80111. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80112. // "required": true,
  80113. // "type": "string"
  80114. // },
  80115. // "securityPolicy": {
  80116. // "description": "Name of the security policy to update.",
  80117. // "location": "path",
  80118. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80119. // "required": true,
  80120. // "type": "string"
  80121. // }
  80122. // },
  80123. // "path": "{project}/global/securityPolicies/{securityPolicy}/removeRule",
  80124. // "response": {
  80125. // "$ref": "Operation"
  80126. // },
  80127. // "scopes": [
  80128. // "https://www.googleapis.com/auth/cloud-platform",
  80129. // "https://www.googleapis.com/auth/compute"
  80130. // ]
  80131. // }
  80132. }
  80133. // method id "compute.snapshots.delete":
  80134. type SnapshotsDeleteCall struct {
  80135. s *Service
  80136. project string
  80137. snapshot string
  80138. urlParams_ gensupport.URLParams
  80139. ctx_ context.Context
  80140. header_ http.Header
  80141. }
  80142. // Delete: Deletes the specified Snapshot resource. Keep in mind that
  80143. // deleting a single snapshot might not necessarily delete all the data
  80144. // on that snapshot. If any data on the snapshot that is marked for
  80145. // deletion is needed for subsequent snapshots, the data will be moved
  80146. // to the next corresponding snapshot.
  80147. //
  80148. // For more information, see Deleting snapshots.
  80149. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete
  80150. func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall {
  80151. c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80152. c.project = project
  80153. c.snapshot = snapshot
  80154. return c
  80155. }
  80156. // RequestId sets the optional parameter "requestId": An optional
  80157. // request ID to identify requests. Specify a unique request ID so that
  80158. // if you must retry your request, the server will know to ignore the
  80159. // request if it has already been completed.
  80160. //
  80161. // For example, consider a situation where you make an initial request
  80162. // and the request times out. If you make the request again with the
  80163. // same request ID, the server can check if original operation with the
  80164. // same request ID was received, and if so, will ignore the second
  80165. // request. This prevents clients from accidentally creating duplicate
  80166. // commitments.
  80167. //
  80168. // The request ID must be a valid UUID with the exception that zero UUID
  80169. // is not supported (00000000-0000-0000-0000-000000000000).
  80170. func (c *SnapshotsDeleteCall) RequestId(requestId string) *SnapshotsDeleteCall {
  80171. c.urlParams_.Set("requestId", requestId)
  80172. return c
  80173. }
  80174. // Fields allows partial responses to be retrieved. See
  80175. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80176. // for more information.
  80177. func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall {
  80178. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80179. return c
  80180. }
  80181. // Context sets the context to be used in this call's Do method. Any
  80182. // pending HTTP request will be aborted if the provided context is
  80183. // canceled.
  80184. func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall {
  80185. c.ctx_ = ctx
  80186. return c
  80187. }
  80188. // Header returns an http.Header that can be modified by the caller to
  80189. // add HTTP headers to the request.
  80190. func (c *SnapshotsDeleteCall) Header() http.Header {
  80191. if c.header_ == nil {
  80192. c.header_ = make(http.Header)
  80193. }
  80194. return c.header_
  80195. }
  80196. func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
  80197. reqHeaders := make(http.Header)
  80198. for k, v := range c.header_ {
  80199. reqHeaders[k] = v
  80200. }
  80201. reqHeaders.Set("User-Agent", c.s.userAgent())
  80202. var body io.Reader = nil
  80203. c.urlParams_.Set("alt", alt)
  80204. c.urlParams_.Set("prettyPrint", "false")
  80205. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  80206. urls += "?" + c.urlParams_.Encode()
  80207. req, err := http.NewRequest("DELETE", urls, body)
  80208. if err != nil {
  80209. return nil, err
  80210. }
  80211. req.Header = reqHeaders
  80212. googleapi.Expand(req.URL, map[string]string{
  80213. "project": c.project,
  80214. "snapshot": c.snapshot,
  80215. })
  80216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80217. }
  80218. // Do executes the "compute.snapshots.delete" call.
  80219. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80220. // status code is an error. Response headers are in either
  80221. // *Operation.ServerResponse.Header or (if a response was returned at
  80222. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80223. // to check whether the returned error was because
  80224. // http.StatusNotModified was returned.
  80225. func (c *SnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80226. gensupport.SetOptions(c.urlParams_, opts...)
  80227. res, err := c.doRequest("json")
  80228. if res != nil && res.StatusCode == http.StatusNotModified {
  80229. if res.Body != nil {
  80230. res.Body.Close()
  80231. }
  80232. return nil, &googleapi.Error{
  80233. Code: res.StatusCode,
  80234. Header: res.Header,
  80235. }
  80236. }
  80237. if err != nil {
  80238. return nil, err
  80239. }
  80240. defer googleapi.CloseBody(res)
  80241. if err := googleapi.CheckResponse(res); err != nil {
  80242. return nil, err
  80243. }
  80244. ret := &Operation{
  80245. ServerResponse: googleapi.ServerResponse{
  80246. Header: res.Header,
  80247. HTTPStatusCode: res.StatusCode,
  80248. },
  80249. }
  80250. target := &ret
  80251. if err := gensupport.DecodeResponse(target, res); err != nil {
  80252. return nil, err
  80253. }
  80254. return ret, nil
  80255. // {
  80256. // "description": "Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot.\n\nFor more information, see Deleting snapshots.",
  80257. // "httpMethod": "DELETE",
  80258. // "id": "compute.snapshots.delete",
  80259. // "parameterOrder": [
  80260. // "project",
  80261. // "snapshot"
  80262. // ],
  80263. // "parameters": {
  80264. // "project": {
  80265. // "description": "Project ID for this request.",
  80266. // "location": "path",
  80267. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80268. // "required": true,
  80269. // "type": "string"
  80270. // },
  80271. // "requestId": {
  80272. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80273. // "location": "query",
  80274. // "type": "string"
  80275. // },
  80276. // "snapshot": {
  80277. // "description": "Name of the Snapshot resource to delete.",
  80278. // "location": "path",
  80279. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80280. // "required": true,
  80281. // "type": "string"
  80282. // }
  80283. // },
  80284. // "path": "{project}/global/snapshots/{snapshot}",
  80285. // "response": {
  80286. // "$ref": "Operation"
  80287. // },
  80288. // "scopes": [
  80289. // "https://www.googleapis.com/auth/cloud-platform",
  80290. // "https://www.googleapis.com/auth/compute"
  80291. // ]
  80292. // }
  80293. }
  80294. // method id "compute.snapshots.get":
  80295. type SnapshotsGetCall struct {
  80296. s *Service
  80297. project string
  80298. snapshot string
  80299. urlParams_ gensupport.URLParams
  80300. ifNoneMatch_ string
  80301. ctx_ context.Context
  80302. header_ http.Header
  80303. }
  80304. // Get: Returns the specified Snapshot resource. Gets a list of
  80305. // available snapshots by making a list() request.
  80306. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get
  80307. func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall {
  80308. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80309. c.project = project
  80310. c.snapshot = snapshot
  80311. return c
  80312. }
  80313. // Fields allows partial responses to be retrieved. See
  80314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80315. // for more information.
  80316. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  80317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80318. return c
  80319. }
  80320. // IfNoneMatch sets the optional parameter which makes the operation
  80321. // fail if the object's ETag matches the given value. This is useful for
  80322. // getting updates only after the object has changed since the last
  80323. // request. Use googleapi.IsNotModified to check whether the response
  80324. // error from Do is the result of In-None-Match.
  80325. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  80326. c.ifNoneMatch_ = entityTag
  80327. return c
  80328. }
  80329. // Context sets the context to be used in this call's Do method. Any
  80330. // pending HTTP request will be aborted if the provided context is
  80331. // canceled.
  80332. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  80333. c.ctx_ = ctx
  80334. return c
  80335. }
  80336. // Header returns an http.Header that can be modified by the caller to
  80337. // add HTTP headers to the request.
  80338. func (c *SnapshotsGetCall) Header() http.Header {
  80339. if c.header_ == nil {
  80340. c.header_ = make(http.Header)
  80341. }
  80342. return c.header_
  80343. }
  80344. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  80345. reqHeaders := make(http.Header)
  80346. for k, v := range c.header_ {
  80347. reqHeaders[k] = v
  80348. }
  80349. reqHeaders.Set("User-Agent", c.s.userAgent())
  80350. if c.ifNoneMatch_ != "" {
  80351. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80352. }
  80353. var body io.Reader = nil
  80354. c.urlParams_.Set("alt", alt)
  80355. c.urlParams_.Set("prettyPrint", "false")
  80356. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  80357. urls += "?" + c.urlParams_.Encode()
  80358. req, err := http.NewRequest("GET", urls, body)
  80359. if err != nil {
  80360. return nil, err
  80361. }
  80362. req.Header = reqHeaders
  80363. googleapi.Expand(req.URL, map[string]string{
  80364. "project": c.project,
  80365. "snapshot": c.snapshot,
  80366. })
  80367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80368. }
  80369. // Do executes the "compute.snapshots.get" call.
  80370. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  80371. // code is an error. Response headers are in either
  80372. // *Snapshot.ServerResponse.Header or (if a response was returned at
  80373. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80374. // to check whether the returned error was because
  80375. // http.StatusNotModified was returned.
  80376. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  80377. gensupport.SetOptions(c.urlParams_, opts...)
  80378. res, err := c.doRequest("json")
  80379. if res != nil && res.StatusCode == http.StatusNotModified {
  80380. if res.Body != nil {
  80381. res.Body.Close()
  80382. }
  80383. return nil, &googleapi.Error{
  80384. Code: res.StatusCode,
  80385. Header: res.Header,
  80386. }
  80387. }
  80388. if err != nil {
  80389. return nil, err
  80390. }
  80391. defer googleapi.CloseBody(res)
  80392. if err := googleapi.CheckResponse(res); err != nil {
  80393. return nil, err
  80394. }
  80395. ret := &Snapshot{
  80396. ServerResponse: googleapi.ServerResponse{
  80397. Header: res.Header,
  80398. HTTPStatusCode: res.StatusCode,
  80399. },
  80400. }
  80401. target := &ret
  80402. if err := gensupport.DecodeResponse(target, res); err != nil {
  80403. return nil, err
  80404. }
  80405. return ret, nil
  80406. // {
  80407. // "description": "Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request.",
  80408. // "httpMethod": "GET",
  80409. // "id": "compute.snapshots.get",
  80410. // "parameterOrder": [
  80411. // "project",
  80412. // "snapshot"
  80413. // ],
  80414. // "parameters": {
  80415. // "project": {
  80416. // "description": "Project ID for this request.",
  80417. // "location": "path",
  80418. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80419. // "required": true,
  80420. // "type": "string"
  80421. // },
  80422. // "snapshot": {
  80423. // "description": "Name of the Snapshot resource to return.",
  80424. // "location": "path",
  80425. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80426. // "required": true,
  80427. // "type": "string"
  80428. // }
  80429. // },
  80430. // "path": "{project}/global/snapshots/{snapshot}",
  80431. // "response": {
  80432. // "$ref": "Snapshot"
  80433. // },
  80434. // "scopes": [
  80435. // "https://www.googleapis.com/auth/cloud-platform",
  80436. // "https://www.googleapis.com/auth/compute",
  80437. // "https://www.googleapis.com/auth/compute.readonly"
  80438. // ]
  80439. // }
  80440. }
  80441. // method id "compute.snapshots.getIamPolicy":
  80442. type SnapshotsGetIamPolicyCall struct {
  80443. s *Service
  80444. project string
  80445. resource string
  80446. urlParams_ gensupport.URLParams
  80447. ifNoneMatch_ string
  80448. ctx_ context.Context
  80449. header_ http.Header
  80450. }
  80451. // GetIamPolicy: Gets the access control policy for a resource. May be
  80452. // empty if no such policy or resource exists.
  80453. func (r *SnapshotsService) GetIamPolicy(project string, resource string) *SnapshotsGetIamPolicyCall {
  80454. c := &SnapshotsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80455. c.project = project
  80456. c.resource = resource
  80457. return c
  80458. }
  80459. // Fields allows partial responses to be retrieved. See
  80460. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80461. // for more information.
  80462. func (c *SnapshotsGetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsGetIamPolicyCall {
  80463. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80464. return c
  80465. }
  80466. // IfNoneMatch sets the optional parameter which makes the operation
  80467. // fail if the object's ETag matches the given value. This is useful for
  80468. // getting updates only after the object has changed since the last
  80469. // request. Use googleapi.IsNotModified to check whether the response
  80470. // error from Do is the result of In-None-Match.
  80471. func (c *SnapshotsGetIamPolicyCall) IfNoneMatch(entityTag string) *SnapshotsGetIamPolicyCall {
  80472. c.ifNoneMatch_ = entityTag
  80473. return c
  80474. }
  80475. // Context sets the context to be used in this call's Do method. Any
  80476. // pending HTTP request will be aborted if the provided context is
  80477. // canceled.
  80478. func (c *SnapshotsGetIamPolicyCall) Context(ctx context.Context) *SnapshotsGetIamPolicyCall {
  80479. c.ctx_ = ctx
  80480. return c
  80481. }
  80482. // Header returns an http.Header that can be modified by the caller to
  80483. // add HTTP headers to the request.
  80484. func (c *SnapshotsGetIamPolicyCall) Header() http.Header {
  80485. if c.header_ == nil {
  80486. c.header_ = make(http.Header)
  80487. }
  80488. return c.header_
  80489. }
  80490. func (c *SnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  80491. reqHeaders := make(http.Header)
  80492. for k, v := range c.header_ {
  80493. reqHeaders[k] = v
  80494. }
  80495. reqHeaders.Set("User-Agent", c.s.userAgent())
  80496. if c.ifNoneMatch_ != "" {
  80497. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80498. }
  80499. var body io.Reader = nil
  80500. c.urlParams_.Set("alt", alt)
  80501. c.urlParams_.Set("prettyPrint", "false")
  80502. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/getIamPolicy")
  80503. urls += "?" + c.urlParams_.Encode()
  80504. req, err := http.NewRequest("GET", urls, body)
  80505. if err != nil {
  80506. return nil, err
  80507. }
  80508. req.Header = reqHeaders
  80509. googleapi.Expand(req.URL, map[string]string{
  80510. "project": c.project,
  80511. "resource": c.resource,
  80512. })
  80513. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80514. }
  80515. // Do executes the "compute.snapshots.getIamPolicy" call.
  80516. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  80517. // code is an error. Response headers are in either
  80518. // *Policy.ServerResponse.Header or (if a response was returned at all)
  80519. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  80520. // check whether the returned error was because http.StatusNotModified
  80521. // was returned.
  80522. func (c *SnapshotsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  80523. gensupport.SetOptions(c.urlParams_, opts...)
  80524. res, err := c.doRequest("json")
  80525. if res != nil && res.StatusCode == http.StatusNotModified {
  80526. if res.Body != nil {
  80527. res.Body.Close()
  80528. }
  80529. return nil, &googleapi.Error{
  80530. Code: res.StatusCode,
  80531. Header: res.Header,
  80532. }
  80533. }
  80534. if err != nil {
  80535. return nil, err
  80536. }
  80537. defer googleapi.CloseBody(res)
  80538. if err := googleapi.CheckResponse(res); err != nil {
  80539. return nil, err
  80540. }
  80541. ret := &Policy{
  80542. ServerResponse: googleapi.ServerResponse{
  80543. Header: res.Header,
  80544. HTTPStatusCode: res.StatusCode,
  80545. },
  80546. }
  80547. target := &ret
  80548. if err := gensupport.DecodeResponse(target, res); err != nil {
  80549. return nil, err
  80550. }
  80551. return ret, nil
  80552. // {
  80553. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  80554. // "httpMethod": "GET",
  80555. // "id": "compute.snapshots.getIamPolicy",
  80556. // "parameterOrder": [
  80557. // "project",
  80558. // "resource"
  80559. // ],
  80560. // "parameters": {
  80561. // "project": {
  80562. // "description": "Project ID for this request.",
  80563. // "location": "path",
  80564. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80565. // "required": true,
  80566. // "type": "string"
  80567. // },
  80568. // "resource": {
  80569. // "description": "Name or id of the resource for this request.",
  80570. // "location": "path",
  80571. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80572. // "required": true,
  80573. // "type": "string"
  80574. // }
  80575. // },
  80576. // "path": "{project}/global/snapshots/{resource}/getIamPolicy",
  80577. // "response": {
  80578. // "$ref": "Policy"
  80579. // },
  80580. // "scopes": [
  80581. // "https://www.googleapis.com/auth/cloud-platform",
  80582. // "https://www.googleapis.com/auth/compute",
  80583. // "https://www.googleapis.com/auth/compute.readonly"
  80584. // ]
  80585. // }
  80586. }
  80587. // method id "compute.snapshots.list":
  80588. type SnapshotsListCall struct {
  80589. s *Service
  80590. project string
  80591. urlParams_ gensupport.URLParams
  80592. ifNoneMatch_ string
  80593. ctx_ context.Context
  80594. header_ http.Header
  80595. }
  80596. // List: Retrieves the list of Snapshot resources contained within the
  80597. // specified project.
  80598. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list
  80599. func (r *SnapshotsService) List(project string) *SnapshotsListCall {
  80600. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80601. c.project = project
  80602. return c
  80603. }
  80604. // Filter sets the optional parameter "filter": A filter expression that
  80605. // filters resources listed in the response. The expression must specify
  80606. // the field name, a comparison operator, and the value that you want to
  80607. // use for filtering. The value must be a string, a number, or a
  80608. // boolean. The comparison operator must be either =, !=, >, or <.
  80609. //
  80610. // For example, if you are filtering Compute Engine instances, you can
  80611. // exclude instances named example-instance by specifying name !=
  80612. // example-instance.
  80613. //
  80614. // You can also filter nested fields. For example, you could specify
  80615. // scheduling.automaticRestart = false to include instances only if they
  80616. // are not scheduled for automatic restarts. You can use filtering on
  80617. // nested fields to filter based on resource labels.
  80618. //
  80619. // To filter on multiple expressions, provide each separate expression
  80620. // within parentheses. For example, (scheduling.automaticRestart = true)
  80621. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  80622. // AND expression. However, you can include AND and OR expressions
  80623. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  80624. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  80625. // true).
  80626. func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall {
  80627. c.urlParams_.Set("filter", filter)
  80628. return c
  80629. }
  80630. // MaxResults sets the optional parameter "maxResults": The maximum
  80631. // number of results per page that should be returned. If the number of
  80632. // available results is larger than maxResults, Compute Engine returns a
  80633. // nextPageToken that can be used to get the next page of results in
  80634. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  80635. // (Default: 500)
  80636. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  80637. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  80638. return c
  80639. }
  80640. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  80641. // a certain order. By default, results are returned in alphanumerical
  80642. // order based on the resource name.
  80643. //
  80644. // You can also sort results in descending order based on the creation
  80645. // timestamp using orderBy="creationTimestamp desc". This sorts results
  80646. // based on the creationTimestamp field in reverse chronological order
  80647. // (newest result first). Use this to sort resources like operations so
  80648. // that the newest operation is returned first.
  80649. //
  80650. // Currently, only sorting by name or creationTimestamp desc is
  80651. // supported.
  80652. func (c *SnapshotsListCall) OrderBy(orderBy string) *SnapshotsListCall {
  80653. c.urlParams_.Set("orderBy", orderBy)
  80654. return c
  80655. }
  80656. // PageToken sets the optional parameter "pageToken": Specifies a page
  80657. // token to use. Set pageToken to the nextPageToken returned by a
  80658. // previous list request to get the next page of results.
  80659. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  80660. c.urlParams_.Set("pageToken", pageToken)
  80661. return c
  80662. }
  80663. // Fields allows partial responses to be retrieved. See
  80664. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80665. // for more information.
  80666. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  80667. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80668. return c
  80669. }
  80670. // IfNoneMatch sets the optional parameter which makes the operation
  80671. // fail if the object's ETag matches the given value. This is useful for
  80672. // getting updates only after the object has changed since the last
  80673. // request. Use googleapi.IsNotModified to check whether the response
  80674. // error from Do is the result of In-None-Match.
  80675. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  80676. c.ifNoneMatch_ = entityTag
  80677. return c
  80678. }
  80679. // Context sets the context to be used in this call's Do method. Any
  80680. // pending HTTP request will be aborted if the provided context is
  80681. // canceled.
  80682. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  80683. c.ctx_ = ctx
  80684. return c
  80685. }
  80686. // Header returns an http.Header that can be modified by the caller to
  80687. // add HTTP headers to the request.
  80688. func (c *SnapshotsListCall) Header() http.Header {
  80689. if c.header_ == nil {
  80690. c.header_ = make(http.Header)
  80691. }
  80692. return c.header_
  80693. }
  80694. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  80695. reqHeaders := make(http.Header)
  80696. for k, v := range c.header_ {
  80697. reqHeaders[k] = v
  80698. }
  80699. reqHeaders.Set("User-Agent", c.s.userAgent())
  80700. if c.ifNoneMatch_ != "" {
  80701. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80702. }
  80703. var body io.Reader = nil
  80704. c.urlParams_.Set("alt", alt)
  80705. c.urlParams_.Set("prettyPrint", "false")
  80706. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots")
  80707. urls += "?" + c.urlParams_.Encode()
  80708. req, err := http.NewRequest("GET", urls, body)
  80709. if err != nil {
  80710. return nil, err
  80711. }
  80712. req.Header = reqHeaders
  80713. googleapi.Expand(req.URL, map[string]string{
  80714. "project": c.project,
  80715. })
  80716. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80717. }
  80718. // Do executes the "compute.snapshots.list" call.
  80719. // Exactly one of *SnapshotList or error will be non-nil. Any non-2xx
  80720. // status code is an error. Response headers are in either
  80721. // *SnapshotList.ServerResponse.Header or (if a response was returned at
  80722. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80723. // to check whether the returned error was because
  80724. // http.StatusNotModified was returned.
  80725. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, error) {
  80726. gensupport.SetOptions(c.urlParams_, opts...)
  80727. res, err := c.doRequest("json")
  80728. if res != nil && res.StatusCode == http.StatusNotModified {
  80729. if res.Body != nil {
  80730. res.Body.Close()
  80731. }
  80732. return nil, &googleapi.Error{
  80733. Code: res.StatusCode,
  80734. Header: res.Header,
  80735. }
  80736. }
  80737. if err != nil {
  80738. return nil, err
  80739. }
  80740. defer googleapi.CloseBody(res)
  80741. if err := googleapi.CheckResponse(res); err != nil {
  80742. return nil, err
  80743. }
  80744. ret := &SnapshotList{
  80745. ServerResponse: googleapi.ServerResponse{
  80746. Header: res.Header,
  80747. HTTPStatusCode: res.StatusCode,
  80748. },
  80749. }
  80750. target := &ret
  80751. if err := gensupport.DecodeResponse(target, res); err != nil {
  80752. return nil, err
  80753. }
  80754. return ret, nil
  80755. // {
  80756. // "description": "Retrieves the list of Snapshot resources contained within the specified project.",
  80757. // "httpMethod": "GET",
  80758. // "id": "compute.snapshots.list",
  80759. // "parameterOrder": [
  80760. // "project"
  80761. // ],
  80762. // "parameters": {
  80763. // "filter": {
  80764. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  80765. // "location": "query",
  80766. // "type": "string"
  80767. // },
  80768. // "maxResults": {
  80769. // "default": "500",
  80770. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  80771. // "format": "uint32",
  80772. // "location": "query",
  80773. // "minimum": "0",
  80774. // "type": "integer"
  80775. // },
  80776. // "orderBy": {
  80777. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  80778. // "location": "query",
  80779. // "type": "string"
  80780. // },
  80781. // "pageToken": {
  80782. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  80783. // "location": "query",
  80784. // "type": "string"
  80785. // },
  80786. // "project": {
  80787. // "description": "Project ID for this request.",
  80788. // "location": "path",
  80789. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80790. // "required": true,
  80791. // "type": "string"
  80792. // }
  80793. // },
  80794. // "path": "{project}/global/snapshots",
  80795. // "response": {
  80796. // "$ref": "SnapshotList"
  80797. // },
  80798. // "scopes": [
  80799. // "https://www.googleapis.com/auth/cloud-platform",
  80800. // "https://www.googleapis.com/auth/compute",
  80801. // "https://www.googleapis.com/auth/compute.readonly"
  80802. // ]
  80803. // }
  80804. }
  80805. // Pages invokes f for each page of results.
  80806. // A non-nil error returned from f will halt the iteration.
  80807. // The provided context supersedes any context provided to the Context method.
  80808. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) error) error {
  80809. c.ctx_ = ctx
  80810. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  80811. for {
  80812. x, err := c.Do()
  80813. if err != nil {
  80814. return err
  80815. }
  80816. if err := f(x); err != nil {
  80817. return err
  80818. }
  80819. if x.NextPageToken == "" {
  80820. return nil
  80821. }
  80822. c.PageToken(x.NextPageToken)
  80823. }
  80824. }
  80825. // method id "compute.snapshots.setIamPolicy":
  80826. type SnapshotsSetIamPolicyCall struct {
  80827. s *Service
  80828. project string
  80829. resource string
  80830. globalsetpolicyrequest *GlobalSetPolicyRequest
  80831. urlParams_ gensupport.URLParams
  80832. ctx_ context.Context
  80833. header_ http.Header
  80834. }
  80835. // SetIamPolicy: Sets the access control policy on the specified
  80836. // resource. Replaces any existing policy.
  80837. func (r *SnapshotsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *SnapshotsSetIamPolicyCall {
  80838. c := &SnapshotsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80839. c.project = project
  80840. c.resource = resource
  80841. c.globalsetpolicyrequest = globalsetpolicyrequest
  80842. return c
  80843. }
  80844. // Fields allows partial responses to be retrieved. See
  80845. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80846. // for more information.
  80847. func (c *SnapshotsSetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsSetIamPolicyCall {
  80848. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80849. return c
  80850. }
  80851. // Context sets the context to be used in this call's Do method. Any
  80852. // pending HTTP request will be aborted if the provided context is
  80853. // canceled.
  80854. func (c *SnapshotsSetIamPolicyCall) Context(ctx context.Context) *SnapshotsSetIamPolicyCall {
  80855. c.ctx_ = ctx
  80856. return c
  80857. }
  80858. // Header returns an http.Header that can be modified by the caller to
  80859. // add HTTP headers to the request.
  80860. func (c *SnapshotsSetIamPolicyCall) Header() http.Header {
  80861. if c.header_ == nil {
  80862. c.header_ = make(http.Header)
  80863. }
  80864. return c.header_
  80865. }
  80866. func (c *SnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  80867. reqHeaders := make(http.Header)
  80868. for k, v := range c.header_ {
  80869. reqHeaders[k] = v
  80870. }
  80871. reqHeaders.Set("User-Agent", c.s.userAgent())
  80872. var body io.Reader = nil
  80873. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  80874. if err != nil {
  80875. return nil, err
  80876. }
  80877. reqHeaders.Set("Content-Type", "application/json")
  80878. c.urlParams_.Set("alt", alt)
  80879. c.urlParams_.Set("prettyPrint", "false")
  80880. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setIamPolicy")
  80881. urls += "?" + c.urlParams_.Encode()
  80882. req, err := http.NewRequest("POST", urls, body)
  80883. if err != nil {
  80884. return nil, err
  80885. }
  80886. req.Header = reqHeaders
  80887. googleapi.Expand(req.URL, map[string]string{
  80888. "project": c.project,
  80889. "resource": c.resource,
  80890. })
  80891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80892. }
  80893. // Do executes the "compute.snapshots.setIamPolicy" call.
  80894. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  80895. // code is an error. Response headers are in either
  80896. // *Policy.ServerResponse.Header or (if a response was returned at all)
  80897. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  80898. // check whether the returned error was because http.StatusNotModified
  80899. // was returned.
  80900. func (c *SnapshotsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  80901. gensupport.SetOptions(c.urlParams_, opts...)
  80902. res, err := c.doRequest("json")
  80903. if res != nil && res.StatusCode == http.StatusNotModified {
  80904. if res.Body != nil {
  80905. res.Body.Close()
  80906. }
  80907. return nil, &googleapi.Error{
  80908. Code: res.StatusCode,
  80909. Header: res.Header,
  80910. }
  80911. }
  80912. if err != nil {
  80913. return nil, err
  80914. }
  80915. defer googleapi.CloseBody(res)
  80916. if err := googleapi.CheckResponse(res); err != nil {
  80917. return nil, err
  80918. }
  80919. ret := &Policy{
  80920. ServerResponse: googleapi.ServerResponse{
  80921. Header: res.Header,
  80922. HTTPStatusCode: res.StatusCode,
  80923. },
  80924. }
  80925. target := &ret
  80926. if err := gensupport.DecodeResponse(target, res); err != nil {
  80927. return nil, err
  80928. }
  80929. return ret, nil
  80930. // {
  80931. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  80932. // "httpMethod": "POST",
  80933. // "id": "compute.snapshots.setIamPolicy",
  80934. // "parameterOrder": [
  80935. // "project",
  80936. // "resource"
  80937. // ],
  80938. // "parameters": {
  80939. // "project": {
  80940. // "description": "Project ID for this request.",
  80941. // "location": "path",
  80942. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80943. // "required": true,
  80944. // "type": "string"
  80945. // },
  80946. // "resource": {
  80947. // "description": "Name or id of the resource for this request.",
  80948. // "location": "path",
  80949. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80950. // "required": true,
  80951. // "type": "string"
  80952. // }
  80953. // },
  80954. // "path": "{project}/global/snapshots/{resource}/setIamPolicy",
  80955. // "request": {
  80956. // "$ref": "GlobalSetPolicyRequest"
  80957. // },
  80958. // "response": {
  80959. // "$ref": "Policy"
  80960. // },
  80961. // "scopes": [
  80962. // "https://www.googleapis.com/auth/cloud-platform",
  80963. // "https://www.googleapis.com/auth/compute"
  80964. // ]
  80965. // }
  80966. }
  80967. // method id "compute.snapshots.setLabels":
  80968. type SnapshotsSetLabelsCall struct {
  80969. s *Service
  80970. project string
  80971. resource string
  80972. globalsetlabelsrequest *GlobalSetLabelsRequest
  80973. urlParams_ gensupport.URLParams
  80974. ctx_ context.Context
  80975. header_ http.Header
  80976. }
  80977. // SetLabels: Sets the labels on a snapshot. To learn more about labels,
  80978. // read the Labeling Resources documentation.
  80979. func (r *SnapshotsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SnapshotsSetLabelsCall {
  80980. c := &SnapshotsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80981. c.project = project
  80982. c.resource = resource
  80983. c.globalsetlabelsrequest = globalsetlabelsrequest
  80984. return c
  80985. }
  80986. // Fields allows partial responses to be retrieved. See
  80987. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80988. // for more information.
  80989. func (c *SnapshotsSetLabelsCall) Fields(s ...googleapi.Field) *SnapshotsSetLabelsCall {
  80990. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80991. return c
  80992. }
  80993. // Context sets the context to be used in this call's Do method. Any
  80994. // pending HTTP request will be aborted if the provided context is
  80995. // canceled.
  80996. func (c *SnapshotsSetLabelsCall) Context(ctx context.Context) *SnapshotsSetLabelsCall {
  80997. c.ctx_ = ctx
  80998. return c
  80999. }
  81000. // Header returns an http.Header that can be modified by the caller to
  81001. // add HTTP headers to the request.
  81002. func (c *SnapshotsSetLabelsCall) Header() http.Header {
  81003. if c.header_ == nil {
  81004. c.header_ = make(http.Header)
  81005. }
  81006. return c.header_
  81007. }
  81008. func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  81009. reqHeaders := make(http.Header)
  81010. for k, v := range c.header_ {
  81011. reqHeaders[k] = v
  81012. }
  81013. reqHeaders.Set("User-Agent", c.s.userAgent())
  81014. var body io.Reader = nil
  81015. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  81016. if err != nil {
  81017. return nil, err
  81018. }
  81019. reqHeaders.Set("Content-Type", "application/json")
  81020. c.urlParams_.Set("alt", alt)
  81021. c.urlParams_.Set("prettyPrint", "false")
  81022. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setLabels")
  81023. urls += "?" + c.urlParams_.Encode()
  81024. req, err := http.NewRequest("POST", urls, body)
  81025. if err != nil {
  81026. return nil, err
  81027. }
  81028. req.Header = reqHeaders
  81029. googleapi.Expand(req.URL, map[string]string{
  81030. "project": c.project,
  81031. "resource": c.resource,
  81032. })
  81033. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81034. }
  81035. // Do executes the "compute.snapshots.setLabels" call.
  81036. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81037. // status code is an error. Response headers are in either
  81038. // *Operation.ServerResponse.Header or (if a response was returned at
  81039. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81040. // to check whether the returned error was because
  81041. // http.StatusNotModified was returned.
  81042. func (c *SnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81043. gensupport.SetOptions(c.urlParams_, opts...)
  81044. res, err := c.doRequest("json")
  81045. if res != nil && res.StatusCode == http.StatusNotModified {
  81046. if res.Body != nil {
  81047. res.Body.Close()
  81048. }
  81049. return nil, &googleapi.Error{
  81050. Code: res.StatusCode,
  81051. Header: res.Header,
  81052. }
  81053. }
  81054. if err != nil {
  81055. return nil, err
  81056. }
  81057. defer googleapi.CloseBody(res)
  81058. if err := googleapi.CheckResponse(res); err != nil {
  81059. return nil, err
  81060. }
  81061. ret := &Operation{
  81062. ServerResponse: googleapi.ServerResponse{
  81063. Header: res.Header,
  81064. HTTPStatusCode: res.StatusCode,
  81065. },
  81066. }
  81067. target := &ret
  81068. if err := gensupport.DecodeResponse(target, res); err != nil {
  81069. return nil, err
  81070. }
  81071. return ret, nil
  81072. // {
  81073. // "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.",
  81074. // "httpMethod": "POST",
  81075. // "id": "compute.snapshots.setLabels",
  81076. // "parameterOrder": [
  81077. // "project",
  81078. // "resource"
  81079. // ],
  81080. // "parameters": {
  81081. // "project": {
  81082. // "description": "Project ID for this request.",
  81083. // "location": "path",
  81084. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81085. // "required": true,
  81086. // "type": "string"
  81087. // },
  81088. // "resource": {
  81089. // "description": "Name or id of the resource for this request.",
  81090. // "location": "path",
  81091. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81092. // "required": true,
  81093. // "type": "string"
  81094. // }
  81095. // },
  81096. // "path": "{project}/global/snapshots/{resource}/setLabels",
  81097. // "request": {
  81098. // "$ref": "GlobalSetLabelsRequest"
  81099. // },
  81100. // "response": {
  81101. // "$ref": "Operation"
  81102. // },
  81103. // "scopes": [
  81104. // "https://www.googleapis.com/auth/cloud-platform",
  81105. // "https://www.googleapis.com/auth/compute"
  81106. // ]
  81107. // }
  81108. }
  81109. // method id "compute.snapshots.testIamPermissions":
  81110. type SnapshotsTestIamPermissionsCall struct {
  81111. s *Service
  81112. project string
  81113. resource string
  81114. testpermissionsrequest *TestPermissionsRequest
  81115. urlParams_ gensupport.URLParams
  81116. ctx_ context.Context
  81117. header_ http.Header
  81118. }
  81119. // TestIamPermissions: Returns permissions that a caller has on the
  81120. // specified resource.
  81121. func (r *SnapshotsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SnapshotsTestIamPermissionsCall {
  81122. c := &SnapshotsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81123. c.project = project
  81124. c.resource = resource
  81125. c.testpermissionsrequest = testpermissionsrequest
  81126. return c
  81127. }
  81128. // Fields allows partial responses to be retrieved. See
  81129. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81130. // for more information.
  81131. func (c *SnapshotsTestIamPermissionsCall) Fields(s ...googleapi.Field) *SnapshotsTestIamPermissionsCall {
  81132. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81133. return c
  81134. }
  81135. // Context sets the context to be used in this call's Do method. Any
  81136. // pending HTTP request will be aborted if the provided context is
  81137. // canceled.
  81138. func (c *SnapshotsTestIamPermissionsCall) Context(ctx context.Context) *SnapshotsTestIamPermissionsCall {
  81139. c.ctx_ = ctx
  81140. return c
  81141. }
  81142. // Header returns an http.Header that can be modified by the caller to
  81143. // add HTTP headers to the request.
  81144. func (c *SnapshotsTestIamPermissionsCall) Header() http.Header {
  81145. if c.header_ == nil {
  81146. c.header_ = make(http.Header)
  81147. }
  81148. return c.header_
  81149. }
  81150. func (c *SnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  81151. reqHeaders := make(http.Header)
  81152. for k, v := range c.header_ {
  81153. reqHeaders[k] = v
  81154. }
  81155. reqHeaders.Set("User-Agent", c.s.userAgent())
  81156. var body io.Reader = nil
  81157. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  81158. if err != nil {
  81159. return nil, err
  81160. }
  81161. reqHeaders.Set("Content-Type", "application/json")
  81162. c.urlParams_.Set("alt", alt)
  81163. c.urlParams_.Set("prettyPrint", "false")
  81164. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/testIamPermissions")
  81165. urls += "?" + c.urlParams_.Encode()
  81166. req, err := http.NewRequest("POST", urls, body)
  81167. if err != nil {
  81168. return nil, err
  81169. }
  81170. req.Header = reqHeaders
  81171. googleapi.Expand(req.URL, map[string]string{
  81172. "project": c.project,
  81173. "resource": c.resource,
  81174. })
  81175. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81176. }
  81177. // Do executes the "compute.snapshots.testIamPermissions" call.
  81178. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  81179. // non-2xx status code is an error. Response headers are in either
  81180. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  81181. // returned at all) in error.(*googleapi.Error).Header. Use
  81182. // googleapi.IsNotModified to check whether the returned error was
  81183. // because http.StatusNotModified was returned.
  81184. func (c *SnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  81185. gensupport.SetOptions(c.urlParams_, opts...)
  81186. res, err := c.doRequest("json")
  81187. if res != nil && res.StatusCode == http.StatusNotModified {
  81188. if res.Body != nil {
  81189. res.Body.Close()
  81190. }
  81191. return nil, &googleapi.Error{
  81192. Code: res.StatusCode,
  81193. Header: res.Header,
  81194. }
  81195. }
  81196. if err != nil {
  81197. return nil, err
  81198. }
  81199. defer googleapi.CloseBody(res)
  81200. if err := googleapi.CheckResponse(res); err != nil {
  81201. return nil, err
  81202. }
  81203. ret := &TestPermissionsResponse{
  81204. ServerResponse: googleapi.ServerResponse{
  81205. Header: res.Header,
  81206. HTTPStatusCode: res.StatusCode,
  81207. },
  81208. }
  81209. target := &ret
  81210. if err := gensupport.DecodeResponse(target, res); err != nil {
  81211. return nil, err
  81212. }
  81213. return ret, nil
  81214. // {
  81215. // "description": "Returns permissions that a caller has on the specified resource.",
  81216. // "httpMethod": "POST",
  81217. // "id": "compute.snapshots.testIamPermissions",
  81218. // "parameterOrder": [
  81219. // "project",
  81220. // "resource"
  81221. // ],
  81222. // "parameters": {
  81223. // "project": {
  81224. // "description": "Project ID for this request.",
  81225. // "location": "path",
  81226. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81227. // "required": true,
  81228. // "type": "string"
  81229. // },
  81230. // "resource": {
  81231. // "description": "Name or id of the resource for this request.",
  81232. // "location": "path",
  81233. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81234. // "required": true,
  81235. // "type": "string"
  81236. // }
  81237. // },
  81238. // "path": "{project}/global/snapshots/{resource}/testIamPermissions",
  81239. // "request": {
  81240. // "$ref": "TestPermissionsRequest"
  81241. // },
  81242. // "response": {
  81243. // "$ref": "TestPermissionsResponse"
  81244. // },
  81245. // "scopes": [
  81246. // "https://www.googleapis.com/auth/cloud-platform",
  81247. // "https://www.googleapis.com/auth/compute",
  81248. // "https://www.googleapis.com/auth/compute.readonly"
  81249. // ]
  81250. // }
  81251. }
  81252. // method id "compute.sslCertificates.delete":
  81253. type SslCertificatesDeleteCall struct {
  81254. s *Service
  81255. project string
  81256. sslCertificate string
  81257. urlParams_ gensupport.URLParams
  81258. ctx_ context.Context
  81259. header_ http.Header
  81260. }
  81261. // Delete: Deletes the specified SslCertificate resource.
  81262. func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall {
  81263. c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81264. c.project = project
  81265. c.sslCertificate = sslCertificate
  81266. return c
  81267. }
  81268. // RequestId sets the optional parameter "requestId": An optional
  81269. // request ID to identify requests. Specify a unique request ID so that
  81270. // if you must retry your request, the server will know to ignore the
  81271. // request if it has already been completed.
  81272. //
  81273. // For example, consider a situation where you make an initial request
  81274. // and the request times out. If you make the request again with the
  81275. // same request ID, the server can check if original operation with the
  81276. // same request ID was received, and if so, will ignore the second
  81277. // request. This prevents clients from accidentally creating duplicate
  81278. // commitments.
  81279. //
  81280. // The request ID must be a valid UUID with the exception that zero UUID
  81281. // is not supported (00000000-0000-0000-0000-000000000000).
  81282. func (c *SslCertificatesDeleteCall) RequestId(requestId string) *SslCertificatesDeleteCall {
  81283. c.urlParams_.Set("requestId", requestId)
  81284. return c
  81285. }
  81286. // Fields allows partial responses to be retrieved. See
  81287. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81288. // for more information.
  81289. func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall {
  81290. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81291. return c
  81292. }
  81293. // Context sets the context to be used in this call's Do method. Any
  81294. // pending HTTP request will be aborted if the provided context is
  81295. // canceled.
  81296. func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall {
  81297. c.ctx_ = ctx
  81298. return c
  81299. }
  81300. // Header returns an http.Header that can be modified by the caller to
  81301. // add HTTP headers to the request.
  81302. func (c *SslCertificatesDeleteCall) Header() http.Header {
  81303. if c.header_ == nil {
  81304. c.header_ = make(http.Header)
  81305. }
  81306. return c.header_
  81307. }
  81308. func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  81309. reqHeaders := make(http.Header)
  81310. for k, v := range c.header_ {
  81311. reqHeaders[k] = v
  81312. }
  81313. reqHeaders.Set("User-Agent", c.s.userAgent())
  81314. var body io.Reader = nil
  81315. c.urlParams_.Set("alt", alt)
  81316. c.urlParams_.Set("prettyPrint", "false")
  81317. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  81318. urls += "?" + c.urlParams_.Encode()
  81319. req, err := http.NewRequest("DELETE", urls, body)
  81320. if err != nil {
  81321. return nil, err
  81322. }
  81323. req.Header = reqHeaders
  81324. googleapi.Expand(req.URL, map[string]string{
  81325. "project": c.project,
  81326. "sslCertificate": c.sslCertificate,
  81327. })
  81328. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81329. }
  81330. // Do executes the "compute.sslCertificates.delete" call.
  81331. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81332. // status code is an error. Response headers are in either
  81333. // *Operation.ServerResponse.Header or (if a response was returned at
  81334. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81335. // to check whether the returned error was because
  81336. // http.StatusNotModified was returned.
  81337. func (c *SslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81338. gensupport.SetOptions(c.urlParams_, opts...)
  81339. res, err := c.doRequest("json")
  81340. if res != nil && res.StatusCode == http.StatusNotModified {
  81341. if res.Body != nil {
  81342. res.Body.Close()
  81343. }
  81344. return nil, &googleapi.Error{
  81345. Code: res.StatusCode,
  81346. Header: res.Header,
  81347. }
  81348. }
  81349. if err != nil {
  81350. return nil, err
  81351. }
  81352. defer googleapi.CloseBody(res)
  81353. if err := googleapi.CheckResponse(res); err != nil {
  81354. return nil, err
  81355. }
  81356. ret := &Operation{
  81357. ServerResponse: googleapi.ServerResponse{
  81358. Header: res.Header,
  81359. HTTPStatusCode: res.StatusCode,
  81360. },
  81361. }
  81362. target := &ret
  81363. if err := gensupport.DecodeResponse(target, res); err != nil {
  81364. return nil, err
  81365. }
  81366. return ret, nil
  81367. // {
  81368. // "description": "Deletes the specified SslCertificate resource.",
  81369. // "httpMethod": "DELETE",
  81370. // "id": "compute.sslCertificates.delete",
  81371. // "parameterOrder": [
  81372. // "project",
  81373. // "sslCertificate"
  81374. // ],
  81375. // "parameters": {
  81376. // "project": {
  81377. // "description": "Project ID for this request.",
  81378. // "location": "path",
  81379. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81380. // "required": true,
  81381. // "type": "string"
  81382. // },
  81383. // "requestId": {
  81384. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81385. // "location": "query",
  81386. // "type": "string"
  81387. // },
  81388. // "sslCertificate": {
  81389. // "description": "Name of the SslCertificate resource to delete.",
  81390. // "location": "path",
  81391. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81392. // "required": true,
  81393. // "type": "string"
  81394. // }
  81395. // },
  81396. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  81397. // "response": {
  81398. // "$ref": "Operation"
  81399. // },
  81400. // "scopes": [
  81401. // "https://www.googleapis.com/auth/cloud-platform",
  81402. // "https://www.googleapis.com/auth/compute"
  81403. // ]
  81404. // }
  81405. }
  81406. // method id "compute.sslCertificates.get":
  81407. type SslCertificatesGetCall struct {
  81408. s *Service
  81409. project string
  81410. sslCertificate string
  81411. urlParams_ gensupport.URLParams
  81412. ifNoneMatch_ string
  81413. ctx_ context.Context
  81414. header_ http.Header
  81415. }
  81416. // Get: Returns the specified SslCertificate resource. Gets a list of
  81417. // available SSL certificates by making a list() request.
  81418. func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall {
  81419. c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81420. c.project = project
  81421. c.sslCertificate = sslCertificate
  81422. return c
  81423. }
  81424. // Fields allows partial responses to be retrieved. See
  81425. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81426. // for more information.
  81427. func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall {
  81428. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81429. return c
  81430. }
  81431. // IfNoneMatch sets the optional parameter which makes the operation
  81432. // fail if the object's ETag matches the given value. This is useful for
  81433. // getting updates only after the object has changed since the last
  81434. // request. Use googleapi.IsNotModified to check whether the response
  81435. // error from Do is the result of In-None-Match.
  81436. func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall {
  81437. c.ifNoneMatch_ = entityTag
  81438. return c
  81439. }
  81440. // Context sets the context to be used in this call's Do method. Any
  81441. // pending HTTP request will be aborted if the provided context is
  81442. // canceled.
  81443. func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall {
  81444. c.ctx_ = ctx
  81445. return c
  81446. }
  81447. // Header returns an http.Header that can be modified by the caller to
  81448. // add HTTP headers to the request.
  81449. func (c *SslCertificatesGetCall) Header() http.Header {
  81450. if c.header_ == nil {
  81451. c.header_ = make(http.Header)
  81452. }
  81453. return c.header_
  81454. }
  81455. func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  81456. reqHeaders := make(http.Header)
  81457. for k, v := range c.header_ {
  81458. reqHeaders[k] = v
  81459. }
  81460. reqHeaders.Set("User-Agent", c.s.userAgent())
  81461. if c.ifNoneMatch_ != "" {
  81462. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81463. }
  81464. var body io.Reader = nil
  81465. c.urlParams_.Set("alt", alt)
  81466. c.urlParams_.Set("prettyPrint", "false")
  81467. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  81468. urls += "?" + c.urlParams_.Encode()
  81469. req, err := http.NewRequest("GET", urls, body)
  81470. if err != nil {
  81471. return nil, err
  81472. }
  81473. req.Header = reqHeaders
  81474. googleapi.Expand(req.URL, map[string]string{
  81475. "project": c.project,
  81476. "sslCertificate": c.sslCertificate,
  81477. })
  81478. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81479. }
  81480. // Do executes the "compute.sslCertificates.get" call.
  81481. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  81482. // status code is an error. Response headers are in either
  81483. // *SslCertificate.ServerResponse.Header or (if a response was returned
  81484. // at all) in error.(*googleapi.Error).Header. Use
  81485. // googleapi.IsNotModified to check whether the returned error was
  81486. // because http.StatusNotModified was returned.
  81487. func (c *SslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  81488. gensupport.SetOptions(c.urlParams_, opts...)
  81489. res, err := c.doRequest("json")
  81490. if res != nil && res.StatusCode == http.StatusNotModified {
  81491. if res.Body != nil {
  81492. res.Body.Close()
  81493. }
  81494. return nil, &googleapi.Error{
  81495. Code: res.StatusCode,
  81496. Header: res.Header,
  81497. }
  81498. }
  81499. if err != nil {
  81500. return nil, err
  81501. }
  81502. defer googleapi.CloseBody(res)
  81503. if err := googleapi.CheckResponse(res); err != nil {
  81504. return nil, err
  81505. }
  81506. ret := &SslCertificate{
  81507. ServerResponse: googleapi.ServerResponse{
  81508. Header: res.Header,
  81509. HTTPStatusCode: res.StatusCode,
  81510. },
  81511. }
  81512. target := &ret
  81513. if err := gensupport.DecodeResponse(target, res); err != nil {
  81514. return nil, err
  81515. }
  81516. return ret, nil
  81517. // {
  81518. // "description": "Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request.",
  81519. // "httpMethod": "GET",
  81520. // "id": "compute.sslCertificates.get",
  81521. // "parameterOrder": [
  81522. // "project",
  81523. // "sslCertificate"
  81524. // ],
  81525. // "parameters": {
  81526. // "project": {
  81527. // "description": "Project ID for this request.",
  81528. // "location": "path",
  81529. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81530. // "required": true,
  81531. // "type": "string"
  81532. // },
  81533. // "sslCertificate": {
  81534. // "description": "Name of the SslCertificate resource to return.",
  81535. // "location": "path",
  81536. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81537. // "required": true,
  81538. // "type": "string"
  81539. // }
  81540. // },
  81541. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  81542. // "response": {
  81543. // "$ref": "SslCertificate"
  81544. // },
  81545. // "scopes": [
  81546. // "https://www.googleapis.com/auth/cloud-platform",
  81547. // "https://www.googleapis.com/auth/compute",
  81548. // "https://www.googleapis.com/auth/compute.readonly"
  81549. // ]
  81550. // }
  81551. }
  81552. // method id "compute.sslCertificates.insert":
  81553. type SslCertificatesInsertCall struct {
  81554. s *Service
  81555. project string
  81556. sslcertificate *SslCertificate
  81557. urlParams_ gensupport.URLParams
  81558. ctx_ context.Context
  81559. header_ http.Header
  81560. }
  81561. // Insert: Creates a SslCertificate resource in the specified project
  81562. // using the data included in the request.
  81563. func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall {
  81564. c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81565. c.project = project
  81566. c.sslcertificate = sslcertificate
  81567. return c
  81568. }
  81569. // RequestId sets the optional parameter "requestId": An optional
  81570. // request ID to identify requests. Specify a unique request ID so that
  81571. // if you must retry your request, the server will know to ignore the
  81572. // request if it has already been completed.
  81573. //
  81574. // For example, consider a situation where you make an initial request
  81575. // and the request times out. If you make the request again with the
  81576. // same request ID, the server can check if original operation with the
  81577. // same request ID was received, and if so, will ignore the second
  81578. // request. This prevents clients from accidentally creating duplicate
  81579. // commitments.
  81580. //
  81581. // The request ID must be a valid UUID with the exception that zero UUID
  81582. // is not supported (00000000-0000-0000-0000-000000000000).
  81583. func (c *SslCertificatesInsertCall) RequestId(requestId string) *SslCertificatesInsertCall {
  81584. c.urlParams_.Set("requestId", requestId)
  81585. return c
  81586. }
  81587. // Fields allows partial responses to be retrieved. See
  81588. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81589. // for more information.
  81590. func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall {
  81591. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81592. return c
  81593. }
  81594. // Context sets the context to be used in this call's Do method. Any
  81595. // pending HTTP request will be aborted if the provided context is
  81596. // canceled.
  81597. func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall {
  81598. c.ctx_ = ctx
  81599. return c
  81600. }
  81601. // Header returns an http.Header that can be modified by the caller to
  81602. // add HTTP headers to the request.
  81603. func (c *SslCertificatesInsertCall) Header() http.Header {
  81604. if c.header_ == nil {
  81605. c.header_ = make(http.Header)
  81606. }
  81607. return c.header_
  81608. }
  81609. func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  81610. reqHeaders := make(http.Header)
  81611. for k, v := range c.header_ {
  81612. reqHeaders[k] = v
  81613. }
  81614. reqHeaders.Set("User-Agent", c.s.userAgent())
  81615. var body io.Reader = nil
  81616. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  81617. if err != nil {
  81618. return nil, err
  81619. }
  81620. reqHeaders.Set("Content-Type", "application/json")
  81621. c.urlParams_.Set("alt", alt)
  81622. c.urlParams_.Set("prettyPrint", "false")
  81623. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  81624. urls += "?" + c.urlParams_.Encode()
  81625. req, err := http.NewRequest("POST", urls, body)
  81626. if err != nil {
  81627. return nil, err
  81628. }
  81629. req.Header = reqHeaders
  81630. googleapi.Expand(req.URL, map[string]string{
  81631. "project": c.project,
  81632. })
  81633. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81634. }
  81635. // Do executes the "compute.sslCertificates.insert" call.
  81636. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81637. // status code is an error. Response headers are in either
  81638. // *Operation.ServerResponse.Header or (if a response was returned at
  81639. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81640. // to check whether the returned error was because
  81641. // http.StatusNotModified was returned.
  81642. func (c *SslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81643. gensupport.SetOptions(c.urlParams_, opts...)
  81644. res, err := c.doRequest("json")
  81645. if res != nil && res.StatusCode == http.StatusNotModified {
  81646. if res.Body != nil {
  81647. res.Body.Close()
  81648. }
  81649. return nil, &googleapi.Error{
  81650. Code: res.StatusCode,
  81651. Header: res.Header,
  81652. }
  81653. }
  81654. if err != nil {
  81655. return nil, err
  81656. }
  81657. defer googleapi.CloseBody(res)
  81658. if err := googleapi.CheckResponse(res); err != nil {
  81659. return nil, err
  81660. }
  81661. ret := &Operation{
  81662. ServerResponse: googleapi.ServerResponse{
  81663. Header: res.Header,
  81664. HTTPStatusCode: res.StatusCode,
  81665. },
  81666. }
  81667. target := &ret
  81668. if err := gensupport.DecodeResponse(target, res); err != nil {
  81669. return nil, err
  81670. }
  81671. return ret, nil
  81672. // {
  81673. // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.",
  81674. // "httpMethod": "POST",
  81675. // "id": "compute.sslCertificates.insert",
  81676. // "parameterOrder": [
  81677. // "project"
  81678. // ],
  81679. // "parameters": {
  81680. // "project": {
  81681. // "description": "Project ID for this request.",
  81682. // "location": "path",
  81683. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81684. // "required": true,
  81685. // "type": "string"
  81686. // },
  81687. // "requestId": {
  81688. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81689. // "location": "query",
  81690. // "type": "string"
  81691. // }
  81692. // },
  81693. // "path": "{project}/global/sslCertificates",
  81694. // "request": {
  81695. // "$ref": "SslCertificate"
  81696. // },
  81697. // "response": {
  81698. // "$ref": "Operation"
  81699. // },
  81700. // "scopes": [
  81701. // "https://www.googleapis.com/auth/cloud-platform",
  81702. // "https://www.googleapis.com/auth/compute"
  81703. // ]
  81704. // }
  81705. }
  81706. // method id "compute.sslCertificates.list":
  81707. type SslCertificatesListCall struct {
  81708. s *Service
  81709. project string
  81710. urlParams_ gensupport.URLParams
  81711. ifNoneMatch_ string
  81712. ctx_ context.Context
  81713. header_ http.Header
  81714. }
  81715. // List: Retrieves the list of SslCertificate resources available to the
  81716. // specified project.
  81717. func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {
  81718. c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81719. c.project = project
  81720. return c
  81721. }
  81722. // Filter sets the optional parameter "filter": A filter expression that
  81723. // filters resources listed in the response. The expression must specify
  81724. // the field name, a comparison operator, and the value that you want to
  81725. // use for filtering. The value must be a string, a number, or a
  81726. // boolean. The comparison operator must be either =, !=, >, or <.
  81727. //
  81728. // For example, if you are filtering Compute Engine instances, you can
  81729. // exclude instances named example-instance by specifying name !=
  81730. // example-instance.
  81731. //
  81732. // You can also filter nested fields. For example, you could specify
  81733. // scheduling.automaticRestart = false to include instances only if they
  81734. // are not scheduled for automatic restarts. You can use filtering on
  81735. // nested fields to filter based on resource labels.
  81736. //
  81737. // To filter on multiple expressions, provide each separate expression
  81738. // within parentheses. For example, (scheduling.automaticRestart = true)
  81739. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  81740. // AND expression. However, you can include AND and OR expressions
  81741. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  81742. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  81743. // true).
  81744. func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall {
  81745. c.urlParams_.Set("filter", filter)
  81746. return c
  81747. }
  81748. // MaxResults sets the optional parameter "maxResults": The maximum
  81749. // number of results per page that should be returned. If the number of
  81750. // available results is larger than maxResults, Compute Engine returns a
  81751. // nextPageToken that can be used to get the next page of results in
  81752. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  81753. // (Default: 500)
  81754. func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall {
  81755. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  81756. return c
  81757. }
  81758. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  81759. // a certain order. By default, results are returned in alphanumerical
  81760. // order based on the resource name.
  81761. //
  81762. // You can also sort results in descending order based on the creation
  81763. // timestamp using orderBy="creationTimestamp desc". This sorts results
  81764. // based on the creationTimestamp field in reverse chronological order
  81765. // (newest result first). Use this to sort resources like operations so
  81766. // that the newest operation is returned first.
  81767. //
  81768. // Currently, only sorting by name or creationTimestamp desc is
  81769. // supported.
  81770. func (c *SslCertificatesListCall) OrderBy(orderBy string) *SslCertificatesListCall {
  81771. c.urlParams_.Set("orderBy", orderBy)
  81772. return c
  81773. }
  81774. // PageToken sets the optional parameter "pageToken": Specifies a page
  81775. // token to use. Set pageToken to the nextPageToken returned by a
  81776. // previous list request to get the next page of results.
  81777. func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall {
  81778. c.urlParams_.Set("pageToken", pageToken)
  81779. return c
  81780. }
  81781. // Fields allows partial responses to be retrieved. See
  81782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81783. // for more information.
  81784. func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall {
  81785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81786. return c
  81787. }
  81788. // IfNoneMatch sets the optional parameter which makes the operation
  81789. // fail if the object's ETag matches the given value. This is useful for
  81790. // getting updates only after the object has changed since the last
  81791. // request. Use googleapi.IsNotModified to check whether the response
  81792. // error from Do is the result of In-None-Match.
  81793. func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall {
  81794. c.ifNoneMatch_ = entityTag
  81795. return c
  81796. }
  81797. // Context sets the context to be used in this call's Do method. Any
  81798. // pending HTTP request will be aborted if the provided context is
  81799. // canceled.
  81800. func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall {
  81801. c.ctx_ = ctx
  81802. return c
  81803. }
  81804. // Header returns an http.Header that can be modified by the caller to
  81805. // add HTTP headers to the request.
  81806. func (c *SslCertificatesListCall) Header() http.Header {
  81807. if c.header_ == nil {
  81808. c.header_ = make(http.Header)
  81809. }
  81810. return c.header_
  81811. }
  81812. func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  81813. reqHeaders := make(http.Header)
  81814. for k, v := range c.header_ {
  81815. reqHeaders[k] = v
  81816. }
  81817. reqHeaders.Set("User-Agent", c.s.userAgent())
  81818. if c.ifNoneMatch_ != "" {
  81819. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81820. }
  81821. var body io.Reader = nil
  81822. c.urlParams_.Set("alt", alt)
  81823. c.urlParams_.Set("prettyPrint", "false")
  81824. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  81825. urls += "?" + c.urlParams_.Encode()
  81826. req, err := http.NewRequest("GET", urls, body)
  81827. if err != nil {
  81828. return nil, err
  81829. }
  81830. req.Header = reqHeaders
  81831. googleapi.Expand(req.URL, map[string]string{
  81832. "project": c.project,
  81833. })
  81834. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81835. }
  81836. // Do executes the "compute.sslCertificates.list" call.
  81837. // Exactly one of *SslCertificateList or error will be non-nil. Any
  81838. // non-2xx status code is an error. Response headers are in either
  81839. // *SslCertificateList.ServerResponse.Header or (if a response was
  81840. // returned at all) in error.(*googleapi.Error).Header. Use
  81841. // googleapi.IsNotModified to check whether the returned error was
  81842. // because http.StatusNotModified was returned.
  81843. func (c *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  81844. gensupport.SetOptions(c.urlParams_, opts...)
  81845. res, err := c.doRequest("json")
  81846. if res != nil && res.StatusCode == http.StatusNotModified {
  81847. if res.Body != nil {
  81848. res.Body.Close()
  81849. }
  81850. return nil, &googleapi.Error{
  81851. Code: res.StatusCode,
  81852. Header: res.Header,
  81853. }
  81854. }
  81855. if err != nil {
  81856. return nil, err
  81857. }
  81858. defer googleapi.CloseBody(res)
  81859. if err := googleapi.CheckResponse(res); err != nil {
  81860. return nil, err
  81861. }
  81862. ret := &SslCertificateList{
  81863. ServerResponse: googleapi.ServerResponse{
  81864. Header: res.Header,
  81865. HTTPStatusCode: res.StatusCode,
  81866. },
  81867. }
  81868. target := &ret
  81869. if err := gensupport.DecodeResponse(target, res); err != nil {
  81870. return nil, err
  81871. }
  81872. return ret, nil
  81873. // {
  81874. // "description": "Retrieves the list of SslCertificate resources available to the specified project.",
  81875. // "httpMethod": "GET",
  81876. // "id": "compute.sslCertificates.list",
  81877. // "parameterOrder": [
  81878. // "project"
  81879. // ],
  81880. // "parameters": {
  81881. // "filter": {
  81882. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  81883. // "location": "query",
  81884. // "type": "string"
  81885. // },
  81886. // "maxResults": {
  81887. // "default": "500",
  81888. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  81889. // "format": "uint32",
  81890. // "location": "query",
  81891. // "minimum": "0",
  81892. // "type": "integer"
  81893. // },
  81894. // "orderBy": {
  81895. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  81896. // "location": "query",
  81897. // "type": "string"
  81898. // },
  81899. // "pageToken": {
  81900. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  81901. // "location": "query",
  81902. // "type": "string"
  81903. // },
  81904. // "project": {
  81905. // "description": "Project ID for this request.",
  81906. // "location": "path",
  81907. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81908. // "required": true,
  81909. // "type": "string"
  81910. // }
  81911. // },
  81912. // "path": "{project}/global/sslCertificates",
  81913. // "response": {
  81914. // "$ref": "SslCertificateList"
  81915. // },
  81916. // "scopes": [
  81917. // "https://www.googleapis.com/auth/cloud-platform",
  81918. // "https://www.googleapis.com/auth/compute",
  81919. // "https://www.googleapis.com/auth/compute.readonly"
  81920. // ]
  81921. // }
  81922. }
  81923. // Pages invokes f for each page of results.
  81924. // A non-nil error returned from f will halt the iteration.
  81925. // The provided context supersedes any context provided to the Context method.
  81926. func (c *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  81927. c.ctx_ = ctx
  81928. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  81929. for {
  81930. x, err := c.Do()
  81931. if err != nil {
  81932. return err
  81933. }
  81934. if err := f(x); err != nil {
  81935. return err
  81936. }
  81937. if x.NextPageToken == "" {
  81938. return nil
  81939. }
  81940. c.PageToken(x.NextPageToken)
  81941. }
  81942. }
  81943. // method id "compute.sslPolicies.delete":
  81944. type SslPoliciesDeleteCall struct {
  81945. s *Service
  81946. project string
  81947. sslPolicy string
  81948. urlParams_ gensupport.URLParams
  81949. ctx_ context.Context
  81950. header_ http.Header
  81951. }
  81952. // Delete: Deletes the specified SSL policy. The SSL policy resource can
  81953. // be deleted only if it is not in use by any TargetHttpsProxy or
  81954. // TargetSslProxy resources.
  81955. func (r *SslPoliciesService) Delete(project string, sslPolicy string) *SslPoliciesDeleteCall {
  81956. c := &SslPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81957. c.project = project
  81958. c.sslPolicy = sslPolicy
  81959. return c
  81960. }
  81961. // RequestId sets the optional parameter "requestId": An optional
  81962. // request ID to identify requests. Specify a unique request ID so that
  81963. // if you must retry your request, the server will know to ignore the
  81964. // request if it has already been completed.
  81965. //
  81966. // For example, consider a situation where you make an initial request
  81967. // and the request times out. If you make the request again with the
  81968. // same request ID, the server can check if original operation with the
  81969. // same request ID was received, and if so, will ignore the second
  81970. // request. This prevents clients from accidentally creating duplicate
  81971. // commitments.
  81972. //
  81973. // The request ID must be a valid UUID with the exception that zero UUID
  81974. // is not supported (00000000-0000-0000-0000-000000000000).
  81975. func (c *SslPoliciesDeleteCall) RequestId(requestId string) *SslPoliciesDeleteCall {
  81976. c.urlParams_.Set("requestId", requestId)
  81977. return c
  81978. }
  81979. // Fields allows partial responses to be retrieved. See
  81980. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81981. // for more information.
  81982. func (c *SslPoliciesDeleteCall) Fields(s ...googleapi.Field) *SslPoliciesDeleteCall {
  81983. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81984. return c
  81985. }
  81986. // Context sets the context to be used in this call's Do method. Any
  81987. // pending HTTP request will be aborted if the provided context is
  81988. // canceled.
  81989. func (c *SslPoliciesDeleteCall) Context(ctx context.Context) *SslPoliciesDeleteCall {
  81990. c.ctx_ = ctx
  81991. return c
  81992. }
  81993. // Header returns an http.Header that can be modified by the caller to
  81994. // add HTTP headers to the request.
  81995. func (c *SslPoliciesDeleteCall) Header() http.Header {
  81996. if c.header_ == nil {
  81997. c.header_ = make(http.Header)
  81998. }
  81999. return c.header_
  82000. }
  82001. func (c *SslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  82002. reqHeaders := make(http.Header)
  82003. for k, v := range c.header_ {
  82004. reqHeaders[k] = v
  82005. }
  82006. reqHeaders.Set("User-Agent", c.s.userAgent())
  82007. var body io.Reader = nil
  82008. c.urlParams_.Set("alt", alt)
  82009. c.urlParams_.Set("prettyPrint", "false")
  82010. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  82011. urls += "?" + c.urlParams_.Encode()
  82012. req, err := http.NewRequest("DELETE", urls, body)
  82013. if err != nil {
  82014. return nil, err
  82015. }
  82016. req.Header = reqHeaders
  82017. googleapi.Expand(req.URL, map[string]string{
  82018. "project": c.project,
  82019. "sslPolicy": c.sslPolicy,
  82020. })
  82021. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82022. }
  82023. // Do executes the "compute.sslPolicies.delete" call.
  82024. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82025. // status code is an error. Response headers are in either
  82026. // *Operation.ServerResponse.Header or (if a response was returned at
  82027. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82028. // to check whether the returned error was because
  82029. // http.StatusNotModified was returned.
  82030. func (c *SslPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82031. gensupport.SetOptions(c.urlParams_, opts...)
  82032. res, err := c.doRequest("json")
  82033. if res != nil && res.StatusCode == http.StatusNotModified {
  82034. if res.Body != nil {
  82035. res.Body.Close()
  82036. }
  82037. return nil, &googleapi.Error{
  82038. Code: res.StatusCode,
  82039. Header: res.Header,
  82040. }
  82041. }
  82042. if err != nil {
  82043. return nil, err
  82044. }
  82045. defer googleapi.CloseBody(res)
  82046. if err := googleapi.CheckResponse(res); err != nil {
  82047. return nil, err
  82048. }
  82049. ret := &Operation{
  82050. ServerResponse: googleapi.ServerResponse{
  82051. Header: res.Header,
  82052. HTTPStatusCode: res.StatusCode,
  82053. },
  82054. }
  82055. target := &ret
  82056. if err := gensupport.DecodeResponse(target, res); err != nil {
  82057. return nil, err
  82058. }
  82059. return ret, nil
  82060. // {
  82061. // "description": "Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources.",
  82062. // "httpMethod": "DELETE",
  82063. // "id": "compute.sslPolicies.delete",
  82064. // "parameterOrder": [
  82065. // "project",
  82066. // "sslPolicy"
  82067. // ],
  82068. // "parameters": {
  82069. // "project": {
  82070. // "description": "Project ID for this request.",
  82071. // "location": "path",
  82072. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82073. // "required": true,
  82074. // "type": "string"
  82075. // },
  82076. // "requestId": {
  82077. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82078. // "location": "query",
  82079. // "type": "string"
  82080. // },
  82081. // "sslPolicy": {
  82082. // "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.",
  82083. // "location": "path",
  82084. // "required": true,
  82085. // "type": "string"
  82086. // }
  82087. // },
  82088. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  82089. // "response": {
  82090. // "$ref": "Operation"
  82091. // },
  82092. // "scopes": [
  82093. // "https://www.googleapis.com/auth/cloud-platform",
  82094. // "https://www.googleapis.com/auth/compute"
  82095. // ]
  82096. // }
  82097. }
  82098. // method id "compute.sslPolicies.get":
  82099. type SslPoliciesGetCall struct {
  82100. s *Service
  82101. project string
  82102. sslPolicy string
  82103. urlParams_ gensupport.URLParams
  82104. ifNoneMatch_ string
  82105. ctx_ context.Context
  82106. header_ http.Header
  82107. }
  82108. // Get: Lists all of the ordered rules present in a single specified
  82109. // policy.
  82110. func (r *SslPoliciesService) Get(project string, sslPolicy string) *SslPoliciesGetCall {
  82111. c := &SslPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82112. c.project = project
  82113. c.sslPolicy = sslPolicy
  82114. return c
  82115. }
  82116. // Fields allows partial responses to be retrieved. See
  82117. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82118. // for more information.
  82119. func (c *SslPoliciesGetCall) Fields(s ...googleapi.Field) *SslPoliciesGetCall {
  82120. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82121. return c
  82122. }
  82123. // IfNoneMatch sets the optional parameter which makes the operation
  82124. // fail if the object's ETag matches the given value. This is useful for
  82125. // getting updates only after the object has changed since the last
  82126. // request. Use googleapi.IsNotModified to check whether the response
  82127. // error from Do is the result of In-None-Match.
  82128. func (c *SslPoliciesGetCall) IfNoneMatch(entityTag string) *SslPoliciesGetCall {
  82129. c.ifNoneMatch_ = entityTag
  82130. return c
  82131. }
  82132. // Context sets the context to be used in this call's Do method. Any
  82133. // pending HTTP request will be aborted if the provided context is
  82134. // canceled.
  82135. func (c *SslPoliciesGetCall) Context(ctx context.Context) *SslPoliciesGetCall {
  82136. c.ctx_ = ctx
  82137. return c
  82138. }
  82139. // Header returns an http.Header that can be modified by the caller to
  82140. // add HTTP headers to the request.
  82141. func (c *SslPoliciesGetCall) Header() http.Header {
  82142. if c.header_ == nil {
  82143. c.header_ = make(http.Header)
  82144. }
  82145. return c.header_
  82146. }
  82147. func (c *SslPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  82148. reqHeaders := make(http.Header)
  82149. for k, v := range c.header_ {
  82150. reqHeaders[k] = v
  82151. }
  82152. reqHeaders.Set("User-Agent", c.s.userAgent())
  82153. if c.ifNoneMatch_ != "" {
  82154. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82155. }
  82156. var body io.Reader = nil
  82157. c.urlParams_.Set("alt", alt)
  82158. c.urlParams_.Set("prettyPrint", "false")
  82159. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  82160. urls += "?" + c.urlParams_.Encode()
  82161. req, err := http.NewRequest("GET", urls, body)
  82162. if err != nil {
  82163. return nil, err
  82164. }
  82165. req.Header = reqHeaders
  82166. googleapi.Expand(req.URL, map[string]string{
  82167. "project": c.project,
  82168. "sslPolicy": c.sslPolicy,
  82169. })
  82170. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82171. }
  82172. // Do executes the "compute.sslPolicies.get" call.
  82173. // Exactly one of *SslPolicy or error will be non-nil. Any non-2xx
  82174. // status code is an error. Response headers are in either
  82175. // *SslPolicy.ServerResponse.Header or (if a response was returned at
  82176. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82177. // to check whether the returned error was because
  82178. // http.StatusNotModified was returned.
  82179. func (c *SslPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SslPolicy, error) {
  82180. gensupport.SetOptions(c.urlParams_, opts...)
  82181. res, err := c.doRequest("json")
  82182. if res != nil && res.StatusCode == http.StatusNotModified {
  82183. if res.Body != nil {
  82184. res.Body.Close()
  82185. }
  82186. return nil, &googleapi.Error{
  82187. Code: res.StatusCode,
  82188. Header: res.Header,
  82189. }
  82190. }
  82191. if err != nil {
  82192. return nil, err
  82193. }
  82194. defer googleapi.CloseBody(res)
  82195. if err := googleapi.CheckResponse(res); err != nil {
  82196. return nil, err
  82197. }
  82198. ret := &SslPolicy{
  82199. ServerResponse: googleapi.ServerResponse{
  82200. Header: res.Header,
  82201. HTTPStatusCode: res.StatusCode,
  82202. },
  82203. }
  82204. target := &ret
  82205. if err := gensupport.DecodeResponse(target, res); err != nil {
  82206. return nil, err
  82207. }
  82208. return ret, nil
  82209. // {
  82210. // "description": "Lists all of the ordered rules present in a single specified policy.",
  82211. // "httpMethod": "GET",
  82212. // "id": "compute.sslPolicies.get",
  82213. // "parameterOrder": [
  82214. // "project",
  82215. // "sslPolicy"
  82216. // ],
  82217. // "parameters": {
  82218. // "project": {
  82219. // "description": "Project ID for this request.",
  82220. // "location": "path",
  82221. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82222. // "required": true,
  82223. // "type": "string"
  82224. // },
  82225. // "sslPolicy": {
  82226. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  82227. // "location": "path",
  82228. // "required": true,
  82229. // "type": "string"
  82230. // }
  82231. // },
  82232. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  82233. // "response": {
  82234. // "$ref": "SslPolicy"
  82235. // },
  82236. // "scopes": [
  82237. // "https://www.googleapis.com/auth/cloud-platform",
  82238. // "https://www.googleapis.com/auth/compute",
  82239. // "https://www.googleapis.com/auth/compute.readonly"
  82240. // ]
  82241. // }
  82242. }
  82243. // method id "compute.sslPolicies.insert":
  82244. type SslPoliciesInsertCall struct {
  82245. s *Service
  82246. project string
  82247. sslpolicy *SslPolicy
  82248. urlParams_ gensupport.URLParams
  82249. ctx_ context.Context
  82250. header_ http.Header
  82251. }
  82252. // Insert: Returns the specified SSL policy resource. Gets a list of
  82253. // available SSL policies by making a list() request.
  82254. func (r *SslPoliciesService) Insert(project string, sslpolicy *SslPolicy) *SslPoliciesInsertCall {
  82255. c := &SslPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82256. c.project = project
  82257. c.sslpolicy = sslpolicy
  82258. return c
  82259. }
  82260. // RequestId sets the optional parameter "requestId": An optional
  82261. // request ID to identify requests. Specify a unique request ID so that
  82262. // if you must retry your request, the server will know to ignore the
  82263. // request if it has already been completed.
  82264. //
  82265. // For example, consider a situation where you make an initial request
  82266. // and the request times out. If you make the request again with the
  82267. // same request ID, the server can check if original operation with the
  82268. // same request ID was received, and if so, will ignore the second
  82269. // request. This prevents clients from accidentally creating duplicate
  82270. // commitments.
  82271. //
  82272. // The request ID must be a valid UUID with the exception that zero UUID
  82273. // is not supported (00000000-0000-0000-0000-000000000000).
  82274. func (c *SslPoliciesInsertCall) RequestId(requestId string) *SslPoliciesInsertCall {
  82275. c.urlParams_.Set("requestId", requestId)
  82276. return c
  82277. }
  82278. // Fields allows partial responses to be retrieved. See
  82279. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82280. // for more information.
  82281. func (c *SslPoliciesInsertCall) Fields(s ...googleapi.Field) *SslPoliciesInsertCall {
  82282. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82283. return c
  82284. }
  82285. // Context sets the context to be used in this call's Do method. Any
  82286. // pending HTTP request will be aborted if the provided context is
  82287. // canceled.
  82288. func (c *SslPoliciesInsertCall) Context(ctx context.Context) *SslPoliciesInsertCall {
  82289. c.ctx_ = ctx
  82290. return c
  82291. }
  82292. // Header returns an http.Header that can be modified by the caller to
  82293. // add HTTP headers to the request.
  82294. func (c *SslPoliciesInsertCall) Header() http.Header {
  82295. if c.header_ == nil {
  82296. c.header_ = make(http.Header)
  82297. }
  82298. return c.header_
  82299. }
  82300. func (c *SslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  82301. reqHeaders := make(http.Header)
  82302. for k, v := range c.header_ {
  82303. reqHeaders[k] = v
  82304. }
  82305. reqHeaders.Set("User-Agent", c.s.userAgent())
  82306. var body io.Reader = nil
  82307. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  82308. if err != nil {
  82309. return nil, err
  82310. }
  82311. reqHeaders.Set("Content-Type", "application/json")
  82312. c.urlParams_.Set("alt", alt)
  82313. c.urlParams_.Set("prettyPrint", "false")
  82314. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  82315. urls += "?" + c.urlParams_.Encode()
  82316. req, err := http.NewRequest("POST", urls, body)
  82317. if err != nil {
  82318. return nil, err
  82319. }
  82320. req.Header = reqHeaders
  82321. googleapi.Expand(req.URL, map[string]string{
  82322. "project": c.project,
  82323. })
  82324. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82325. }
  82326. // Do executes the "compute.sslPolicies.insert" call.
  82327. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82328. // status code is an error. Response headers are in either
  82329. // *Operation.ServerResponse.Header or (if a response was returned at
  82330. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82331. // to check whether the returned error was because
  82332. // http.StatusNotModified was returned.
  82333. func (c *SslPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82334. gensupport.SetOptions(c.urlParams_, opts...)
  82335. res, err := c.doRequest("json")
  82336. if res != nil && res.StatusCode == http.StatusNotModified {
  82337. if res.Body != nil {
  82338. res.Body.Close()
  82339. }
  82340. return nil, &googleapi.Error{
  82341. Code: res.StatusCode,
  82342. Header: res.Header,
  82343. }
  82344. }
  82345. if err != nil {
  82346. return nil, err
  82347. }
  82348. defer googleapi.CloseBody(res)
  82349. if err := googleapi.CheckResponse(res); err != nil {
  82350. return nil, err
  82351. }
  82352. ret := &Operation{
  82353. ServerResponse: googleapi.ServerResponse{
  82354. Header: res.Header,
  82355. HTTPStatusCode: res.StatusCode,
  82356. },
  82357. }
  82358. target := &ret
  82359. if err := gensupport.DecodeResponse(target, res); err != nil {
  82360. return nil, err
  82361. }
  82362. return ret, nil
  82363. // {
  82364. // "description": "Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request.",
  82365. // "httpMethod": "POST",
  82366. // "id": "compute.sslPolicies.insert",
  82367. // "parameterOrder": [
  82368. // "project"
  82369. // ],
  82370. // "parameters": {
  82371. // "project": {
  82372. // "description": "Project ID for this request.",
  82373. // "location": "path",
  82374. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82375. // "required": true,
  82376. // "type": "string"
  82377. // },
  82378. // "requestId": {
  82379. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82380. // "location": "query",
  82381. // "type": "string"
  82382. // }
  82383. // },
  82384. // "path": "{project}/global/sslPolicies",
  82385. // "request": {
  82386. // "$ref": "SslPolicy"
  82387. // },
  82388. // "response": {
  82389. // "$ref": "Operation"
  82390. // },
  82391. // "scopes": [
  82392. // "https://www.googleapis.com/auth/cloud-platform",
  82393. // "https://www.googleapis.com/auth/compute"
  82394. // ]
  82395. // }
  82396. }
  82397. // method id "compute.sslPolicies.list":
  82398. type SslPoliciesListCall struct {
  82399. s *Service
  82400. project string
  82401. urlParams_ gensupport.URLParams
  82402. ifNoneMatch_ string
  82403. ctx_ context.Context
  82404. header_ http.Header
  82405. }
  82406. // List: Lists all the SSL policies that have been configured for the
  82407. // specified project.
  82408. func (r *SslPoliciesService) List(project string) *SslPoliciesListCall {
  82409. c := &SslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82410. c.project = project
  82411. return c
  82412. }
  82413. // Filter sets the optional parameter "filter": A filter expression that
  82414. // filters resources listed in the response. The expression must specify
  82415. // the field name, a comparison operator, and the value that you want to
  82416. // use for filtering. The value must be a string, a number, or a
  82417. // boolean. The comparison operator must be either =, !=, >, or <.
  82418. //
  82419. // For example, if you are filtering Compute Engine instances, you can
  82420. // exclude instances named example-instance by specifying name !=
  82421. // example-instance.
  82422. //
  82423. // You can also filter nested fields. For example, you could specify
  82424. // scheduling.automaticRestart = false to include instances only if they
  82425. // are not scheduled for automatic restarts. You can use filtering on
  82426. // nested fields to filter based on resource labels.
  82427. //
  82428. // To filter on multiple expressions, provide each separate expression
  82429. // within parentheses. For example, (scheduling.automaticRestart = true)
  82430. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  82431. // AND expression. However, you can include AND and OR expressions
  82432. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  82433. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  82434. // true).
  82435. func (c *SslPoliciesListCall) Filter(filter string) *SslPoliciesListCall {
  82436. c.urlParams_.Set("filter", filter)
  82437. return c
  82438. }
  82439. // MaxResults sets the optional parameter "maxResults": The maximum
  82440. // number of results per page that should be returned. If the number of
  82441. // available results is larger than maxResults, Compute Engine returns a
  82442. // nextPageToken that can be used to get the next page of results in
  82443. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  82444. // (Default: 500)
  82445. func (c *SslPoliciesListCall) MaxResults(maxResults int64) *SslPoliciesListCall {
  82446. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  82447. return c
  82448. }
  82449. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  82450. // a certain order. By default, results are returned in alphanumerical
  82451. // order based on the resource name.
  82452. //
  82453. // You can also sort results in descending order based on the creation
  82454. // timestamp using orderBy="creationTimestamp desc". This sorts results
  82455. // based on the creationTimestamp field in reverse chronological order
  82456. // (newest result first). Use this to sort resources like operations so
  82457. // that the newest operation is returned first.
  82458. //
  82459. // Currently, only sorting by name or creationTimestamp desc is
  82460. // supported.
  82461. func (c *SslPoliciesListCall) OrderBy(orderBy string) *SslPoliciesListCall {
  82462. c.urlParams_.Set("orderBy", orderBy)
  82463. return c
  82464. }
  82465. // PageToken sets the optional parameter "pageToken": Specifies a page
  82466. // token to use. Set pageToken to the nextPageToken returned by a
  82467. // previous list request to get the next page of results.
  82468. func (c *SslPoliciesListCall) PageToken(pageToken string) *SslPoliciesListCall {
  82469. c.urlParams_.Set("pageToken", pageToken)
  82470. return c
  82471. }
  82472. // Fields allows partial responses to be retrieved. See
  82473. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82474. // for more information.
  82475. func (c *SslPoliciesListCall) Fields(s ...googleapi.Field) *SslPoliciesListCall {
  82476. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82477. return c
  82478. }
  82479. // IfNoneMatch sets the optional parameter which makes the operation
  82480. // fail if the object's ETag matches the given value. This is useful for
  82481. // getting updates only after the object has changed since the last
  82482. // request. Use googleapi.IsNotModified to check whether the response
  82483. // error from Do is the result of In-None-Match.
  82484. func (c *SslPoliciesListCall) IfNoneMatch(entityTag string) *SslPoliciesListCall {
  82485. c.ifNoneMatch_ = entityTag
  82486. return c
  82487. }
  82488. // Context sets the context to be used in this call's Do method. Any
  82489. // pending HTTP request will be aborted if the provided context is
  82490. // canceled.
  82491. func (c *SslPoliciesListCall) Context(ctx context.Context) *SslPoliciesListCall {
  82492. c.ctx_ = ctx
  82493. return c
  82494. }
  82495. // Header returns an http.Header that can be modified by the caller to
  82496. // add HTTP headers to the request.
  82497. func (c *SslPoliciesListCall) Header() http.Header {
  82498. if c.header_ == nil {
  82499. c.header_ = make(http.Header)
  82500. }
  82501. return c.header_
  82502. }
  82503. func (c *SslPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  82504. reqHeaders := make(http.Header)
  82505. for k, v := range c.header_ {
  82506. reqHeaders[k] = v
  82507. }
  82508. reqHeaders.Set("User-Agent", c.s.userAgent())
  82509. if c.ifNoneMatch_ != "" {
  82510. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82511. }
  82512. var body io.Reader = nil
  82513. c.urlParams_.Set("alt", alt)
  82514. c.urlParams_.Set("prettyPrint", "false")
  82515. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  82516. urls += "?" + c.urlParams_.Encode()
  82517. req, err := http.NewRequest("GET", urls, body)
  82518. if err != nil {
  82519. return nil, err
  82520. }
  82521. req.Header = reqHeaders
  82522. googleapi.Expand(req.URL, map[string]string{
  82523. "project": c.project,
  82524. })
  82525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82526. }
  82527. // Do executes the "compute.sslPolicies.list" call.
  82528. // Exactly one of *SslPoliciesList or error will be non-nil. Any non-2xx
  82529. // status code is an error. Response headers are in either
  82530. // *SslPoliciesList.ServerResponse.Header or (if a response was returned
  82531. // at all) in error.(*googleapi.Error).Header. Use
  82532. // googleapi.IsNotModified to check whether the returned error was
  82533. // because http.StatusNotModified was returned.
  82534. func (c *SslPoliciesListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesList, error) {
  82535. gensupport.SetOptions(c.urlParams_, opts...)
  82536. res, err := c.doRequest("json")
  82537. if res != nil && res.StatusCode == http.StatusNotModified {
  82538. if res.Body != nil {
  82539. res.Body.Close()
  82540. }
  82541. return nil, &googleapi.Error{
  82542. Code: res.StatusCode,
  82543. Header: res.Header,
  82544. }
  82545. }
  82546. if err != nil {
  82547. return nil, err
  82548. }
  82549. defer googleapi.CloseBody(res)
  82550. if err := googleapi.CheckResponse(res); err != nil {
  82551. return nil, err
  82552. }
  82553. ret := &SslPoliciesList{
  82554. ServerResponse: googleapi.ServerResponse{
  82555. Header: res.Header,
  82556. HTTPStatusCode: res.StatusCode,
  82557. },
  82558. }
  82559. target := &ret
  82560. if err := gensupport.DecodeResponse(target, res); err != nil {
  82561. return nil, err
  82562. }
  82563. return ret, nil
  82564. // {
  82565. // "description": "Lists all the SSL policies that have been configured for the specified project.",
  82566. // "httpMethod": "GET",
  82567. // "id": "compute.sslPolicies.list",
  82568. // "parameterOrder": [
  82569. // "project"
  82570. // ],
  82571. // "parameters": {
  82572. // "filter": {
  82573. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  82574. // "location": "query",
  82575. // "type": "string"
  82576. // },
  82577. // "maxResults": {
  82578. // "default": "500",
  82579. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  82580. // "format": "uint32",
  82581. // "location": "query",
  82582. // "minimum": "0",
  82583. // "type": "integer"
  82584. // },
  82585. // "orderBy": {
  82586. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  82587. // "location": "query",
  82588. // "type": "string"
  82589. // },
  82590. // "pageToken": {
  82591. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  82592. // "location": "query",
  82593. // "type": "string"
  82594. // },
  82595. // "project": {
  82596. // "description": "Project ID for this request.",
  82597. // "location": "path",
  82598. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82599. // "required": true,
  82600. // "type": "string"
  82601. // }
  82602. // },
  82603. // "path": "{project}/global/sslPolicies",
  82604. // "response": {
  82605. // "$ref": "SslPoliciesList"
  82606. // },
  82607. // "scopes": [
  82608. // "https://www.googleapis.com/auth/cloud-platform",
  82609. // "https://www.googleapis.com/auth/compute",
  82610. // "https://www.googleapis.com/auth/compute.readonly"
  82611. // ]
  82612. // }
  82613. }
  82614. // Pages invokes f for each page of results.
  82615. // A non-nil error returned from f will halt the iteration.
  82616. // The provided context supersedes any context provided to the Context method.
  82617. func (c *SslPoliciesListCall) Pages(ctx context.Context, f func(*SslPoliciesList) error) error {
  82618. c.ctx_ = ctx
  82619. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  82620. for {
  82621. x, err := c.Do()
  82622. if err != nil {
  82623. return err
  82624. }
  82625. if err := f(x); err != nil {
  82626. return err
  82627. }
  82628. if x.NextPageToken == "" {
  82629. return nil
  82630. }
  82631. c.PageToken(x.NextPageToken)
  82632. }
  82633. }
  82634. // method id "compute.sslPolicies.listAvailableFeatures":
  82635. type SslPoliciesListAvailableFeaturesCall struct {
  82636. s *Service
  82637. project string
  82638. urlParams_ gensupport.URLParams
  82639. ifNoneMatch_ string
  82640. ctx_ context.Context
  82641. header_ http.Header
  82642. }
  82643. // ListAvailableFeatures: Lists all features that can be specified in
  82644. // the SSL policy when using custom profile.
  82645. func (r *SslPoliciesService) ListAvailableFeatures(project string) *SslPoliciesListAvailableFeaturesCall {
  82646. c := &SslPoliciesListAvailableFeaturesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82647. c.project = project
  82648. return c
  82649. }
  82650. // Filter sets the optional parameter "filter": A filter expression that
  82651. // filters resources listed in the response. The expression must specify
  82652. // the field name, a comparison operator, and the value that you want to
  82653. // use for filtering. The value must be a string, a number, or a
  82654. // boolean. The comparison operator must be either =, !=, >, or <.
  82655. //
  82656. // For example, if you are filtering Compute Engine instances, you can
  82657. // exclude instances named example-instance by specifying name !=
  82658. // example-instance.
  82659. //
  82660. // You can also filter nested fields. For example, you could specify
  82661. // scheduling.automaticRestart = false to include instances only if they
  82662. // are not scheduled for automatic restarts. You can use filtering on
  82663. // nested fields to filter based on resource labels.
  82664. //
  82665. // To filter on multiple expressions, provide each separate expression
  82666. // within parentheses. For example, (scheduling.automaticRestart = true)
  82667. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  82668. // AND expression. However, you can include AND and OR expressions
  82669. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  82670. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  82671. // true).
  82672. func (c *SslPoliciesListAvailableFeaturesCall) Filter(filter string) *SslPoliciesListAvailableFeaturesCall {
  82673. c.urlParams_.Set("filter", filter)
  82674. return c
  82675. }
  82676. // MaxResults sets the optional parameter "maxResults": The maximum
  82677. // number of results per page that should be returned. If the number of
  82678. // available results is larger than maxResults, Compute Engine returns a
  82679. // nextPageToken that can be used to get the next page of results in
  82680. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  82681. // (Default: 500)
  82682. func (c *SslPoliciesListAvailableFeaturesCall) MaxResults(maxResults int64) *SslPoliciesListAvailableFeaturesCall {
  82683. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  82684. return c
  82685. }
  82686. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  82687. // a certain order. By default, results are returned in alphanumerical
  82688. // order based on the resource name.
  82689. //
  82690. // You can also sort results in descending order based on the creation
  82691. // timestamp using orderBy="creationTimestamp desc". This sorts results
  82692. // based on the creationTimestamp field in reverse chronological order
  82693. // (newest result first). Use this to sort resources like operations so
  82694. // that the newest operation is returned first.
  82695. //
  82696. // Currently, only sorting by name or creationTimestamp desc is
  82697. // supported.
  82698. func (c *SslPoliciesListAvailableFeaturesCall) OrderBy(orderBy string) *SslPoliciesListAvailableFeaturesCall {
  82699. c.urlParams_.Set("orderBy", orderBy)
  82700. return c
  82701. }
  82702. // PageToken sets the optional parameter "pageToken": Specifies a page
  82703. // token to use. Set pageToken to the nextPageToken returned by a
  82704. // previous list request to get the next page of results.
  82705. func (c *SslPoliciesListAvailableFeaturesCall) PageToken(pageToken string) *SslPoliciesListAvailableFeaturesCall {
  82706. c.urlParams_.Set("pageToken", pageToken)
  82707. return c
  82708. }
  82709. // Fields allows partial responses to be retrieved. See
  82710. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82711. // for more information.
  82712. func (c *SslPoliciesListAvailableFeaturesCall) Fields(s ...googleapi.Field) *SslPoliciesListAvailableFeaturesCall {
  82713. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82714. return c
  82715. }
  82716. // IfNoneMatch sets the optional parameter which makes the operation
  82717. // fail if the object's ETag matches the given value. This is useful for
  82718. // getting updates only after the object has changed since the last
  82719. // request. Use googleapi.IsNotModified to check whether the response
  82720. // error from Do is the result of In-None-Match.
  82721. func (c *SslPoliciesListAvailableFeaturesCall) IfNoneMatch(entityTag string) *SslPoliciesListAvailableFeaturesCall {
  82722. c.ifNoneMatch_ = entityTag
  82723. return c
  82724. }
  82725. // Context sets the context to be used in this call's Do method. Any
  82726. // pending HTTP request will be aborted if the provided context is
  82727. // canceled.
  82728. func (c *SslPoliciesListAvailableFeaturesCall) Context(ctx context.Context) *SslPoliciesListAvailableFeaturesCall {
  82729. c.ctx_ = ctx
  82730. return c
  82731. }
  82732. // Header returns an http.Header that can be modified by the caller to
  82733. // add HTTP headers to the request.
  82734. func (c *SslPoliciesListAvailableFeaturesCall) Header() http.Header {
  82735. if c.header_ == nil {
  82736. c.header_ = make(http.Header)
  82737. }
  82738. return c.header_
  82739. }
  82740. func (c *SslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Response, error) {
  82741. reqHeaders := make(http.Header)
  82742. for k, v := range c.header_ {
  82743. reqHeaders[k] = v
  82744. }
  82745. reqHeaders.Set("User-Agent", c.s.userAgent())
  82746. if c.ifNoneMatch_ != "" {
  82747. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82748. }
  82749. var body io.Reader = nil
  82750. c.urlParams_.Set("alt", alt)
  82751. c.urlParams_.Set("prettyPrint", "false")
  82752. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/listAvailableFeatures")
  82753. urls += "?" + c.urlParams_.Encode()
  82754. req, err := http.NewRequest("GET", urls, body)
  82755. if err != nil {
  82756. return nil, err
  82757. }
  82758. req.Header = reqHeaders
  82759. googleapi.Expand(req.URL, map[string]string{
  82760. "project": c.project,
  82761. })
  82762. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82763. }
  82764. // Do executes the "compute.sslPolicies.listAvailableFeatures" call.
  82765. // Exactly one of *SslPoliciesListAvailableFeaturesResponse or error
  82766. // will be non-nil. Any non-2xx status code is an error. Response
  82767. // headers are in either
  82768. // *SslPoliciesListAvailableFeaturesResponse.ServerResponse.Header or
  82769. // (if a response was returned at all) in
  82770. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  82771. // whether the returned error was because http.StatusNotModified was
  82772. // returned.
  82773. func (c *SslPoliciesListAvailableFeaturesCall) Do(opts ...googleapi.CallOption) (*SslPoliciesListAvailableFeaturesResponse, error) {
  82774. gensupport.SetOptions(c.urlParams_, opts...)
  82775. res, err := c.doRequest("json")
  82776. if res != nil && res.StatusCode == http.StatusNotModified {
  82777. if res.Body != nil {
  82778. res.Body.Close()
  82779. }
  82780. return nil, &googleapi.Error{
  82781. Code: res.StatusCode,
  82782. Header: res.Header,
  82783. }
  82784. }
  82785. if err != nil {
  82786. return nil, err
  82787. }
  82788. defer googleapi.CloseBody(res)
  82789. if err := googleapi.CheckResponse(res); err != nil {
  82790. return nil, err
  82791. }
  82792. ret := &SslPoliciesListAvailableFeaturesResponse{
  82793. ServerResponse: googleapi.ServerResponse{
  82794. Header: res.Header,
  82795. HTTPStatusCode: res.StatusCode,
  82796. },
  82797. }
  82798. target := &ret
  82799. if err := gensupport.DecodeResponse(target, res); err != nil {
  82800. return nil, err
  82801. }
  82802. return ret, nil
  82803. // {
  82804. // "description": "Lists all features that can be specified in the SSL policy when using custom profile.",
  82805. // "httpMethod": "GET",
  82806. // "id": "compute.sslPolicies.listAvailableFeatures",
  82807. // "parameterOrder": [
  82808. // "project"
  82809. // ],
  82810. // "parameters": {
  82811. // "filter": {
  82812. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  82813. // "location": "query",
  82814. // "type": "string"
  82815. // },
  82816. // "maxResults": {
  82817. // "default": "500",
  82818. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  82819. // "format": "uint32",
  82820. // "location": "query",
  82821. // "minimum": "0",
  82822. // "type": "integer"
  82823. // },
  82824. // "orderBy": {
  82825. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  82826. // "location": "query",
  82827. // "type": "string"
  82828. // },
  82829. // "pageToken": {
  82830. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  82831. // "location": "query",
  82832. // "type": "string"
  82833. // },
  82834. // "project": {
  82835. // "description": "Project ID for this request.",
  82836. // "location": "path",
  82837. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82838. // "required": true,
  82839. // "type": "string"
  82840. // }
  82841. // },
  82842. // "path": "{project}/global/sslPolicies/listAvailableFeatures",
  82843. // "response": {
  82844. // "$ref": "SslPoliciesListAvailableFeaturesResponse"
  82845. // },
  82846. // "scopes": [
  82847. // "https://www.googleapis.com/auth/cloud-platform",
  82848. // "https://www.googleapis.com/auth/compute",
  82849. // "https://www.googleapis.com/auth/compute.readonly"
  82850. // ]
  82851. // }
  82852. }
  82853. // method id "compute.sslPolicies.patch":
  82854. type SslPoliciesPatchCall struct {
  82855. s *Service
  82856. project string
  82857. sslPolicy string
  82858. sslpolicy *SslPolicy
  82859. urlParams_ gensupport.URLParams
  82860. ctx_ context.Context
  82861. header_ http.Header
  82862. }
  82863. // Patch: Patches the specified SSL policy with the data included in the
  82864. // request.
  82865. func (r *SslPoliciesService) Patch(project string, sslPolicy string, sslpolicy *SslPolicy) *SslPoliciesPatchCall {
  82866. c := &SslPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82867. c.project = project
  82868. c.sslPolicy = sslPolicy
  82869. c.sslpolicy = sslpolicy
  82870. return c
  82871. }
  82872. // RequestId sets the optional parameter "requestId": An optional
  82873. // request ID to identify requests. Specify a unique request ID so that
  82874. // if you must retry your request, the server will know to ignore the
  82875. // request if it has already been completed.
  82876. //
  82877. // For example, consider a situation where you make an initial request
  82878. // and the request times out. If you make the request again with the
  82879. // same request ID, the server can check if original operation with the
  82880. // same request ID was received, and if so, will ignore the second
  82881. // request. This prevents clients from accidentally creating duplicate
  82882. // commitments.
  82883. //
  82884. // The request ID must be a valid UUID with the exception that zero UUID
  82885. // is not supported (00000000-0000-0000-0000-000000000000).
  82886. func (c *SslPoliciesPatchCall) RequestId(requestId string) *SslPoliciesPatchCall {
  82887. c.urlParams_.Set("requestId", requestId)
  82888. return c
  82889. }
  82890. // Fields allows partial responses to be retrieved. See
  82891. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82892. // for more information.
  82893. func (c *SslPoliciesPatchCall) Fields(s ...googleapi.Field) *SslPoliciesPatchCall {
  82894. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82895. return c
  82896. }
  82897. // Context sets the context to be used in this call's Do method. Any
  82898. // pending HTTP request will be aborted if the provided context is
  82899. // canceled.
  82900. func (c *SslPoliciesPatchCall) Context(ctx context.Context) *SslPoliciesPatchCall {
  82901. c.ctx_ = ctx
  82902. return c
  82903. }
  82904. // Header returns an http.Header that can be modified by the caller to
  82905. // add HTTP headers to the request.
  82906. func (c *SslPoliciesPatchCall) Header() http.Header {
  82907. if c.header_ == nil {
  82908. c.header_ = make(http.Header)
  82909. }
  82910. return c.header_
  82911. }
  82912. func (c *SslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  82913. reqHeaders := make(http.Header)
  82914. for k, v := range c.header_ {
  82915. reqHeaders[k] = v
  82916. }
  82917. reqHeaders.Set("User-Agent", c.s.userAgent())
  82918. var body io.Reader = nil
  82919. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  82920. if err != nil {
  82921. return nil, err
  82922. }
  82923. reqHeaders.Set("Content-Type", "application/json")
  82924. c.urlParams_.Set("alt", alt)
  82925. c.urlParams_.Set("prettyPrint", "false")
  82926. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  82927. urls += "?" + c.urlParams_.Encode()
  82928. req, err := http.NewRequest("PATCH", urls, body)
  82929. if err != nil {
  82930. return nil, err
  82931. }
  82932. req.Header = reqHeaders
  82933. googleapi.Expand(req.URL, map[string]string{
  82934. "project": c.project,
  82935. "sslPolicy": c.sslPolicy,
  82936. })
  82937. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82938. }
  82939. // Do executes the "compute.sslPolicies.patch" call.
  82940. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82941. // status code is an error. Response headers are in either
  82942. // *Operation.ServerResponse.Header or (if a response was returned at
  82943. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82944. // to check whether the returned error was because
  82945. // http.StatusNotModified was returned.
  82946. func (c *SslPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82947. gensupport.SetOptions(c.urlParams_, opts...)
  82948. res, err := c.doRequest("json")
  82949. if res != nil && res.StatusCode == http.StatusNotModified {
  82950. if res.Body != nil {
  82951. res.Body.Close()
  82952. }
  82953. return nil, &googleapi.Error{
  82954. Code: res.StatusCode,
  82955. Header: res.Header,
  82956. }
  82957. }
  82958. if err != nil {
  82959. return nil, err
  82960. }
  82961. defer googleapi.CloseBody(res)
  82962. if err := googleapi.CheckResponse(res); err != nil {
  82963. return nil, err
  82964. }
  82965. ret := &Operation{
  82966. ServerResponse: googleapi.ServerResponse{
  82967. Header: res.Header,
  82968. HTTPStatusCode: res.StatusCode,
  82969. },
  82970. }
  82971. target := &ret
  82972. if err := gensupport.DecodeResponse(target, res); err != nil {
  82973. return nil, err
  82974. }
  82975. return ret, nil
  82976. // {
  82977. // "description": "Patches the specified SSL policy with the data included in the request.",
  82978. // "httpMethod": "PATCH",
  82979. // "id": "compute.sslPolicies.patch",
  82980. // "parameterOrder": [
  82981. // "project",
  82982. // "sslPolicy"
  82983. // ],
  82984. // "parameters": {
  82985. // "project": {
  82986. // "description": "Project ID for this request.",
  82987. // "location": "path",
  82988. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82989. // "required": true,
  82990. // "type": "string"
  82991. // },
  82992. // "requestId": {
  82993. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82994. // "location": "query",
  82995. // "type": "string"
  82996. // },
  82997. // "sslPolicy": {
  82998. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  82999. // "location": "path",
  83000. // "required": true,
  83001. // "type": "string"
  83002. // }
  83003. // },
  83004. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  83005. // "request": {
  83006. // "$ref": "SslPolicy"
  83007. // },
  83008. // "response": {
  83009. // "$ref": "Operation"
  83010. // },
  83011. // "scopes": [
  83012. // "https://www.googleapis.com/auth/cloud-platform",
  83013. // "https://www.googleapis.com/auth/compute"
  83014. // ]
  83015. // }
  83016. }
  83017. // method id "compute.subnetworks.aggregatedList":
  83018. type SubnetworksAggregatedListCall struct {
  83019. s *Service
  83020. project string
  83021. urlParams_ gensupport.URLParams
  83022. ifNoneMatch_ string
  83023. ctx_ context.Context
  83024. header_ http.Header
  83025. }
  83026. // AggregatedList: Retrieves an aggregated list of subnetworks.
  83027. func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {
  83028. c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83029. c.project = project
  83030. return c
  83031. }
  83032. // Filter sets the optional parameter "filter": A filter expression that
  83033. // filters resources listed in the response. The expression must specify
  83034. // the field name, a comparison operator, and the value that you want to
  83035. // use for filtering. The value must be a string, a number, or a
  83036. // boolean. The comparison operator must be either =, !=, >, or <.
  83037. //
  83038. // For example, if you are filtering Compute Engine instances, you can
  83039. // exclude instances named example-instance by specifying name !=
  83040. // example-instance.
  83041. //
  83042. // You can also filter nested fields. For example, you could specify
  83043. // scheduling.automaticRestart = false to include instances only if they
  83044. // are not scheduled for automatic restarts. You can use filtering on
  83045. // nested fields to filter based on resource labels.
  83046. //
  83047. // To filter on multiple expressions, provide each separate expression
  83048. // within parentheses. For example, (scheduling.automaticRestart = true)
  83049. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  83050. // AND expression. However, you can include AND and OR expressions
  83051. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  83052. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  83053. // true).
  83054. func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall {
  83055. c.urlParams_.Set("filter", filter)
  83056. return c
  83057. }
  83058. // MaxResults sets the optional parameter "maxResults": The maximum
  83059. // number of results per page that should be returned. If the number of
  83060. // available results is larger than maxResults, Compute Engine returns a
  83061. // nextPageToken that can be used to get the next page of results in
  83062. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  83063. // (Default: 500)
  83064. func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall {
  83065. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  83066. return c
  83067. }
  83068. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  83069. // a certain order. By default, results are returned in alphanumerical
  83070. // order based on the resource name.
  83071. //
  83072. // You can also sort results in descending order based on the creation
  83073. // timestamp using orderBy="creationTimestamp desc". This sorts results
  83074. // based on the creationTimestamp field in reverse chronological order
  83075. // (newest result first). Use this to sort resources like operations so
  83076. // that the newest operation is returned first.
  83077. //
  83078. // Currently, only sorting by name or creationTimestamp desc is
  83079. // supported.
  83080. func (c *SubnetworksAggregatedListCall) OrderBy(orderBy string) *SubnetworksAggregatedListCall {
  83081. c.urlParams_.Set("orderBy", orderBy)
  83082. return c
  83083. }
  83084. // PageToken sets the optional parameter "pageToken": Specifies a page
  83085. // token to use. Set pageToken to the nextPageToken returned by a
  83086. // previous list request to get the next page of results.
  83087. func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall {
  83088. c.urlParams_.Set("pageToken", pageToken)
  83089. return c
  83090. }
  83091. // Fields allows partial responses to be retrieved. See
  83092. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83093. // for more information.
  83094. func (c *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall {
  83095. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83096. return c
  83097. }
  83098. // IfNoneMatch sets the optional parameter which makes the operation
  83099. // fail if the object's ETag matches the given value. This is useful for
  83100. // getting updates only after the object has changed since the last
  83101. // request. Use googleapi.IsNotModified to check whether the response
  83102. // error from Do is the result of In-None-Match.
  83103. func (c *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall {
  83104. c.ifNoneMatch_ = entityTag
  83105. return c
  83106. }
  83107. // Context sets the context to be used in this call's Do method. Any
  83108. // pending HTTP request will be aborted if the provided context is
  83109. // canceled.
  83110. func (c *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall {
  83111. c.ctx_ = ctx
  83112. return c
  83113. }
  83114. // Header returns an http.Header that can be modified by the caller to
  83115. // add HTTP headers to the request.
  83116. func (c *SubnetworksAggregatedListCall) Header() http.Header {
  83117. if c.header_ == nil {
  83118. c.header_ = make(http.Header)
  83119. }
  83120. return c.header_
  83121. }
  83122. func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  83123. reqHeaders := make(http.Header)
  83124. for k, v := range c.header_ {
  83125. reqHeaders[k] = v
  83126. }
  83127. reqHeaders.Set("User-Agent", c.s.userAgent())
  83128. if c.ifNoneMatch_ != "" {
  83129. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83130. }
  83131. var body io.Reader = nil
  83132. c.urlParams_.Set("alt", alt)
  83133. c.urlParams_.Set("prettyPrint", "false")
  83134. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks")
  83135. urls += "?" + c.urlParams_.Encode()
  83136. req, err := http.NewRequest("GET", urls, body)
  83137. if err != nil {
  83138. return nil, err
  83139. }
  83140. req.Header = reqHeaders
  83141. googleapi.Expand(req.URL, map[string]string{
  83142. "project": c.project,
  83143. })
  83144. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83145. }
  83146. // Do executes the "compute.subnetworks.aggregatedList" call.
  83147. // Exactly one of *SubnetworkAggregatedList or error will be non-nil.
  83148. // Any non-2xx status code is an error. Response headers are in either
  83149. // *SubnetworkAggregatedList.ServerResponse.Header or (if a response was
  83150. // returned at all) in error.(*googleapi.Error).Header. Use
  83151. // googleapi.IsNotModified to check whether the returned error was
  83152. // because http.StatusNotModified was returned.
  83153. func (c *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, error) {
  83154. gensupport.SetOptions(c.urlParams_, opts...)
  83155. res, err := c.doRequest("json")
  83156. if res != nil && res.StatusCode == http.StatusNotModified {
  83157. if res.Body != nil {
  83158. res.Body.Close()
  83159. }
  83160. return nil, &googleapi.Error{
  83161. Code: res.StatusCode,
  83162. Header: res.Header,
  83163. }
  83164. }
  83165. if err != nil {
  83166. return nil, err
  83167. }
  83168. defer googleapi.CloseBody(res)
  83169. if err := googleapi.CheckResponse(res); err != nil {
  83170. return nil, err
  83171. }
  83172. ret := &SubnetworkAggregatedList{
  83173. ServerResponse: googleapi.ServerResponse{
  83174. Header: res.Header,
  83175. HTTPStatusCode: res.StatusCode,
  83176. },
  83177. }
  83178. target := &ret
  83179. if err := gensupport.DecodeResponse(target, res); err != nil {
  83180. return nil, err
  83181. }
  83182. return ret, nil
  83183. // {
  83184. // "description": "Retrieves an aggregated list of subnetworks.",
  83185. // "httpMethod": "GET",
  83186. // "id": "compute.subnetworks.aggregatedList",
  83187. // "parameterOrder": [
  83188. // "project"
  83189. // ],
  83190. // "parameters": {
  83191. // "filter": {
  83192. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  83193. // "location": "query",
  83194. // "type": "string"
  83195. // },
  83196. // "maxResults": {
  83197. // "default": "500",
  83198. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  83199. // "format": "uint32",
  83200. // "location": "query",
  83201. // "minimum": "0",
  83202. // "type": "integer"
  83203. // },
  83204. // "orderBy": {
  83205. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  83206. // "location": "query",
  83207. // "type": "string"
  83208. // },
  83209. // "pageToken": {
  83210. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  83211. // "location": "query",
  83212. // "type": "string"
  83213. // },
  83214. // "project": {
  83215. // "description": "Project ID for this request.",
  83216. // "location": "path",
  83217. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83218. // "required": true,
  83219. // "type": "string"
  83220. // }
  83221. // },
  83222. // "path": "{project}/aggregated/subnetworks",
  83223. // "response": {
  83224. // "$ref": "SubnetworkAggregatedList"
  83225. // },
  83226. // "scopes": [
  83227. // "https://www.googleapis.com/auth/cloud-platform",
  83228. // "https://www.googleapis.com/auth/compute",
  83229. // "https://www.googleapis.com/auth/compute.readonly"
  83230. // ]
  83231. // }
  83232. }
  83233. // Pages invokes f for each page of results.
  83234. // A non-nil error returned from f will halt the iteration.
  83235. // The provided context supersedes any context provided to the Context method.
  83236. func (c *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) error) error {
  83237. c.ctx_ = ctx
  83238. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  83239. for {
  83240. x, err := c.Do()
  83241. if err != nil {
  83242. return err
  83243. }
  83244. if err := f(x); err != nil {
  83245. return err
  83246. }
  83247. if x.NextPageToken == "" {
  83248. return nil
  83249. }
  83250. c.PageToken(x.NextPageToken)
  83251. }
  83252. }
  83253. // method id "compute.subnetworks.delete":
  83254. type SubnetworksDeleteCall struct {
  83255. s *Service
  83256. project string
  83257. region string
  83258. subnetwork string
  83259. urlParams_ gensupport.URLParams
  83260. ctx_ context.Context
  83261. header_ http.Header
  83262. }
  83263. // Delete: Deletes the specified subnetwork.
  83264. func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall {
  83265. c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83266. c.project = project
  83267. c.region = region
  83268. c.subnetwork = subnetwork
  83269. return c
  83270. }
  83271. // RequestId sets the optional parameter "requestId": An optional
  83272. // request ID to identify requests. Specify a unique request ID so that
  83273. // if you must retry your request, the server will know to ignore the
  83274. // request if it has already been completed.
  83275. //
  83276. // For example, consider a situation where you make an initial request
  83277. // and the request times out. If you make the request again with the
  83278. // same request ID, the server can check if original operation with the
  83279. // same request ID was received, and if so, will ignore the second
  83280. // request. This prevents clients from accidentally creating duplicate
  83281. // commitments.
  83282. //
  83283. // The request ID must be a valid UUID with the exception that zero UUID
  83284. // is not supported (00000000-0000-0000-0000-000000000000).
  83285. func (c *SubnetworksDeleteCall) RequestId(requestId string) *SubnetworksDeleteCall {
  83286. c.urlParams_.Set("requestId", requestId)
  83287. return c
  83288. }
  83289. // Fields allows partial responses to be retrieved. See
  83290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83291. // for more information.
  83292. func (c *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall {
  83293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83294. return c
  83295. }
  83296. // Context sets the context to be used in this call's Do method. Any
  83297. // pending HTTP request will be aborted if the provided context is
  83298. // canceled.
  83299. func (c *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall {
  83300. c.ctx_ = ctx
  83301. return c
  83302. }
  83303. // Header returns an http.Header that can be modified by the caller to
  83304. // add HTTP headers to the request.
  83305. func (c *SubnetworksDeleteCall) Header() http.Header {
  83306. if c.header_ == nil {
  83307. c.header_ = make(http.Header)
  83308. }
  83309. return c.header_
  83310. }
  83311. func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  83312. reqHeaders := make(http.Header)
  83313. for k, v := range c.header_ {
  83314. reqHeaders[k] = v
  83315. }
  83316. reqHeaders.Set("User-Agent", c.s.userAgent())
  83317. var body io.Reader = nil
  83318. c.urlParams_.Set("alt", alt)
  83319. c.urlParams_.Set("prettyPrint", "false")
  83320. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  83321. urls += "?" + c.urlParams_.Encode()
  83322. req, err := http.NewRequest("DELETE", urls, body)
  83323. if err != nil {
  83324. return nil, err
  83325. }
  83326. req.Header = reqHeaders
  83327. googleapi.Expand(req.URL, map[string]string{
  83328. "project": c.project,
  83329. "region": c.region,
  83330. "subnetwork": c.subnetwork,
  83331. })
  83332. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83333. }
  83334. // Do executes the "compute.subnetworks.delete" call.
  83335. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83336. // status code is an error. Response headers are in either
  83337. // *Operation.ServerResponse.Header or (if a response was returned at
  83338. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83339. // to check whether the returned error was because
  83340. // http.StatusNotModified was returned.
  83341. func (c *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83342. gensupport.SetOptions(c.urlParams_, opts...)
  83343. res, err := c.doRequest("json")
  83344. if res != nil && res.StatusCode == http.StatusNotModified {
  83345. if res.Body != nil {
  83346. res.Body.Close()
  83347. }
  83348. return nil, &googleapi.Error{
  83349. Code: res.StatusCode,
  83350. Header: res.Header,
  83351. }
  83352. }
  83353. if err != nil {
  83354. return nil, err
  83355. }
  83356. defer googleapi.CloseBody(res)
  83357. if err := googleapi.CheckResponse(res); err != nil {
  83358. return nil, err
  83359. }
  83360. ret := &Operation{
  83361. ServerResponse: googleapi.ServerResponse{
  83362. Header: res.Header,
  83363. HTTPStatusCode: res.StatusCode,
  83364. },
  83365. }
  83366. target := &ret
  83367. if err := gensupport.DecodeResponse(target, res); err != nil {
  83368. return nil, err
  83369. }
  83370. return ret, nil
  83371. // {
  83372. // "description": "Deletes the specified subnetwork.",
  83373. // "httpMethod": "DELETE",
  83374. // "id": "compute.subnetworks.delete",
  83375. // "parameterOrder": [
  83376. // "project",
  83377. // "region",
  83378. // "subnetwork"
  83379. // ],
  83380. // "parameters": {
  83381. // "project": {
  83382. // "description": "Project ID for this request.",
  83383. // "location": "path",
  83384. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83385. // "required": true,
  83386. // "type": "string"
  83387. // },
  83388. // "region": {
  83389. // "description": "Name of the region scoping this request.",
  83390. // "location": "path",
  83391. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83392. // "required": true,
  83393. // "type": "string"
  83394. // },
  83395. // "requestId": {
  83396. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83397. // "location": "query",
  83398. // "type": "string"
  83399. // },
  83400. // "subnetwork": {
  83401. // "description": "Name of the Subnetwork resource to delete.",
  83402. // "location": "path",
  83403. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83404. // "required": true,
  83405. // "type": "string"
  83406. // }
  83407. // },
  83408. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  83409. // "response": {
  83410. // "$ref": "Operation"
  83411. // },
  83412. // "scopes": [
  83413. // "https://www.googleapis.com/auth/cloud-platform",
  83414. // "https://www.googleapis.com/auth/compute"
  83415. // ]
  83416. // }
  83417. }
  83418. // method id "compute.subnetworks.expandIpCidrRange":
  83419. type SubnetworksExpandIpCidrRangeCall struct {
  83420. s *Service
  83421. project string
  83422. region string
  83423. subnetwork string
  83424. subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest
  83425. urlParams_ gensupport.URLParams
  83426. ctx_ context.Context
  83427. header_ http.Header
  83428. }
  83429. // ExpandIpCidrRange: Expands the IP CIDR range of the subnetwork to a
  83430. // specified value.
  83431. func (r *SubnetworksService) ExpandIpCidrRange(project string, region string, subnetwork string, subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest) *SubnetworksExpandIpCidrRangeCall {
  83432. c := &SubnetworksExpandIpCidrRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83433. c.project = project
  83434. c.region = region
  83435. c.subnetwork = subnetwork
  83436. c.subnetworksexpandipcidrrangerequest = subnetworksexpandipcidrrangerequest
  83437. return c
  83438. }
  83439. // RequestId sets the optional parameter "requestId": An optional
  83440. // request ID to identify requests. Specify a unique request ID so that
  83441. // if you must retry your request, the server will know to ignore the
  83442. // request if it has already been completed.
  83443. //
  83444. // For example, consider a situation where you make an initial request
  83445. // and the request times out. If you make the request again with the
  83446. // same request ID, the server can check if original operation with the
  83447. // same request ID was received, and if so, will ignore the second
  83448. // request. This prevents clients from accidentally creating duplicate
  83449. // commitments.
  83450. //
  83451. // The request ID must be a valid UUID with the exception that zero UUID
  83452. // is not supported (00000000-0000-0000-0000-000000000000).
  83453. func (c *SubnetworksExpandIpCidrRangeCall) RequestId(requestId string) *SubnetworksExpandIpCidrRangeCall {
  83454. c.urlParams_.Set("requestId", requestId)
  83455. return c
  83456. }
  83457. // Fields allows partial responses to be retrieved. See
  83458. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83459. // for more information.
  83460. func (c *SubnetworksExpandIpCidrRangeCall) Fields(s ...googleapi.Field) *SubnetworksExpandIpCidrRangeCall {
  83461. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83462. return c
  83463. }
  83464. // Context sets the context to be used in this call's Do method. Any
  83465. // pending HTTP request will be aborted if the provided context is
  83466. // canceled.
  83467. func (c *SubnetworksExpandIpCidrRangeCall) Context(ctx context.Context) *SubnetworksExpandIpCidrRangeCall {
  83468. c.ctx_ = ctx
  83469. return c
  83470. }
  83471. // Header returns an http.Header that can be modified by the caller to
  83472. // add HTTP headers to the request.
  83473. func (c *SubnetworksExpandIpCidrRangeCall) Header() http.Header {
  83474. if c.header_ == nil {
  83475. c.header_ = make(http.Header)
  83476. }
  83477. return c.header_
  83478. }
  83479. func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) {
  83480. reqHeaders := make(http.Header)
  83481. for k, v := range c.header_ {
  83482. reqHeaders[k] = v
  83483. }
  83484. reqHeaders.Set("User-Agent", c.s.userAgent())
  83485. var body io.Reader = nil
  83486. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest)
  83487. if err != nil {
  83488. return nil, err
  83489. }
  83490. reqHeaders.Set("Content-Type", "application/json")
  83491. c.urlParams_.Set("alt", alt)
  83492. c.urlParams_.Set("prettyPrint", "false")
  83493. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")
  83494. urls += "?" + c.urlParams_.Encode()
  83495. req, err := http.NewRequest("POST", urls, body)
  83496. if err != nil {
  83497. return nil, err
  83498. }
  83499. req.Header = reqHeaders
  83500. googleapi.Expand(req.URL, map[string]string{
  83501. "project": c.project,
  83502. "region": c.region,
  83503. "subnetwork": c.subnetwork,
  83504. })
  83505. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83506. }
  83507. // Do executes the "compute.subnetworks.expandIpCidrRange" call.
  83508. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83509. // status code is an error. Response headers are in either
  83510. // *Operation.ServerResponse.Header or (if a response was returned at
  83511. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83512. // to check whether the returned error was because
  83513. // http.StatusNotModified was returned.
  83514. func (c *SubnetworksExpandIpCidrRangeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83515. gensupport.SetOptions(c.urlParams_, opts...)
  83516. res, err := c.doRequest("json")
  83517. if res != nil && res.StatusCode == http.StatusNotModified {
  83518. if res.Body != nil {
  83519. res.Body.Close()
  83520. }
  83521. return nil, &googleapi.Error{
  83522. Code: res.StatusCode,
  83523. Header: res.Header,
  83524. }
  83525. }
  83526. if err != nil {
  83527. return nil, err
  83528. }
  83529. defer googleapi.CloseBody(res)
  83530. if err := googleapi.CheckResponse(res); err != nil {
  83531. return nil, err
  83532. }
  83533. ret := &Operation{
  83534. ServerResponse: googleapi.ServerResponse{
  83535. Header: res.Header,
  83536. HTTPStatusCode: res.StatusCode,
  83537. },
  83538. }
  83539. target := &ret
  83540. if err := gensupport.DecodeResponse(target, res); err != nil {
  83541. return nil, err
  83542. }
  83543. return ret, nil
  83544. // {
  83545. // "description": "Expands the IP CIDR range of the subnetwork to a specified value.",
  83546. // "httpMethod": "POST",
  83547. // "id": "compute.subnetworks.expandIpCidrRange",
  83548. // "parameterOrder": [
  83549. // "project",
  83550. // "region",
  83551. // "subnetwork"
  83552. // ],
  83553. // "parameters": {
  83554. // "project": {
  83555. // "description": "Project ID for this request.",
  83556. // "location": "path",
  83557. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83558. // "required": true,
  83559. // "type": "string"
  83560. // },
  83561. // "region": {
  83562. // "description": "Name of the region scoping this request.",
  83563. // "location": "path",
  83564. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83565. // "required": true,
  83566. // "type": "string"
  83567. // },
  83568. // "requestId": {
  83569. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83570. // "location": "query",
  83571. // "type": "string"
  83572. // },
  83573. // "subnetwork": {
  83574. // "description": "Name of the Subnetwork resource to update.",
  83575. // "location": "path",
  83576. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83577. // "required": true,
  83578. // "type": "string"
  83579. // }
  83580. // },
  83581. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
  83582. // "request": {
  83583. // "$ref": "SubnetworksExpandIpCidrRangeRequest"
  83584. // },
  83585. // "response": {
  83586. // "$ref": "Operation"
  83587. // },
  83588. // "scopes": [
  83589. // "https://www.googleapis.com/auth/cloud-platform",
  83590. // "https://www.googleapis.com/auth/compute"
  83591. // ]
  83592. // }
  83593. }
  83594. // method id "compute.subnetworks.get":
  83595. type SubnetworksGetCall struct {
  83596. s *Service
  83597. project string
  83598. region string
  83599. subnetwork string
  83600. urlParams_ gensupport.URLParams
  83601. ifNoneMatch_ string
  83602. ctx_ context.Context
  83603. header_ http.Header
  83604. }
  83605. // Get: Returns the specified subnetwork. Gets a list of available
  83606. // subnetworks list() request.
  83607. func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall {
  83608. c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83609. c.project = project
  83610. c.region = region
  83611. c.subnetwork = subnetwork
  83612. return c
  83613. }
  83614. // Fields allows partial responses to be retrieved. See
  83615. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83616. // for more information.
  83617. func (c *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall {
  83618. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83619. return c
  83620. }
  83621. // IfNoneMatch sets the optional parameter which makes the operation
  83622. // fail if the object's ETag matches the given value. This is useful for
  83623. // getting updates only after the object has changed since the last
  83624. // request. Use googleapi.IsNotModified to check whether the response
  83625. // error from Do is the result of In-None-Match.
  83626. func (c *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall {
  83627. c.ifNoneMatch_ = entityTag
  83628. return c
  83629. }
  83630. // Context sets the context to be used in this call's Do method. Any
  83631. // pending HTTP request will be aborted if the provided context is
  83632. // canceled.
  83633. func (c *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall {
  83634. c.ctx_ = ctx
  83635. return c
  83636. }
  83637. // Header returns an http.Header that can be modified by the caller to
  83638. // add HTTP headers to the request.
  83639. func (c *SubnetworksGetCall) Header() http.Header {
  83640. if c.header_ == nil {
  83641. c.header_ = make(http.Header)
  83642. }
  83643. return c.header_
  83644. }
  83645. func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) {
  83646. reqHeaders := make(http.Header)
  83647. for k, v := range c.header_ {
  83648. reqHeaders[k] = v
  83649. }
  83650. reqHeaders.Set("User-Agent", c.s.userAgent())
  83651. if c.ifNoneMatch_ != "" {
  83652. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83653. }
  83654. var body io.Reader = nil
  83655. c.urlParams_.Set("alt", alt)
  83656. c.urlParams_.Set("prettyPrint", "false")
  83657. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  83658. urls += "?" + c.urlParams_.Encode()
  83659. req, err := http.NewRequest("GET", urls, body)
  83660. if err != nil {
  83661. return nil, err
  83662. }
  83663. req.Header = reqHeaders
  83664. googleapi.Expand(req.URL, map[string]string{
  83665. "project": c.project,
  83666. "region": c.region,
  83667. "subnetwork": c.subnetwork,
  83668. })
  83669. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83670. }
  83671. // Do executes the "compute.subnetworks.get" call.
  83672. // Exactly one of *Subnetwork or error will be non-nil. Any non-2xx
  83673. // status code is an error. Response headers are in either
  83674. // *Subnetwork.ServerResponse.Header or (if a response was returned at
  83675. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83676. // to check whether the returned error was because
  83677. // http.StatusNotModified was returned.
  83678. func (c *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, error) {
  83679. gensupport.SetOptions(c.urlParams_, opts...)
  83680. res, err := c.doRequest("json")
  83681. if res != nil && res.StatusCode == http.StatusNotModified {
  83682. if res.Body != nil {
  83683. res.Body.Close()
  83684. }
  83685. return nil, &googleapi.Error{
  83686. Code: res.StatusCode,
  83687. Header: res.Header,
  83688. }
  83689. }
  83690. if err != nil {
  83691. return nil, err
  83692. }
  83693. defer googleapi.CloseBody(res)
  83694. if err := googleapi.CheckResponse(res); err != nil {
  83695. return nil, err
  83696. }
  83697. ret := &Subnetwork{
  83698. ServerResponse: googleapi.ServerResponse{
  83699. Header: res.Header,
  83700. HTTPStatusCode: res.StatusCode,
  83701. },
  83702. }
  83703. target := &ret
  83704. if err := gensupport.DecodeResponse(target, res); err != nil {
  83705. return nil, err
  83706. }
  83707. return ret, nil
  83708. // {
  83709. // "description": "Returns the specified subnetwork. Gets a list of available subnetworks list() request.",
  83710. // "httpMethod": "GET",
  83711. // "id": "compute.subnetworks.get",
  83712. // "parameterOrder": [
  83713. // "project",
  83714. // "region",
  83715. // "subnetwork"
  83716. // ],
  83717. // "parameters": {
  83718. // "project": {
  83719. // "description": "Project ID for this request.",
  83720. // "location": "path",
  83721. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83722. // "required": true,
  83723. // "type": "string"
  83724. // },
  83725. // "region": {
  83726. // "description": "Name of the region scoping this request.",
  83727. // "location": "path",
  83728. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83729. // "required": true,
  83730. // "type": "string"
  83731. // },
  83732. // "subnetwork": {
  83733. // "description": "Name of the Subnetwork resource to return.",
  83734. // "location": "path",
  83735. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83736. // "required": true,
  83737. // "type": "string"
  83738. // }
  83739. // },
  83740. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  83741. // "response": {
  83742. // "$ref": "Subnetwork"
  83743. // },
  83744. // "scopes": [
  83745. // "https://www.googleapis.com/auth/cloud-platform",
  83746. // "https://www.googleapis.com/auth/compute",
  83747. // "https://www.googleapis.com/auth/compute.readonly"
  83748. // ]
  83749. // }
  83750. }
  83751. // method id "compute.subnetworks.getIamPolicy":
  83752. type SubnetworksGetIamPolicyCall struct {
  83753. s *Service
  83754. project string
  83755. region string
  83756. resource string
  83757. urlParams_ gensupport.URLParams
  83758. ifNoneMatch_ string
  83759. ctx_ context.Context
  83760. header_ http.Header
  83761. }
  83762. // GetIamPolicy: Gets the access control policy for a resource. May be
  83763. // empty if no such policy or resource exists.
  83764. func (r *SubnetworksService) GetIamPolicy(project string, region string, resource string) *SubnetworksGetIamPolicyCall {
  83765. c := &SubnetworksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83766. c.project = project
  83767. c.region = region
  83768. c.resource = resource
  83769. return c
  83770. }
  83771. // Fields allows partial responses to be retrieved. See
  83772. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83773. // for more information.
  83774. func (c *SubnetworksGetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksGetIamPolicyCall {
  83775. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83776. return c
  83777. }
  83778. // IfNoneMatch sets the optional parameter which makes the operation
  83779. // fail if the object's ETag matches the given value. This is useful for
  83780. // getting updates only after the object has changed since the last
  83781. // request. Use googleapi.IsNotModified to check whether the response
  83782. // error from Do is the result of In-None-Match.
  83783. func (c *SubnetworksGetIamPolicyCall) IfNoneMatch(entityTag string) *SubnetworksGetIamPolicyCall {
  83784. c.ifNoneMatch_ = entityTag
  83785. return c
  83786. }
  83787. // Context sets the context to be used in this call's Do method. Any
  83788. // pending HTTP request will be aborted if the provided context is
  83789. // canceled.
  83790. func (c *SubnetworksGetIamPolicyCall) Context(ctx context.Context) *SubnetworksGetIamPolicyCall {
  83791. c.ctx_ = ctx
  83792. return c
  83793. }
  83794. // Header returns an http.Header that can be modified by the caller to
  83795. // add HTTP headers to the request.
  83796. func (c *SubnetworksGetIamPolicyCall) Header() http.Header {
  83797. if c.header_ == nil {
  83798. c.header_ = make(http.Header)
  83799. }
  83800. return c.header_
  83801. }
  83802. func (c *SubnetworksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  83803. reqHeaders := make(http.Header)
  83804. for k, v := range c.header_ {
  83805. reqHeaders[k] = v
  83806. }
  83807. reqHeaders.Set("User-Agent", c.s.userAgent())
  83808. if c.ifNoneMatch_ != "" {
  83809. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83810. }
  83811. var body io.Reader = nil
  83812. c.urlParams_.Set("alt", alt)
  83813. c.urlParams_.Set("prettyPrint", "false")
  83814. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy")
  83815. urls += "?" + c.urlParams_.Encode()
  83816. req, err := http.NewRequest("GET", urls, body)
  83817. if err != nil {
  83818. return nil, err
  83819. }
  83820. req.Header = reqHeaders
  83821. googleapi.Expand(req.URL, map[string]string{
  83822. "project": c.project,
  83823. "region": c.region,
  83824. "resource": c.resource,
  83825. })
  83826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83827. }
  83828. // Do executes the "compute.subnetworks.getIamPolicy" call.
  83829. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  83830. // code is an error. Response headers are in either
  83831. // *Policy.ServerResponse.Header or (if a response was returned at all)
  83832. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  83833. // check whether the returned error was because http.StatusNotModified
  83834. // was returned.
  83835. func (c *SubnetworksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  83836. gensupport.SetOptions(c.urlParams_, opts...)
  83837. res, err := c.doRequest("json")
  83838. if res != nil && res.StatusCode == http.StatusNotModified {
  83839. if res.Body != nil {
  83840. res.Body.Close()
  83841. }
  83842. return nil, &googleapi.Error{
  83843. Code: res.StatusCode,
  83844. Header: res.Header,
  83845. }
  83846. }
  83847. if err != nil {
  83848. return nil, err
  83849. }
  83850. defer googleapi.CloseBody(res)
  83851. if err := googleapi.CheckResponse(res); err != nil {
  83852. return nil, err
  83853. }
  83854. ret := &Policy{
  83855. ServerResponse: googleapi.ServerResponse{
  83856. Header: res.Header,
  83857. HTTPStatusCode: res.StatusCode,
  83858. },
  83859. }
  83860. target := &ret
  83861. if err := gensupport.DecodeResponse(target, res); err != nil {
  83862. return nil, err
  83863. }
  83864. return ret, nil
  83865. // {
  83866. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  83867. // "httpMethod": "GET",
  83868. // "id": "compute.subnetworks.getIamPolicy",
  83869. // "parameterOrder": [
  83870. // "project",
  83871. // "region",
  83872. // "resource"
  83873. // ],
  83874. // "parameters": {
  83875. // "project": {
  83876. // "description": "Project ID for this request.",
  83877. // "location": "path",
  83878. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83879. // "required": true,
  83880. // "type": "string"
  83881. // },
  83882. // "region": {
  83883. // "description": "The name of the region for this request.",
  83884. // "location": "path",
  83885. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83886. // "required": true,
  83887. // "type": "string"
  83888. // },
  83889. // "resource": {
  83890. // "description": "Name or id of the resource for this request.",
  83891. // "location": "path",
  83892. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83893. // "required": true,
  83894. // "type": "string"
  83895. // }
  83896. // },
  83897. // "path": "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
  83898. // "response": {
  83899. // "$ref": "Policy"
  83900. // },
  83901. // "scopes": [
  83902. // "https://www.googleapis.com/auth/cloud-platform",
  83903. // "https://www.googleapis.com/auth/compute",
  83904. // "https://www.googleapis.com/auth/compute.readonly"
  83905. // ]
  83906. // }
  83907. }
  83908. // method id "compute.subnetworks.insert":
  83909. type SubnetworksInsertCall struct {
  83910. s *Service
  83911. project string
  83912. region string
  83913. subnetwork *Subnetwork
  83914. urlParams_ gensupport.URLParams
  83915. ctx_ context.Context
  83916. header_ http.Header
  83917. }
  83918. // Insert: Creates a subnetwork in the specified project using the data
  83919. // included in the request.
  83920. func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall {
  83921. c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83922. c.project = project
  83923. c.region = region
  83924. c.subnetwork = subnetwork
  83925. return c
  83926. }
  83927. // RequestId sets the optional parameter "requestId": An optional
  83928. // request ID to identify requests. Specify a unique request ID so that
  83929. // if you must retry your request, the server will know to ignore the
  83930. // request if it has already been completed.
  83931. //
  83932. // For example, consider a situation where you make an initial request
  83933. // and the request times out. If you make the request again with the
  83934. // same request ID, the server can check if original operation with the
  83935. // same request ID was received, and if so, will ignore the second
  83936. // request. This prevents clients from accidentally creating duplicate
  83937. // commitments.
  83938. //
  83939. // The request ID must be a valid UUID with the exception that zero UUID
  83940. // is not supported (00000000-0000-0000-0000-000000000000).
  83941. func (c *SubnetworksInsertCall) RequestId(requestId string) *SubnetworksInsertCall {
  83942. c.urlParams_.Set("requestId", requestId)
  83943. return c
  83944. }
  83945. // Fields allows partial responses to be retrieved. See
  83946. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83947. // for more information.
  83948. func (c *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall {
  83949. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83950. return c
  83951. }
  83952. // Context sets the context to be used in this call's Do method. Any
  83953. // pending HTTP request will be aborted if the provided context is
  83954. // canceled.
  83955. func (c *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall {
  83956. c.ctx_ = ctx
  83957. return c
  83958. }
  83959. // Header returns an http.Header that can be modified by the caller to
  83960. // add HTTP headers to the request.
  83961. func (c *SubnetworksInsertCall) Header() http.Header {
  83962. if c.header_ == nil {
  83963. c.header_ = make(http.Header)
  83964. }
  83965. return c.header_
  83966. }
  83967. func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  83968. reqHeaders := make(http.Header)
  83969. for k, v := range c.header_ {
  83970. reqHeaders[k] = v
  83971. }
  83972. reqHeaders.Set("User-Agent", c.s.userAgent())
  83973. var body io.Reader = nil
  83974. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork)
  83975. if err != nil {
  83976. return nil, err
  83977. }
  83978. reqHeaders.Set("Content-Type", "application/json")
  83979. c.urlParams_.Set("alt", alt)
  83980. c.urlParams_.Set("prettyPrint", "false")
  83981. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  83982. urls += "?" + c.urlParams_.Encode()
  83983. req, err := http.NewRequest("POST", urls, body)
  83984. if err != nil {
  83985. return nil, err
  83986. }
  83987. req.Header = reqHeaders
  83988. googleapi.Expand(req.URL, map[string]string{
  83989. "project": c.project,
  83990. "region": c.region,
  83991. })
  83992. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83993. }
  83994. // Do executes the "compute.subnetworks.insert" call.
  83995. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83996. // status code is an error. Response headers are in either
  83997. // *Operation.ServerResponse.Header or (if a response was returned at
  83998. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83999. // to check whether the returned error was because
  84000. // http.StatusNotModified was returned.
  84001. func (c *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84002. gensupport.SetOptions(c.urlParams_, opts...)
  84003. res, err := c.doRequest("json")
  84004. if res != nil && res.StatusCode == http.StatusNotModified {
  84005. if res.Body != nil {
  84006. res.Body.Close()
  84007. }
  84008. return nil, &googleapi.Error{
  84009. Code: res.StatusCode,
  84010. Header: res.Header,
  84011. }
  84012. }
  84013. if err != nil {
  84014. return nil, err
  84015. }
  84016. defer googleapi.CloseBody(res)
  84017. if err := googleapi.CheckResponse(res); err != nil {
  84018. return nil, err
  84019. }
  84020. ret := &Operation{
  84021. ServerResponse: googleapi.ServerResponse{
  84022. Header: res.Header,
  84023. HTTPStatusCode: res.StatusCode,
  84024. },
  84025. }
  84026. target := &ret
  84027. if err := gensupport.DecodeResponse(target, res); err != nil {
  84028. return nil, err
  84029. }
  84030. return ret, nil
  84031. // {
  84032. // "description": "Creates a subnetwork in the specified project using the data included in the request.",
  84033. // "httpMethod": "POST",
  84034. // "id": "compute.subnetworks.insert",
  84035. // "parameterOrder": [
  84036. // "project",
  84037. // "region"
  84038. // ],
  84039. // "parameters": {
  84040. // "project": {
  84041. // "description": "Project ID for this request.",
  84042. // "location": "path",
  84043. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84044. // "required": true,
  84045. // "type": "string"
  84046. // },
  84047. // "region": {
  84048. // "description": "Name of the region scoping this request.",
  84049. // "location": "path",
  84050. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84051. // "required": true,
  84052. // "type": "string"
  84053. // },
  84054. // "requestId": {
  84055. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84056. // "location": "query",
  84057. // "type": "string"
  84058. // }
  84059. // },
  84060. // "path": "{project}/regions/{region}/subnetworks",
  84061. // "request": {
  84062. // "$ref": "Subnetwork"
  84063. // },
  84064. // "response": {
  84065. // "$ref": "Operation"
  84066. // },
  84067. // "scopes": [
  84068. // "https://www.googleapis.com/auth/cloud-platform",
  84069. // "https://www.googleapis.com/auth/compute"
  84070. // ]
  84071. // }
  84072. }
  84073. // method id "compute.subnetworks.list":
  84074. type SubnetworksListCall struct {
  84075. s *Service
  84076. project string
  84077. region string
  84078. urlParams_ gensupport.URLParams
  84079. ifNoneMatch_ string
  84080. ctx_ context.Context
  84081. header_ http.Header
  84082. }
  84083. // List: Retrieves a list of subnetworks available to the specified
  84084. // project.
  84085. func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall {
  84086. c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84087. c.project = project
  84088. c.region = region
  84089. return c
  84090. }
  84091. // Filter sets the optional parameter "filter": A filter expression that
  84092. // filters resources listed in the response. The expression must specify
  84093. // the field name, a comparison operator, and the value that you want to
  84094. // use for filtering. The value must be a string, a number, or a
  84095. // boolean. The comparison operator must be either =, !=, >, or <.
  84096. //
  84097. // For example, if you are filtering Compute Engine instances, you can
  84098. // exclude instances named example-instance by specifying name !=
  84099. // example-instance.
  84100. //
  84101. // You can also filter nested fields. For example, you could specify
  84102. // scheduling.automaticRestart = false to include instances only if they
  84103. // are not scheduled for automatic restarts. You can use filtering on
  84104. // nested fields to filter based on resource labels.
  84105. //
  84106. // To filter on multiple expressions, provide each separate expression
  84107. // within parentheses. For example, (scheduling.automaticRestart = true)
  84108. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  84109. // AND expression. However, you can include AND and OR expressions
  84110. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  84111. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  84112. // true).
  84113. func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall {
  84114. c.urlParams_.Set("filter", filter)
  84115. return c
  84116. }
  84117. // MaxResults sets the optional parameter "maxResults": The maximum
  84118. // number of results per page that should be returned. If the number of
  84119. // available results is larger than maxResults, Compute Engine returns a
  84120. // nextPageToken that can be used to get the next page of results in
  84121. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  84122. // (Default: 500)
  84123. func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall {
  84124. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  84125. return c
  84126. }
  84127. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  84128. // a certain order. By default, results are returned in alphanumerical
  84129. // order based on the resource name.
  84130. //
  84131. // You can also sort results in descending order based on the creation
  84132. // timestamp using orderBy="creationTimestamp desc". This sorts results
  84133. // based on the creationTimestamp field in reverse chronological order
  84134. // (newest result first). Use this to sort resources like operations so
  84135. // that the newest operation is returned first.
  84136. //
  84137. // Currently, only sorting by name or creationTimestamp desc is
  84138. // supported.
  84139. func (c *SubnetworksListCall) OrderBy(orderBy string) *SubnetworksListCall {
  84140. c.urlParams_.Set("orderBy", orderBy)
  84141. return c
  84142. }
  84143. // PageToken sets the optional parameter "pageToken": Specifies a page
  84144. // token to use. Set pageToken to the nextPageToken returned by a
  84145. // previous list request to get the next page of results.
  84146. func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall {
  84147. c.urlParams_.Set("pageToken", pageToken)
  84148. return c
  84149. }
  84150. // Fields allows partial responses to be retrieved. See
  84151. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84152. // for more information.
  84153. func (c *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall {
  84154. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84155. return c
  84156. }
  84157. // IfNoneMatch sets the optional parameter which makes the operation
  84158. // fail if the object's ETag matches the given value. This is useful for
  84159. // getting updates only after the object has changed since the last
  84160. // request. Use googleapi.IsNotModified to check whether the response
  84161. // error from Do is the result of In-None-Match.
  84162. func (c *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall {
  84163. c.ifNoneMatch_ = entityTag
  84164. return c
  84165. }
  84166. // Context sets the context to be used in this call's Do method. Any
  84167. // pending HTTP request will be aborted if the provided context is
  84168. // canceled.
  84169. func (c *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall {
  84170. c.ctx_ = ctx
  84171. return c
  84172. }
  84173. // Header returns an http.Header that can be modified by the caller to
  84174. // add HTTP headers to the request.
  84175. func (c *SubnetworksListCall) Header() http.Header {
  84176. if c.header_ == nil {
  84177. c.header_ = make(http.Header)
  84178. }
  84179. return c.header_
  84180. }
  84181. func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  84182. reqHeaders := make(http.Header)
  84183. for k, v := range c.header_ {
  84184. reqHeaders[k] = v
  84185. }
  84186. reqHeaders.Set("User-Agent", c.s.userAgent())
  84187. if c.ifNoneMatch_ != "" {
  84188. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84189. }
  84190. var body io.Reader = nil
  84191. c.urlParams_.Set("alt", alt)
  84192. c.urlParams_.Set("prettyPrint", "false")
  84193. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  84194. urls += "?" + c.urlParams_.Encode()
  84195. req, err := http.NewRequest("GET", urls, body)
  84196. if err != nil {
  84197. return nil, err
  84198. }
  84199. req.Header = reqHeaders
  84200. googleapi.Expand(req.URL, map[string]string{
  84201. "project": c.project,
  84202. "region": c.region,
  84203. })
  84204. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84205. }
  84206. // Do executes the "compute.subnetworks.list" call.
  84207. // Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx
  84208. // status code is an error. Response headers are in either
  84209. // *SubnetworkList.ServerResponse.Header or (if a response was returned
  84210. // at all) in error.(*googleapi.Error).Header. Use
  84211. // googleapi.IsNotModified to check whether the returned error was
  84212. // because http.StatusNotModified was returned.
  84213. func (c *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, error) {
  84214. gensupport.SetOptions(c.urlParams_, opts...)
  84215. res, err := c.doRequest("json")
  84216. if res != nil && res.StatusCode == http.StatusNotModified {
  84217. if res.Body != nil {
  84218. res.Body.Close()
  84219. }
  84220. return nil, &googleapi.Error{
  84221. Code: res.StatusCode,
  84222. Header: res.Header,
  84223. }
  84224. }
  84225. if err != nil {
  84226. return nil, err
  84227. }
  84228. defer googleapi.CloseBody(res)
  84229. if err := googleapi.CheckResponse(res); err != nil {
  84230. return nil, err
  84231. }
  84232. ret := &SubnetworkList{
  84233. ServerResponse: googleapi.ServerResponse{
  84234. Header: res.Header,
  84235. HTTPStatusCode: res.StatusCode,
  84236. },
  84237. }
  84238. target := &ret
  84239. if err := gensupport.DecodeResponse(target, res); err != nil {
  84240. return nil, err
  84241. }
  84242. return ret, nil
  84243. // {
  84244. // "description": "Retrieves a list of subnetworks available to the specified project.",
  84245. // "httpMethod": "GET",
  84246. // "id": "compute.subnetworks.list",
  84247. // "parameterOrder": [
  84248. // "project",
  84249. // "region"
  84250. // ],
  84251. // "parameters": {
  84252. // "filter": {
  84253. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  84254. // "location": "query",
  84255. // "type": "string"
  84256. // },
  84257. // "maxResults": {
  84258. // "default": "500",
  84259. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  84260. // "format": "uint32",
  84261. // "location": "query",
  84262. // "minimum": "0",
  84263. // "type": "integer"
  84264. // },
  84265. // "orderBy": {
  84266. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  84267. // "location": "query",
  84268. // "type": "string"
  84269. // },
  84270. // "pageToken": {
  84271. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  84272. // "location": "query",
  84273. // "type": "string"
  84274. // },
  84275. // "project": {
  84276. // "description": "Project ID for this request.",
  84277. // "location": "path",
  84278. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84279. // "required": true,
  84280. // "type": "string"
  84281. // },
  84282. // "region": {
  84283. // "description": "Name of the region scoping this request.",
  84284. // "location": "path",
  84285. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84286. // "required": true,
  84287. // "type": "string"
  84288. // }
  84289. // },
  84290. // "path": "{project}/regions/{region}/subnetworks",
  84291. // "response": {
  84292. // "$ref": "SubnetworkList"
  84293. // },
  84294. // "scopes": [
  84295. // "https://www.googleapis.com/auth/cloud-platform",
  84296. // "https://www.googleapis.com/auth/compute",
  84297. // "https://www.googleapis.com/auth/compute.readonly"
  84298. // ]
  84299. // }
  84300. }
  84301. // Pages invokes f for each page of results.
  84302. // A non-nil error returned from f will halt the iteration.
  84303. // The provided context supersedes any context provided to the Context method.
  84304. func (c *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) error) error {
  84305. c.ctx_ = ctx
  84306. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  84307. for {
  84308. x, err := c.Do()
  84309. if err != nil {
  84310. return err
  84311. }
  84312. if err := f(x); err != nil {
  84313. return err
  84314. }
  84315. if x.NextPageToken == "" {
  84316. return nil
  84317. }
  84318. c.PageToken(x.NextPageToken)
  84319. }
  84320. }
  84321. // method id "compute.subnetworks.listUsable":
  84322. type SubnetworksListUsableCall struct {
  84323. s *Service
  84324. project string
  84325. urlParams_ gensupport.URLParams
  84326. ifNoneMatch_ string
  84327. ctx_ context.Context
  84328. header_ http.Header
  84329. }
  84330. // ListUsable: Retrieves an aggregated list of usable subnetworks.
  84331. func (r *SubnetworksService) ListUsable(project string) *SubnetworksListUsableCall {
  84332. c := &SubnetworksListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84333. c.project = project
  84334. return c
  84335. }
  84336. // Filter sets the optional parameter "filter": A filter expression that
  84337. // filters resources listed in the response. The expression must specify
  84338. // the field name, a comparison operator, and the value that you want to
  84339. // use for filtering. The value must be a string, a number, or a
  84340. // boolean. The comparison operator must be either =, !=, >, or <.
  84341. //
  84342. // For example, if you are filtering Compute Engine instances, you can
  84343. // exclude instances named example-instance by specifying name !=
  84344. // example-instance.
  84345. //
  84346. // You can also filter nested fields. For example, you could specify
  84347. // scheduling.automaticRestart = false to include instances only if they
  84348. // are not scheduled for automatic restarts. You can use filtering on
  84349. // nested fields to filter based on resource labels.
  84350. //
  84351. // To filter on multiple expressions, provide each separate expression
  84352. // within parentheses. For example, (scheduling.automaticRestart = true)
  84353. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  84354. // AND expression. However, you can include AND and OR expressions
  84355. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  84356. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  84357. // true).
  84358. func (c *SubnetworksListUsableCall) Filter(filter string) *SubnetworksListUsableCall {
  84359. c.urlParams_.Set("filter", filter)
  84360. return c
  84361. }
  84362. // MaxResults sets the optional parameter "maxResults": The maximum
  84363. // number of results per page that should be returned. If the number of
  84364. // available results is larger than maxResults, Compute Engine returns a
  84365. // nextPageToken that can be used to get the next page of results in
  84366. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  84367. // (Default: 500)
  84368. func (c *SubnetworksListUsableCall) MaxResults(maxResults int64) *SubnetworksListUsableCall {
  84369. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  84370. return c
  84371. }
  84372. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  84373. // a certain order. By default, results are returned in alphanumerical
  84374. // order based on the resource name.
  84375. //
  84376. // You can also sort results in descending order based on the creation
  84377. // timestamp using orderBy="creationTimestamp desc". This sorts results
  84378. // based on the creationTimestamp field in reverse chronological order
  84379. // (newest result first). Use this to sort resources like operations so
  84380. // that the newest operation is returned first.
  84381. //
  84382. // Currently, only sorting by name or creationTimestamp desc is
  84383. // supported.
  84384. func (c *SubnetworksListUsableCall) OrderBy(orderBy string) *SubnetworksListUsableCall {
  84385. c.urlParams_.Set("orderBy", orderBy)
  84386. return c
  84387. }
  84388. // PageToken sets the optional parameter "pageToken": Specifies a page
  84389. // token to use. Set pageToken to the nextPageToken returned by a
  84390. // previous list request to get the next page of results.
  84391. func (c *SubnetworksListUsableCall) PageToken(pageToken string) *SubnetworksListUsableCall {
  84392. c.urlParams_.Set("pageToken", pageToken)
  84393. return c
  84394. }
  84395. // Fields allows partial responses to be retrieved. See
  84396. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84397. // for more information.
  84398. func (c *SubnetworksListUsableCall) Fields(s ...googleapi.Field) *SubnetworksListUsableCall {
  84399. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84400. return c
  84401. }
  84402. // IfNoneMatch sets the optional parameter which makes the operation
  84403. // fail if the object's ETag matches the given value. This is useful for
  84404. // getting updates only after the object has changed since the last
  84405. // request. Use googleapi.IsNotModified to check whether the response
  84406. // error from Do is the result of In-None-Match.
  84407. func (c *SubnetworksListUsableCall) IfNoneMatch(entityTag string) *SubnetworksListUsableCall {
  84408. c.ifNoneMatch_ = entityTag
  84409. return c
  84410. }
  84411. // Context sets the context to be used in this call's Do method. Any
  84412. // pending HTTP request will be aborted if the provided context is
  84413. // canceled.
  84414. func (c *SubnetworksListUsableCall) Context(ctx context.Context) *SubnetworksListUsableCall {
  84415. c.ctx_ = ctx
  84416. return c
  84417. }
  84418. // Header returns an http.Header that can be modified by the caller to
  84419. // add HTTP headers to the request.
  84420. func (c *SubnetworksListUsableCall) Header() http.Header {
  84421. if c.header_ == nil {
  84422. c.header_ = make(http.Header)
  84423. }
  84424. return c.header_
  84425. }
  84426. func (c *SubnetworksListUsableCall) doRequest(alt string) (*http.Response, error) {
  84427. reqHeaders := make(http.Header)
  84428. for k, v := range c.header_ {
  84429. reqHeaders[k] = v
  84430. }
  84431. reqHeaders.Set("User-Agent", c.s.userAgent())
  84432. if c.ifNoneMatch_ != "" {
  84433. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84434. }
  84435. var body io.Reader = nil
  84436. c.urlParams_.Set("alt", alt)
  84437. c.urlParams_.Set("prettyPrint", "false")
  84438. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks/listUsable")
  84439. urls += "?" + c.urlParams_.Encode()
  84440. req, err := http.NewRequest("GET", urls, body)
  84441. if err != nil {
  84442. return nil, err
  84443. }
  84444. req.Header = reqHeaders
  84445. googleapi.Expand(req.URL, map[string]string{
  84446. "project": c.project,
  84447. })
  84448. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84449. }
  84450. // Do executes the "compute.subnetworks.listUsable" call.
  84451. // Exactly one of *UsableSubnetworksAggregatedList or error will be
  84452. // non-nil. Any non-2xx status code is an error. Response headers are in
  84453. // either *UsableSubnetworksAggregatedList.ServerResponse.Header or (if
  84454. // a response was returned at all) in error.(*googleapi.Error).Header.
  84455. // Use googleapi.IsNotModified to check whether the returned error was
  84456. // because http.StatusNotModified was returned.
  84457. func (c *SubnetworksListUsableCall) Do(opts ...googleapi.CallOption) (*UsableSubnetworksAggregatedList, error) {
  84458. gensupport.SetOptions(c.urlParams_, opts...)
  84459. res, err := c.doRequest("json")
  84460. if res != nil && res.StatusCode == http.StatusNotModified {
  84461. if res.Body != nil {
  84462. res.Body.Close()
  84463. }
  84464. return nil, &googleapi.Error{
  84465. Code: res.StatusCode,
  84466. Header: res.Header,
  84467. }
  84468. }
  84469. if err != nil {
  84470. return nil, err
  84471. }
  84472. defer googleapi.CloseBody(res)
  84473. if err := googleapi.CheckResponse(res); err != nil {
  84474. return nil, err
  84475. }
  84476. ret := &UsableSubnetworksAggregatedList{
  84477. ServerResponse: googleapi.ServerResponse{
  84478. Header: res.Header,
  84479. HTTPStatusCode: res.StatusCode,
  84480. },
  84481. }
  84482. target := &ret
  84483. if err := gensupport.DecodeResponse(target, res); err != nil {
  84484. return nil, err
  84485. }
  84486. return ret, nil
  84487. // {
  84488. // "description": "Retrieves an aggregated list of usable subnetworks.",
  84489. // "httpMethod": "GET",
  84490. // "id": "compute.subnetworks.listUsable",
  84491. // "parameterOrder": [
  84492. // "project"
  84493. // ],
  84494. // "parameters": {
  84495. // "filter": {
  84496. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  84497. // "location": "query",
  84498. // "type": "string"
  84499. // },
  84500. // "maxResults": {
  84501. // "default": "500",
  84502. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  84503. // "format": "uint32",
  84504. // "location": "query",
  84505. // "minimum": "0",
  84506. // "type": "integer"
  84507. // },
  84508. // "orderBy": {
  84509. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  84510. // "location": "query",
  84511. // "type": "string"
  84512. // },
  84513. // "pageToken": {
  84514. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  84515. // "location": "query",
  84516. // "type": "string"
  84517. // },
  84518. // "project": {
  84519. // "description": "Project ID for this request.",
  84520. // "location": "path",
  84521. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84522. // "required": true,
  84523. // "type": "string"
  84524. // }
  84525. // },
  84526. // "path": "{project}/aggregated/subnetworks/listUsable",
  84527. // "response": {
  84528. // "$ref": "UsableSubnetworksAggregatedList"
  84529. // },
  84530. // "scopes": [
  84531. // "https://www.googleapis.com/auth/cloud-platform",
  84532. // "https://www.googleapis.com/auth/compute",
  84533. // "https://www.googleapis.com/auth/compute.readonly"
  84534. // ]
  84535. // }
  84536. }
  84537. // Pages invokes f for each page of results.
  84538. // A non-nil error returned from f will halt the iteration.
  84539. // The provided context supersedes any context provided to the Context method.
  84540. func (c *SubnetworksListUsableCall) Pages(ctx context.Context, f func(*UsableSubnetworksAggregatedList) error) error {
  84541. c.ctx_ = ctx
  84542. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  84543. for {
  84544. x, err := c.Do()
  84545. if err != nil {
  84546. return err
  84547. }
  84548. if err := f(x); err != nil {
  84549. return err
  84550. }
  84551. if x.NextPageToken == "" {
  84552. return nil
  84553. }
  84554. c.PageToken(x.NextPageToken)
  84555. }
  84556. }
  84557. // method id "compute.subnetworks.patch":
  84558. type SubnetworksPatchCall struct {
  84559. s *Service
  84560. project string
  84561. region string
  84562. subnetwork string
  84563. subnetwork2 *Subnetwork
  84564. urlParams_ gensupport.URLParams
  84565. ctx_ context.Context
  84566. header_ http.Header
  84567. }
  84568. // Patch: Patches the specified subnetwork with the data included in the
  84569. // request. Only certain fields can up updated with a patch request as
  84570. // indicated in the field descriptions. You must specify the current
  84571. // fingeprint of the subnetwork resource being patched.
  84572. func (r *SubnetworksService) Patch(project string, region string, subnetwork string, subnetwork2 *Subnetwork) *SubnetworksPatchCall {
  84573. c := &SubnetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84574. c.project = project
  84575. c.region = region
  84576. c.subnetwork = subnetwork
  84577. c.subnetwork2 = subnetwork2
  84578. return c
  84579. }
  84580. // RequestId sets the optional parameter "requestId": An optional
  84581. // request ID to identify requests. Specify a unique request ID so that
  84582. // if you must retry your request, the server will know to ignore the
  84583. // request if it has already been completed.
  84584. //
  84585. // For example, consider a situation where you make an initial request
  84586. // and the request times out. If you make the request again with the
  84587. // same request ID, the server can check if original operation with the
  84588. // same request ID was received, and if so, will ignore the second
  84589. // request. This prevents clients from accidentally creating duplicate
  84590. // commitments.
  84591. //
  84592. // The request ID must be a valid UUID with the exception that zero UUID
  84593. // is not supported (00000000-0000-0000-0000-000000000000).
  84594. func (c *SubnetworksPatchCall) RequestId(requestId string) *SubnetworksPatchCall {
  84595. c.urlParams_.Set("requestId", requestId)
  84596. return c
  84597. }
  84598. // Fields allows partial responses to be retrieved. See
  84599. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84600. // for more information.
  84601. func (c *SubnetworksPatchCall) Fields(s ...googleapi.Field) *SubnetworksPatchCall {
  84602. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84603. return c
  84604. }
  84605. // Context sets the context to be used in this call's Do method. Any
  84606. // pending HTTP request will be aborted if the provided context is
  84607. // canceled.
  84608. func (c *SubnetworksPatchCall) Context(ctx context.Context) *SubnetworksPatchCall {
  84609. c.ctx_ = ctx
  84610. return c
  84611. }
  84612. // Header returns an http.Header that can be modified by the caller to
  84613. // add HTTP headers to the request.
  84614. func (c *SubnetworksPatchCall) Header() http.Header {
  84615. if c.header_ == nil {
  84616. c.header_ = make(http.Header)
  84617. }
  84618. return c.header_
  84619. }
  84620. func (c *SubnetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  84621. reqHeaders := make(http.Header)
  84622. for k, v := range c.header_ {
  84623. reqHeaders[k] = v
  84624. }
  84625. reqHeaders.Set("User-Agent", c.s.userAgent())
  84626. var body io.Reader = nil
  84627. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork2)
  84628. if err != nil {
  84629. return nil, err
  84630. }
  84631. reqHeaders.Set("Content-Type", "application/json")
  84632. c.urlParams_.Set("alt", alt)
  84633. c.urlParams_.Set("prettyPrint", "false")
  84634. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  84635. urls += "?" + c.urlParams_.Encode()
  84636. req, err := http.NewRequest("PATCH", urls, body)
  84637. if err != nil {
  84638. return nil, err
  84639. }
  84640. req.Header = reqHeaders
  84641. googleapi.Expand(req.URL, map[string]string{
  84642. "project": c.project,
  84643. "region": c.region,
  84644. "subnetwork": c.subnetwork,
  84645. })
  84646. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84647. }
  84648. // Do executes the "compute.subnetworks.patch" call.
  84649. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84650. // status code is an error. Response headers are in either
  84651. // *Operation.ServerResponse.Header or (if a response was returned at
  84652. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84653. // to check whether the returned error was because
  84654. // http.StatusNotModified was returned.
  84655. func (c *SubnetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84656. gensupport.SetOptions(c.urlParams_, opts...)
  84657. res, err := c.doRequest("json")
  84658. if res != nil && res.StatusCode == http.StatusNotModified {
  84659. if res.Body != nil {
  84660. res.Body.Close()
  84661. }
  84662. return nil, &googleapi.Error{
  84663. Code: res.StatusCode,
  84664. Header: res.Header,
  84665. }
  84666. }
  84667. if err != nil {
  84668. return nil, err
  84669. }
  84670. defer googleapi.CloseBody(res)
  84671. if err := googleapi.CheckResponse(res); err != nil {
  84672. return nil, err
  84673. }
  84674. ret := &Operation{
  84675. ServerResponse: googleapi.ServerResponse{
  84676. Header: res.Header,
  84677. HTTPStatusCode: res.StatusCode,
  84678. },
  84679. }
  84680. target := &ret
  84681. if err := gensupport.DecodeResponse(target, res); err != nil {
  84682. return nil, err
  84683. }
  84684. return ret, nil
  84685. // {
  84686. // "description": "Patches the specified subnetwork with the data included in the request. Only certain fields can up updated with a patch request as indicated in the field descriptions. You must specify the current fingeprint of the subnetwork resource being patched.",
  84687. // "httpMethod": "PATCH",
  84688. // "id": "compute.subnetworks.patch",
  84689. // "parameterOrder": [
  84690. // "project",
  84691. // "region",
  84692. // "subnetwork"
  84693. // ],
  84694. // "parameters": {
  84695. // "project": {
  84696. // "description": "Project ID for this request.",
  84697. // "location": "path",
  84698. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84699. // "required": true,
  84700. // "type": "string"
  84701. // },
  84702. // "region": {
  84703. // "description": "Name of the region scoping this request.",
  84704. // "location": "path",
  84705. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84706. // "required": true,
  84707. // "type": "string"
  84708. // },
  84709. // "requestId": {
  84710. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84711. // "location": "query",
  84712. // "type": "string"
  84713. // },
  84714. // "subnetwork": {
  84715. // "description": "Name of the Subnetwork resource to patch.",
  84716. // "location": "path",
  84717. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84718. // "required": true,
  84719. // "type": "string"
  84720. // }
  84721. // },
  84722. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  84723. // "request": {
  84724. // "$ref": "Subnetwork"
  84725. // },
  84726. // "response": {
  84727. // "$ref": "Operation"
  84728. // },
  84729. // "scopes": [
  84730. // "https://www.googleapis.com/auth/cloud-platform",
  84731. // "https://www.googleapis.com/auth/compute"
  84732. // ]
  84733. // }
  84734. }
  84735. // method id "compute.subnetworks.setIamPolicy":
  84736. type SubnetworksSetIamPolicyCall struct {
  84737. s *Service
  84738. project string
  84739. region string
  84740. resource string
  84741. regionsetpolicyrequest *RegionSetPolicyRequest
  84742. urlParams_ gensupport.URLParams
  84743. ctx_ context.Context
  84744. header_ http.Header
  84745. }
  84746. // SetIamPolicy: Sets the access control policy on the specified
  84747. // resource. Replaces any existing policy.
  84748. func (r *SubnetworksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *SubnetworksSetIamPolicyCall {
  84749. c := &SubnetworksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84750. c.project = project
  84751. c.region = region
  84752. c.resource = resource
  84753. c.regionsetpolicyrequest = regionsetpolicyrequest
  84754. return c
  84755. }
  84756. // Fields allows partial responses to be retrieved. See
  84757. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84758. // for more information.
  84759. func (c *SubnetworksSetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksSetIamPolicyCall {
  84760. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84761. return c
  84762. }
  84763. // Context sets the context to be used in this call's Do method. Any
  84764. // pending HTTP request will be aborted if the provided context is
  84765. // canceled.
  84766. func (c *SubnetworksSetIamPolicyCall) Context(ctx context.Context) *SubnetworksSetIamPolicyCall {
  84767. c.ctx_ = ctx
  84768. return c
  84769. }
  84770. // Header returns an http.Header that can be modified by the caller to
  84771. // add HTTP headers to the request.
  84772. func (c *SubnetworksSetIamPolicyCall) Header() http.Header {
  84773. if c.header_ == nil {
  84774. c.header_ = make(http.Header)
  84775. }
  84776. return c.header_
  84777. }
  84778. func (c *SubnetworksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  84779. reqHeaders := make(http.Header)
  84780. for k, v := range c.header_ {
  84781. reqHeaders[k] = v
  84782. }
  84783. reqHeaders.Set("User-Agent", c.s.userAgent())
  84784. var body io.Reader = nil
  84785. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  84786. if err != nil {
  84787. return nil, err
  84788. }
  84789. reqHeaders.Set("Content-Type", "application/json")
  84790. c.urlParams_.Set("alt", alt)
  84791. c.urlParams_.Set("prettyPrint", "false")
  84792. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy")
  84793. urls += "?" + c.urlParams_.Encode()
  84794. req, err := http.NewRequest("POST", urls, body)
  84795. if err != nil {
  84796. return nil, err
  84797. }
  84798. req.Header = reqHeaders
  84799. googleapi.Expand(req.URL, map[string]string{
  84800. "project": c.project,
  84801. "region": c.region,
  84802. "resource": c.resource,
  84803. })
  84804. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84805. }
  84806. // Do executes the "compute.subnetworks.setIamPolicy" call.
  84807. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  84808. // code is an error. Response headers are in either
  84809. // *Policy.ServerResponse.Header or (if a response was returned at all)
  84810. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  84811. // check whether the returned error was because http.StatusNotModified
  84812. // was returned.
  84813. func (c *SubnetworksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  84814. gensupport.SetOptions(c.urlParams_, opts...)
  84815. res, err := c.doRequest("json")
  84816. if res != nil && res.StatusCode == http.StatusNotModified {
  84817. if res.Body != nil {
  84818. res.Body.Close()
  84819. }
  84820. return nil, &googleapi.Error{
  84821. Code: res.StatusCode,
  84822. Header: res.Header,
  84823. }
  84824. }
  84825. if err != nil {
  84826. return nil, err
  84827. }
  84828. defer googleapi.CloseBody(res)
  84829. if err := googleapi.CheckResponse(res); err != nil {
  84830. return nil, err
  84831. }
  84832. ret := &Policy{
  84833. ServerResponse: googleapi.ServerResponse{
  84834. Header: res.Header,
  84835. HTTPStatusCode: res.StatusCode,
  84836. },
  84837. }
  84838. target := &ret
  84839. if err := gensupport.DecodeResponse(target, res); err != nil {
  84840. return nil, err
  84841. }
  84842. return ret, nil
  84843. // {
  84844. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  84845. // "httpMethod": "POST",
  84846. // "id": "compute.subnetworks.setIamPolicy",
  84847. // "parameterOrder": [
  84848. // "project",
  84849. // "region",
  84850. // "resource"
  84851. // ],
  84852. // "parameters": {
  84853. // "project": {
  84854. // "description": "Project ID for this request.",
  84855. // "location": "path",
  84856. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84857. // "required": true,
  84858. // "type": "string"
  84859. // },
  84860. // "region": {
  84861. // "description": "The name of the region for this request.",
  84862. // "location": "path",
  84863. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84864. // "required": true,
  84865. // "type": "string"
  84866. // },
  84867. // "resource": {
  84868. // "description": "Name or id of the resource for this request.",
  84869. // "location": "path",
  84870. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84871. // "required": true,
  84872. // "type": "string"
  84873. // }
  84874. // },
  84875. // "path": "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
  84876. // "request": {
  84877. // "$ref": "RegionSetPolicyRequest"
  84878. // },
  84879. // "response": {
  84880. // "$ref": "Policy"
  84881. // },
  84882. // "scopes": [
  84883. // "https://www.googleapis.com/auth/cloud-platform",
  84884. // "https://www.googleapis.com/auth/compute"
  84885. // ]
  84886. // }
  84887. }
  84888. // method id "compute.subnetworks.setPrivateIpGoogleAccess":
  84889. type SubnetworksSetPrivateIpGoogleAccessCall struct {
  84890. s *Service
  84891. project string
  84892. region string
  84893. subnetwork string
  84894. subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest
  84895. urlParams_ gensupport.URLParams
  84896. ctx_ context.Context
  84897. header_ http.Header
  84898. }
  84899. // SetPrivateIpGoogleAccess: Set whether VMs in this subnet can access
  84900. // Google services without assigning external IP addresses through
  84901. // Private Google Access.
  84902. func (r *SubnetworksService) SetPrivateIpGoogleAccess(project string, region string, subnetwork string, subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest) *SubnetworksSetPrivateIpGoogleAccessCall {
  84903. c := &SubnetworksSetPrivateIpGoogleAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84904. c.project = project
  84905. c.region = region
  84906. c.subnetwork = subnetwork
  84907. c.subnetworkssetprivateipgoogleaccessrequest = subnetworkssetprivateipgoogleaccessrequest
  84908. return c
  84909. }
  84910. // RequestId sets the optional parameter "requestId": An optional
  84911. // request ID to identify requests. Specify a unique request ID so that
  84912. // if you must retry your request, the server will know to ignore the
  84913. // request if it has already been completed.
  84914. //
  84915. // For example, consider a situation where you make an initial request
  84916. // and the request times out. If you make the request again with the
  84917. // same request ID, the server can check if original operation with the
  84918. // same request ID was received, and if so, will ignore the second
  84919. // request. This prevents clients from accidentally creating duplicate
  84920. // commitments.
  84921. //
  84922. // The request ID must be a valid UUID with the exception that zero UUID
  84923. // is not supported (00000000-0000-0000-0000-000000000000).
  84924. func (c *SubnetworksSetPrivateIpGoogleAccessCall) RequestId(requestId string) *SubnetworksSetPrivateIpGoogleAccessCall {
  84925. c.urlParams_.Set("requestId", requestId)
  84926. return c
  84927. }
  84928. // Fields allows partial responses to be retrieved. See
  84929. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84930. // for more information.
  84931. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Fields(s ...googleapi.Field) *SubnetworksSetPrivateIpGoogleAccessCall {
  84932. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84933. return c
  84934. }
  84935. // Context sets the context to be used in this call's Do method. Any
  84936. // pending HTTP request will be aborted if the provided context is
  84937. // canceled.
  84938. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Context(ctx context.Context) *SubnetworksSetPrivateIpGoogleAccessCall {
  84939. c.ctx_ = ctx
  84940. return c
  84941. }
  84942. // Header returns an http.Header that can be modified by the caller to
  84943. // add HTTP headers to the request.
  84944. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header {
  84945. if c.header_ == nil {
  84946. c.header_ = make(http.Header)
  84947. }
  84948. return c.header_
  84949. }
  84950. func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) {
  84951. reqHeaders := make(http.Header)
  84952. for k, v := range c.header_ {
  84953. reqHeaders[k] = v
  84954. }
  84955. reqHeaders.Set("User-Agent", c.s.userAgent())
  84956. var body io.Reader = nil
  84957. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest)
  84958. if err != nil {
  84959. return nil, err
  84960. }
  84961. reqHeaders.Set("Content-Type", "application/json")
  84962. c.urlParams_.Set("alt", alt)
  84963. c.urlParams_.Set("prettyPrint", "false")
  84964. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")
  84965. urls += "?" + c.urlParams_.Encode()
  84966. req, err := http.NewRequest("POST", urls, body)
  84967. if err != nil {
  84968. return nil, err
  84969. }
  84970. req.Header = reqHeaders
  84971. googleapi.Expand(req.URL, map[string]string{
  84972. "project": c.project,
  84973. "region": c.region,
  84974. "subnetwork": c.subnetwork,
  84975. })
  84976. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84977. }
  84978. // Do executes the "compute.subnetworks.setPrivateIpGoogleAccess" call.
  84979. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84980. // status code is an error. Response headers are in either
  84981. // *Operation.ServerResponse.Header or (if a response was returned at
  84982. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84983. // to check whether the returned error was because
  84984. // http.StatusNotModified was returned.
  84985. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84986. gensupport.SetOptions(c.urlParams_, opts...)
  84987. res, err := c.doRequest("json")
  84988. if res != nil && res.StatusCode == http.StatusNotModified {
  84989. if res.Body != nil {
  84990. res.Body.Close()
  84991. }
  84992. return nil, &googleapi.Error{
  84993. Code: res.StatusCode,
  84994. Header: res.Header,
  84995. }
  84996. }
  84997. if err != nil {
  84998. return nil, err
  84999. }
  85000. defer googleapi.CloseBody(res)
  85001. if err := googleapi.CheckResponse(res); err != nil {
  85002. return nil, err
  85003. }
  85004. ret := &Operation{
  85005. ServerResponse: googleapi.ServerResponse{
  85006. Header: res.Header,
  85007. HTTPStatusCode: res.StatusCode,
  85008. },
  85009. }
  85010. target := &ret
  85011. if err := gensupport.DecodeResponse(target, res); err != nil {
  85012. return nil, err
  85013. }
  85014. return ret, nil
  85015. // {
  85016. // "description": "Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.",
  85017. // "httpMethod": "POST",
  85018. // "id": "compute.subnetworks.setPrivateIpGoogleAccess",
  85019. // "parameterOrder": [
  85020. // "project",
  85021. // "region",
  85022. // "subnetwork"
  85023. // ],
  85024. // "parameters": {
  85025. // "project": {
  85026. // "description": "Project ID for this request.",
  85027. // "location": "path",
  85028. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85029. // "required": true,
  85030. // "type": "string"
  85031. // },
  85032. // "region": {
  85033. // "description": "Name of the region scoping this request.",
  85034. // "location": "path",
  85035. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85036. // "required": true,
  85037. // "type": "string"
  85038. // },
  85039. // "requestId": {
  85040. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85041. // "location": "query",
  85042. // "type": "string"
  85043. // },
  85044. // "subnetwork": {
  85045. // "description": "Name of the Subnetwork resource.",
  85046. // "location": "path",
  85047. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  85048. // "required": true,
  85049. // "type": "string"
  85050. // }
  85051. // },
  85052. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
  85053. // "request": {
  85054. // "$ref": "SubnetworksSetPrivateIpGoogleAccessRequest"
  85055. // },
  85056. // "response": {
  85057. // "$ref": "Operation"
  85058. // },
  85059. // "scopes": [
  85060. // "https://www.googleapis.com/auth/cloud-platform",
  85061. // "https://www.googleapis.com/auth/compute"
  85062. // ]
  85063. // }
  85064. }
  85065. // method id "compute.subnetworks.testIamPermissions":
  85066. type SubnetworksTestIamPermissionsCall struct {
  85067. s *Service
  85068. project string
  85069. region string
  85070. resource string
  85071. testpermissionsrequest *TestPermissionsRequest
  85072. urlParams_ gensupport.URLParams
  85073. ctx_ context.Context
  85074. header_ http.Header
  85075. }
  85076. // TestIamPermissions: Returns permissions that a caller has on the
  85077. // specified resource.
  85078. func (r *SubnetworksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *SubnetworksTestIamPermissionsCall {
  85079. c := &SubnetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85080. c.project = project
  85081. c.region = region
  85082. c.resource = resource
  85083. c.testpermissionsrequest = testpermissionsrequest
  85084. return c
  85085. }
  85086. // Fields allows partial responses to be retrieved. See
  85087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85088. // for more information.
  85089. func (c *SubnetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *SubnetworksTestIamPermissionsCall {
  85090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85091. return c
  85092. }
  85093. // Context sets the context to be used in this call's Do method. Any
  85094. // pending HTTP request will be aborted if the provided context is
  85095. // canceled.
  85096. func (c *SubnetworksTestIamPermissionsCall) Context(ctx context.Context) *SubnetworksTestIamPermissionsCall {
  85097. c.ctx_ = ctx
  85098. return c
  85099. }
  85100. // Header returns an http.Header that can be modified by the caller to
  85101. // add HTTP headers to the request.
  85102. func (c *SubnetworksTestIamPermissionsCall) Header() http.Header {
  85103. if c.header_ == nil {
  85104. c.header_ = make(http.Header)
  85105. }
  85106. return c.header_
  85107. }
  85108. func (c *SubnetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  85109. reqHeaders := make(http.Header)
  85110. for k, v := range c.header_ {
  85111. reqHeaders[k] = v
  85112. }
  85113. reqHeaders.Set("User-Agent", c.s.userAgent())
  85114. var body io.Reader = nil
  85115. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  85116. if err != nil {
  85117. return nil, err
  85118. }
  85119. reqHeaders.Set("Content-Type", "application/json")
  85120. c.urlParams_.Set("alt", alt)
  85121. c.urlParams_.Set("prettyPrint", "false")
  85122. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions")
  85123. urls += "?" + c.urlParams_.Encode()
  85124. req, err := http.NewRequest("POST", urls, body)
  85125. if err != nil {
  85126. return nil, err
  85127. }
  85128. req.Header = reqHeaders
  85129. googleapi.Expand(req.URL, map[string]string{
  85130. "project": c.project,
  85131. "region": c.region,
  85132. "resource": c.resource,
  85133. })
  85134. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85135. }
  85136. // Do executes the "compute.subnetworks.testIamPermissions" call.
  85137. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  85138. // non-2xx status code is an error. Response headers are in either
  85139. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  85140. // returned at all) in error.(*googleapi.Error).Header. Use
  85141. // googleapi.IsNotModified to check whether the returned error was
  85142. // because http.StatusNotModified was returned.
  85143. func (c *SubnetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  85144. gensupport.SetOptions(c.urlParams_, opts...)
  85145. res, err := c.doRequest("json")
  85146. if res != nil && res.StatusCode == http.StatusNotModified {
  85147. if res.Body != nil {
  85148. res.Body.Close()
  85149. }
  85150. return nil, &googleapi.Error{
  85151. Code: res.StatusCode,
  85152. Header: res.Header,
  85153. }
  85154. }
  85155. if err != nil {
  85156. return nil, err
  85157. }
  85158. defer googleapi.CloseBody(res)
  85159. if err := googleapi.CheckResponse(res); err != nil {
  85160. return nil, err
  85161. }
  85162. ret := &TestPermissionsResponse{
  85163. ServerResponse: googleapi.ServerResponse{
  85164. Header: res.Header,
  85165. HTTPStatusCode: res.StatusCode,
  85166. },
  85167. }
  85168. target := &ret
  85169. if err := gensupport.DecodeResponse(target, res); err != nil {
  85170. return nil, err
  85171. }
  85172. return ret, nil
  85173. // {
  85174. // "description": "Returns permissions that a caller has on the specified resource.",
  85175. // "httpMethod": "POST",
  85176. // "id": "compute.subnetworks.testIamPermissions",
  85177. // "parameterOrder": [
  85178. // "project",
  85179. // "region",
  85180. // "resource"
  85181. // ],
  85182. // "parameters": {
  85183. // "project": {
  85184. // "description": "Project ID for this request.",
  85185. // "location": "path",
  85186. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85187. // "required": true,
  85188. // "type": "string"
  85189. // },
  85190. // "region": {
  85191. // "description": "The name of the region for this request.",
  85192. // "location": "path",
  85193. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85194. // "required": true,
  85195. // "type": "string"
  85196. // },
  85197. // "resource": {
  85198. // "description": "Name or id of the resource for this request.",
  85199. // "location": "path",
  85200. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  85201. // "required": true,
  85202. // "type": "string"
  85203. // }
  85204. // },
  85205. // "path": "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
  85206. // "request": {
  85207. // "$ref": "TestPermissionsRequest"
  85208. // },
  85209. // "response": {
  85210. // "$ref": "TestPermissionsResponse"
  85211. // },
  85212. // "scopes": [
  85213. // "https://www.googleapis.com/auth/cloud-platform",
  85214. // "https://www.googleapis.com/auth/compute",
  85215. // "https://www.googleapis.com/auth/compute.readonly"
  85216. // ]
  85217. // }
  85218. }
  85219. // method id "compute.targetHttpProxies.delete":
  85220. type TargetHttpProxiesDeleteCall struct {
  85221. s *Service
  85222. project string
  85223. targetHttpProxy string
  85224. urlParams_ gensupport.URLParams
  85225. ctx_ context.Context
  85226. header_ http.Header
  85227. }
  85228. // Delete: Deletes the specified TargetHttpProxy resource.
  85229. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete
  85230. func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall {
  85231. c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85232. c.project = project
  85233. c.targetHttpProxy = targetHttpProxy
  85234. return c
  85235. }
  85236. // RequestId sets the optional parameter "requestId": An optional
  85237. // request ID to identify requests. Specify a unique request ID so that
  85238. // if you must retry your request, the server will know to ignore the
  85239. // request if it has already been completed.
  85240. //
  85241. // For example, consider a situation where you make an initial request
  85242. // and the request times out. If you make the request again with the
  85243. // same request ID, the server can check if original operation with the
  85244. // same request ID was received, and if so, will ignore the second
  85245. // request. This prevents clients from accidentally creating duplicate
  85246. // commitments.
  85247. //
  85248. // The request ID must be a valid UUID with the exception that zero UUID
  85249. // is not supported (00000000-0000-0000-0000-000000000000).
  85250. func (c *TargetHttpProxiesDeleteCall) RequestId(requestId string) *TargetHttpProxiesDeleteCall {
  85251. c.urlParams_.Set("requestId", requestId)
  85252. return c
  85253. }
  85254. // Fields allows partial responses to be retrieved. See
  85255. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85256. // for more information.
  85257. func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall {
  85258. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85259. return c
  85260. }
  85261. // Context sets the context to be used in this call's Do method. Any
  85262. // pending HTTP request will be aborted if the provided context is
  85263. // canceled.
  85264. func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall {
  85265. c.ctx_ = ctx
  85266. return c
  85267. }
  85268. // Header returns an http.Header that can be modified by the caller to
  85269. // add HTTP headers to the request.
  85270. func (c *TargetHttpProxiesDeleteCall) Header() http.Header {
  85271. if c.header_ == nil {
  85272. c.header_ = make(http.Header)
  85273. }
  85274. return c.header_
  85275. }
  85276. func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  85277. reqHeaders := make(http.Header)
  85278. for k, v := range c.header_ {
  85279. reqHeaders[k] = v
  85280. }
  85281. reqHeaders.Set("User-Agent", c.s.userAgent())
  85282. var body io.Reader = nil
  85283. c.urlParams_.Set("alt", alt)
  85284. c.urlParams_.Set("prettyPrint", "false")
  85285. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  85286. urls += "?" + c.urlParams_.Encode()
  85287. req, err := http.NewRequest("DELETE", urls, body)
  85288. if err != nil {
  85289. return nil, err
  85290. }
  85291. req.Header = reqHeaders
  85292. googleapi.Expand(req.URL, map[string]string{
  85293. "project": c.project,
  85294. "targetHttpProxy": c.targetHttpProxy,
  85295. })
  85296. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85297. }
  85298. // Do executes the "compute.targetHttpProxies.delete" call.
  85299. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85300. // status code is an error. Response headers are in either
  85301. // *Operation.ServerResponse.Header or (if a response was returned at
  85302. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85303. // to check whether the returned error was because
  85304. // http.StatusNotModified was returned.
  85305. func (c *TargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85306. gensupport.SetOptions(c.urlParams_, opts...)
  85307. res, err := c.doRequest("json")
  85308. if res != nil && res.StatusCode == http.StatusNotModified {
  85309. if res.Body != nil {
  85310. res.Body.Close()
  85311. }
  85312. return nil, &googleapi.Error{
  85313. Code: res.StatusCode,
  85314. Header: res.Header,
  85315. }
  85316. }
  85317. if err != nil {
  85318. return nil, err
  85319. }
  85320. defer googleapi.CloseBody(res)
  85321. if err := googleapi.CheckResponse(res); err != nil {
  85322. return nil, err
  85323. }
  85324. ret := &Operation{
  85325. ServerResponse: googleapi.ServerResponse{
  85326. Header: res.Header,
  85327. HTTPStatusCode: res.StatusCode,
  85328. },
  85329. }
  85330. target := &ret
  85331. if err := gensupport.DecodeResponse(target, res); err != nil {
  85332. return nil, err
  85333. }
  85334. return ret, nil
  85335. // {
  85336. // "description": "Deletes the specified TargetHttpProxy resource.",
  85337. // "httpMethod": "DELETE",
  85338. // "id": "compute.targetHttpProxies.delete",
  85339. // "parameterOrder": [
  85340. // "project",
  85341. // "targetHttpProxy"
  85342. // ],
  85343. // "parameters": {
  85344. // "project": {
  85345. // "description": "Project ID for this request.",
  85346. // "location": "path",
  85347. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85348. // "required": true,
  85349. // "type": "string"
  85350. // },
  85351. // "requestId": {
  85352. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85353. // "location": "query",
  85354. // "type": "string"
  85355. // },
  85356. // "targetHttpProxy": {
  85357. // "description": "Name of the TargetHttpProxy resource to delete.",
  85358. // "location": "path",
  85359. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  85360. // "required": true,
  85361. // "type": "string"
  85362. // }
  85363. // },
  85364. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  85365. // "response": {
  85366. // "$ref": "Operation"
  85367. // },
  85368. // "scopes": [
  85369. // "https://www.googleapis.com/auth/cloud-platform",
  85370. // "https://www.googleapis.com/auth/compute"
  85371. // ]
  85372. // }
  85373. }
  85374. // method id "compute.targetHttpProxies.get":
  85375. type TargetHttpProxiesGetCall struct {
  85376. s *Service
  85377. project string
  85378. targetHttpProxy string
  85379. urlParams_ gensupport.URLParams
  85380. ifNoneMatch_ string
  85381. ctx_ context.Context
  85382. header_ http.Header
  85383. }
  85384. // Get: Returns the specified TargetHttpProxy resource. Gets a list of
  85385. // available target HTTP proxies by making a list() request.
  85386. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get
  85387. func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall {
  85388. c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85389. c.project = project
  85390. c.targetHttpProxy = targetHttpProxy
  85391. return c
  85392. }
  85393. // Fields allows partial responses to be retrieved. See
  85394. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85395. // for more information.
  85396. func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall {
  85397. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85398. return c
  85399. }
  85400. // IfNoneMatch sets the optional parameter which makes the operation
  85401. // fail if the object's ETag matches the given value. This is useful for
  85402. // getting updates only after the object has changed since the last
  85403. // request. Use googleapi.IsNotModified to check whether the response
  85404. // error from Do is the result of In-None-Match.
  85405. func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall {
  85406. c.ifNoneMatch_ = entityTag
  85407. return c
  85408. }
  85409. // Context sets the context to be used in this call's Do method. Any
  85410. // pending HTTP request will be aborted if the provided context is
  85411. // canceled.
  85412. func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall {
  85413. c.ctx_ = ctx
  85414. return c
  85415. }
  85416. // Header returns an http.Header that can be modified by the caller to
  85417. // add HTTP headers to the request.
  85418. func (c *TargetHttpProxiesGetCall) Header() http.Header {
  85419. if c.header_ == nil {
  85420. c.header_ = make(http.Header)
  85421. }
  85422. return c.header_
  85423. }
  85424. func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  85425. reqHeaders := make(http.Header)
  85426. for k, v := range c.header_ {
  85427. reqHeaders[k] = v
  85428. }
  85429. reqHeaders.Set("User-Agent", c.s.userAgent())
  85430. if c.ifNoneMatch_ != "" {
  85431. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85432. }
  85433. var body io.Reader = nil
  85434. c.urlParams_.Set("alt", alt)
  85435. c.urlParams_.Set("prettyPrint", "false")
  85436. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  85437. urls += "?" + c.urlParams_.Encode()
  85438. req, err := http.NewRequest("GET", urls, body)
  85439. if err != nil {
  85440. return nil, err
  85441. }
  85442. req.Header = reqHeaders
  85443. googleapi.Expand(req.URL, map[string]string{
  85444. "project": c.project,
  85445. "targetHttpProxy": c.targetHttpProxy,
  85446. })
  85447. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85448. }
  85449. // Do executes the "compute.targetHttpProxies.get" call.
  85450. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  85451. // status code is an error. Response headers are in either
  85452. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  85453. // at all) in error.(*googleapi.Error).Header. Use
  85454. // googleapi.IsNotModified to check whether the returned error was
  85455. // because http.StatusNotModified was returned.
  85456. func (c *TargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  85457. gensupport.SetOptions(c.urlParams_, opts...)
  85458. res, err := c.doRequest("json")
  85459. if res != nil && res.StatusCode == http.StatusNotModified {
  85460. if res.Body != nil {
  85461. res.Body.Close()
  85462. }
  85463. return nil, &googleapi.Error{
  85464. Code: res.StatusCode,
  85465. Header: res.Header,
  85466. }
  85467. }
  85468. if err != nil {
  85469. return nil, err
  85470. }
  85471. defer googleapi.CloseBody(res)
  85472. if err := googleapi.CheckResponse(res); err != nil {
  85473. return nil, err
  85474. }
  85475. ret := &TargetHttpProxy{
  85476. ServerResponse: googleapi.ServerResponse{
  85477. Header: res.Header,
  85478. HTTPStatusCode: res.StatusCode,
  85479. },
  85480. }
  85481. target := &ret
  85482. if err := gensupport.DecodeResponse(target, res); err != nil {
  85483. return nil, err
  85484. }
  85485. return ret, nil
  85486. // {
  85487. // "description": "Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request.",
  85488. // "httpMethod": "GET",
  85489. // "id": "compute.targetHttpProxies.get",
  85490. // "parameterOrder": [
  85491. // "project",
  85492. // "targetHttpProxy"
  85493. // ],
  85494. // "parameters": {
  85495. // "project": {
  85496. // "description": "Project ID for this request.",
  85497. // "location": "path",
  85498. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85499. // "required": true,
  85500. // "type": "string"
  85501. // },
  85502. // "targetHttpProxy": {
  85503. // "description": "Name of the TargetHttpProxy resource to return.",
  85504. // "location": "path",
  85505. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  85506. // "required": true,
  85507. // "type": "string"
  85508. // }
  85509. // },
  85510. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  85511. // "response": {
  85512. // "$ref": "TargetHttpProxy"
  85513. // },
  85514. // "scopes": [
  85515. // "https://www.googleapis.com/auth/cloud-platform",
  85516. // "https://www.googleapis.com/auth/compute",
  85517. // "https://www.googleapis.com/auth/compute.readonly"
  85518. // ]
  85519. // }
  85520. }
  85521. // method id "compute.targetHttpProxies.insert":
  85522. type TargetHttpProxiesInsertCall struct {
  85523. s *Service
  85524. project string
  85525. targethttpproxy *TargetHttpProxy
  85526. urlParams_ gensupport.URLParams
  85527. ctx_ context.Context
  85528. header_ http.Header
  85529. }
  85530. // Insert: Creates a TargetHttpProxy resource in the specified project
  85531. // using the data included in the request.
  85532. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert
  85533. func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall {
  85534. c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85535. c.project = project
  85536. c.targethttpproxy = targethttpproxy
  85537. return c
  85538. }
  85539. // RequestId sets the optional parameter "requestId": An optional
  85540. // request ID to identify requests. Specify a unique request ID so that
  85541. // if you must retry your request, the server will know to ignore the
  85542. // request if it has already been completed.
  85543. //
  85544. // For example, consider a situation where you make an initial request
  85545. // and the request times out. If you make the request again with the
  85546. // same request ID, the server can check if original operation with the
  85547. // same request ID was received, and if so, will ignore the second
  85548. // request. This prevents clients from accidentally creating duplicate
  85549. // commitments.
  85550. //
  85551. // The request ID must be a valid UUID with the exception that zero UUID
  85552. // is not supported (00000000-0000-0000-0000-000000000000).
  85553. func (c *TargetHttpProxiesInsertCall) RequestId(requestId string) *TargetHttpProxiesInsertCall {
  85554. c.urlParams_.Set("requestId", requestId)
  85555. return c
  85556. }
  85557. // Fields allows partial responses to be retrieved. See
  85558. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85559. // for more information.
  85560. func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall {
  85561. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85562. return c
  85563. }
  85564. // Context sets the context to be used in this call's Do method. Any
  85565. // pending HTTP request will be aborted if the provided context is
  85566. // canceled.
  85567. func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall {
  85568. c.ctx_ = ctx
  85569. return c
  85570. }
  85571. // Header returns an http.Header that can be modified by the caller to
  85572. // add HTTP headers to the request.
  85573. func (c *TargetHttpProxiesInsertCall) Header() http.Header {
  85574. if c.header_ == nil {
  85575. c.header_ = make(http.Header)
  85576. }
  85577. return c.header_
  85578. }
  85579. func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  85580. reqHeaders := make(http.Header)
  85581. for k, v := range c.header_ {
  85582. reqHeaders[k] = v
  85583. }
  85584. reqHeaders.Set("User-Agent", c.s.userAgent())
  85585. var body io.Reader = nil
  85586. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  85587. if err != nil {
  85588. return nil, err
  85589. }
  85590. reqHeaders.Set("Content-Type", "application/json")
  85591. c.urlParams_.Set("alt", alt)
  85592. c.urlParams_.Set("prettyPrint", "false")
  85593. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  85594. urls += "?" + c.urlParams_.Encode()
  85595. req, err := http.NewRequest("POST", urls, body)
  85596. if err != nil {
  85597. return nil, err
  85598. }
  85599. req.Header = reqHeaders
  85600. googleapi.Expand(req.URL, map[string]string{
  85601. "project": c.project,
  85602. })
  85603. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85604. }
  85605. // Do executes the "compute.targetHttpProxies.insert" call.
  85606. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85607. // status code is an error. Response headers are in either
  85608. // *Operation.ServerResponse.Header or (if a response was returned at
  85609. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85610. // to check whether the returned error was because
  85611. // http.StatusNotModified was returned.
  85612. func (c *TargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85613. gensupport.SetOptions(c.urlParams_, opts...)
  85614. res, err := c.doRequest("json")
  85615. if res != nil && res.StatusCode == http.StatusNotModified {
  85616. if res.Body != nil {
  85617. res.Body.Close()
  85618. }
  85619. return nil, &googleapi.Error{
  85620. Code: res.StatusCode,
  85621. Header: res.Header,
  85622. }
  85623. }
  85624. if err != nil {
  85625. return nil, err
  85626. }
  85627. defer googleapi.CloseBody(res)
  85628. if err := googleapi.CheckResponse(res); err != nil {
  85629. return nil, err
  85630. }
  85631. ret := &Operation{
  85632. ServerResponse: googleapi.ServerResponse{
  85633. Header: res.Header,
  85634. HTTPStatusCode: res.StatusCode,
  85635. },
  85636. }
  85637. target := &ret
  85638. if err := gensupport.DecodeResponse(target, res); err != nil {
  85639. return nil, err
  85640. }
  85641. return ret, nil
  85642. // {
  85643. // "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
  85644. // "httpMethod": "POST",
  85645. // "id": "compute.targetHttpProxies.insert",
  85646. // "parameterOrder": [
  85647. // "project"
  85648. // ],
  85649. // "parameters": {
  85650. // "project": {
  85651. // "description": "Project ID for this request.",
  85652. // "location": "path",
  85653. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85654. // "required": true,
  85655. // "type": "string"
  85656. // },
  85657. // "requestId": {
  85658. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85659. // "location": "query",
  85660. // "type": "string"
  85661. // }
  85662. // },
  85663. // "path": "{project}/global/targetHttpProxies",
  85664. // "request": {
  85665. // "$ref": "TargetHttpProxy"
  85666. // },
  85667. // "response": {
  85668. // "$ref": "Operation"
  85669. // },
  85670. // "scopes": [
  85671. // "https://www.googleapis.com/auth/cloud-platform",
  85672. // "https://www.googleapis.com/auth/compute"
  85673. // ]
  85674. // }
  85675. }
  85676. // method id "compute.targetHttpProxies.list":
  85677. type TargetHttpProxiesListCall struct {
  85678. s *Service
  85679. project string
  85680. urlParams_ gensupport.URLParams
  85681. ifNoneMatch_ string
  85682. ctx_ context.Context
  85683. header_ http.Header
  85684. }
  85685. // List: Retrieves the list of TargetHttpProxy resources available to
  85686. // the specified project.
  85687. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list
  85688. func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall {
  85689. c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85690. c.project = project
  85691. return c
  85692. }
  85693. // Filter sets the optional parameter "filter": A filter expression that
  85694. // filters resources listed in the response. The expression must specify
  85695. // the field name, a comparison operator, and the value that you want to
  85696. // use for filtering. The value must be a string, a number, or a
  85697. // boolean. The comparison operator must be either =, !=, >, or <.
  85698. //
  85699. // For example, if you are filtering Compute Engine instances, you can
  85700. // exclude instances named example-instance by specifying name !=
  85701. // example-instance.
  85702. //
  85703. // You can also filter nested fields. For example, you could specify
  85704. // scheduling.automaticRestart = false to include instances only if they
  85705. // are not scheduled for automatic restarts. You can use filtering on
  85706. // nested fields to filter based on resource labels.
  85707. //
  85708. // To filter on multiple expressions, provide each separate expression
  85709. // within parentheses. For example, (scheduling.automaticRestart = true)
  85710. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85711. // AND expression. However, you can include AND and OR expressions
  85712. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85713. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85714. // true).
  85715. func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall {
  85716. c.urlParams_.Set("filter", filter)
  85717. return c
  85718. }
  85719. // MaxResults sets the optional parameter "maxResults": The maximum
  85720. // number of results per page that should be returned. If the number of
  85721. // available results is larger than maxResults, Compute Engine returns a
  85722. // nextPageToken that can be used to get the next page of results in
  85723. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85724. // (Default: 500)
  85725. func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall {
  85726. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85727. return c
  85728. }
  85729. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85730. // a certain order. By default, results are returned in alphanumerical
  85731. // order based on the resource name.
  85732. //
  85733. // You can also sort results in descending order based on the creation
  85734. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85735. // based on the creationTimestamp field in reverse chronological order
  85736. // (newest result first). Use this to sort resources like operations so
  85737. // that the newest operation is returned first.
  85738. //
  85739. // Currently, only sorting by name or creationTimestamp desc is
  85740. // supported.
  85741. func (c *TargetHttpProxiesListCall) OrderBy(orderBy string) *TargetHttpProxiesListCall {
  85742. c.urlParams_.Set("orderBy", orderBy)
  85743. return c
  85744. }
  85745. // PageToken sets the optional parameter "pageToken": Specifies a page
  85746. // token to use. Set pageToken to the nextPageToken returned by a
  85747. // previous list request to get the next page of results.
  85748. func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall {
  85749. c.urlParams_.Set("pageToken", pageToken)
  85750. return c
  85751. }
  85752. // Fields allows partial responses to be retrieved. See
  85753. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85754. // for more information.
  85755. func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall {
  85756. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85757. return c
  85758. }
  85759. // IfNoneMatch sets the optional parameter which makes the operation
  85760. // fail if the object's ETag matches the given value. This is useful for
  85761. // getting updates only after the object has changed since the last
  85762. // request. Use googleapi.IsNotModified to check whether the response
  85763. // error from Do is the result of In-None-Match.
  85764. func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall {
  85765. c.ifNoneMatch_ = entityTag
  85766. return c
  85767. }
  85768. // Context sets the context to be used in this call's Do method. Any
  85769. // pending HTTP request will be aborted if the provided context is
  85770. // canceled.
  85771. func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall {
  85772. c.ctx_ = ctx
  85773. return c
  85774. }
  85775. // Header returns an http.Header that can be modified by the caller to
  85776. // add HTTP headers to the request.
  85777. func (c *TargetHttpProxiesListCall) Header() http.Header {
  85778. if c.header_ == nil {
  85779. c.header_ = make(http.Header)
  85780. }
  85781. return c.header_
  85782. }
  85783. func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  85784. reqHeaders := make(http.Header)
  85785. for k, v := range c.header_ {
  85786. reqHeaders[k] = v
  85787. }
  85788. reqHeaders.Set("User-Agent", c.s.userAgent())
  85789. if c.ifNoneMatch_ != "" {
  85790. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85791. }
  85792. var body io.Reader = nil
  85793. c.urlParams_.Set("alt", alt)
  85794. c.urlParams_.Set("prettyPrint", "false")
  85795. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  85796. urls += "?" + c.urlParams_.Encode()
  85797. req, err := http.NewRequest("GET", urls, body)
  85798. if err != nil {
  85799. return nil, err
  85800. }
  85801. req.Header = reqHeaders
  85802. googleapi.Expand(req.URL, map[string]string{
  85803. "project": c.project,
  85804. })
  85805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85806. }
  85807. // Do executes the "compute.targetHttpProxies.list" call.
  85808. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  85809. // non-2xx status code is an error. Response headers are in either
  85810. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  85811. // returned at all) in error.(*googleapi.Error).Header. Use
  85812. // googleapi.IsNotModified to check whether the returned error was
  85813. // because http.StatusNotModified was returned.
  85814. func (c *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  85815. gensupport.SetOptions(c.urlParams_, opts...)
  85816. res, err := c.doRequest("json")
  85817. if res != nil && res.StatusCode == http.StatusNotModified {
  85818. if res.Body != nil {
  85819. res.Body.Close()
  85820. }
  85821. return nil, &googleapi.Error{
  85822. Code: res.StatusCode,
  85823. Header: res.Header,
  85824. }
  85825. }
  85826. if err != nil {
  85827. return nil, err
  85828. }
  85829. defer googleapi.CloseBody(res)
  85830. if err := googleapi.CheckResponse(res); err != nil {
  85831. return nil, err
  85832. }
  85833. ret := &TargetHttpProxyList{
  85834. ServerResponse: googleapi.ServerResponse{
  85835. Header: res.Header,
  85836. HTTPStatusCode: res.StatusCode,
  85837. },
  85838. }
  85839. target := &ret
  85840. if err := gensupport.DecodeResponse(target, res); err != nil {
  85841. return nil, err
  85842. }
  85843. return ret, nil
  85844. // {
  85845. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
  85846. // "httpMethod": "GET",
  85847. // "id": "compute.targetHttpProxies.list",
  85848. // "parameterOrder": [
  85849. // "project"
  85850. // ],
  85851. // "parameters": {
  85852. // "filter": {
  85853. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  85854. // "location": "query",
  85855. // "type": "string"
  85856. // },
  85857. // "maxResults": {
  85858. // "default": "500",
  85859. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  85860. // "format": "uint32",
  85861. // "location": "query",
  85862. // "minimum": "0",
  85863. // "type": "integer"
  85864. // },
  85865. // "orderBy": {
  85866. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  85867. // "location": "query",
  85868. // "type": "string"
  85869. // },
  85870. // "pageToken": {
  85871. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  85872. // "location": "query",
  85873. // "type": "string"
  85874. // },
  85875. // "project": {
  85876. // "description": "Project ID for this request.",
  85877. // "location": "path",
  85878. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85879. // "required": true,
  85880. // "type": "string"
  85881. // }
  85882. // },
  85883. // "path": "{project}/global/targetHttpProxies",
  85884. // "response": {
  85885. // "$ref": "TargetHttpProxyList"
  85886. // },
  85887. // "scopes": [
  85888. // "https://www.googleapis.com/auth/cloud-platform",
  85889. // "https://www.googleapis.com/auth/compute",
  85890. // "https://www.googleapis.com/auth/compute.readonly"
  85891. // ]
  85892. // }
  85893. }
  85894. // Pages invokes f for each page of results.
  85895. // A non-nil error returned from f will halt the iteration.
  85896. // The provided context supersedes any context provided to the Context method.
  85897. func (c *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  85898. c.ctx_ = ctx
  85899. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  85900. for {
  85901. x, err := c.Do()
  85902. if err != nil {
  85903. return err
  85904. }
  85905. if err := f(x); err != nil {
  85906. return err
  85907. }
  85908. if x.NextPageToken == "" {
  85909. return nil
  85910. }
  85911. c.PageToken(x.NextPageToken)
  85912. }
  85913. }
  85914. // method id "compute.targetHttpProxies.setUrlMap":
  85915. type TargetHttpProxiesSetUrlMapCall struct {
  85916. s *Service
  85917. project string
  85918. targetHttpProxy string
  85919. urlmapreference *UrlMapReference
  85920. urlParams_ gensupport.URLParams
  85921. ctx_ context.Context
  85922. header_ http.Header
  85923. }
  85924. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  85925. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap
  85926. func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall {
  85927. c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85928. c.project = project
  85929. c.targetHttpProxy = targetHttpProxy
  85930. c.urlmapreference = urlmapreference
  85931. return c
  85932. }
  85933. // RequestId sets the optional parameter "requestId": An optional
  85934. // request ID to identify requests. Specify a unique request ID so that
  85935. // if you must retry your request, the server will know to ignore the
  85936. // request if it has already been completed.
  85937. //
  85938. // For example, consider a situation where you make an initial request
  85939. // and the request times out. If you make the request again with the
  85940. // same request ID, the server can check if original operation with the
  85941. // same request ID was received, and if so, will ignore the second
  85942. // request. This prevents clients from accidentally creating duplicate
  85943. // commitments.
  85944. //
  85945. // The request ID must be a valid UUID with the exception that zero UUID
  85946. // is not supported (00000000-0000-0000-0000-000000000000).
  85947. func (c *TargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpProxiesSetUrlMapCall {
  85948. c.urlParams_.Set("requestId", requestId)
  85949. return c
  85950. }
  85951. // Fields allows partial responses to be retrieved. See
  85952. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85953. // for more information.
  85954. func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall {
  85955. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85956. return c
  85957. }
  85958. // Context sets the context to be used in this call's Do method. Any
  85959. // pending HTTP request will be aborted if the provided context is
  85960. // canceled.
  85961. func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall {
  85962. c.ctx_ = ctx
  85963. return c
  85964. }
  85965. // Header returns an http.Header that can be modified by the caller to
  85966. // add HTTP headers to the request.
  85967. func (c *TargetHttpProxiesSetUrlMapCall) Header() http.Header {
  85968. if c.header_ == nil {
  85969. c.header_ = make(http.Header)
  85970. }
  85971. return c.header_
  85972. }
  85973. func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  85974. reqHeaders := make(http.Header)
  85975. for k, v := range c.header_ {
  85976. reqHeaders[k] = v
  85977. }
  85978. reqHeaders.Set("User-Agent", c.s.userAgent())
  85979. var body io.Reader = nil
  85980. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  85981. if err != nil {
  85982. return nil, err
  85983. }
  85984. reqHeaders.Set("Content-Type", "application/json")
  85985. c.urlParams_.Set("alt", alt)
  85986. c.urlParams_.Set("prettyPrint", "false")
  85987. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  85988. urls += "?" + c.urlParams_.Encode()
  85989. req, err := http.NewRequest("POST", urls, body)
  85990. if err != nil {
  85991. return nil, err
  85992. }
  85993. req.Header = reqHeaders
  85994. googleapi.Expand(req.URL, map[string]string{
  85995. "project": c.project,
  85996. "targetHttpProxy": c.targetHttpProxy,
  85997. })
  85998. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85999. }
  86000. // Do executes the "compute.targetHttpProxies.setUrlMap" call.
  86001. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86002. // status code is an error. Response headers are in either
  86003. // *Operation.ServerResponse.Header or (if a response was returned at
  86004. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86005. // to check whether the returned error was because
  86006. // http.StatusNotModified was returned.
  86007. func (c *TargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86008. gensupport.SetOptions(c.urlParams_, opts...)
  86009. res, err := c.doRequest("json")
  86010. if res != nil && res.StatusCode == http.StatusNotModified {
  86011. if res.Body != nil {
  86012. res.Body.Close()
  86013. }
  86014. return nil, &googleapi.Error{
  86015. Code: res.StatusCode,
  86016. Header: res.Header,
  86017. }
  86018. }
  86019. if err != nil {
  86020. return nil, err
  86021. }
  86022. defer googleapi.CloseBody(res)
  86023. if err := googleapi.CheckResponse(res); err != nil {
  86024. return nil, err
  86025. }
  86026. ret := &Operation{
  86027. ServerResponse: googleapi.ServerResponse{
  86028. Header: res.Header,
  86029. HTTPStatusCode: res.StatusCode,
  86030. },
  86031. }
  86032. target := &ret
  86033. if err := gensupport.DecodeResponse(target, res); err != nil {
  86034. return nil, err
  86035. }
  86036. return ret, nil
  86037. // {
  86038. // "description": "Changes the URL map for TargetHttpProxy.",
  86039. // "httpMethod": "POST",
  86040. // "id": "compute.targetHttpProxies.setUrlMap",
  86041. // "parameterOrder": [
  86042. // "project",
  86043. // "targetHttpProxy"
  86044. // ],
  86045. // "parameters": {
  86046. // "project": {
  86047. // "description": "Project ID for this request.",
  86048. // "location": "path",
  86049. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86050. // "required": true,
  86051. // "type": "string"
  86052. // },
  86053. // "requestId": {
  86054. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86055. // "location": "query",
  86056. // "type": "string"
  86057. // },
  86058. // "targetHttpProxy": {
  86059. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  86060. // "location": "path",
  86061. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  86062. // "required": true,
  86063. // "type": "string"
  86064. // }
  86065. // },
  86066. // "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  86067. // "request": {
  86068. // "$ref": "UrlMapReference"
  86069. // },
  86070. // "response": {
  86071. // "$ref": "Operation"
  86072. // },
  86073. // "scopes": [
  86074. // "https://www.googleapis.com/auth/cloud-platform",
  86075. // "https://www.googleapis.com/auth/compute"
  86076. // ]
  86077. // }
  86078. }
  86079. // method id "compute.targetHttpsProxies.delete":
  86080. type TargetHttpsProxiesDeleteCall struct {
  86081. s *Service
  86082. project string
  86083. targetHttpsProxy string
  86084. urlParams_ gensupport.URLParams
  86085. ctx_ context.Context
  86086. header_ http.Header
  86087. }
  86088. // Delete: Deletes the specified TargetHttpsProxy resource.
  86089. func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall {
  86090. c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86091. c.project = project
  86092. c.targetHttpsProxy = targetHttpsProxy
  86093. return c
  86094. }
  86095. // RequestId sets the optional parameter "requestId": An optional
  86096. // request ID to identify requests. Specify a unique request ID so that
  86097. // if you must retry your request, the server will know to ignore the
  86098. // request if it has already been completed.
  86099. //
  86100. // For example, consider a situation where you make an initial request
  86101. // and the request times out. If you make the request again with the
  86102. // same request ID, the server can check if original operation with the
  86103. // same request ID was received, and if so, will ignore the second
  86104. // request. This prevents clients from accidentally creating duplicate
  86105. // commitments.
  86106. //
  86107. // The request ID must be a valid UUID with the exception that zero UUID
  86108. // is not supported (00000000-0000-0000-0000-000000000000).
  86109. func (c *TargetHttpsProxiesDeleteCall) RequestId(requestId string) *TargetHttpsProxiesDeleteCall {
  86110. c.urlParams_.Set("requestId", requestId)
  86111. return c
  86112. }
  86113. // Fields allows partial responses to be retrieved. See
  86114. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86115. // for more information.
  86116. func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall {
  86117. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86118. return c
  86119. }
  86120. // Context sets the context to be used in this call's Do method. Any
  86121. // pending HTTP request will be aborted if the provided context is
  86122. // canceled.
  86123. func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall {
  86124. c.ctx_ = ctx
  86125. return c
  86126. }
  86127. // Header returns an http.Header that can be modified by the caller to
  86128. // add HTTP headers to the request.
  86129. func (c *TargetHttpsProxiesDeleteCall) Header() http.Header {
  86130. if c.header_ == nil {
  86131. c.header_ = make(http.Header)
  86132. }
  86133. return c.header_
  86134. }
  86135. func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  86136. reqHeaders := make(http.Header)
  86137. for k, v := range c.header_ {
  86138. reqHeaders[k] = v
  86139. }
  86140. reqHeaders.Set("User-Agent", c.s.userAgent())
  86141. var body io.Reader = nil
  86142. c.urlParams_.Set("alt", alt)
  86143. c.urlParams_.Set("prettyPrint", "false")
  86144. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  86145. urls += "?" + c.urlParams_.Encode()
  86146. req, err := http.NewRequest("DELETE", urls, body)
  86147. if err != nil {
  86148. return nil, err
  86149. }
  86150. req.Header = reqHeaders
  86151. googleapi.Expand(req.URL, map[string]string{
  86152. "project": c.project,
  86153. "targetHttpsProxy": c.targetHttpsProxy,
  86154. })
  86155. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86156. }
  86157. // Do executes the "compute.targetHttpsProxies.delete" call.
  86158. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86159. // status code is an error. Response headers are in either
  86160. // *Operation.ServerResponse.Header or (if a response was returned at
  86161. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86162. // to check whether the returned error was because
  86163. // http.StatusNotModified was returned.
  86164. func (c *TargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86165. gensupport.SetOptions(c.urlParams_, opts...)
  86166. res, err := c.doRequest("json")
  86167. if res != nil && res.StatusCode == http.StatusNotModified {
  86168. if res.Body != nil {
  86169. res.Body.Close()
  86170. }
  86171. return nil, &googleapi.Error{
  86172. Code: res.StatusCode,
  86173. Header: res.Header,
  86174. }
  86175. }
  86176. if err != nil {
  86177. return nil, err
  86178. }
  86179. defer googleapi.CloseBody(res)
  86180. if err := googleapi.CheckResponse(res); err != nil {
  86181. return nil, err
  86182. }
  86183. ret := &Operation{
  86184. ServerResponse: googleapi.ServerResponse{
  86185. Header: res.Header,
  86186. HTTPStatusCode: res.StatusCode,
  86187. },
  86188. }
  86189. target := &ret
  86190. if err := gensupport.DecodeResponse(target, res); err != nil {
  86191. return nil, err
  86192. }
  86193. return ret, nil
  86194. // {
  86195. // "description": "Deletes the specified TargetHttpsProxy resource.",
  86196. // "httpMethod": "DELETE",
  86197. // "id": "compute.targetHttpsProxies.delete",
  86198. // "parameterOrder": [
  86199. // "project",
  86200. // "targetHttpsProxy"
  86201. // ],
  86202. // "parameters": {
  86203. // "project": {
  86204. // "description": "Project ID for this request.",
  86205. // "location": "path",
  86206. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86207. // "required": true,
  86208. // "type": "string"
  86209. // },
  86210. // "requestId": {
  86211. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86212. // "location": "query",
  86213. // "type": "string"
  86214. // },
  86215. // "targetHttpsProxy": {
  86216. // "description": "Name of the TargetHttpsProxy resource to delete.",
  86217. // "location": "path",
  86218. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  86219. // "required": true,
  86220. // "type": "string"
  86221. // }
  86222. // },
  86223. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  86224. // "response": {
  86225. // "$ref": "Operation"
  86226. // },
  86227. // "scopes": [
  86228. // "https://www.googleapis.com/auth/cloud-platform",
  86229. // "https://www.googleapis.com/auth/compute"
  86230. // ]
  86231. // }
  86232. }
  86233. // method id "compute.targetHttpsProxies.get":
  86234. type TargetHttpsProxiesGetCall struct {
  86235. s *Service
  86236. project string
  86237. targetHttpsProxy string
  86238. urlParams_ gensupport.URLParams
  86239. ifNoneMatch_ string
  86240. ctx_ context.Context
  86241. header_ http.Header
  86242. }
  86243. // Get: Returns the specified TargetHttpsProxy resource. Gets a list of
  86244. // available target HTTPS proxies by making a list() request.
  86245. func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall {
  86246. c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86247. c.project = project
  86248. c.targetHttpsProxy = targetHttpsProxy
  86249. return c
  86250. }
  86251. // Fields allows partial responses to be retrieved. See
  86252. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86253. // for more information.
  86254. func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall {
  86255. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86256. return c
  86257. }
  86258. // IfNoneMatch sets the optional parameter which makes the operation
  86259. // fail if the object's ETag matches the given value. This is useful for
  86260. // getting updates only after the object has changed since the last
  86261. // request. Use googleapi.IsNotModified to check whether the response
  86262. // error from Do is the result of In-None-Match.
  86263. func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall {
  86264. c.ifNoneMatch_ = entityTag
  86265. return c
  86266. }
  86267. // Context sets the context to be used in this call's Do method. Any
  86268. // pending HTTP request will be aborted if the provided context is
  86269. // canceled.
  86270. func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall {
  86271. c.ctx_ = ctx
  86272. return c
  86273. }
  86274. // Header returns an http.Header that can be modified by the caller to
  86275. // add HTTP headers to the request.
  86276. func (c *TargetHttpsProxiesGetCall) Header() http.Header {
  86277. if c.header_ == nil {
  86278. c.header_ = make(http.Header)
  86279. }
  86280. return c.header_
  86281. }
  86282. func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  86283. reqHeaders := make(http.Header)
  86284. for k, v := range c.header_ {
  86285. reqHeaders[k] = v
  86286. }
  86287. reqHeaders.Set("User-Agent", c.s.userAgent())
  86288. if c.ifNoneMatch_ != "" {
  86289. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86290. }
  86291. var body io.Reader = nil
  86292. c.urlParams_.Set("alt", alt)
  86293. c.urlParams_.Set("prettyPrint", "false")
  86294. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  86295. urls += "?" + c.urlParams_.Encode()
  86296. req, err := http.NewRequest("GET", urls, body)
  86297. if err != nil {
  86298. return nil, err
  86299. }
  86300. req.Header = reqHeaders
  86301. googleapi.Expand(req.URL, map[string]string{
  86302. "project": c.project,
  86303. "targetHttpsProxy": c.targetHttpsProxy,
  86304. })
  86305. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86306. }
  86307. // Do executes the "compute.targetHttpsProxies.get" call.
  86308. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  86309. // non-2xx status code is an error. Response headers are in either
  86310. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  86311. // returned at all) in error.(*googleapi.Error).Header. Use
  86312. // googleapi.IsNotModified to check whether the returned error was
  86313. // because http.StatusNotModified was returned.
  86314. func (c *TargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  86315. gensupport.SetOptions(c.urlParams_, opts...)
  86316. res, err := c.doRequest("json")
  86317. if res != nil && res.StatusCode == http.StatusNotModified {
  86318. if res.Body != nil {
  86319. res.Body.Close()
  86320. }
  86321. return nil, &googleapi.Error{
  86322. Code: res.StatusCode,
  86323. Header: res.Header,
  86324. }
  86325. }
  86326. if err != nil {
  86327. return nil, err
  86328. }
  86329. defer googleapi.CloseBody(res)
  86330. if err := googleapi.CheckResponse(res); err != nil {
  86331. return nil, err
  86332. }
  86333. ret := &TargetHttpsProxy{
  86334. ServerResponse: googleapi.ServerResponse{
  86335. Header: res.Header,
  86336. HTTPStatusCode: res.StatusCode,
  86337. },
  86338. }
  86339. target := &ret
  86340. if err := gensupport.DecodeResponse(target, res); err != nil {
  86341. return nil, err
  86342. }
  86343. return ret, nil
  86344. // {
  86345. // "description": "Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request.",
  86346. // "httpMethod": "GET",
  86347. // "id": "compute.targetHttpsProxies.get",
  86348. // "parameterOrder": [
  86349. // "project",
  86350. // "targetHttpsProxy"
  86351. // ],
  86352. // "parameters": {
  86353. // "project": {
  86354. // "description": "Project ID for this request.",
  86355. // "location": "path",
  86356. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86357. // "required": true,
  86358. // "type": "string"
  86359. // },
  86360. // "targetHttpsProxy": {
  86361. // "description": "Name of the TargetHttpsProxy resource to return.",
  86362. // "location": "path",
  86363. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  86364. // "required": true,
  86365. // "type": "string"
  86366. // }
  86367. // },
  86368. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  86369. // "response": {
  86370. // "$ref": "TargetHttpsProxy"
  86371. // },
  86372. // "scopes": [
  86373. // "https://www.googleapis.com/auth/cloud-platform",
  86374. // "https://www.googleapis.com/auth/compute",
  86375. // "https://www.googleapis.com/auth/compute.readonly"
  86376. // ]
  86377. // }
  86378. }
  86379. // method id "compute.targetHttpsProxies.insert":
  86380. type TargetHttpsProxiesInsertCall struct {
  86381. s *Service
  86382. project string
  86383. targethttpsproxy *TargetHttpsProxy
  86384. urlParams_ gensupport.URLParams
  86385. ctx_ context.Context
  86386. header_ http.Header
  86387. }
  86388. // Insert: Creates a TargetHttpsProxy resource in the specified project
  86389. // using the data included in the request.
  86390. func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall {
  86391. c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86392. c.project = project
  86393. c.targethttpsproxy = targethttpsproxy
  86394. return c
  86395. }
  86396. // RequestId sets the optional parameter "requestId": An optional
  86397. // request ID to identify requests. Specify a unique request ID so that
  86398. // if you must retry your request, the server will know to ignore the
  86399. // request if it has already been completed.
  86400. //
  86401. // For example, consider a situation where you make an initial request
  86402. // and the request times out. If you make the request again with the
  86403. // same request ID, the server can check if original operation with the
  86404. // same request ID was received, and if so, will ignore the second
  86405. // request. This prevents clients from accidentally creating duplicate
  86406. // commitments.
  86407. //
  86408. // The request ID must be a valid UUID with the exception that zero UUID
  86409. // is not supported (00000000-0000-0000-0000-000000000000).
  86410. func (c *TargetHttpsProxiesInsertCall) RequestId(requestId string) *TargetHttpsProxiesInsertCall {
  86411. c.urlParams_.Set("requestId", requestId)
  86412. return c
  86413. }
  86414. // Fields allows partial responses to be retrieved. See
  86415. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86416. // for more information.
  86417. func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall {
  86418. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86419. return c
  86420. }
  86421. // Context sets the context to be used in this call's Do method. Any
  86422. // pending HTTP request will be aborted if the provided context is
  86423. // canceled.
  86424. func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall {
  86425. c.ctx_ = ctx
  86426. return c
  86427. }
  86428. // Header returns an http.Header that can be modified by the caller to
  86429. // add HTTP headers to the request.
  86430. func (c *TargetHttpsProxiesInsertCall) Header() http.Header {
  86431. if c.header_ == nil {
  86432. c.header_ = make(http.Header)
  86433. }
  86434. return c.header_
  86435. }
  86436. func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  86437. reqHeaders := make(http.Header)
  86438. for k, v := range c.header_ {
  86439. reqHeaders[k] = v
  86440. }
  86441. reqHeaders.Set("User-Agent", c.s.userAgent())
  86442. var body io.Reader = nil
  86443. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  86444. if err != nil {
  86445. return nil, err
  86446. }
  86447. reqHeaders.Set("Content-Type", "application/json")
  86448. c.urlParams_.Set("alt", alt)
  86449. c.urlParams_.Set("prettyPrint", "false")
  86450. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  86451. urls += "?" + c.urlParams_.Encode()
  86452. req, err := http.NewRequest("POST", urls, body)
  86453. if err != nil {
  86454. return nil, err
  86455. }
  86456. req.Header = reqHeaders
  86457. googleapi.Expand(req.URL, map[string]string{
  86458. "project": c.project,
  86459. })
  86460. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86461. }
  86462. // Do executes the "compute.targetHttpsProxies.insert" call.
  86463. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86464. // status code is an error. Response headers are in either
  86465. // *Operation.ServerResponse.Header or (if a response was returned at
  86466. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86467. // to check whether the returned error was because
  86468. // http.StatusNotModified was returned.
  86469. func (c *TargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86470. gensupport.SetOptions(c.urlParams_, opts...)
  86471. res, err := c.doRequest("json")
  86472. if res != nil && res.StatusCode == http.StatusNotModified {
  86473. if res.Body != nil {
  86474. res.Body.Close()
  86475. }
  86476. return nil, &googleapi.Error{
  86477. Code: res.StatusCode,
  86478. Header: res.Header,
  86479. }
  86480. }
  86481. if err != nil {
  86482. return nil, err
  86483. }
  86484. defer googleapi.CloseBody(res)
  86485. if err := googleapi.CheckResponse(res); err != nil {
  86486. return nil, err
  86487. }
  86488. ret := &Operation{
  86489. ServerResponse: googleapi.ServerResponse{
  86490. Header: res.Header,
  86491. HTTPStatusCode: res.StatusCode,
  86492. },
  86493. }
  86494. target := &ret
  86495. if err := gensupport.DecodeResponse(target, res); err != nil {
  86496. return nil, err
  86497. }
  86498. return ret, nil
  86499. // {
  86500. // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
  86501. // "httpMethod": "POST",
  86502. // "id": "compute.targetHttpsProxies.insert",
  86503. // "parameterOrder": [
  86504. // "project"
  86505. // ],
  86506. // "parameters": {
  86507. // "project": {
  86508. // "description": "Project ID for this request.",
  86509. // "location": "path",
  86510. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86511. // "required": true,
  86512. // "type": "string"
  86513. // },
  86514. // "requestId": {
  86515. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86516. // "location": "query",
  86517. // "type": "string"
  86518. // }
  86519. // },
  86520. // "path": "{project}/global/targetHttpsProxies",
  86521. // "request": {
  86522. // "$ref": "TargetHttpsProxy"
  86523. // },
  86524. // "response": {
  86525. // "$ref": "Operation"
  86526. // },
  86527. // "scopes": [
  86528. // "https://www.googleapis.com/auth/cloud-platform",
  86529. // "https://www.googleapis.com/auth/compute"
  86530. // ]
  86531. // }
  86532. }
  86533. // method id "compute.targetHttpsProxies.list":
  86534. type TargetHttpsProxiesListCall struct {
  86535. s *Service
  86536. project string
  86537. urlParams_ gensupport.URLParams
  86538. ifNoneMatch_ string
  86539. ctx_ context.Context
  86540. header_ http.Header
  86541. }
  86542. // List: Retrieves the list of TargetHttpsProxy resources available to
  86543. // the specified project.
  86544. func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall {
  86545. c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86546. c.project = project
  86547. return c
  86548. }
  86549. // Filter sets the optional parameter "filter": A filter expression that
  86550. // filters resources listed in the response. The expression must specify
  86551. // the field name, a comparison operator, and the value that you want to
  86552. // use for filtering. The value must be a string, a number, or a
  86553. // boolean. The comparison operator must be either =, !=, >, or <.
  86554. //
  86555. // For example, if you are filtering Compute Engine instances, you can
  86556. // exclude instances named example-instance by specifying name !=
  86557. // example-instance.
  86558. //
  86559. // You can also filter nested fields. For example, you could specify
  86560. // scheduling.automaticRestart = false to include instances only if they
  86561. // are not scheduled for automatic restarts. You can use filtering on
  86562. // nested fields to filter based on resource labels.
  86563. //
  86564. // To filter on multiple expressions, provide each separate expression
  86565. // within parentheses. For example, (scheduling.automaticRestart = true)
  86566. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  86567. // AND expression. However, you can include AND and OR expressions
  86568. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  86569. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  86570. // true).
  86571. func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall {
  86572. c.urlParams_.Set("filter", filter)
  86573. return c
  86574. }
  86575. // MaxResults sets the optional parameter "maxResults": The maximum
  86576. // number of results per page that should be returned. If the number of
  86577. // available results is larger than maxResults, Compute Engine returns a
  86578. // nextPageToken that can be used to get the next page of results in
  86579. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  86580. // (Default: 500)
  86581. func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall {
  86582. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  86583. return c
  86584. }
  86585. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  86586. // a certain order. By default, results are returned in alphanumerical
  86587. // order based on the resource name.
  86588. //
  86589. // You can also sort results in descending order based on the creation
  86590. // timestamp using orderBy="creationTimestamp desc". This sorts results
  86591. // based on the creationTimestamp field in reverse chronological order
  86592. // (newest result first). Use this to sort resources like operations so
  86593. // that the newest operation is returned first.
  86594. //
  86595. // Currently, only sorting by name or creationTimestamp desc is
  86596. // supported.
  86597. func (c *TargetHttpsProxiesListCall) OrderBy(orderBy string) *TargetHttpsProxiesListCall {
  86598. c.urlParams_.Set("orderBy", orderBy)
  86599. return c
  86600. }
  86601. // PageToken sets the optional parameter "pageToken": Specifies a page
  86602. // token to use. Set pageToken to the nextPageToken returned by a
  86603. // previous list request to get the next page of results.
  86604. func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall {
  86605. c.urlParams_.Set("pageToken", pageToken)
  86606. return c
  86607. }
  86608. // Fields allows partial responses to be retrieved. See
  86609. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86610. // for more information.
  86611. func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall {
  86612. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86613. return c
  86614. }
  86615. // IfNoneMatch sets the optional parameter which makes the operation
  86616. // fail if the object's ETag matches the given value. This is useful for
  86617. // getting updates only after the object has changed since the last
  86618. // request. Use googleapi.IsNotModified to check whether the response
  86619. // error from Do is the result of In-None-Match.
  86620. func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall {
  86621. c.ifNoneMatch_ = entityTag
  86622. return c
  86623. }
  86624. // Context sets the context to be used in this call's Do method. Any
  86625. // pending HTTP request will be aborted if the provided context is
  86626. // canceled.
  86627. func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall {
  86628. c.ctx_ = ctx
  86629. return c
  86630. }
  86631. // Header returns an http.Header that can be modified by the caller to
  86632. // add HTTP headers to the request.
  86633. func (c *TargetHttpsProxiesListCall) Header() http.Header {
  86634. if c.header_ == nil {
  86635. c.header_ = make(http.Header)
  86636. }
  86637. return c.header_
  86638. }
  86639. func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  86640. reqHeaders := make(http.Header)
  86641. for k, v := range c.header_ {
  86642. reqHeaders[k] = v
  86643. }
  86644. reqHeaders.Set("User-Agent", c.s.userAgent())
  86645. if c.ifNoneMatch_ != "" {
  86646. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86647. }
  86648. var body io.Reader = nil
  86649. c.urlParams_.Set("alt", alt)
  86650. c.urlParams_.Set("prettyPrint", "false")
  86651. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  86652. urls += "?" + c.urlParams_.Encode()
  86653. req, err := http.NewRequest("GET", urls, body)
  86654. if err != nil {
  86655. return nil, err
  86656. }
  86657. req.Header = reqHeaders
  86658. googleapi.Expand(req.URL, map[string]string{
  86659. "project": c.project,
  86660. })
  86661. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86662. }
  86663. // Do executes the "compute.targetHttpsProxies.list" call.
  86664. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  86665. // non-2xx status code is an error. Response headers are in either
  86666. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  86667. // returned at all) in error.(*googleapi.Error).Header. Use
  86668. // googleapi.IsNotModified to check whether the returned error was
  86669. // because http.StatusNotModified was returned.
  86670. func (c *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  86671. gensupport.SetOptions(c.urlParams_, opts...)
  86672. res, err := c.doRequest("json")
  86673. if res != nil && res.StatusCode == http.StatusNotModified {
  86674. if res.Body != nil {
  86675. res.Body.Close()
  86676. }
  86677. return nil, &googleapi.Error{
  86678. Code: res.StatusCode,
  86679. Header: res.Header,
  86680. }
  86681. }
  86682. if err != nil {
  86683. return nil, err
  86684. }
  86685. defer googleapi.CloseBody(res)
  86686. if err := googleapi.CheckResponse(res); err != nil {
  86687. return nil, err
  86688. }
  86689. ret := &TargetHttpsProxyList{
  86690. ServerResponse: googleapi.ServerResponse{
  86691. Header: res.Header,
  86692. HTTPStatusCode: res.StatusCode,
  86693. },
  86694. }
  86695. target := &ret
  86696. if err := gensupport.DecodeResponse(target, res); err != nil {
  86697. return nil, err
  86698. }
  86699. return ret, nil
  86700. // {
  86701. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
  86702. // "httpMethod": "GET",
  86703. // "id": "compute.targetHttpsProxies.list",
  86704. // "parameterOrder": [
  86705. // "project"
  86706. // ],
  86707. // "parameters": {
  86708. // "filter": {
  86709. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  86710. // "location": "query",
  86711. // "type": "string"
  86712. // },
  86713. // "maxResults": {
  86714. // "default": "500",
  86715. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  86716. // "format": "uint32",
  86717. // "location": "query",
  86718. // "minimum": "0",
  86719. // "type": "integer"
  86720. // },
  86721. // "orderBy": {
  86722. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  86723. // "location": "query",
  86724. // "type": "string"
  86725. // },
  86726. // "pageToken": {
  86727. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  86728. // "location": "query",
  86729. // "type": "string"
  86730. // },
  86731. // "project": {
  86732. // "description": "Project ID for this request.",
  86733. // "location": "path",
  86734. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86735. // "required": true,
  86736. // "type": "string"
  86737. // }
  86738. // },
  86739. // "path": "{project}/global/targetHttpsProxies",
  86740. // "response": {
  86741. // "$ref": "TargetHttpsProxyList"
  86742. // },
  86743. // "scopes": [
  86744. // "https://www.googleapis.com/auth/cloud-platform",
  86745. // "https://www.googleapis.com/auth/compute",
  86746. // "https://www.googleapis.com/auth/compute.readonly"
  86747. // ]
  86748. // }
  86749. }
  86750. // Pages invokes f for each page of results.
  86751. // A non-nil error returned from f will halt the iteration.
  86752. // The provided context supersedes any context provided to the Context method.
  86753. func (c *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  86754. c.ctx_ = ctx
  86755. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  86756. for {
  86757. x, err := c.Do()
  86758. if err != nil {
  86759. return err
  86760. }
  86761. if err := f(x); err != nil {
  86762. return err
  86763. }
  86764. if x.NextPageToken == "" {
  86765. return nil
  86766. }
  86767. c.PageToken(x.NextPageToken)
  86768. }
  86769. }
  86770. // method id "compute.targetHttpsProxies.setQuicOverride":
  86771. type TargetHttpsProxiesSetQuicOverrideCall struct {
  86772. s *Service
  86773. project string
  86774. targetHttpsProxy string
  86775. targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest
  86776. urlParams_ gensupport.URLParams
  86777. ctx_ context.Context
  86778. header_ http.Header
  86779. }
  86780. // SetQuicOverride: Sets the QUIC override policy for TargetHttpsProxy.
  86781. func (r *TargetHttpsProxiesService) SetQuicOverride(project string, targetHttpsProxy string, targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest) *TargetHttpsProxiesSetQuicOverrideCall {
  86782. c := &TargetHttpsProxiesSetQuicOverrideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86783. c.project = project
  86784. c.targetHttpsProxy = targetHttpsProxy
  86785. c.targethttpsproxiessetquicoverriderequest = targethttpsproxiessetquicoverriderequest
  86786. return c
  86787. }
  86788. // RequestId sets the optional parameter "requestId": An optional
  86789. // request ID to identify requests. Specify a unique request ID so that
  86790. // if you must retry your request, the server will know to ignore the
  86791. // request if it has already been completed.
  86792. //
  86793. // For example, consider a situation where you make an initial request
  86794. // and the request times out. If you make the request again with the
  86795. // same request ID, the server can check if original operation with the
  86796. // same request ID was received, and if so, will ignore the second
  86797. // request. This prevents clients from accidentally creating duplicate
  86798. // commitments.
  86799. //
  86800. // The request ID must be a valid UUID with the exception that zero UUID
  86801. // is not supported (00000000-0000-0000-0000-000000000000).
  86802. func (c *TargetHttpsProxiesSetQuicOverrideCall) RequestId(requestId string) *TargetHttpsProxiesSetQuicOverrideCall {
  86803. c.urlParams_.Set("requestId", requestId)
  86804. return c
  86805. }
  86806. // Fields allows partial responses to be retrieved. See
  86807. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86808. // for more information.
  86809. func (c *TargetHttpsProxiesSetQuicOverrideCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetQuicOverrideCall {
  86810. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86811. return c
  86812. }
  86813. // Context sets the context to be used in this call's Do method. Any
  86814. // pending HTTP request will be aborted if the provided context is
  86815. // canceled.
  86816. func (c *TargetHttpsProxiesSetQuicOverrideCall) Context(ctx context.Context) *TargetHttpsProxiesSetQuicOverrideCall {
  86817. c.ctx_ = ctx
  86818. return c
  86819. }
  86820. // Header returns an http.Header that can be modified by the caller to
  86821. // add HTTP headers to the request.
  86822. func (c *TargetHttpsProxiesSetQuicOverrideCall) Header() http.Header {
  86823. if c.header_ == nil {
  86824. c.header_ = make(http.Header)
  86825. }
  86826. return c.header_
  86827. }
  86828. func (c *TargetHttpsProxiesSetQuicOverrideCall) doRequest(alt string) (*http.Response, error) {
  86829. reqHeaders := make(http.Header)
  86830. for k, v := range c.header_ {
  86831. reqHeaders[k] = v
  86832. }
  86833. reqHeaders.Set("User-Agent", c.s.userAgent())
  86834. var body io.Reader = nil
  86835. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetquicoverriderequest)
  86836. if err != nil {
  86837. return nil, err
  86838. }
  86839. reqHeaders.Set("Content-Type", "application/json")
  86840. c.urlParams_.Set("alt", alt)
  86841. c.urlParams_.Set("prettyPrint", "false")
  86842. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride")
  86843. urls += "?" + c.urlParams_.Encode()
  86844. req, err := http.NewRequest("POST", urls, body)
  86845. if err != nil {
  86846. return nil, err
  86847. }
  86848. req.Header = reqHeaders
  86849. googleapi.Expand(req.URL, map[string]string{
  86850. "project": c.project,
  86851. "targetHttpsProxy": c.targetHttpsProxy,
  86852. })
  86853. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86854. }
  86855. // Do executes the "compute.targetHttpsProxies.setQuicOverride" call.
  86856. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86857. // status code is an error. Response headers are in either
  86858. // *Operation.ServerResponse.Header or (if a response was returned at
  86859. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86860. // to check whether the returned error was because
  86861. // http.StatusNotModified was returned.
  86862. func (c *TargetHttpsProxiesSetQuicOverrideCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86863. gensupport.SetOptions(c.urlParams_, opts...)
  86864. res, err := c.doRequest("json")
  86865. if res != nil && res.StatusCode == http.StatusNotModified {
  86866. if res.Body != nil {
  86867. res.Body.Close()
  86868. }
  86869. return nil, &googleapi.Error{
  86870. Code: res.StatusCode,
  86871. Header: res.Header,
  86872. }
  86873. }
  86874. if err != nil {
  86875. return nil, err
  86876. }
  86877. defer googleapi.CloseBody(res)
  86878. if err := googleapi.CheckResponse(res); err != nil {
  86879. return nil, err
  86880. }
  86881. ret := &Operation{
  86882. ServerResponse: googleapi.ServerResponse{
  86883. Header: res.Header,
  86884. HTTPStatusCode: res.StatusCode,
  86885. },
  86886. }
  86887. target := &ret
  86888. if err := gensupport.DecodeResponse(target, res); err != nil {
  86889. return nil, err
  86890. }
  86891. return ret, nil
  86892. // {
  86893. // "description": "Sets the QUIC override policy for TargetHttpsProxy.",
  86894. // "httpMethod": "POST",
  86895. // "id": "compute.targetHttpsProxies.setQuicOverride",
  86896. // "parameterOrder": [
  86897. // "project",
  86898. // "targetHttpsProxy"
  86899. // ],
  86900. // "parameters": {
  86901. // "project": {
  86902. // "description": "Project ID for this request.",
  86903. // "location": "path",
  86904. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86905. // "required": true,
  86906. // "type": "string"
  86907. // },
  86908. // "requestId": {
  86909. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86910. // "location": "query",
  86911. // "type": "string"
  86912. // },
  86913. // "targetHttpsProxy": {
  86914. // "description": "Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035.",
  86915. // "location": "path",
  86916. // "required": true,
  86917. // "type": "string"
  86918. // }
  86919. // },
  86920. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
  86921. // "request": {
  86922. // "$ref": "TargetHttpsProxiesSetQuicOverrideRequest"
  86923. // },
  86924. // "response": {
  86925. // "$ref": "Operation"
  86926. // },
  86927. // "scopes": [
  86928. // "https://www.googleapis.com/auth/cloud-platform",
  86929. // "https://www.googleapis.com/auth/compute"
  86930. // ]
  86931. // }
  86932. }
  86933. // method id "compute.targetHttpsProxies.setSslCertificates":
  86934. type TargetHttpsProxiesSetSslCertificatesCall struct {
  86935. s *Service
  86936. project string
  86937. targetHttpsProxy string
  86938. targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest
  86939. urlParams_ gensupport.URLParams
  86940. ctx_ context.Context
  86941. header_ http.Header
  86942. }
  86943. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  86944. func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall {
  86945. c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86946. c.project = project
  86947. c.targetHttpsProxy = targetHttpsProxy
  86948. c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest
  86949. return c
  86950. }
  86951. // RequestId sets the optional parameter "requestId": An optional
  86952. // request ID to identify requests. Specify a unique request ID so that
  86953. // if you must retry your request, the server will know to ignore the
  86954. // request if it has already been completed.
  86955. //
  86956. // For example, consider a situation where you make an initial request
  86957. // and the request times out. If you make the request again with the
  86958. // same request ID, the server can check if original operation with the
  86959. // same request ID was received, and if so, will ignore the second
  86960. // request. This prevents clients from accidentally creating duplicate
  86961. // commitments.
  86962. //
  86963. // The request ID must be a valid UUID with the exception that zero UUID
  86964. // is not supported (00000000-0000-0000-0000-000000000000).
  86965. func (c *TargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetHttpsProxiesSetSslCertificatesCall {
  86966. c.urlParams_.Set("requestId", requestId)
  86967. return c
  86968. }
  86969. // Fields allows partial responses to be retrieved. See
  86970. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86971. // for more information.
  86972. func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall {
  86973. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86974. return c
  86975. }
  86976. // Context sets the context to be used in this call's Do method. Any
  86977. // pending HTTP request will be aborted if the provided context is
  86978. // canceled.
  86979. func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall {
  86980. c.ctx_ = ctx
  86981. return c
  86982. }
  86983. // Header returns an http.Header that can be modified by the caller to
  86984. // add HTTP headers to the request.
  86985. func (c *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
  86986. if c.header_ == nil {
  86987. c.header_ = make(http.Header)
  86988. }
  86989. return c.header_
  86990. }
  86991. func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  86992. reqHeaders := make(http.Header)
  86993. for k, v := range c.header_ {
  86994. reqHeaders[k] = v
  86995. }
  86996. reqHeaders.Set("User-Agent", c.s.userAgent())
  86997. var body io.Reader = nil
  86998. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest)
  86999. if err != nil {
  87000. return nil, err
  87001. }
  87002. reqHeaders.Set("Content-Type", "application/json")
  87003. c.urlParams_.Set("alt", alt)
  87004. c.urlParams_.Set("prettyPrint", "false")
  87005. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  87006. urls += "?" + c.urlParams_.Encode()
  87007. req, err := http.NewRequest("POST", urls, body)
  87008. if err != nil {
  87009. return nil, err
  87010. }
  87011. req.Header = reqHeaders
  87012. googleapi.Expand(req.URL, map[string]string{
  87013. "project": c.project,
  87014. "targetHttpsProxy": c.targetHttpsProxy,
  87015. })
  87016. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87017. }
  87018. // Do executes the "compute.targetHttpsProxies.setSslCertificates" call.
  87019. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87020. // status code is an error. Response headers are in either
  87021. // *Operation.ServerResponse.Header or (if a response was returned at
  87022. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87023. // to check whether the returned error was because
  87024. // http.StatusNotModified was returned.
  87025. func (c *TargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87026. gensupport.SetOptions(c.urlParams_, opts...)
  87027. res, err := c.doRequest("json")
  87028. if res != nil && res.StatusCode == http.StatusNotModified {
  87029. if res.Body != nil {
  87030. res.Body.Close()
  87031. }
  87032. return nil, &googleapi.Error{
  87033. Code: res.StatusCode,
  87034. Header: res.Header,
  87035. }
  87036. }
  87037. if err != nil {
  87038. return nil, err
  87039. }
  87040. defer googleapi.CloseBody(res)
  87041. if err := googleapi.CheckResponse(res); err != nil {
  87042. return nil, err
  87043. }
  87044. ret := &Operation{
  87045. ServerResponse: googleapi.ServerResponse{
  87046. Header: res.Header,
  87047. HTTPStatusCode: res.StatusCode,
  87048. },
  87049. }
  87050. target := &ret
  87051. if err := gensupport.DecodeResponse(target, res); err != nil {
  87052. return nil, err
  87053. }
  87054. return ret, nil
  87055. // {
  87056. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  87057. // "httpMethod": "POST",
  87058. // "id": "compute.targetHttpsProxies.setSslCertificates",
  87059. // "parameterOrder": [
  87060. // "project",
  87061. // "targetHttpsProxy"
  87062. // ],
  87063. // "parameters": {
  87064. // "project": {
  87065. // "description": "Project ID for this request.",
  87066. // "location": "path",
  87067. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87068. // "required": true,
  87069. // "type": "string"
  87070. // },
  87071. // "requestId": {
  87072. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87073. // "location": "query",
  87074. // "type": "string"
  87075. // },
  87076. // "targetHttpsProxy": {
  87077. // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
  87078. // "location": "path",
  87079. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87080. // "required": true,
  87081. // "type": "string"
  87082. // }
  87083. // },
  87084. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  87085. // "request": {
  87086. // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
  87087. // },
  87088. // "response": {
  87089. // "$ref": "Operation"
  87090. // },
  87091. // "scopes": [
  87092. // "https://www.googleapis.com/auth/cloud-platform",
  87093. // "https://www.googleapis.com/auth/compute"
  87094. // ]
  87095. // }
  87096. }
  87097. // method id "compute.targetHttpsProxies.setSslPolicy":
  87098. type TargetHttpsProxiesSetSslPolicyCall struct {
  87099. s *Service
  87100. project string
  87101. targetHttpsProxy string
  87102. sslpolicyreference *SslPolicyReference
  87103. urlParams_ gensupport.URLParams
  87104. ctx_ context.Context
  87105. header_ http.Header
  87106. }
  87107. // SetSslPolicy: Sets the SSL policy for TargetHttpsProxy. The SSL
  87108. // policy specifies the server-side support for SSL features. This
  87109. // affects connections between clients and the HTTPS proxy load
  87110. // balancer. They do not affect the connection between the load balancer
  87111. // and the backends.
  87112. func (r *TargetHttpsProxiesService) SetSslPolicy(project string, targetHttpsProxy string, sslpolicyreference *SslPolicyReference) *TargetHttpsProxiesSetSslPolicyCall {
  87113. c := &TargetHttpsProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87114. c.project = project
  87115. c.targetHttpsProxy = targetHttpsProxy
  87116. c.sslpolicyreference = sslpolicyreference
  87117. return c
  87118. }
  87119. // RequestId sets the optional parameter "requestId": An optional
  87120. // request ID to identify requests. Specify a unique request ID so that
  87121. // if you must retry your request, the server will know to ignore the
  87122. // request if it has already been completed.
  87123. //
  87124. // For example, consider a situation where you make an initial request
  87125. // and the request times out. If you make the request again with the
  87126. // same request ID, the server can check if original operation with the
  87127. // same request ID was received, and if so, will ignore the second
  87128. // request. This prevents clients from accidentally creating duplicate
  87129. // commitments.
  87130. //
  87131. // The request ID must be a valid UUID with the exception that zero UUID
  87132. // is not supported (00000000-0000-0000-0000-000000000000).
  87133. func (c *TargetHttpsProxiesSetSslPolicyCall) RequestId(requestId string) *TargetHttpsProxiesSetSslPolicyCall {
  87134. c.urlParams_.Set("requestId", requestId)
  87135. return c
  87136. }
  87137. // Fields allows partial responses to be retrieved. See
  87138. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87139. // for more information.
  87140. func (c *TargetHttpsProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslPolicyCall {
  87141. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87142. return c
  87143. }
  87144. // Context sets the context to be used in this call's Do method. Any
  87145. // pending HTTP request will be aborted if the provided context is
  87146. // canceled.
  87147. func (c *TargetHttpsProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslPolicyCall {
  87148. c.ctx_ = ctx
  87149. return c
  87150. }
  87151. // Header returns an http.Header that can be modified by the caller to
  87152. // add HTTP headers to the request.
  87153. func (c *TargetHttpsProxiesSetSslPolicyCall) Header() http.Header {
  87154. if c.header_ == nil {
  87155. c.header_ = make(http.Header)
  87156. }
  87157. return c.header_
  87158. }
  87159. func (c *TargetHttpsProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  87160. reqHeaders := make(http.Header)
  87161. for k, v := range c.header_ {
  87162. reqHeaders[k] = v
  87163. }
  87164. reqHeaders.Set("User-Agent", c.s.userAgent())
  87165. var body io.Reader = nil
  87166. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  87167. if err != nil {
  87168. return nil, err
  87169. }
  87170. reqHeaders.Set("Content-Type", "application/json")
  87171. c.urlParams_.Set("alt", alt)
  87172. c.urlParams_.Set("prettyPrint", "false")
  87173. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")
  87174. urls += "?" + c.urlParams_.Encode()
  87175. req, err := http.NewRequest("POST", urls, body)
  87176. if err != nil {
  87177. return nil, err
  87178. }
  87179. req.Header = reqHeaders
  87180. googleapi.Expand(req.URL, map[string]string{
  87181. "project": c.project,
  87182. "targetHttpsProxy": c.targetHttpsProxy,
  87183. })
  87184. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87185. }
  87186. // Do executes the "compute.targetHttpsProxies.setSslPolicy" call.
  87187. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87188. // status code is an error. Response headers are in either
  87189. // *Operation.ServerResponse.Header or (if a response was returned at
  87190. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87191. // to check whether the returned error was because
  87192. // http.StatusNotModified was returned.
  87193. func (c *TargetHttpsProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87194. gensupport.SetOptions(c.urlParams_, opts...)
  87195. res, err := c.doRequest("json")
  87196. if res != nil && res.StatusCode == http.StatusNotModified {
  87197. if res.Body != nil {
  87198. res.Body.Close()
  87199. }
  87200. return nil, &googleapi.Error{
  87201. Code: res.StatusCode,
  87202. Header: res.Header,
  87203. }
  87204. }
  87205. if err != nil {
  87206. return nil, err
  87207. }
  87208. defer googleapi.CloseBody(res)
  87209. if err := googleapi.CheckResponse(res); err != nil {
  87210. return nil, err
  87211. }
  87212. ret := &Operation{
  87213. ServerResponse: googleapi.ServerResponse{
  87214. Header: res.Header,
  87215. HTTPStatusCode: res.StatusCode,
  87216. },
  87217. }
  87218. target := &ret
  87219. if err := gensupport.DecodeResponse(target, res); err != nil {
  87220. return nil, err
  87221. }
  87222. return ret, nil
  87223. // {
  87224. // "description": "Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends.",
  87225. // "httpMethod": "POST",
  87226. // "id": "compute.targetHttpsProxies.setSslPolicy",
  87227. // "parameterOrder": [
  87228. // "project",
  87229. // "targetHttpsProxy"
  87230. // ],
  87231. // "parameters": {
  87232. // "project": {
  87233. // "description": "Project ID for this request.",
  87234. // "location": "path",
  87235. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87236. // "required": true,
  87237. // "type": "string"
  87238. // },
  87239. // "requestId": {
  87240. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87241. // "location": "query",
  87242. // "type": "string"
  87243. // },
  87244. // "targetHttpsProxy": {
  87245. // "description": "Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035.",
  87246. // "location": "path",
  87247. // "required": true,
  87248. // "type": "string"
  87249. // }
  87250. // },
  87251. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
  87252. // "request": {
  87253. // "$ref": "SslPolicyReference"
  87254. // },
  87255. // "response": {
  87256. // "$ref": "Operation"
  87257. // },
  87258. // "scopes": [
  87259. // "https://www.googleapis.com/auth/cloud-platform",
  87260. // "https://www.googleapis.com/auth/compute"
  87261. // ]
  87262. // }
  87263. }
  87264. // method id "compute.targetHttpsProxies.setUrlMap":
  87265. type TargetHttpsProxiesSetUrlMapCall struct {
  87266. s *Service
  87267. project string
  87268. targetHttpsProxy string
  87269. urlmapreference *UrlMapReference
  87270. urlParams_ gensupport.URLParams
  87271. ctx_ context.Context
  87272. header_ http.Header
  87273. }
  87274. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  87275. func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall {
  87276. c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87277. c.project = project
  87278. c.targetHttpsProxy = targetHttpsProxy
  87279. c.urlmapreference = urlmapreference
  87280. return c
  87281. }
  87282. // RequestId sets the optional parameter "requestId": An optional
  87283. // request ID to identify requests. Specify a unique request ID so that
  87284. // if you must retry your request, the server will know to ignore the
  87285. // request if it has already been completed.
  87286. //
  87287. // For example, consider a situation where you make an initial request
  87288. // and the request times out. If you make the request again with the
  87289. // same request ID, the server can check if original operation with the
  87290. // same request ID was received, and if so, will ignore the second
  87291. // request. This prevents clients from accidentally creating duplicate
  87292. // commitments.
  87293. //
  87294. // The request ID must be a valid UUID with the exception that zero UUID
  87295. // is not supported (00000000-0000-0000-0000-000000000000).
  87296. func (c *TargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpsProxiesSetUrlMapCall {
  87297. c.urlParams_.Set("requestId", requestId)
  87298. return c
  87299. }
  87300. // Fields allows partial responses to be retrieved. See
  87301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87302. // for more information.
  87303. func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall {
  87304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87305. return c
  87306. }
  87307. // Context sets the context to be used in this call's Do method. Any
  87308. // pending HTTP request will be aborted if the provided context is
  87309. // canceled.
  87310. func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall {
  87311. c.ctx_ = ctx
  87312. return c
  87313. }
  87314. // Header returns an http.Header that can be modified by the caller to
  87315. // add HTTP headers to the request.
  87316. func (c *TargetHttpsProxiesSetUrlMapCall) Header() http.Header {
  87317. if c.header_ == nil {
  87318. c.header_ = make(http.Header)
  87319. }
  87320. return c.header_
  87321. }
  87322. func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  87323. reqHeaders := make(http.Header)
  87324. for k, v := range c.header_ {
  87325. reqHeaders[k] = v
  87326. }
  87327. reqHeaders.Set("User-Agent", c.s.userAgent())
  87328. var body io.Reader = nil
  87329. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  87330. if err != nil {
  87331. return nil, err
  87332. }
  87333. reqHeaders.Set("Content-Type", "application/json")
  87334. c.urlParams_.Set("alt", alt)
  87335. c.urlParams_.Set("prettyPrint", "false")
  87336. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  87337. urls += "?" + c.urlParams_.Encode()
  87338. req, err := http.NewRequest("POST", urls, body)
  87339. if err != nil {
  87340. return nil, err
  87341. }
  87342. req.Header = reqHeaders
  87343. googleapi.Expand(req.URL, map[string]string{
  87344. "project": c.project,
  87345. "targetHttpsProxy": c.targetHttpsProxy,
  87346. })
  87347. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87348. }
  87349. // Do executes the "compute.targetHttpsProxies.setUrlMap" call.
  87350. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87351. // status code is an error. Response headers are in either
  87352. // *Operation.ServerResponse.Header or (if a response was returned at
  87353. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87354. // to check whether the returned error was because
  87355. // http.StatusNotModified was returned.
  87356. func (c *TargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87357. gensupport.SetOptions(c.urlParams_, opts...)
  87358. res, err := c.doRequest("json")
  87359. if res != nil && res.StatusCode == http.StatusNotModified {
  87360. if res.Body != nil {
  87361. res.Body.Close()
  87362. }
  87363. return nil, &googleapi.Error{
  87364. Code: res.StatusCode,
  87365. Header: res.Header,
  87366. }
  87367. }
  87368. if err != nil {
  87369. return nil, err
  87370. }
  87371. defer googleapi.CloseBody(res)
  87372. if err := googleapi.CheckResponse(res); err != nil {
  87373. return nil, err
  87374. }
  87375. ret := &Operation{
  87376. ServerResponse: googleapi.ServerResponse{
  87377. Header: res.Header,
  87378. HTTPStatusCode: res.StatusCode,
  87379. },
  87380. }
  87381. target := &ret
  87382. if err := gensupport.DecodeResponse(target, res); err != nil {
  87383. return nil, err
  87384. }
  87385. return ret, nil
  87386. // {
  87387. // "description": "Changes the URL map for TargetHttpsProxy.",
  87388. // "httpMethod": "POST",
  87389. // "id": "compute.targetHttpsProxies.setUrlMap",
  87390. // "parameterOrder": [
  87391. // "project",
  87392. // "targetHttpsProxy"
  87393. // ],
  87394. // "parameters": {
  87395. // "project": {
  87396. // "description": "Project ID for this request.",
  87397. // "location": "path",
  87398. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87399. // "required": true,
  87400. // "type": "string"
  87401. // },
  87402. // "requestId": {
  87403. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87404. // "location": "query",
  87405. // "type": "string"
  87406. // },
  87407. // "targetHttpsProxy": {
  87408. // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
  87409. // "location": "path",
  87410. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87411. // "required": true,
  87412. // "type": "string"
  87413. // }
  87414. // },
  87415. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  87416. // "request": {
  87417. // "$ref": "UrlMapReference"
  87418. // },
  87419. // "response": {
  87420. // "$ref": "Operation"
  87421. // },
  87422. // "scopes": [
  87423. // "https://www.googleapis.com/auth/cloud-platform",
  87424. // "https://www.googleapis.com/auth/compute"
  87425. // ]
  87426. // }
  87427. }
  87428. // method id "compute.targetInstances.aggregatedList":
  87429. type TargetInstancesAggregatedListCall struct {
  87430. s *Service
  87431. project string
  87432. urlParams_ gensupport.URLParams
  87433. ifNoneMatch_ string
  87434. ctx_ context.Context
  87435. header_ http.Header
  87436. }
  87437. // AggregatedList: Retrieves an aggregated list of target instances.
  87438. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList
  87439. func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {
  87440. c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87441. c.project = project
  87442. return c
  87443. }
  87444. // Filter sets the optional parameter "filter": A filter expression that
  87445. // filters resources listed in the response. The expression must specify
  87446. // the field name, a comparison operator, and the value that you want to
  87447. // use for filtering. The value must be a string, a number, or a
  87448. // boolean. The comparison operator must be either =, !=, >, or <.
  87449. //
  87450. // For example, if you are filtering Compute Engine instances, you can
  87451. // exclude instances named example-instance by specifying name !=
  87452. // example-instance.
  87453. //
  87454. // You can also filter nested fields. For example, you could specify
  87455. // scheduling.automaticRestart = false to include instances only if they
  87456. // are not scheduled for automatic restarts. You can use filtering on
  87457. // nested fields to filter based on resource labels.
  87458. //
  87459. // To filter on multiple expressions, provide each separate expression
  87460. // within parentheses. For example, (scheduling.automaticRestart = true)
  87461. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  87462. // AND expression. However, you can include AND and OR expressions
  87463. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  87464. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  87465. // true).
  87466. func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall {
  87467. c.urlParams_.Set("filter", filter)
  87468. return c
  87469. }
  87470. // MaxResults sets the optional parameter "maxResults": The maximum
  87471. // number of results per page that should be returned. If the number of
  87472. // available results is larger than maxResults, Compute Engine returns a
  87473. // nextPageToken that can be used to get the next page of results in
  87474. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  87475. // (Default: 500)
  87476. func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall {
  87477. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  87478. return c
  87479. }
  87480. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  87481. // a certain order. By default, results are returned in alphanumerical
  87482. // order based on the resource name.
  87483. //
  87484. // You can also sort results in descending order based on the creation
  87485. // timestamp using orderBy="creationTimestamp desc". This sorts results
  87486. // based on the creationTimestamp field in reverse chronological order
  87487. // (newest result first). Use this to sort resources like operations so
  87488. // that the newest operation is returned first.
  87489. //
  87490. // Currently, only sorting by name or creationTimestamp desc is
  87491. // supported.
  87492. func (c *TargetInstancesAggregatedListCall) OrderBy(orderBy string) *TargetInstancesAggregatedListCall {
  87493. c.urlParams_.Set("orderBy", orderBy)
  87494. return c
  87495. }
  87496. // PageToken sets the optional parameter "pageToken": Specifies a page
  87497. // token to use. Set pageToken to the nextPageToken returned by a
  87498. // previous list request to get the next page of results.
  87499. func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall {
  87500. c.urlParams_.Set("pageToken", pageToken)
  87501. return c
  87502. }
  87503. // Fields allows partial responses to be retrieved. See
  87504. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87505. // for more information.
  87506. func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall {
  87507. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87508. return c
  87509. }
  87510. // IfNoneMatch sets the optional parameter which makes the operation
  87511. // fail if the object's ETag matches the given value. This is useful for
  87512. // getting updates only after the object has changed since the last
  87513. // request. Use googleapi.IsNotModified to check whether the response
  87514. // error from Do is the result of In-None-Match.
  87515. func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall {
  87516. c.ifNoneMatch_ = entityTag
  87517. return c
  87518. }
  87519. // Context sets the context to be used in this call's Do method. Any
  87520. // pending HTTP request will be aborted if the provided context is
  87521. // canceled.
  87522. func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall {
  87523. c.ctx_ = ctx
  87524. return c
  87525. }
  87526. // Header returns an http.Header that can be modified by the caller to
  87527. // add HTTP headers to the request.
  87528. func (c *TargetInstancesAggregatedListCall) Header() http.Header {
  87529. if c.header_ == nil {
  87530. c.header_ = make(http.Header)
  87531. }
  87532. return c.header_
  87533. }
  87534. func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  87535. reqHeaders := make(http.Header)
  87536. for k, v := range c.header_ {
  87537. reqHeaders[k] = v
  87538. }
  87539. reqHeaders.Set("User-Agent", c.s.userAgent())
  87540. if c.ifNoneMatch_ != "" {
  87541. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87542. }
  87543. var body io.Reader = nil
  87544. c.urlParams_.Set("alt", alt)
  87545. c.urlParams_.Set("prettyPrint", "false")
  87546. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances")
  87547. urls += "?" + c.urlParams_.Encode()
  87548. req, err := http.NewRequest("GET", urls, body)
  87549. if err != nil {
  87550. return nil, err
  87551. }
  87552. req.Header = reqHeaders
  87553. googleapi.Expand(req.URL, map[string]string{
  87554. "project": c.project,
  87555. })
  87556. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87557. }
  87558. // Do executes the "compute.targetInstances.aggregatedList" call.
  87559. // Exactly one of *TargetInstanceAggregatedList or error will be
  87560. // non-nil. Any non-2xx status code is an error. Response headers are in
  87561. // either *TargetInstanceAggregatedList.ServerResponse.Header or (if a
  87562. // response was returned at all) in error.(*googleapi.Error).Header. Use
  87563. // googleapi.IsNotModified to check whether the returned error was
  87564. // because http.StatusNotModified was returned.
  87565. func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceAggregatedList, error) {
  87566. gensupport.SetOptions(c.urlParams_, opts...)
  87567. res, err := c.doRequest("json")
  87568. if res != nil && res.StatusCode == http.StatusNotModified {
  87569. if res.Body != nil {
  87570. res.Body.Close()
  87571. }
  87572. return nil, &googleapi.Error{
  87573. Code: res.StatusCode,
  87574. Header: res.Header,
  87575. }
  87576. }
  87577. if err != nil {
  87578. return nil, err
  87579. }
  87580. defer googleapi.CloseBody(res)
  87581. if err := googleapi.CheckResponse(res); err != nil {
  87582. return nil, err
  87583. }
  87584. ret := &TargetInstanceAggregatedList{
  87585. ServerResponse: googleapi.ServerResponse{
  87586. Header: res.Header,
  87587. HTTPStatusCode: res.StatusCode,
  87588. },
  87589. }
  87590. target := &ret
  87591. if err := gensupport.DecodeResponse(target, res); err != nil {
  87592. return nil, err
  87593. }
  87594. return ret, nil
  87595. // {
  87596. // "description": "Retrieves an aggregated list of target instances.",
  87597. // "httpMethod": "GET",
  87598. // "id": "compute.targetInstances.aggregatedList",
  87599. // "parameterOrder": [
  87600. // "project"
  87601. // ],
  87602. // "parameters": {
  87603. // "filter": {
  87604. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  87605. // "location": "query",
  87606. // "type": "string"
  87607. // },
  87608. // "maxResults": {
  87609. // "default": "500",
  87610. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  87611. // "format": "uint32",
  87612. // "location": "query",
  87613. // "minimum": "0",
  87614. // "type": "integer"
  87615. // },
  87616. // "orderBy": {
  87617. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  87618. // "location": "query",
  87619. // "type": "string"
  87620. // },
  87621. // "pageToken": {
  87622. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  87623. // "location": "query",
  87624. // "type": "string"
  87625. // },
  87626. // "project": {
  87627. // "description": "Project ID for this request.",
  87628. // "location": "path",
  87629. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87630. // "required": true,
  87631. // "type": "string"
  87632. // }
  87633. // },
  87634. // "path": "{project}/aggregated/targetInstances",
  87635. // "response": {
  87636. // "$ref": "TargetInstanceAggregatedList"
  87637. // },
  87638. // "scopes": [
  87639. // "https://www.googleapis.com/auth/cloud-platform",
  87640. // "https://www.googleapis.com/auth/compute",
  87641. // "https://www.googleapis.com/auth/compute.readonly"
  87642. // ]
  87643. // }
  87644. }
  87645. // Pages invokes f for each page of results.
  87646. // A non-nil error returned from f will halt the iteration.
  87647. // The provided context supersedes any context provided to the Context method.
  87648. func (c *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) error) error {
  87649. c.ctx_ = ctx
  87650. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  87651. for {
  87652. x, err := c.Do()
  87653. if err != nil {
  87654. return err
  87655. }
  87656. if err := f(x); err != nil {
  87657. return err
  87658. }
  87659. if x.NextPageToken == "" {
  87660. return nil
  87661. }
  87662. c.PageToken(x.NextPageToken)
  87663. }
  87664. }
  87665. // method id "compute.targetInstances.delete":
  87666. type TargetInstancesDeleteCall struct {
  87667. s *Service
  87668. project string
  87669. zone string
  87670. targetInstance string
  87671. urlParams_ gensupport.URLParams
  87672. ctx_ context.Context
  87673. header_ http.Header
  87674. }
  87675. // Delete: Deletes the specified TargetInstance resource.
  87676. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete
  87677. func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall {
  87678. c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87679. c.project = project
  87680. c.zone = zone
  87681. c.targetInstance = targetInstance
  87682. return c
  87683. }
  87684. // RequestId sets the optional parameter "requestId": An optional
  87685. // request ID to identify requests. Specify a unique request ID so that
  87686. // if you must retry your request, the server will know to ignore the
  87687. // request if it has already been completed.
  87688. //
  87689. // For example, consider a situation where you make an initial request
  87690. // and the request times out. If you make the request again with the
  87691. // same request ID, the server can check if original operation with the
  87692. // same request ID was received, and if so, will ignore the second
  87693. // request. This prevents clients from accidentally creating duplicate
  87694. // commitments.
  87695. //
  87696. // The request ID must be a valid UUID with the exception that zero UUID
  87697. // is not supported (00000000-0000-0000-0000-000000000000).
  87698. func (c *TargetInstancesDeleteCall) RequestId(requestId string) *TargetInstancesDeleteCall {
  87699. c.urlParams_.Set("requestId", requestId)
  87700. return c
  87701. }
  87702. // Fields allows partial responses to be retrieved. See
  87703. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87704. // for more information.
  87705. func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall {
  87706. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87707. return c
  87708. }
  87709. // Context sets the context to be used in this call's Do method. Any
  87710. // pending HTTP request will be aborted if the provided context is
  87711. // canceled.
  87712. func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall {
  87713. c.ctx_ = ctx
  87714. return c
  87715. }
  87716. // Header returns an http.Header that can be modified by the caller to
  87717. // add HTTP headers to the request.
  87718. func (c *TargetInstancesDeleteCall) Header() http.Header {
  87719. if c.header_ == nil {
  87720. c.header_ = make(http.Header)
  87721. }
  87722. return c.header_
  87723. }
  87724. func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  87725. reqHeaders := make(http.Header)
  87726. for k, v := range c.header_ {
  87727. reqHeaders[k] = v
  87728. }
  87729. reqHeaders.Set("User-Agent", c.s.userAgent())
  87730. var body io.Reader = nil
  87731. c.urlParams_.Set("alt", alt)
  87732. c.urlParams_.Set("prettyPrint", "false")
  87733. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  87734. urls += "?" + c.urlParams_.Encode()
  87735. req, err := http.NewRequest("DELETE", urls, body)
  87736. if err != nil {
  87737. return nil, err
  87738. }
  87739. req.Header = reqHeaders
  87740. googleapi.Expand(req.URL, map[string]string{
  87741. "project": c.project,
  87742. "zone": c.zone,
  87743. "targetInstance": c.targetInstance,
  87744. })
  87745. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87746. }
  87747. // Do executes the "compute.targetInstances.delete" call.
  87748. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87749. // status code is an error. Response headers are in either
  87750. // *Operation.ServerResponse.Header or (if a response was returned at
  87751. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87752. // to check whether the returned error was because
  87753. // http.StatusNotModified was returned.
  87754. func (c *TargetInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87755. gensupport.SetOptions(c.urlParams_, opts...)
  87756. res, err := c.doRequest("json")
  87757. if res != nil && res.StatusCode == http.StatusNotModified {
  87758. if res.Body != nil {
  87759. res.Body.Close()
  87760. }
  87761. return nil, &googleapi.Error{
  87762. Code: res.StatusCode,
  87763. Header: res.Header,
  87764. }
  87765. }
  87766. if err != nil {
  87767. return nil, err
  87768. }
  87769. defer googleapi.CloseBody(res)
  87770. if err := googleapi.CheckResponse(res); err != nil {
  87771. return nil, err
  87772. }
  87773. ret := &Operation{
  87774. ServerResponse: googleapi.ServerResponse{
  87775. Header: res.Header,
  87776. HTTPStatusCode: res.StatusCode,
  87777. },
  87778. }
  87779. target := &ret
  87780. if err := gensupport.DecodeResponse(target, res); err != nil {
  87781. return nil, err
  87782. }
  87783. return ret, nil
  87784. // {
  87785. // "description": "Deletes the specified TargetInstance resource.",
  87786. // "httpMethod": "DELETE",
  87787. // "id": "compute.targetInstances.delete",
  87788. // "parameterOrder": [
  87789. // "project",
  87790. // "zone",
  87791. // "targetInstance"
  87792. // ],
  87793. // "parameters": {
  87794. // "project": {
  87795. // "description": "Project ID for this request.",
  87796. // "location": "path",
  87797. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87798. // "required": true,
  87799. // "type": "string"
  87800. // },
  87801. // "requestId": {
  87802. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87803. // "location": "query",
  87804. // "type": "string"
  87805. // },
  87806. // "targetInstance": {
  87807. // "description": "Name of the TargetInstance resource to delete.",
  87808. // "location": "path",
  87809. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87810. // "required": true,
  87811. // "type": "string"
  87812. // },
  87813. // "zone": {
  87814. // "description": "Name of the zone scoping this request.",
  87815. // "location": "path",
  87816. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87817. // "required": true,
  87818. // "type": "string"
  87819. // }
  87820. // },
  87821. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  87822. // "response": {
  87823. // "$ref": "Operation"
  87824. // },
  87825. // "scopes": [
  87826. // "https://www.googleapis.com/auth/cloud-platform",
  87827. // "https://www.googleapis.com/auth/compute"
  87828. // ]
  87829. // }
  87830. }
  87831. // method id "compute.targetInstances.get":
  87832. type TargetInstancesGetCall struct {
  87833. s *Service
  87834. project string
  87835. zone string
  87836. targetInstance string
  87837. urlParams_ gensupport.URLParams
  87838. ifNoneMatch_ string
  87839. ctx_ context.Context
  87840. header_ http.Header
  87841. }
  87842. // Get: Returns the specified TargetInstance resource. Gets a list of
  87843. // available target instances by making a list() request.
  87844. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get
  87845. func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall {
  87846. c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87847. c.project = project
  87848. c.zone = zone
  87849. c.targetInstance = targetInstance
  87850. return c
  87851. }
  87852. // Fields allows partial responses to be retrieved. See
  87853. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87854. // for more information.
  87855. func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall {
  87856. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87857. return c
  87858. }
  87859. // IfNoneMatch sets the optional parameter which makes the operation
  87860. // fail if the object's ETag matches the given value. This is useful for
  87861. // getting updates only after the object has changed since the last
  87862. // request. Use googleapi.IsNotModified to check whether the response
  87863. // error from Do is the result of In-None-Match.
  87864. func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall {
  87865. c.ifNoneMatch_ = entityTag
  87866. return c
  87867. }
  87868. // Context sets the context to be used in this call's Do method. Any
  87869. // pending HTTP request will be aborted if the provided context is
  87870. // canceled.
  87871. func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall {
  87872. c.ctx_ = ctx
  87873. return c
  87874. }
  87875. // Header returns an http.Header that can be modified by the caller to
  87876. // add HTTP headers to the request.
  87877. func (c *TargetInstancesGetCall) Header() http.Header {
  87878. if c.header_ == nil {
  87879. c.header_ = make(http.Header)
  87880. }
  87881. return c.header_
  87882. }
  87883. func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  87884. reqHeaders := make(http.Header)
  87885. for k, v := range c.header_ {
  87886. reqHeaders[k] = v
  87887. }
  87888. reqHeaders.Set("User-Agent", c.s.userAgent())
  87889. if c.ifNoneMatch_ != "" {
  87890. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87891. }
  87892. var body io.Reader = nil
  87893. c.urlParams_.Set("alt", alt)
  87894. c.urlParams_.Set("prettyPrint", "false")
  87895. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  87896. urls += "?" + c.urlParams_.Encode()
  87897. req, err := http.NewRequest("GET", urls, body)
  87898. if err != nil {
  87899. return nil, err
  87900. }
  87901. req.Header = reqHeaders
  87902. googleapi.Expand(req.URL, map[string]string{
  87903. "project": c.project,
  87904. "zone": c.zone,
  87905. "targetInstance": c.targetInstance,
  87906. })
  87907. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87908. }
  87909. // Do executes the "compute.targetInstances.get" call.
  87910. // Exactly one of *TargetInstance or error will be non-nil. Any non-2xx
  87911. // status code is an error. Response headers are in either
  87912. // *TargetInstance.ServerResponse.Header or (if a response was returned
  87913. // at all) in error.(*googleapi.Error).Header. Use
  87914. // googleapi.IsNotModified to check whether the returned error was
  87915. // because http.StatusNotModified was returned.
  87916. func (c *TargetInstancesGetCall) Do(opts ...googleapi.CallOption) (*TargetInstance, error) {
  87917. gensupport.SetOptions(c.urlParams_, opts...)
  87918. res, err := c.doRequest("json")
  87919. if res != nil && res.StatusCode == http.StatusNotModified {
  87920. if res.Body != nil {
  87921. res.Body.Close()
  87922. }
  87923. return nil, &googleapi.Error{
  87924. Code: res.StatusCode,
  87925. Header: res.Header,
  87926. }
  87927. }
  87928. if err != nil {
  87929. return nil, err
  87930. }
  87931. defer googleapi.CloseBody(res)
  87932. if err := googleapi.CheckResponse(res); err != nil {
  87933. return nil, err
  87934. }
  87935. ret := &TargetInstance{
  87936. ServerResponse: googleapi.ServerResponse{
  87937. Header: res.Header,
  87938. HTTPStatusCode: res.StatusCode,
  87939. },
  87940. }
  87941. target := &ret
  87942. if err := gensupport.DecodeResponse(target, res); err != nil {
  87943. return nil, err
  87944. }
  87945. return ret, nil
  87946. // {
  87947. // "description": "Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request.",
  87948. // "httpMethod": "GET",
  87949. // "id": "compute.targetInstances.get",
  87950. // "parameterOrder": [
  87951. // "project",
  87952. // "zone",
  87953. // "targetInstance"
  87954. // ],
  87955. // "parameters": {
  87956. // "project": {
  87957. // "description": "Project ID for this request.",
  87958. // "location": "path",
  87959. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87960. // "required": true,
  87961. // "type": "string"
  87962. // },
  87963. // "targetInstance": {
  87964. // "description": "Name of the TargetInstance resource to return.",
  87965. // "location": "path",
  87966. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87967. // "required": true,
  87968. // "type": "string"
  87969. // },
  87970. // "zone": {
  87971. // "description": "Name of the zone scoping this request.",
  87972. // "location": "path",
  87973. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87974. // "required": true,
  87975. // "type": "string"
  87976. // }
  87977. // },
  87978. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  87979. // "response": {
  87980. // "$ref": "TargetInstance"
  87981. // },
  87982. // "scopes": [
  87983. // "https://www.googleapis.com/auth/cloud-platform",
  87984. // "https://www.googleapis.com/auth/compute",
  87985. // "https://www.googleapis.com/auth/compute.readonly"
  87986. // ]
  87987. // }
  87988. }
  87989. // method id "compute.targetInstances.insert":
  87990. type TargetInstancesInsertCall struct {
  87991. s *Service
  87992. project string
  87993. zone string
  87994. targetinstance *TargetInstance
  87995. urlParams_ gensupport.URLParams
  87996. ctx_ context.Context
  87997. header_ http.Header
  87998. }
  87999. // Insert: Creates a TargetInstance resource in the specified project
  88000. // and zone using the data included in the request.
  88001. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert
  88002. func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall {
  88003. c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88004. c.project = project
  88005. c.zone = zone
  88006. c.targetinstance = targetinstance
  88007. return c
  88008. }
  88009. // RequestId sets the optional parameter "requestId": An optional
  88010. // request ID to identify requests. Specify a unique request ID so that
  88011. // if you must retry your request, the server will know to ignore the
  88012. // request if it has already been completed.
  88013. //
  88014. // For example, consider a situation where you make an initial request
  88015. // and the request times out. If you make the request again with the
  88016. // same request ID, the server can check if original operation with the
  88017. // same request ID was received, and if so, will ignore the second
  88018. // request. This prevents clients from accidentally creating duplicate
  88019. // commitments.
  88020. //
  88021. // The request ID must be a valid UUID with the exception that zero UUID
  88022. // is not supported (00000000-0000-0000-0000-000000000000).
  88023. func (c *TargetInstancesInsertCall) RequestId(requestId string) *TargetInstancesInsertCall {
  88024. c.urlParams_.Set("requestId", requestId)
  88025. return c
  88026. }
  88027. // Fields allows partial responses to be retrieved. See
  88028. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88029. // for more information.
  88030. func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall {
  88031. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88032. return c
  88033. }
  88034. // Context sets the context to be used in this call's Do method. Any
  88035. // pending HTTP request will be aborted if the provided context is
  88036. // canceled.
  88037. func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall {
  88038. c.ctx_ = ctx
  88039. return c
  88040. }
  88041. // Header returns an http.Header that can be modified by the caller to
  88042. // add HTTP headers to the request.
  88043. func (c *TargetInstancesInsertCall) Header() http.Header {
  88044. if c.header_ == nil {
  88045. c.header_ = make(http.Header)
  88046. }
  88047. return c.header_
  88048. }
  88049. func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  88050. reqHeaders := make(http.Header)
  88051. for k, v := range c.header_ {
  88052. reqHeaders[k] = v
  88053. }
  88054. reqHeaders.Set("User-Agent", c.s.userAgent())
  88055. var body io.Reader = nil
  88056. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance)
  88057. if err != nil {
  88058. return nil, err
  88059. }
  88060. reqHeaders.Set("Content-Type", "application/json")
  88061. c.urlParams_.Set("alt", alt)
  88062. c.urlParams_.Set("prettyPrint", "false")
  88063. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  88064. urls += "?" + c.urlParams_.Encode()
  88065. req, err := http.NewRequest("POST", urls, body)
  88066. if err != nil {
  88067. return nil, err
  88068. }
  88069. req.Header = reqHeaders
  88070. googleapi.Expand(req.URL, map[string]string{
  88071. "project": c.project,
  88072. "zone": c.zone,
  88073. })
  88074. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88075. }
  88076. // Do executes the "compute.targetInstances.insert" call.
  88077. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88078. // status code is an error. Response headers are in either
  88079. // *Operation.ServerResponse.Header or (if a response was returned at
  88080. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88081. // to check whether the returned error was because
  88082. // http.StatusNotModified was returned.
  88083. func (c *TargetInstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88084. gensupport.SetOptions(c.urlParams_, opts...)
  88085. res, err := c.doRequest("json")
  88086. if res != nil && res.StatusCode == http.StatusNotModified {
  88087. if res.Body != nil {
  88088. res.Body.Close()
  88089. }
  88090. return nil, &googleapi.Error{
  88091. Code: res.StatusCode,
  88092. Header: res.Header,
  88093. }
  88094. }
  88095. if err != nil {
  88096. return nil, err
  88097. }
  88098. defer googleapi.CloseBody(res)
  88099. if err := googleapi.CheckResponse(res); err != nil {
  88100. return nil, err
  88101. }
  88102. ret := &Operation{
  88103. ServerResponse: googleapi.ServerResponse{
  88104. Header: res.Header,
  88105. HTTPStatusCode: res.StatusCode,
  88106. },
  88107. }
  88108. target := &ret
  88109. if err := gensupport.DecodeResponse(target, res); err != nil {
  88110. return nil, err
  88111. }
  88112. return ret, nil
  88113. // {
  88114. // "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
  88115. // "httpMethod": "POST",
  88116. // "id": "compute.targetInstances.insert",
  88117. // "parameterOrder": [
  88118. // "project",
  88119. // "zone"
  88120. // ],
  88121. // "parameters": {
  88122. // "project": {
  88123. // "description": "Project ID for this request.",
  88124. // "location": "path",
  88125. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88126. // "required": true,
  88127. // "type": "string"
  88128. // },
  88129. // "requestId": {
  88130. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88131. // "location": "query",
  88132. // "type": "string"
  88133. // },
  88134. // "zone": {
  88135. // "description": "Name of the zone scoping this request.",
  88136. // "location": "path",
  88137. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88138. // "required": true,
  88139. // "type": "string"
  88140. // }
  88141. // },
  88142. // "path": "{project}/zones/{zone}/targetInstances",
  88143. // "request": {
  88144. // "$ref": "TargetInstance"
  88145. // },
  88146. // "response": {
  88147. // "$ref": "Operation"
  88148. // },
  88149. // "scopes": [
  88150. // "https://www.googleapis.com/auth/cloud-platform",
  88151. // "https://www.googleapis.com/auth/compute"
  88152. // ]
  88153. // }
  88154. }
  88155. // method id "compute.targetInstances.list":
  88156. type TargetInstancesListCall struct {
  88157. s *Service
  88158. project string
  88159. zone string
  88160. urlParams_ gensupport.URLParams
  88161. ifNoneMatch_ string
  88162. ctx_ context.Context
  88163. header_ http.Header
  88164. }
  88165. // List: Retrieves a list of TargetInstance resources available to the
  88166. // specified project and zone.
  88167. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list
  88168. func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall {
  88169. c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88170. c.project = project
  88171. c.zone = zone
  88172. return c
  88173. }
  88174. // Filter sets the optional parameter "filter": A filter expression that
  88175. // filters resources listed in the response. The expression must specify
  88176. // the field name, a comparison operator, and the value that you want to
  88177. // use for filtering. The value must be a string, a number, or a
  88178. // boolean. The comparison operator must be either =, !=, >, or <.
  88179. //
  88180. // For example, if you are filtering Compute Engine instances, you can
  88181. // exclude instances named example-instance by specifying name !=
  88182. // example-instance.
  88183. //
  88184. // You can also filter nested fields. For example, you could specify
  88185. // scheduling.automaticRestart = false to include instances only if they
  88186. // are not scheduled for automatic restarts. You can use filtering on
  88187. // nested fields to filter based on resource labels.
  88188. //
  88189. // To filter on multiple expressions, provide each separate expression
  88190. // within parentheses. For example, (scheduling.automaticRestart = true)
  88191. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  88192. // AND expression. However, you can include AND and OR expressions
  88193. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  88194. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  88195. // true).
  88196. func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall {
  88197. c.urlParams_.Set("filter", filter)
  88198. return c
  88199. }
  88200. // MaxResults sets the optional parameter "maxResults": The maximum
  88201. // number of results per page that should be returned. If the number of
  88202. // available results is larger than maxResults, Compute Engine returns a
  88203. // nextPageToken that can be used to get the next page of results in
  88204. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  88205. // (Default: 500)
  88206. func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall {
  88207. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  88208. return c
  88209. }
  88210. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  88211. // a certain order. By default, results are returned in alphanumerical
  88212. // order based on the resource name.
  88213. //
  88214. // You can also sort results in descending order based on the creation
  88215. // timestamp using orderBy="creationTimestamp desc". This sorts results
  88216. // based on the creationTimestamp field in reverse chronological order
  88217. // (newest result first). Use this to sort resources like operations so
  88218. // that the newest operation is returned first.
  88219. //
  88220. // Currently, only sorting by name or creationTimestamp desc is
  88221. // supported.
  88222. func (c *TargetInstancesListCall) OrderBy(orderBy string) *TargetInstancesListCall {
  88223. c.urlParams_.Set("orderBy", orderBy)
  88224. return c
  88225. }
  88226. // PageToken sets the optional parameter "pageToken": Specifies a page
  88227. // token to use. Set pageToken to the nextPageToken returned by a
  88228. // previous list request to get the next page of results.
  88229. func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall {
  88230. c.urlParams_.Set("pageToken", pageToken)
  88231. return c
  88232. }
  88233. // Fields allows partial responses to be retrieved. See
  88234. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88235. // for more information.
  88236. func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall {
  88237. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88238. return c
  88239. }
  88240. // IfNoneMatch sets the optional parameter which makes the operation
  88241. // fail if the object's ETag matches the given value. This is useful for
  88242. // getting updates only after the object has changed since the last
  88243. // request. Use googleapi.IsNotModified to check whether the response
  88244. // error from Do is the result of In-None-Match.
  88245. func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall {
  88246. c.ifNoneMatch_ = entityTag
  88247. return c
  88248. }
  88249. // Context sets the context to be used in this call's Do method. Any
  88250. // pending HTTP request will be aborted if the provided context is
  88251. // canceled.
  88252. func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall {
  88253. c.ctx_ = ctx
  88254. return c
  88255. }
  88256. // Header returns an http.Header that can be modified by the caller to
  88257. // add HTTP headers to the request.
  88258. func (c *TargetInstancesListCall) Header() http.Header {
  88259. if c.header_ == nil {
  88260. c.header_ = make(http.Header)
  88261. }
  88262. return c.header_
  88263. }
  88264. func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) {
  88265. reqHeaders := make(http.Header)
  88266. for k, v := range c.header_ {
  88267. reqHeaders[k] = v
  88268. }
  88269. reqHeaders.Set("User-Agent", c.s.userAgent())
  88270. if c.ifNoneMatch_ != "" {
  88271. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88272. }
  88273. var body io.Reader = nil
  88274. c.urlParams_.Set("alt", alt)
  88275. c.urlParams_.Set("prettyPrint", "false")
  88276. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  88277. urls += "?" + c.urlParams_.Encode()
  88278. req, err := http.NewRequest("GET", urls, body)
  88279. if err != nil {
  88280. return nil, err
  88281. }
  88282. req.Header = reqHeaders
  88283. googleapi.Expand(req.URL, map[string]string{
  88284. "project": c.project,
  88285. "zone": c.zone,
  88286. })
  88287. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88288. }
  88289. // Do executes the "compute.targetInstances.list" call.
  88290. // Exactly one of *TargetInstanceList or error will be non-nil. Any
  88291. // non-2xx status code is an error. Response headers are in either
  88292. // *TargetInstanceList.ServerResponse.Header or (if a response was
  88293. // returned at all) in error.(*googleapi.Error).Header. Use
  88294. // googleapi.IsNotModified to check whether the returned error was
  88295. // because http.StatusNotModified was returned.
  88296. func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceList, error) {
  88297. gensupport.SetOptions(c.urlParams_, opts...)
  88298. res, err := c.doRequest("json")
  88299. if res != nil && res.StatusCode == http.StatusNotModified {
  88300. if res.Body != nil {
  88301. res.Body.Close()
  88302. }
  88303. return nil, &googleapi.Error{
  88304. Code: res.StatusCode,
  88305. Header: res.Header,
  88306. }
  88307. }
  88308. if err != nil {
  88309. return nil, err
  88310. }
  88311. defer googleapi.CloseBody(res)
  88312. if err := googleapi.CheckResponse(res); err != nil {
  88313. return nil, err
  88314. }
  88315. ret := &TargetInstanceList{
  88316. ServerResponse: googleapi.ServerResponse{
  88317. Header: res.Header,
  88318. HTTPStatusCode: res.StatusCode,
  88319. },
  88320. }
  88321. target := &ret
  88322. if err := gensupport.DecodeResponse(target, res); err != nil {
  88323. return nil, err
  88324. }
  88325. return ret, nil
  88326. // {
  88327. // "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
  88328. // "httpMethod": "GET",
  88329. // "id": "compute.targetInstances.list",
  88330. // "parameterOrder": [
  88331. // "project",
  88332. // "zone"
  88333. // ],
  88334. // "parameters": {
  88335. // "filter": {
  88336. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  88337. // "location": "query",
  88338. // "type": "string"
  88339. // },
  88340. // "maxResults": {
  88341. // "default": "500",
  88342. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  88343. // "format": "uint32",
  88344. // "location": "query",
  88345. // "minimum": "0",
  88346. // "type": "integer"
  88347. // },
  88348. // "orderBy": {
  88349. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  88350. // "location": "query",
  88351. // "type": "string"
  88352. // },
  88353. // "pageToken": {
  88354. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  88355. // "location": "query",
  88356. // "type": "string"
  88357. // },
  88358. // "project": {
  88359. // "description": "Project ID for this request.",
  88360. // "location": "path",
  88361. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88362. // "required": true,
  88363. // "type": "string"
  88364. // },
  88365. // "zone": {
  88366. // "description": "Name of the zone scoping this request.",
  88367. // "location": "path",
  88368. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88369. // "required": true,
  88370. // "type": "string"
  88371. // }
  88372. // },
  88373. // "path": "{project}/zones/{zone}/targetInstances",
  88374. // "response": {
  88375. // "$ref": "TargetInstanceList"
  88376. // },
  88377. // "scopes": [
  88378. // "https://www.googleapis.com/auth/cloud-platform",
  88379. // "https://www.googleapis.com/auth/compute",
  88380. // "https://www.googleapis.com/auth/compute.readonly"
  88381. // ]
  88382. // }
  88383. }
  88384. // Pages invokes f for each page of results.
  88385. // A non-nil error returned from f will halt the iteration.
  88386. // The provided context supersedes any context provided to the Context method.
  88387. func (c *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) error) error {
  88388. c.ctx_ = ctx
  88389. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  88390. for {
  88391. x, err := c.Do()
  88392. if err != nil {
  88393. return err
  88394. }
  88395. if err := f(x); err != nil {
  88396. return err
  88397. }
  88398. if x.NextPageToken == "" {
  88399. return nil
  88400. }
  88401. c.PageToken(x.NextPageToken)
  88402. }
  88403. }
  88404. // method id "compute.targetPools.addHealthCheck":
  88405. type TargetPoolsAddHealthCheckCall struct {
  88406. s *Service
  88407. project string
  88408. region string
  88409. targetPool string
  88410. targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest
  88411. urlParams_ gensupport.URLParams
  88412. ctx_ context.Context
  88413. header_ http.Header
  88414. }
  88415. // AddHealthCheck: Adds health check URLs to a target pool.
  88416. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck
  88417. func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall {
  88418. c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88419. c.project = project
  88420. c.region = region
  88421. c.targetPool = targetPool
  88422. c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest
  88423. return c
  88424. }
  88425. // RequestId sets the optional parameter "requestId": An optional
  88426. // request ID to identify requests. Specify a unique request ID so that
  88427. // if you must retry your request, the server will know to ignore the
  88428. // request if it has already been completed.
  88429. //
  88430. // For example, consider a situation where you make an initial request
  88431. // and the request times out. If you make the request again with the
  88432. // same request ID, the server can check if original operation with the
  88433. // same request ID was received, and if so, will ignore the second
  88434. // request. This prevents clients from accidentally creating duplicate
  88435. // commitments.
  88436. //
  88437. // The request ID must be a valid UUID with the exception that zero UUID
  88438. // is not supported (00000000-0000-0000-0000-000000000000).
  88439. func (c *TargetPoolsAddHealthCheckCall) RequestId(requestId string) *TargetPoolsAddHealthCheckCall {
  88440. c.urlParams_.Set("requestId", requestId)
  88441. return c
  88442. }
  88443. // Fields allows partial responses to be retrieved. See
  88444. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88445. // for more information.
  88446. func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall {
  88447. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88448. return c
  88449. }
  88450. // Context sets the context to be used in this call's Do method. Any
  88451. // pending HTTP request will be aborted if the provided context is
  88452. // canceled.
  88453. func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall {
  88454. c.ctx_ = ctx
  88455. return c
  88456. }
  88457. // Header returns an http.Header that can be modified by the caller to
  88458. // add HTTP headers to the request.
  88459. func (c *TargetPoolsAddHealthCheckCall) Header() http.Header {
  88460. if c.header_ == nil {
  88461. c.header_ = make(http.Header)
  88462. }
  88463. return c.header_
  88464. }
  88465. func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  88466. reqHeaders := make(http.Header)
  88467. for k, v := range c.header_ {
  88468. reqHeaders[k] = v
  88469. }
  88470. reqHeaders.Set("User-Agent", c.s.userAgent())
  88471. var body io.Reader = nil
  88472. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest)
  88473. if err != nil {
  88474. return nil, err
  88475. }
  88476. reqHeaders.Set("Content-Type", "application/json")
  88477. c.urlParams_.Set("alt", alt)
  88478. c.urlParams_.Set("prettyPrint", "false")
  88479. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")
  88480. urls += "?" + c.urlParams_.Encode()
  88481. req, err := http.NewRequest("POST", urls, body)
  88482. if err != nil {
  88483. return nil, err
  88484. }
  88485. req.Header = reqHeaders
  88486. googleapi.Expand(req.URL, map[string]string{
  88487. "project": c.project,
  88488. "region": c.region,
  88489. "targetPool": c.targetPool,
  88490. })
  88491. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88492. }
  88493. // Do executes the "compute.targetPools.addHealthCheck" call.
  88494. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88495. // status code is an error. Response headers are in either
  88496. // *Operation.ServerResponse.Header or (if a response was returned at
  88497. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88498. // to check whether the returned error was because
  88499. // http.StatusNotModified was returned.
  88500. func (c *TargetPoolsAddHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88501. gensupport.SetOptions(c.urlParams_, opts...)
  88502. res, err := c.doRequest("json")
  88503. if res != nil && res.StatusCode == http.StatusNotModified {
  88504. if res.Body != nil {
  88505. res.Body.Close()
  88506. }
  88507. return nil, &googleapi.Error{
  88508. Code: res.StatusCode,
  88509. Header: res.Header,
  88510. }
  88511. }
  88512. if err != nil {
  88513. return nil, err
  88514. }
  88515. defer googleapi.CloseBody(res)
  88516. if err := googleapi.CheckResponse(res); err != nil {
  88517. return nil, err
  88518. }
  88519. ret := &Operation{
  88520. ServerResponse: googleapi.ServerResponse{
  88521. Header: res.Header,
  88522. HTTPStatusCode: res.StatusCode,
  88523. },
  88524. }
  88525. target := &ret
  88526. if err := gensupport.DecodeResponse(target, res); err != nil {
  88527. return nil, err
  88528. }
  88529. return ret, nil
  88530. // {
  88531. // "description": "Adds health check URLs to a target pool.",
  88532. // "httpMethod": "POST",
  88533. // "id": "compute.targetPools.addHealthCheck",
  88534. // "parameterOrder": [
  88535. // "project",
  88536. // "region",
  88537. // "targetPool"
  88538. // ],
  88539. // "parameters": {
  88540. // "project": {
  88541. // "description": "Project ID for this request.",
  88542. // "location": "path",
  88543. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88544. // "required": true,
  88545. // "type": "string"
  88546. // },
  88547. // "region": {
  88548. // "description": "Name of the region scoping this request.",
  88549. // "location": "path",
  88550. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88551. // "required": true,
  88552. // "type": "string"
  88553. // },
  88554. // "requestId": {
  88555. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88556. // "location": "query",
  88557. // "type": "string"
  88558. // },
  88559. // "targetPool": {
  88560. // "description": "Name of the target pool to add a health check to.",
  88561. // "location": "path",
  88562. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88563. // "required": true,
  88564. // "type": "string"
  88565. // }
  88566. // },
  88567. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
  88568. // "request": {
  88569. // "$ref": "TargetPoolsAddHealthCheckRequest"
  88570. // },
  88571. // "response": {
  88572. // "$ref": "Operation"
  88573. // },
  88574. // "scopes": [
  88575. // "https://www.googleapis.com/auth/cloud-platform",
  88576. // "https://www.googleapis.com/auth/compute"
  88577. // ]
  88578. // }
  88579. }
  88580. // method id "compute.targetPools.addInstance":
  88581. type TargetPoolsAddInstanceCall struct {
  88582. s *Service
  88583. project string
  88584. region string
  88585. targetPool string
  88586. targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest
  88587. urlParams_ gensupport.URLParams
  88588. ctx_ context.Context
  88589. header_ http.Header
  88590. }
  88591. // AddInstance: Adds an instance to a target pool.
  88592. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance
  88593. func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall {
  88594. c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88595. c.project = project
  88596. c.region = region
  88597. c.targetPool = targetPool
  88598. c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest
  88599. return c
  88600. }
  88601. // RequestId sets the optional parameter "requestId": An optional
  88602. // request ID to identify requests. Specify a unique request ID so that
  88603. // if you must retry your request, the server will know to ignore the
  88604. // request if it has already been completed.
  88605. //
  88606. // For example, consider a situation where you make an initial request
  88607. // and the request times out. If you make the request again with the
  88608. // same request ID, the server can check if original operation with the
  88609. // same request ID was received, and if so, will ignore the second
  88610. // request. This prevents clients from accidentally creating duplicate
  88611. // commitments.
  88612. //
  88613. // The request ID must be a valid UUID with the exception that zero UUID
  88614. // is not supported (00000000-0000-0000-0000-000000000000).
  88615. func (c *TargetPoolsAddInstanceCall) RequestId(requestId string) *TargetPoolsAddInstanceCall {
  88616. c.urlParams_.Set("requestId", requestId)
  88617. return c
  88618. }
  88619. // Fields allows partial responses to be retrieved. See
  88620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88621. // for more information.
  88622. func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall {
  88623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88624. return c
  88625. }
  88626. // Context sets the context to be used in this call's Do method. Any
  88627. // pending HTTP request will be aborted if the provided context is
  88628. // canceled.
  88629. func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall {
  88630. c.ctx_ = ctx
  88631. return c
  88632. }
  88633. // Header returns an http.Header that can be modified by the caller to
  88634. // add HTTP headers to the request.
  88635. func (c *TargetPoolsAddInstanceCall) Header() http.Header {
  88636. if c.header_ == nil {
  88637. c.header_ = make(http.Header)
  88638. }
  88639. return c.header_
  88640. }
  88641. func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) {
  88642. reqHeaders := make(http.Header)
  88643. for k, v := range c.header_ {
  88644. reqHeaders[k] = v
  88645. }
  88646. reqHeaders.Set("User-Agent", c.s.userAgent())
  88647. var body io.Reader = nil
  88648. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest)
  88649. if err != nil {
  88650. return nil, err
  88651. }
  88652. reqHeaders.Set("Content-Type", "application/json")
  88653. c.urlParams_.Set("alt", alt)
  88654. c.urlParams_.Set("prettyPrint", "false")
  88655. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance")
  88656. urls += "?" + c.urlParams_.Encode()
  88657. req, err := http.NewRequest("POST", urls, body)
  88658. if err != nil {
  88659. return nil, err
  88660. }
  88661. req.Header = reqHeaders
  88662. googleapi.Expand(req.URL, map[string]string{
  88663. "project": c.project,
  88664. "region": c.region,
  88665. "targetPool": c.targetPool,
  88666. })
  88667. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88668. }
  88669. // Do executes the "compute.targetPools.addInstance" call.
  88670. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88671. // status code is an error. Response headers are in either
  88672. // *Operation.ServerResponse.Header or (if a response was returned at
  88673. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88674. // to check whether the returned error was because
  88675. // http.StatusNotModified was returned.
  88676. func (c *TargetPoolsAddInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88677. gensupport.SetOptions(c.urlParams_, opts...)
  88678. res, err := c.doRequest("json")
  88679. if res != nil && res.StatusCode == http.StatusNotModified {
  88680. if res.Body != nil {
  88681. res.Body.Close()
  88682. }
  88683. return nil, &googleapi.Error{
  88684. Code: res.StatusCode,
  88685. Header: res.Header,
  88686. }
  88687. }
  88688. if err != nil {
  88689. return nil, err
  88690. }
  88691. defer googleapi.CloseBody(res)
  88692. if err := googleapi.CheckResponse(res); err != nil {
  88693. return nil, err
  88694. }
  88695. ret := &Operation{
  88696. ServerResponse: googleapi.ServerResponse{
  88697. Header: res.Header,
  88698. HTTPStatusCode: res.StatusCode,
  88699. },
  88700. }
  88701. target := &ret
  88702. if err := gensupport.DecodeResponse(target, res); err != nil {
  88703. return nil, err
  88704. }
  88705. return ret, nil
  88706. // {
  88707. // "description": "Adds an instance to a target pool.",
  88708. // "httpMethod": "POST",
  88709. // "id": "compute.targetPools.addInstance",
  88710. // "parameterOrder": [
  88711. // "project",
  88712. // "region",
  88713. // "targetPool"
  88714. // ],
  88715. // "parameters": {
  88716. // "project": {
  88717. // "description": "Project ID for this request.",
  88718. // "location": "path",
  88719. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88720. // "required": true,
  88721. // "type": "string"
  88722. // },
  88723. // "region": {
  88724. // "description": "Name of the region scoping this request.",
  88725. // "location": "path",
  88726. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88727. // "required": true,
  88728. // "type": "string"
  88729. // },
  88730. // "requestId": {
  88731. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88732. // "location": "query",
  88733. // "type": "string"
  88734. // },
  88735. // "targetPool": {
  88736. // "description": "Name of the TargetPool resource to add instances to.",
  88737. // "location": "path",
  88738. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88739. // "required": true,
  88740. // "type": "string"
  88741. // }
  88742. // },
  88743. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance",
  88744. // "request": {
  88745. // "$ref": "TargetPoolsAddInstanceRequest"
  88746. // },
  88747. // "response": {
  88748. // "$ref": "Operation"
  88749. // },
  88750. // "scopes": [
  88751. // "https://www.googleapis.com/auth/cloud-platform",
  88752. // "https://www.googleapis.com/auth/compute"
  88753. // ]
  88754. // }
  88755. }
  88756. // method id "compute.targetPools.aggregatedList":
  88757. type TargetPoolsAggregatedListCall struct {
  88758. s *Service
  88759. project string
  88760. urlParams_ gensupport.URLParams
  88761. ifNoneMatch_ string
  88762. ctx_ context.Context
  88763. header_ http.Header
  88764. }
  88765. // AggregatedList: Retrieves an aggregated list of target pools.
  88766. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList
  88767. func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {
  88768. c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88769. c.project = project
  88770. return c
  88771. }
  88772. // Filter sets the optional parameter "filter": A filter expression that
  88773. // filters resources listed in the response. The expression must specify
  88774. // the field name, a comparison operator, and the value that you want to
  88775. // use for filtering. The value must be a string, a number, or a
  88776. // boolean. The comparison operator must be either =, !=, >, or <.
  88777. //
  88778. // For example, if you are filtering Compute Engine instances, you can
  88779. // exclude instances named example-instance by specifying name !=
  88780. // example-instance.
  88781. //
  88782. // You can also filter nested fields. For example, you could specify
  88783. // scheduling.automaticRestart = false to include instances only if they
  88784. // are not scheduled for automatic restarts. You can use filtering on
  88785. // nested fields to filter based on resource labels.
  88786. //
  88787. // To filter on multiple expressions, provide each separate expression
  88788. // within parentheses. For example, (scheduling.automaticRestart = true)
  88789. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  88790. // AND expression. However, you can include AND and OR expressions
  88791. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  88792. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  88793. // true).
  88794. func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall {
  88795. c.urlParams_.Set("filter", filter)
  88796. return c
  88797. }
  88798. // MaxResults sets the optional parameter "maxResults": The maximum
  88799. // number of results per page that should be returned. If the number of
  88800. // available results is larger than maxResults, Compute Engine returns a
  88801. // nextPageToken that can be used to get the next page of results in
  88802. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  88803. // (Default: 500)
  88804. func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall {
  88805. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  88806. return c
  88807. }
  88808. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  88809. // a certain order. By default, results are returned in alphanumerical
  88810. // order based on the resource name.
  88811. //
  88812. // You can also sort results in descending order based on the creation
  88813. // timestamp using orderBy="creationTimestamp desc". This sorts results
  88814. // based on the creationTimestamp field in reverse chronological order
  88815. // (newest result first). Use this to sort resources like operations so
  88816. // that the newest operation is returned first.
  88817. //
  88818. // Currently, only sorting by name or creationTimestamp desc is
  88819. // supported.
  88820. func (c *TargetPoolsAggregatedListCall) OrderBy(orderBy string) *TargetPoolsAggregatedListCall {
  88821. c.urlParams_.Set("orderBy", orderBy)
  88822. return c
  88823. }
  88824. // PageToken sets the optional parameter "pageToken": Specifies a page
  88825. // token to use. Set pageToken to the nextPageToken returned by a
  88826. // previous list request to get the next page of results.
  88827. func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall {
  88828. c.urlParams_.Set("pageToken", pageToken)
  88829. return c
  88830. }
  88831. // Fields allows partial responses to be retrieved. See
  88832. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88833. // for more information.
  88834. func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall {
  88835. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88836. return c
  88837. }
  88838. // IfNoneMatch sets the optional parameter which makes the operation
  88839. // fail if the object's ETag matches the given value. This is useful for
  88840. // getting updates only after the object has changed since the last
  88841. // request. Use googleapi.IsNotModified to check whether the response
  88842. // error from Do is the result of In-None-Match.
  88843. func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall {
  88844. c.ifNoneMatch_ = entityTag
  88845. return c
  88846. }
  88847. // Context sets the context to be used in this call's Do method. Any
  88848. // pending HTTP request will be aborted if the provided context is
  88849. // canceled.
  88850. func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall {
  88851. c.ctx_ = ctx
  88852. return c
  88853. }
  88854. // Header returns an http.Header that can be modified by the caller to
  88855. // add HTTP headers to the request.
  88856. func (c *TargetPoolsAggregatedListCall) Header() http.Header {
  88857. if c.header_ == nil {
  88858. c.header_ = make(http.Header)
  88859. }
  88860. return c.header_
  88861. }
  88862. func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  88863. reqHeaders := make(http.Header)
  88864. for k, v := range c.header_ {
  88865. reqHeaders[k] = v
  88866. }
  88867. reqHeaders.Set("User-Agent", c.s.userAgent())
  88868. if c.ifNoneMatch_ != "" {
  88869. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88870. }
  88871. var body io.Reader = nil
  88872. c.urlParams_.Set("alt", alt)
  88873. c.urlParams_.Set("prettyPrint", "false")
  88874. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools")
  88875. urls += "?" + c.urlParams_.Encode()
  88876. req, err := http.NewRequest("GET", urls, body)
  88877. if err != nil {
  88878. return nil, err
  88879. }
  88880. req.Header = reqHeaders
  88881. googleapi.Expand(req.URL, map[string]string{
  88882. "project": c.project,
  88883. })
  88884. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88885. }
  88886. // Do executes the "compute.targetPools.aggregatedList" call.
  88887. // Exactly one of *TargetPoolAggregatedList or error will be non-nil.
  88888. // Any non-2xx status code is an error. Response headers are in either
  88889. // *TargetPoolAggregatedList.ServerResponse.Header or (if a response was
  88890. // returned at all) in error.(*googleapi.Error).Header. Use
  88891. // googleapi.IsNotModified to check whether the returned error was
  88892. // because http.StatusNotModified was returned.
  88893. func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetPoolAggregatedList, error) {
  88894. gensupport.SetOptions(c.urlParams_, opts...)
  88895. res, err := c.doRequest("json")
  88896. if res != nil && res.StatusCode == http.StatusNotModified {
  88897. if res.Body != nil {
  88898. res.Body.Close()
  88899. }
  88900. return nil, &googleapi.Error{
  88901. Code: res.StatusCode,
  88902. Header: res.Header,
  88903. }
  88904. }
  88905. if err != nil {
  88906. return nil, err
  88907. }
  88908. defer googleapi.CloseBody(res)
  88909. if err := googleapi.CheckResponse(res); err != nil {
  88910. return nil, err
  88911. }
  88912. ret := &TargetPoolAggregatedList{
  88913. ServerResponse: googleapi.ServerResponse{
  88914. Header: res.Header,
  88915. HTTPStatusCode: res.StatusCode,
  88916. },
  88917. }
  88918. target := &ret
  88919. if err := gensupport.DecodeResponse(target, res); err != nil {
  88920. return nil, err
  88921. }
  88922. return ret, nil
  88923. // {
  88924. // "description": "Retrieves an aggregated list of target pools.",
  88925. // "httpMethod": "GET",
  88926. // "id": "compute.targetPools.aggregatedList",
  88927. // "parameterOrder": [
  88928. // "project"
  88929. // ],
  88930. // "parameters": {
  88931. // "filter": {
  88932. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  88933. // "location": "query",
  88934. // "type": "string"
  88935. // },
  88936. // "maxResults": {
  88937. // "default": "500",
  88938. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  88939. // "format": "uint32",
  88940. // "location": "query",
  88941. // "minimum": "0",
  88942. // "type": "integer"
  88943. // },
  88944. // "orderBy": {
  88945. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  88946. // "location": "query",
  88947. // "type": "string"
  88948. // },
  88949. // "pageToken": {
  88950. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  88951. // "location": "query",
  88952. // "type": "string"
  88953. // },
  88954. // "project": {
  88955. // "description": "Project ID for this request.",
  88956. // "location": "path",
  88957. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88958. // "required": true,
  88959. // "type": "string"
  88960. // }
  88961. // },
  88962. // "path": "{project}/aggregated/targetPools",
  88963. // "response": {
  88964. // "$ref": "TargetPoolAggregatedList"
  88965. // },
  88966. // "scopes": [
  88967. // "https://www.googleapis.com/auth/cloud-platform",
  88968. // "https://www.googleapis.com/auth/compute",
  88969. // "https://www.googleapis.com/auth/compute.readonly"
  88970. // ]
  88971. // }
  88972. }
  88973. // Pages invokes f for each page of results.
  88974. // A non-nil error returned from f will halt the iteration.
  88975. // The provided context supersedes any context provided to the Context method.
  88976. func (c *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) error) error {
  88977. c.ctx_ = ctx
  88978. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  88979. for {
  88980. x, err := c.Do()
  88981. if err != nil {
  88982. return err
  88983. }
  88984. if err := f(x); err != nil {
  88985. return err
  88986. }
  88987. if x.NextPageToken == "" {
  88988. return nil
  88989. }
  88990. c.PageToken(x.NextPageToken)
  88991. }
  88992. }
  88993. // method id "compute.targetPools.delete":
  88994. type TargetPoolsDeleteCall struct {
  88995. s *Service
  88996. project string
  88997. region string
  88998. targetPool string
  88999. urlParams_ gensupport.URLParams
  89000. ctx_ context.Context
  89001. header_ http.Header
  89002. }
  89003. // Delete: Deletes the specified target pool.
  89004. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete
  89005. func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall {
  89006. c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89007. c.project = project
  89008. c.region = region
  89009. c.targetPool = targetPool
  89010. return c
  89011. }
  89012. // RequestId sets the optional parameter "requestId": An optional
  89013. // request ID to identify requests. Specify a unique request ID so that
  89014. // if you must retry your request, the server will know to ignore the
  89015. // request if it has already been completed.
  89016. //
  89017. // For example, consider a situation where you make an initial request
  89018. // and the request times out. If you make the request again with the
  89019. // same request ID, the server can check if original operation with the
  89020. // same request ID was received, and if so, will ignore the second
  89021. // request. This prevents clients from accidentally creating duplicate
  89022. // commitments.
  89023. //
  89024. // The request ID must be a valid UUID with the exception that zero UUID
  89025. // is not supported (00000000-0000-0000-0000-000000000000).
  89026. func (c *TargetPoolsDeleteCall) RequestId(requestId string) *TargetPoolsDeleteCall {
  89027. c.urlParams_.Set("requestId", requestId)
  89028. return c
  89029. }
  89030. // Fields allows partial responses to be retrieved. See
  89031. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89032. // for more information.
  89033. func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall {
  89034. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89035. return c
  89036. }
  89037. // Context sets the context to be used in this call's Do method. Any
  89038. // pending HTTP request will be aborted if the provided context is
  89039. // canceled.
  89040. func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall {
  89041. c.ctx_ = ctx
  89042. return c
  89043. }
  89044. // Header returns an http.Header that can be modified by the caller to
  89045. // add HTTP headers to the request.
  89046. func (c *TargetPoolsDeleteCall) Header() http.Header {
  89047. if c.header_ == nil {
  89048. c.header_ = make(http.Header)
  89049. }
  89050. return c.header_
  89051. }
  89052. func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  89053. reqHeaders := make(http.Header)
  89054. for k, v := range c.header_ {
  89055. reqHeaders[k] = v
  89056. }
  89057. reqHeaders.Set("User-Agent", c.s.userAgent())
  89058. var body io.Reader = nil
  89059. c.urlParams_.Set("alt", alt)
  89060. c.urlParams_.Set("prettyPrint", "false")
  89061. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  89062. urls += "?" + c.urlParams_.Encode()
  89063. req, err := http.NewRequest("DELETE", urls, body)
  89064. if err != nil {
  89065. return nil, err
  89066. }
  89067. req.Header = reqHeaders
  89068. googleapi.Expand(req.URL, map[string]string{
  89069. "project": c.project,
  89070. "region": c.region,
  89071. "targetPool": c.targetPool,
  89072. })
  89073. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89074. }
  89075. // Do executes the "compute.targetPools.delete" call.
  89076. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89077. // status code is an error. Response headers are in either
  89078. // *Operation.ServerResponse.Header or (if a response was returned at
  89079. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89080. // to check whether the returned error was because
  89081. // http.StatusNotModified was returned.
  89082. func (c *TargetPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89083. gensupport.SetOptions(c.urlParams_, opts...)
  89084. res, err := c.doRequest("json")
  89085. if res != nil && res.StatusCode == http.StatusNotModified {
  89086. if res.Body != nil {
  89087. res.Body.Close()
  89088. }
  89089. return nil, &googleapi.Error{
  89090. Code: res.StatusCode,
  89091. Header: res.Header,
  89092. }
  89093. }
  89094. if err != nil {
  89095. return nil, err
  89096. }
  89097. defer googleapi.CloseBody(res)
  89098. if err := googleapi.CheckResponse(res); err != nil {
  89099. return nil, err
  89100. }
  89101. ret := &Operation{
  89102. ServerResponse: googleapi.ServerResponse{
  89103. Header: res.Header,
  89104. HTTPStatusCode: res.StatusCode,
  89105. },
  89106. }
  89107. target := &ret
  89108. if err := gensupport.DecodeResponse(target, res); err != nil {
  89109. return nil, err
  89110. }
  89111. return ret, nil
  89112. // {
  89113. // "description": "Deletes the specified target pool.",
  89114. // "httpMethod": "DELETE",
  89115. // "id": "compute.targetPools.delete",
  89116. // "parameterOrder": [
  89117. // "project",
  89118. // "region",
  89119. // "targetPool"
  89120. // ],
  89121. // "parameters": {
  89122. // "project": {
  89123. // "description": "Project ID for this request.",
  89124. // "location": "path",
  89125. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89126. // "required": true,
  89127. // "type": "string"
  89128. // },
  89129. // "region": {
  89130. // "description": "Name of the region scoping this request.",
  89131. // "location": "path",
  89132. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89133. // "required": true,
  89134. // "type": "string"
  89135. // },
  89136. // "requestId": {
  89137. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89138. // "location": "query",
  89139. // "type": "string"
  89140. // },
  89141. // "targetPool": {
  89142. // "description": "Name of the TargetPool resource to delete.",
  89143. // "location": "path",
  89144. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89145. // "required": true,
  89146. // "type": "string"
  89147. // }
  89148. // },
  89149. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  89150. // "response": {
  89151. // "$ref": "Operation"
  89152. // },
  89153. // "scopes": [
  89154. // "https://www.googleapis.com/auth/cloud-platform",
  89155. // "https://www.googleapis.com/auth/compute"
  89156. // ]
  89157. // }
  89158. }
  89159. // method id "compute.targetPools.get":
  89160. type TargetPoolsGetCall struct {
  89161. s *Service
  89162. project string
  89163. region string
  89164. targetPool string
  89165. urlParams_ gensupport.URLParams
  89166. ifNoneMatch_ string
  89167. ctx_ context.Context
  89168. header_ http.Header
  89169. }
  89170. // Get: Returns the specified target pool. Gets a list of available
  89171. // target pools by making a list() request.
  89172. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get
  89173. func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall {
  89174. c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89175. c.project = project
  89176. c.region = region
  89177. c.targetPool = targetPool
  89178. return c
  89179. }
  89180. // Fields allows partial responses to be retrieved. See
  89181. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89182. // for more information.
  89183. func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall {
  89184. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89185. return c
  89186. }
  89187. // IfNoneMatch sets the optional parameter which makes the operation
  89188. // fail if the object's ETag matches the given value. This is useful for
  89189. // getting updates only after the object has changed since the last
  89190. // request. Use googleapi.IsNotModified to check whether the response
  89191. // error from Do is the result of In-None-Match.
  89192. func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall {
  89193. c.ifNoneMatch_ = entityTag
  89194. return c
  89195. }
  89196. // Context sets the context to be used in this call's Do method. Any
  89197. // pending HTTP request will be aborted if the provided context is
  89198. // canceled.
  89199. func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall {
  89200. c.ctx_ = ctx
  89201. return c
  89202. }
  89203. // Header returns an http.Header that can be modified by the caller to
  89204. // add HTTP headers to the request.
  89205. func (c *TargetPoolsGetCall) Header() http.Header {
  89206. if c.header_ == nil {
  89207. c.header_ = make(http.Header)
  89208. }
  89209. return c.header_
  89210. }
  89211. func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  89212. reqHeaders := make(http.Header)
  89213. for k, v := range c.header_ {
  89214. reqHeaders[k] = v
  89215. }
  89216. reqHeaders.Set("User-Agent", c.s.userAgent())
  89217. if c.ifNoneMatch_ != "" {
  89218. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89219. }
  89220. var body io.Reader = nil
  89221. c.urlParams_.Set("alt", alt)
  89222. c.urlParams_.Set("prettyPrint", "false")
  89223. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  89224. urls += "?" + c.urlParams_.Encode()
  89225. req, err := http.NewRequest("GET", urls, body)
  89226. if err != nil {
  89227. return nil, err
  89228. }
  89229. req.Header = reqHeaders
  89230. googleapi.Expand(req.URL, map[string]string{
  89231. "project": c.project,
  89232. "region": c.region,
  89233. "targetPool": c.targetPool,
  89234. })
  89235. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89236. }
  89237. // Do executes the "compute.targetPools.get" call.
  89238. // Exactly one of *TargetPool or error will be non-nil. Any non-2xx
  89239. // status code is an error. Response headers are in either
  89240. // *TargetPool.ServerResponse.Header or (if a response was returned at
  89241. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89242. // to check whether the returned error was because
  89243. // http.StatusNotModified was returned.
  89244. func (c *TargetPoolsGetCall) Do(opts ...googleapi.CallOption) (*TargetPool, error) {
  89245. gensupport.SetOptions(c.urlParams_, opts...)
  89246. res, err := c.doRequest("json")
  89247. if res != nil && res.StatusCode == http.StatusNotModified {
  89248. if res.Body != nil {
  89249. res.Body.Close()
  89250. }
  89251. return nil, &googleapi.Error{
  89252. Code: res.StatusCode,
  89253. Header: res.Header,
  89254. }
  89255. }
  89256. if err != nil {
  89257. return nil, err
  89258. }
  89259. defer googleapi.CloseBody(res)
  89260. if err := googleapi.CheckResponse(res); err != nil {
  89261. return nil, err
  89262. }
  89263. ret := &TargetPool{
  89264. ServerResponse: googleapi.ServerResponse{
  89265. Header: res.Header,
  89266. HTTPStatusCode: res.StatusCode,
  89267. },
  89268. }
  89269. target := &ret
  89270. if err := gensupport.DecodeResponse(target, res); err != nil {
  89271. return nil, err
  89272. }
  89273. return ret, nil
  89274. // {
  89275. // "description": "Returns the specified target pool. Gets a list of available target pools by making a list() request.",
  89276. // "httpMethod": "GET",
  89277. // "id": "compute.targetPools.get",
  89278. // "parameterOrder": [
  89279. // "project",
  89280. // "region",
  89281. // "targetPool"
  89282. // ],
  89283. // "parameters": {
  89284. // "project": {
  89285. // "description": "Project ID for this request.",
  89286. // "location": "path",
  89287. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89288. // "required": true,
  89289. // "type": "string"
  89290. // },
  89291. // "region": {
  89292. // "description": "Name of the region scoping this request.",
  89293. // "location": "path",
  89294. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89295. // "required": true,
  89296. // "type": "string"
  89297. // },
  89298. // "targetPool": {
  89299. // "description": "Name of the TargetPool resource to return.",
  89300. // "location": "path",
  89301. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89302. // "required": true,
  89303. // "type": "string"
  89304. // }
  89305. // },
  89306. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  89307. // "response": {
  89308. // "$ref": "TargetPool"
  89309. // },
  89310. // "scopes": [
  89311. // "https://www.googleapis.com/auth/cloud-platform",
  89312. // "https://www.googleapis.com/auth/compute",
  89313. // "https://www.googleapis.com/auth/compute.readonly"
  89314. // ]
  89315. // }
  89316. }
  89317. // method id "compute.targetPools.getHealth":
  89318. type TargetPoolsGetHealthCall struct {
  89319. s *Service
  89320. project string
  89321. region string
  89322. targetPool string
  89323. instancereference *InstanceReference
  89324. urlParams_ gensupport.URLParams
  89325. ctx_ context.Context
  89326. header_ http.Header
  89327. }
  89328. // GetHealth: Gets the most recent health check results for each IP for
  89329. // the instance that is referenced by the given target pool.
  89330. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth
  89331. func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall {
  89332. c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89333. c.project = project
  89334. c.region = region
  89335. c.targetPool = targetPool
  89336. c.instancereference = instancereference
  89337. return c
  89338. }
  89339. // Fields allows partial responses to be retrieved. See
  89340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89341. // for more information.
  89342. func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall {
  89343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89344. return c
  89345. }
  89346. // Context sets the context to be used in this call's Do method. Any
  89347. // pending HTTP request will be aborted if the provided context is
  89348. // canceled.
  89349. func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall {
  89350. c.ctx_ = ctx
  89351. return c
  89352. }
  89353. // Header returns an http.Header that can be modified by the caller to
  89354. // add HTTP headers to the request.
  89355. func (c *TargetPoolsGetHealthCall) Header() http.Header {
  89356. if c.header_ == nil {
  89357. c.header_ = make(http.Header)
  89358. }
  89359. return c.header_
  89360. }
  89361. func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) {
  89362. reqHeaders := make(http.Header)
  89363. for k, v := range c.header_ {
  89364. reqHeaders[k] = v
  89365. }
  89366. reqHeaders.Set("User-Agent", c.s.userAgent())
  89367. var body io.Reader = nil
  89368. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference)
  89369. if err != nil {
  89370. return nil, err
  89371. }
  89372. reqHeaders.Set("Content-Type", "application/json")
  89373. c.urlParams_.Set("alt", alt)
  89374. c.urlParams_.Set("prettyPrint", "false")
  89375. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth")
  89376. urls += "?" + c.urlParams_.Encode()
  89377. req, err := http.NewRequest("POST", urls, body)
  89378. if err != nil {
  89379. return nil, err
  89380. }
  89381. req.Header = reqHeaders
  89382. googleapi.Expand(req.URL, map[string]string{
  89383. "project": c.project,
  89384. "region": c.region,
  89385. "targetPool": c.targetPool,
  89386. })
  89387. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89388. }
  89389. // Do executes the "compute.targetPools.getHealth" call.
  89390. // Exactly one of *TargetPoolInstanceHealth or error will be non-nil.
  89391. // Any non-2xx status code is an error. Response headers are in either
  89392. // *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was
  89393. // returned at all) in error.(*googleapi.Error).Header. Use
  89394. // googleapi.IsNotModified to check whether the returned error was
  89395. // because http.StatusNotModified was returned.
  89396. func (c *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPoolInstanceHealth, error) {
  89397. gensupport.SetOptions(c.urlParams_, opts...)
  89398. res, err := c.doRequest("json")
  89399. if res != nil && res.StatusCode == http.StatusNotModified {
  89400. if res.Body != nil {
  89401. res.Body.Close()
  89402. }
  89403. return nil, &googleapi.Error{
  89404. Code: res.StatusCode,
  89405. Header: res.Header,
  89406. }
  89407. }
  89408. if err != nil {
  89409. return nil, err
  89410. }
  89411. defer googleapi.CloseBody(res)
  89412. if err := googleapi.CheckResponse(res); err != nil {
  89413. return nil, err
  89414. }
  89415. ret := &TargetPoolInstanceHealth{
  89416. ServerResponse: googleapi.ServerResponse{
  89417. Header: res.Header,
  89418. HTTPStatusCode: res.StatusCode,
  89419. },
  89420. }
  89421. target := &ret
  89422. if err := gensupport.DecodeResponse(target, res); err != nil {
  89423. return nil, err
  89424. }
  89425. return ret, nil
  89426. // {
  89427. // "description": "Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.",
  89428. // "httpMethod": "POST",
  89429. // "id": "compute.targetPools.getHealth",
  89430. // "parameterOrder": [
  89431. // "project",
  89432. // "region",
  89433. // "targetPool"
  89434. // ],
  89435. // "parameters": {
  89436. // "project": {
  89437. // "description": "Project ID for this request.",
  89438. // "location": "path",
  89439. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89440. // "required": true,
  89441. // "type": "string"
  89442. // },
  89443. // "region": {
  89444. // "description": "Name of the region scoping this request.",
  89445. // "location": "path",
  89446. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89447. // "required": true,
  89448. // "type": "string"
  89449. // },
  89450. // "targetPool": {
  89451. // "description": "Name of the TargetPool resource to which the queried instance belongs.",
  89452. // "location": "path",
  89453. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89454. // "required": true,
  89455. // "type": "string"
  89456. // }
  89457. // },
  89458. // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth",
  89459. // "request": {
  89460. // "$ref": "InstanceReference"
  89461. // },
  89462. // "response": {
  89463. // "$ref": "TargetPoolInstanceHealth"
  89464. // },
  89465. // "scopes": [
  89466. // "https://www.googleapis.com/auth/cloud-platform",
  89467. // "https://www.googleapis.com/auth/compute",
  89468. // "https://www.googleapis.com/auth/compute.readonly"
  89469. // ]
  89470. // }
  89471. }
  89472. // method id "compute.targetPools.insert":
  89473. type TargetPoolsInsertCall struct {
  89474. s *Service
  89475. project string
  89476. region string
  89477. targetpool *TargetPool
  89478. urlParams_ gensupport.URLParams
  89479. ctx_ context.Context
  89480. header_ http.Header
  89481. }
  89482. // Insert: Creates a target pool in the specified project and region
  89483. // using the data included in the request.
  89484. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert
  89485. func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall {
  89486. c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89487. c.project = project
  89488. c.region = region
  89489. c.targetpool = targetpool
  89490. return c
  89491. }
  89492. // RequestId sets the optional parameter "requestId": An optional
  89493. // request ID to identify requests. Specify a unique request ID so that
  89494. // if you must retry your request, the server will know to ignore the
  89495. // request if it has already been completed.
  89496. //
  89497. // For example, consider a situation where you make an initial request
  89498. // and the request times out. If you make the request again with the
  89499. // same request ID, the server can check if original operation with the
  89500. // same request ID was received, and if so, will ignore the second
  89501. // request. This prevents clients from accidentally creating duplicate
  89502. // commitments.
  89503. //
  89504. // The request ID must be a valid UUID with the exception that zero UUID
  89505. // is not supported (00000000-0000-0000-0000-000000000000).
  89506. func (c *TargetPoolsInsertCall) RequestId(requestId string) *TargetPoolsInsertCall {
  89507. c.urlParams_.Set("requestId", requestId)
  89508. return c
  89509. }
  89510. // Fields allows partial responses to be retrieved. See
  89511. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89512. // for more information.
  89513. func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall {
  89514. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89515. return c
  89516. }
  89517. // Context sets the context to be used in this call's Do method. Any
  89518. // pending HTTP request will be aborted if the provided context is
  89519. // canceled.
  89520. func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall {
  89521. c.ctx_ = ctx
  89522. return c
  89523. }
  89524. // Header returns an http.Header that can be modified by the caller to
  89525. // add HTTP headers to the request.
  89526. func (c *TargetPoolsInsertCall) Header() http.Header {
  89527. if c.header_ == nil {
  89528. c.header_ = make(http.Header)
  89529. }
  89530. return c.header_
  89531. }
  89532. func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) {
  89533. reqHeaders := make(http.Header)
  89534. for k, v := range c.header_ {
  89535. reqHeaders[k] = v
  89536. }
  89537. reqHeaders.Set("User-Agent", c.s.userAgent())
  89538. var body io.Reader = nil
  89539. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool)
  89540. if err != nil {
  89541. return nil, err
  89542. }
  89543. reqHeaders.Set("Content-Type", "application/json")
  89544. c.urlParams_.Set("alt", alt)
  89545. c.urlParams_.Set("prettyPrint", "false")
  89546. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  89547. urls += "?" + c.urlParams_.Encode()
  89548. req, err := http.NewRequest("POST", urls, body)
  89549. if err != nil {
  89550. return nil, err
  89551. }
  89552. req.Header = reqHeaders
  89553. googleapi.Expand(req.URL, map[string]string{
  89554. "project": c.project,
  89555. "region": c.region,
  89556. })
  89557. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89558. }
  89559. // Do executes the "compute.targetPools.insert" call.
  89560. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89561. // status code is an error. Response headers are in either
  89562. // *Operation.ServerResponse.Header or (if a response was returned at
  89563. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89564. // to check whether the returned error was because
  89565. // http.StatusNotModified was returned.
  89566. func (c *TargetPoolsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89567. gensupport.SetOptions(c.urlParams_, opts...)
  89568. res, err := c.doRequest("json")
  89569. if res != nil && res.StatusCode == http.StatusNotModified {
  89570. if res.Body != nil {
  89571. res.Body.Close()
  89572. }
  89573. return nil, &googleapi.Error{
  89574. Code: res.StatusCode,
  89575. Header: res.Header,
  89576. }
  89577. }
  89578. if err != nil {
  89579. return nil, err
  89580. }
  89581. defer googleapi.CloseBody(res)
  89582. if err := googleapi.CheckResponse(res); err != nil {
  89583. return nil, err
  89584. }
  89585. ret := &Operation{
  89586. ServerResponse: googleapi.ServerResponse{
  89587. Header: res.Header,
  89588. HTTPStatusCode: res.StatusCode,
  89589. },
  89590. }
  89591. target := &ret
  89592. if err := gensupport.DecodeResponse(target, res); err != nil {
  89593. return nil, err
  89594. }
  89595. return ret, nil
  89596. // {
  89597. // "description": "Creates a target pool in the specified project and region using the data included in the request.",
  89598. // "httpMethod": "POST",
  89599. // "id": "compute.targetPools.insert",
  89600. // "parameterOrder": [
  89601. // "project",
  89602. // "region"
  89603. // ],
  89604. // "parameters": {
  89605. // "project": {
  89606. // "description": "Project ID for this request.",
  89607. // "location": "path",
  89608. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89609. // "required": true,
  89610. // "type": "string"
  89611. // },
  89612. // "region": {
  89613. // "description": "Name of the region scoping this request.",
  89614. // "location": "path",
  89615. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89616. // "required": true,
  89617. // "type": "string"
  89618. // },
  89619. // "requestId": {
  89620. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89621. // "location": "query",
  89622. // "type": "string"
  89623. // }
  89624. // },
  89625. // "path": "{project}/regions/{region}/targetPools",
  89626. // "request": {
  89627. // "$ref": "TargetPool"
  89628. // },
  89629. // "response": {
  89630. // "$ref": "Operation"
  89631. // },
  89632. // "scopes": [
  89633. // "https://www.googleapis.com/auth/cloud-platform",
  89634. // "https://www.googleapis.com/auth/compute"
  89635. // ]
  89636. // }
  89637. }
  89638. // method id "compute.targetPools.list":
  89639. type TargetPoolsListCall struct {
  89640. s *Service
  89641. project string
  89642. region string
  89643. urlParams_ gensupport.URLParams
  89644. ifNoneMatch_ string
  89645. ctx_ context.Context
  89646. header_ http.Header
  89647. }
  89648. // List: Retrieves a list of target pools available to the specified
  89649. // project and region.
  89650. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list
  89651. func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall {
  89652. c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89653. c.project = project
  89654. c.region = region
  89655. return c
  89656. }
  89657. // Filter sets the optional parameter "filter": A filter expression that
  89658. // filters resources listed in the response. The expression must specify
  89659. // the field name, a comparison operator, and the value that you want to
  89660. // use for filtering. The value must be a string, a number, or a
  89661. // boolean. The comparison operator must be either =, !=, >, or <.
  89662. //
  89663. // For example, if you are filtering Compute Engine instances, you can
  89664. // exclude instances named example-instance by specifying name !=
  89665. // example-instance.
  89666. //
  89667. // You can also filter nested fields. For example, you could specify
  89668. // scheduling.automaticRestart = false to include instances only if they
  89669. // are not scheduled for automatic restarts. You can use filtering on
  89670. // nested fields to filter based on resource labels.
  89671. //
  89672. // To filter on multiple expressions, provide each separate expression
  89673. // within parentheses. For example, (scheduling.automaticRestart = true)
  89674. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  89675. // AND expression. However, you can include AND and OR expressions
  89676. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  89677. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  89678. // true).
  89679. func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall {
  89680. c.urlParams_.Set("filter", filter)
  89681. return c
  89682. }
  89683. // MaxResults sets the optional parameter "maxResults": The maximum
  89684. // number of results per page that should be returned. If the number of
  89685. // available results is larger than maxResults, Compute Engine returns a
  89686. // nextPageToken that can be used to get the next page of results in
  89687. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  89688. // (Default: 500)
  89689. func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall {
  89690. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  89691. return c
  89692. }
  89693. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  89694. // a certain order. By default, results are returned in alphanumerical
  89695. // order based on the resource name.
  89696. //
  89697. // You can also sort results in descending order based on the creation
  89698. // timestamp using orderBy="creationTimestamp desc". This sorts results
  89699. // based on the creationTimestamp field in reverse chronological order
  89700. // (newest result first). Use this to sort resources like operations so
  89701. // that the newest operation is returned first.
  89702. //
  89703. // Currently, only sorting by name or creationTimestamp desc is
  89704. // supported.
  89705. func (c *TargetPoolsListCall) OrderBy(orderBy string) *TargetPoolsListCall {
  89706. c.urlParams_.Set("orderBy", orderBy)
  89707. return c
  89708. }
  89709. // PageToken sets the optional parameter "pageToken": Specifies a page
  89710. // token to use. Set pageToken to the nextPageToken returned by a
  89711. // previous list request to get the next page of results.
  89712. func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall {
  89713. c.urlParams_.Set("pageToken", pageToken)
  89714. return c
  89715. }
  89716. // Fields allows partial responses to be retrieved. See
  89717. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89718. // for more information.
  89719. func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall {
  89720. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89721. return c
  89722. }
  89723. // IfNoneMatch sets the optional parameter which makes the operation
  89724. // fail if the object's ETag matches the given value. This is useful for
  89725. // getting updates only after the object has changed since the last
  89726. // request. Use googleapi.IsNotModified to check whether the response
  89727. // error from Do is the result of In-None-Match.
  89728. func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall {
  89729. c.ifNoneMatch_ = entityTag
  89730. return c
  89731. }
  89732. // Context sets the context to be used in this call's Do method. Any
  89733. // pending HTTP request will be aborted if the provided context is
  89734. // canceled.
  89735. func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall {
  89736. c.ctx_ = ctx
  89737. return c
  89738. }
  89739. // Header returns an http.Header that can be modified by the caller to
  89740. // add HTTP headers to the request.
  89741. func (c *TargetPoolsListCall) Header() http.Header {
  89742. if c.header_ == nil {
  89743. c.header_ = make(http.Header)
  89744. }
  89745. return c.header_
  89746. }
  89747. func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) {
  89748. reqHeaders := make(http.Header)
  89749. for k, v := range c.header_ {
  89750. reqHeaders[k] = v
  89751. }
  89752. reqHeaders.Set("User-Agent", c.s.userAgent())
  89753. if c.ifNoneMatch_ != "" {
  89754. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89755. }
  89756. var body io.Reader = nil
  89757. c.urlParams_.Set("alt", alt)
  89758. c.urlParams_.Set("prettyPrint", "false")
  89759. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  89760. urls += "?" + c.urlParams_.Encode()
  89761. req, err := http.NewRequest("GET", urls, body)
  89762. if err != nil {
  89763. return nil, err
  89764. }
  89765. req.Header = reqHeaders
  89766. googleapi.Expand(req.URL, map[string]string{
  89767. "project": c.project,
  89768. "region": c.region,
  89769. })
  89770. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89771. }
  89772. // Do executes the "compute.targetPools.list" call.
  89773. // Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx
  89774. // status code is an error. Response headers are in either
  89775. // *TargetPoolList.ServerResponse.Header or (if a response was returned
  89776. // at all) in error.(*googleapi.Error).Header. Use
  89777. // googleapi.IsNotModified to check whether the returned error was
  89778. // because http.StatusNotModified was returned.
  89779. func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, error) {
  89780. gensupport.SetOptions(c.urlParams_, opts...)
  89781. res, err := c.doRequest("json")
  89782. if res != nil && res.StatusCode == http.StatusNotModified {
  89783. if res.Body != nil {
  89784. res.Body.Close()
  89785. }
  89786. return nil, &googleapi.Error{
  89787. Code: res.StatusCode,
  89788. Header: res.Header,
  89789. }
  89790. }
  89791. if err != nil {
  89792. return nil, err
  89793. }
  89794. defer googleapi.CloseBody(res)
  89795. if err := googleapi.CheckResponse(res); err != nil {
  89796. return nil, err
  89797. }
  89798. ret := &TargetPoolList{
  89799. ServerResponse: googleapi.ServerResponse{
  89800. Header: res.Header,
  89801. HTTPStatusCode: res.StatusCode,
  89802. },
  89803. }
  89804. target := &ret
  89805. if err := gensupport.DecodeResponse(target, res); err != nil {
  89806. return nil, err
  89807. }
  89808. return ret, nil
  89809. // {
  89810. // "description": "Retrieves a list of target pools available to the specified project and region.",
  89811. // "httpMethod": "GET",
  89812. // "id": "compute.targetPools.list",
  89813. // "parameterOrder": [
  89814. // "project",
  89815. // "region"
  89816. // ],
  89817. // "parameters": {
  89818. // "filter": {
  89819. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  89820. // "location": "query",
  89821. // "type": "string"
  89822. // },
  89823. // "maxResults": {
  89824. // "default": "500",
  89825. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  89826. // "format": "uint32",
  89827. // "location": "query",
  89828. // "minimum": "0",
  89829. // "type": "integer"
  89830. // },
  89831. // "orderBy": {
  89832. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  89833. // "location": "query",
  89834. // "type": "string"
  89835. // },
  89836. // "pageToken": {
  89837. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  89838. // "location": "query",
  89839. // "type": "string"
  89840. // },
  89841. // "project": {
  89842. // "description": "Project ID for this request.",
  89843. // "location": "path",
  89844. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89845. // "required": true,
  89846. // "type": "string"
  89847. // },
  89848. // "region": {
  89849. // "description": "Name of the region scoping this request.",
  89850. // "location": "path",
  89851. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89852. // "required": true,
  89853. // "type": "string"
  89854. // }
  89855. // },
  89856. // "path": "{project}/regions/{region}/targetPools",
  89857. // "response": {
  89858. // "$ref": "TargetPoolList"
  89859. // },
  89860. // "scopes": [
  89861. // "https://www.googleapis.com/auth/cloud-platform",
  89862. // "https://www.googleapis.com/auth/compute",
  89863. // "https://www.googleapis.com/auth/compute.readonly"
  89864. // ]
  89865. // }
  89866. }
  89867. // Pages invokes f for each page of results.
  89868. // A non-nil error returned from f will halt the iteration.
  89869. // The provided context supersedes any context provided to the Context method.
  89870. func (c *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) error) error {
  89871. c.ctx_ = ctx
  89872. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  89873. for {
  89874. x, err := c.Do()
  89875. if err != nil {
  89876. return err
  89877. }
  89878. if err := f(x); err != nil {
  89879. return err
  89880. }
  89881. if x.NextPageToken == "" {
  89882. return nil
  89883. }
  89884. c.PageToken(x.NextPageToken)
  89885. }
  89886. }
  89887. // method id "compute.targetPools.removeHealthCheck":
  89888. type TargetPoolsRemoveHealthCheckCall struct {
  89889. s *Service
  89890. project string
  89891. region string
  89892. targetPool string
  89893. targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest
  89894. urlParams_ gensupport.URLParams
  89895. ctx_ context.Context
  89896. header_ http.Header
  89897. }
  89898. // RemoveHealthCheck: Removes health check URL from a target pool.
  89899. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck
  89900. func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall {
  89901. c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89902. c.project = project
  89903. c.region = region
  89904. c.targetPool = targetPool
  89905. c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest
  89906. return c
  89907. }
  89908. // RequestId sets the optional parameter "requestId": An optional
  89909. // request ID to identify requests. Specify a unique request ID so that
  89910. // if you must retry your request, the server will know to ignore the
  89911. // request if it has already been completed.
  89912. //
  89913. // For example, consider a situation where you make an initial request
  89914. // and the request times out. If you make the request again with the
  89915. // same request ID, the server can check if original operation with the
  89916. // same request ID was received, and if so, will ignore the second
  89917. // request. This prevents clients from accidentally creating duplicate
  89918. // commitments.
  89919. //
  89920. // The request ID must be a valid UUID with the exception that zero UUID
  89921. // is not supported (00000000-0000-0000-0000-000000000000).
  89922. func (c *TargetPoolsRemoveHealthCheckCall) RequestId(requestId string) *TargetPoolsRemoveHealthCheckCall {
  89923. c.urlParams_.Set("requestId", requestId)
  89924. return c
  89925. }
  89926. // Fields allows partial responses to be retrieved. See
  89927. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89928. // for more information.
  89929. func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall {
  89930. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89931. return c
  89932. }
  89933. // Context sets the context to be used in this call's Do method. Any
  89934. // pending HTTP request will be aborted if the provided context is
  89935. // canceled.
  89936. func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall {
  89937. c.ctx_ = ctx
  89938. return c
  89939. }
  89940. // Header returns an http.Header that can be modified by the caller to
  89941. // add HTTP headers to the request.
  89942. func (c *TargetPoolsRemoveHealthCheckCall) Header() http.Header {
  89943. if c.header_ == nil {
  89944. c.header_ = make(http.Header)
  89945. }
  89946. return c.header_
  89947. }
  89948. func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  89949. reqHeaders := make(http.Header)
  89950. for k, v := range c.header_ {
  89951. reqHeaders[k] = v
  89952. }
  89953. reqHeaders.Set("User-Agent", c.s.userAgent())
  89954. var body io.Reader = nil
  89955. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest)
  89956. if err != nil {
  89957. return nil, err
  89958. }
  89959. reqHeaders.Set("Content-Type", "application/json")
  89960. c.urlParams_.Set("alt", alt)
  89961. c.urlParams_.Set("prettyPrint", "false")
  89962. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")
  89963. urls += "?" + c.urlParams_.Encode()
  89964. req, err := http.NewRequest("POST", urls, body)
  89965. if err != nil {
  89966. return nil, err
  89967. }
  89968. req.Header = reqHeaders
  89969. googleapi.Expand(req.URL, map[string]string{
  89970. "project": c.project,
  89971. "region": c.region,
  89972. "targetPool": c.targetPool,
  89973. })
  89974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89975. }
  89976. // Do executes the "compute.targetPools.removeHealthCheck" call.
  89977. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89978. // status code is an error. Response headers are in either
  89979. // *Operation.ServerResponse.Header or (if a response was returned at
  89980. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89981. // to check whether the returned error was because
  89982. // http.StatusNotModified was returned.
  89983. func (c *TargetPoolsRemoveHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89984. gensupport.SetOptions(c.urlParams_, opts...)
  89985. res, err := c.doRequest("json")
  89986. if res != nil && res.StatusCode == http.StatusNotModified {
  89987. if res.Body != nil {
  89988. res.Body.Close()
  89989. }
  89990. return nil, &googleapi.Error{
  89991. Code: res.StatusCode,
  89992. Header: res.Header,
  89993. }
  89994. }
  89995. if err != nil {
  89996. return nil, err
  89997. }
  89998. defer googleapi.CloseBody(res)
  89999. if err := googleapi.CheckResponse(res); err != nil {
  90000. return nil, err
  90001. }
  90002. ret := &Operation{
  90003. ServerResponse: googleapi.ServerResponse{
  90004. Header: res.Header,
  90005. HTTPStatusCode: res.StatusCode,
  90006. },
  90007. }
  90008. target := &ret
  90009. if err := gensupport.DecodeResponse(target, res); err != nil {
  90010. return nil, err
  90011. }
  90012. return ret, nil
  90013. // {
  90014. // "description": "Removes health check URL from a target pool.",
  90015. // "httpMethod": "POST",
  90016. // "id": "compute.targetPools.removeHealthCheck",
  90017. // "parameterOrder": [
  90018. // "project",
  90019. // "region",
  90020. // "targetPool"
  90021. // ],
  90022. // "parameters": {
  90023. // "project": {
  90024. // "description": "Project ID for this request.",
  90025. // "location": "path",
  90026. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90027. // "required": true,
  90028. // "type": "string"
  90029. // },
  90030. // "region": {
  90031. // "description": "Name of the region for this request.",
  90032. // "location": "path",
  90033. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90034. // "required": true,
  90035. // "type": "string"
  90036. // },
  90037. // "requestId": {
  90038. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90039. // "location": "query",
  90040. // "type": "string"
  90041. // },
  90042. // "targetPool": {
  90043. // "description": "Name of the target pool to remove health checks from.",
  90044. // "location": "path",
  90045. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  90046. // "required": true,
  90047. // "type": "string"
  90048. // }
  90049. // },
  90050. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
  90051. // "request": {
  90052. // "$ref": "TargetPoolsRemoveHealthCheckRequest"
  90053. // },
  90054. // "response": {
  90055. // "$ref": "Operation"
  90056. // },
  90057. // "scopes": [
  90058. // "https://www.googleapis.com/auth/cloud-platform",
  90059. // "https://www.googleapis.com/auth/compute"
  90060. // ]
  90061. // }
  90062. }
  90063. // method id "compute.targetPools.removeInstance":
  90064. type TargetPoolsRemoveInstanceCall struct {
  90065. s *Service
  90066. project string
  90067. region string
  90068. targetPool string
  90069. targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest
  90070. urlParams_ gensupport.URLParams
  90071. ctx_ context.Context
  90072. header_ http.Header
  90073. }
  90074. // RemoveInstance: Removes instance URL from a target pool.
  90075. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance
  90076. func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall {
  90077. c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90078. c.project = project
  90079. c.region = region
  90080. c.targetPool = targetPool
  90081. c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest
  90082. return c
  90083. }
  90084. // RequestId sets the optional parameter "requestId": An optional
  90085. // request ID to identify requests. Specify a unique request ID so that
  90086. // if you must retry your request, the server will know to ignore the
  90087. // request if it has already been completed.
  90088. //
  90089. // For example, consider a situation where you make an initial request
  90090. // and the request times out. If you make the request again with the
  90091. // same request ID, the server can check if original operation with the
  90092. // same request ID was received, and if so, will ignore the second
  90093. // request. This prevents clients from accidentally creating duplicate
  90094. // commitments.
  90095. //
  90096. // The request ID must be a valid UUID with the exception that zero UUID
  90097. // is not supported (00000000-0000-0000-0000-000000000000).
  90098. func (c *TargetPoolsRemoveInstanceCall) RequestId(requestId string) *TargetPoolsRemoveInstanceCall {
  90099. c.urlParams_.Set("requestId", requestId)
  90100. return c
  90101. }
  90102. // Fields allows partial responses to be retrieved. See
  90103. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90104. // for more information.
  90105. func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall {
  90106. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90107. return c
  90108. }
  90109. // Context sets the context to be used in this call's Do method. Any
  90110. // pending HTTP request will be aborted if the provided context is
  90111. // canceled.
  90112. func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall {
  90113. c.ctx_ = ctx
  90114. return c
  90115. }
  90116. // Header returns an http.Header that can be modified by the caller to
  90117. // add HTTP headers to the request.
  90118. func (c *TargetPoolsRemoveInstanceCall) Header() http.Header {
  90119. if c.header_ == nil {
  90120. c.header_ = make(http.Header)
  90121. }
  90122. return c.header_
  90123. }
  90124. func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  90125. reqHeaders := make(http.Header)
  90126. for k, v := range c.header_ {
  90127. reqHeaders[k] = v
  90128. }
  90129. reqHeaders.Set("User-Agent", c.s.userAgent())
  90130. var body io.Reader = nil
  90131. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest)
  90132. if err != nil {
  90133. return nil, err
  90134. }
  90135. reqHeaders.Set("Content-Type", "application/json")
  90136. c.urlParams_.Set("alt", alt)
  90137. c.urlParams_.Set("prettyPrint", "false")
  90138. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")
  90139. urls += "?" + c.urlParams_.Encode()
  90140. req, err := http.NewRequest("POST", urls, body)
  90141. if err != nil {
  90142. return nil, err
  90143. }
  90144. req.Header = reqHeaders
  90145. googleapi.Expand(req.URL, map[string]string{
  90146. "project": c.project,
  90147. "region": c.region,
  90148. "targetPool": c.targetPool,
  90149. })
  90150. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90151. }
  90152. // Do executes the "compute.targetPools.removeInstance" call.
  90153. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90154. // status code is an error. Response headers are in either
  90155. // *Operation.ServerResponse.Header or (if a response was returned at
  90156. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90157. // to check whether the returned error was because
  90158. // http.StatusNotModified was returned.
  90159. func (c *TargetPoolsRemoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90160. gensupport.SetOptions(c.urlParams_, opts...)
  90161. res, err := c.doRequest("json")
  90162. if res != nil && res.StatusCode == http.StatusNotModified {
  90163. if res.Body != nil {
  90164. res.Body.Close()
  90165. }
  90166. return nil, &googleapi.Error{
  90167. Code: res.StatusCode,
  90168. Header: res.Header,
  90169. }
  90170. }
  90171. if err != nil {
  90172. return nil, err
  90173. }
  90174. defer googleapi.CloseBody(res)
  90175. if err := googleapi.CheckResponse(res); err != nil {
  90176. return nil, err
  90177. }
  90178. ret := &Operation{
  90179. ServerResponse: googleapi.ServerResponse{
  90180. Header: res.Header,
  90181. HTTPStatusCode: res.StatusCode,
  90182. },
  90183. }
  90184. target := &ret
  90185. if err := gensupport.DecodeResponse(target, res); err != nil {
  90186. return nil, err
  90187. }
  90188. return ret, nil
  90189. // {
  90190. // "description": "Removes instance URL from a target pool.",
  90191. // "httpMethod": "POST",
  90192. // "id": "compute.targetPools.removeInstance",
  90193. // "parameterOrder": [
  90194. // "project",
  90195. // "region",
  90196. // "targetPool"
  90197. // ],
  90198. // "parameters": {
  90199. // "project": {
  90200. // "description": "Project ID for this request.",
  90201. // "location": "path",
  90202. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90203. // "required": true,
  90204. // "type": "string"
  90205. // },
  90206. // "region": {
  90207. // "description": "Name of the region scoping this request.",
  90208. // "location": "path",
  90209. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90210. // "required": true,
  90211. // "type": "string"
  90212. // },
  90213. // "requestId": {
  90214. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90215. // "location": "query",
  90216. // "type": "string"
  90217. // },
  90218. // "targetPool": {
  90219. // "description": "Name of the TargetPool resource to remove instances from.",
  90220. // "location": "path",
  90221. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  90222. // "required": true,
  90223. // "type": "string"
  90224. // }
  90225. // },
  90226. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
  90227. // "request": {
  90228. // "$ref": "TargetPoolsRemoveInstanceRequest"
  90229. // },
  90230. // "response": {
  90231. // "$ref": "Operation"
  90232. // },
  90233. // "scopes": [
  90234. // "https://www.googleapis.com/auth/cloud-platform",
  90235. // "https://www.googleapis.com/auth/compute"
  90236. // ]
  90237. // }
  90238. }
  90239. // method id "compute.targetPools.setBackup":
  90240. type TargetPoolsSetBackupCall struct {
  90241. s *Service
  90242. project string
  90243. region string
  90244. targetPool string
  90245. targetreference *TargetReference
  90246. urlParams_ gensupport.URLParams
  90247. ctx_ context.Context
  90248. header_ http.Header
  90249. }
  90250. // SetBackup: Changes a backup target pool's configurations.
  90251. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup
  90252. func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall {
  90253. c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90254. c.project = project
  90255. c.region = region
  90256. c.targetPool = targetPool
  90257. c.targetreference = targetreference
  90258. return c
  90259. }
  90260. // FailoverRatio sets the optional parameter "failoverRatio": New
  90261. // failoverRatio value for the target pool.
  90262. func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall {
  90263. c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio))
  90264. return c
  90265. }
  90266. // RequestId sets the optional parameter "requestId": An optional
  90267. // request ID to identify requests. Specify a unique request ID so that
  90268. // if you must retry your request, the server will know to ignore the
  90269. // request if it has already been completed.
  90270. //
  90271. // For example, consider a situation where you make an initial request
  90272. // and the request times out. If you make the request again with the
  90273. // same request ID, the server can check if original operation with the
  90274. // same request ID was received, and if so, will ignore the second
  90275. // request. This prevents clients from accidentally creating duplicate
  90276. // commitments.
  90277. //
  90278. // The request ID must be a valid UUID with the exception that zero UUID
  90279. // is not supported (00000000-0000-0000-0000-000000000000).
  90280. func (c *TargetPoolsSetBackupCall) RequestId(requestId string) *TargetPoolsSetBackupCall {
  90281. c.urlParams_.Set("requestId", requestId)
  90282. return c
  90283. }
  90284. // Fields allows partial responses to be retrieved. See
  90285. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90286. // for more information.
  90287. func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall {
  90288. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90289. return c
  90290. }
  90291. // Context sets the context to be used in this call's Do method. Any
  90292. // pending HTTP request will be aborted if the provided context is
  90293. // canceled.
  90294. func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall {
  90295. c.ctx_ = ctx
  90296. return c
  90297. }
  90298. // Header returns an http.Header that can be modified by the caller to
  90299. // add HTTP headers to the request.
  90300. func (c *TargetPoolsSetBackupCall) Header() http.Header {
  90301. if c.header_ == nil {
  90302. c.header_ = make(http.Header)
  90303. }
  90304. return c.header_
  90305. }
  90306. func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) {
  90307. reqHeaders := make(http.Header)
  90308. for k, v := range c.header_ {
  90309. reqHeaders[k] = v
  90310. }
  90311. reqHeaders.Set("User-Agent", c.s.userAgent())
  90312. var body io.Reader = nil
  90313. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  90314. if err != nil {
  90315. return nil, err
  90316. }
  90317. reqHeaders.Set("Content-Type", "application/json")
  90318. c.urlParams_.Set("alt", alt)
  90319. c.urlParams_.Set("prettyPrint", "false")
  90320. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup")
  90321. urls += "?" + c.urlParams_.Encode()
  90322. req, err := http.NewRequest("POST", urls, body)
  90323. if err != nil {
  90324. return nil, err
  90325. }
  90326. req.Header = reqHeaders
  90327. googleapi.Expand(req.URL, map[string]string{
  90328. "project": c.project,
  90329. "region": c.region,
  90330. "targetPool": c.targetPool,
  90331. })
  90332. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90333. }
  90334. // Do executes the "compute.targetPools.setBackup" call.
  90335. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90336. // status code is an error. Response headers are in either
  90337. // *Operation.ServerResponse.Header or (if a response was returned at
  90338. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90339. // to check whether the returned error was because
  90340. // http.StatusNotModified was returned.
  90341. func (c *TargetPoolsSetBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90342. gensupport.SetOptions(c.urlParams_, opts...)
  90343. res, err := c.doRequest("json")
  90344. if res != nil && res.StatusCode == http.StatusNotModified {
  90345. if res.Body != nil {
  90346. res.Body.Close()
  90347. }
  90348. return nil, &googleapi.Error{
  90349. Code: res.StatusCode,
  90350. Header: res.Header,
  90351. }
  90352. }
  90353. if err != nil {
  90354. return nil, err
  90355. }
  90356. defer googleapi.CloseBody(res)
  90357. if err := googleapi.CheckResponse(res); err != nil {
  90358. return nil, err
  90359. }
  90360. ret := &Operation{
  90361. ServerResponse: googleapi.ServerResponse{
  90362. Header: res.Header,
  90363. HTTPStatusCode: res.StatusCode,
  90364. },
  90365. }
  90366. target := &ret
  90367. if err := gensupport.DecodeResponse(target, res); err != nil {
  90368. return nil, err
  90369. }
  90370. return ret, nil
  90371. // {
  90372. // "description": "Changes a backup target pool's configurations.",
  90373. // "httpMethod": "POST",
  90374. // "id": "compute.targetPools.setBackup",
  90375. // "parameterOrder": [
  90376. // "project",
  90377. // "region",
  90378. // "targetPool"
  90379. // ],
  90380. // "parameters": {
  90381. // "failoverRatio": {
  90382. // "description": "New failoverRatio value for the target pool.",
  90383. // "format": "float",
  90384. // "location": "query",
  90385. // "type": "number"
  90386. // },
  90387. // "project": {
  90388. // "description": "Project ID for this request.",
  90389. // "location": "path",
  90390. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90391. // "required": true,
  90392. // "type": "string"
  90393. // },
  90394. // "region": {
  90395. // "description": "Name of the region scoping this request.",
  90396. // "location": "path",
  90397. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90398. // "required": true,
  90399. // "type": "string"
  90400. // },
  90401. // "requestId": {
  90402. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90403. // "location": "query",
  90404. // "type": "string"
  90405. // },
  90406. // "targetPool": {
  90407. // "description": "Name of the TargetPool resource to set a backup pool for.",
  90408. // "location": "path",
  90409. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  90410. // "required": true,
  90411. // "type": "string"
  90412. // }
  90413. // },
  90414. // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup",
  90415. // "request": {
  90416. // "$ref": "TargetReference"
  90417. // },
  90418. // "response": {
  90419. // "$ref": "Operation"
  90420. // },
  90421. // "scopes": [
  90422. // "https://www.googleapis.com/auth/cloud-platform",
  90423. // "https://www.googleapis.com/auth/compute"
  90424. // ]
  90425. // }
  90426. }
  90427. // method id "compute.targetSslProxies.delete":
  90428. type TargetSslProxiesDeleteCall struct {
  90429. s *Service
  90430. project string
  90431. targetSslProxy string
  90432. urlParams_ gensupport.URLParams
  90433. ctx_ context.Context
  90434. header_ http.Header
  90435. }
  90436. // Delete: Deletes the specified TargetSslProxy resource.
  90437. func (r *TargetSslProxiesService) Delete(project string, targetSslProxy string) *TargetSslProxiesDeleteCall {
  90438. c := &TargetSslProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90439. c.project = project
  90440. c.targetSslProxy = targetSslProxy
  90441. return c
  90442. }
  90443. // RequestId sets the optional parameter "requestId": An optional
  90444. // request ID to identify requests. Specify a unique request ID so that
  90445. // if you must retry your request, the server will know to ignore the
  90446. // request if it has already been completed.
  90447. //
  90448. // For example, consider a situation where you make an initial request
  90449. // and the request times out. If you make the request again with the
  90450. // same request ID, the server can check if original operation with the
  90451. // same request ID was received, and if so, will ignore the second
  90452. // request. This prevents clients from accidentally creating duplicate
  90453. // commitments.
  90454. //
  90455. // The request ID must be a valid UUID with the exception that zero UUID
  90456. // is not supported (00000000-0000-0000-0000-000000000000).
  90457. func (c *TargetSslProxiesDeleteCall) RequestId(requestId string) *TargetSslProxiesDeleteCall {
  90458. c.urlParams_.Set("requestId", requestId)
  90459. return c
  90460. }
  90461. // Fields allows partial responses to be retrieved. See
  90462. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90463. // for more information.
  90464. func (c *TargetSslProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetSslProxiesDeleteCall {
  90465. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90466. return c
  90467. }
  90468. // Context sets the context to be used in this call's Do method. Any
  90469. // pending HTTP request will be aborted if the provided context is
  90470. // canceled.
  90471. func (c *TargetSslProxiesDeleteCall) Context(ctx context.Context) *TargetSslProxiesDeleteCall {
  90472. c.ctx_ = ctx
  90473. return c
  90474. }
  90475. // Header returns an http.Header that can be modified by the caller to
  90476. // add HTTP headers to the request.
  90477. func (c *TargetSslProxiesDeleteCall) Header() http.Header {
  90478. if c.header_ == nil {
  90479. c.header_ = make(http.Header)
  90480. }
  90481. return c.header_
  90482. }
  90483. func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  90484. reqHeaders := make(http.Header)
  90485. for k, v := range c.header_ {
  90486. reqHeaders[k] = v
  90487. }
  90488. reqHeaders.Set("User-Agent", c.s.userAgent())
  90489. var body io.Reader = nil
  90490. c.urlParams_.Set("alt", alt)
  90491. c.urlParams_.Set("prettyPrint", "false")
  90492. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  90493. urls += "?" + c.urlParams_.Encode()
  90494. req, err := http.NewRequest("DELETE", urls, body)
  90495. if err != nil {
  90496. return nil, err
  90497. }
  90498. req.Header = reqHeaders
  90499. googleapi.Expand(req.URL, map[string]string{
  90500. "project": c.project,
  90501. "targetSslProxy": c.targetSslProxy,
  90502. })
  90503. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90504. }
  90505. // Do executes the "compute.targetSslProxies.delete" call.
  90506. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90507. // status code is an error. Response headers are in either
  90508. // *Operation.ServerResponse.Header or (if a response was returned at
  90509. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90510. // to check whether the returned error was because
  90511. // http.StatusNotModified was returned.
  90512. func (c *TargetSslProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90513. gensupport.SetOptions(c.urlParams_, opts...)
  90514. res, err := c.doRequest("json")
  90515. if res != nil && res.StatusCode == http.StatusNotModified {
  90516. if res.Body != nil {
  90517. res.Body.Close()
  90518. }
  90519. return nil, &googleapi.Error{
  90520. Code: res.StatusCode,
  90521. Header: res.Header,
  90522. }
  90523. }
  90524. if err != nil {
  90525. return nil, err
  90526. }
  90527. defer googleapi.CloseBody(res)
  90528. if err := googleapi.CheckResponse(res); err != nil {
  90529. return nil, err
  90530. }
  90531. ret := &Operation{
  90532. ServerResponse: googleapi.ServerResponse{
  90533. Header: res.Header,
  90534. HTTPStatusCode: res.StatusCode,
  90535. },
  90536. }
  90537. target := &ret
  90538. if err := gensupport.DecodeResponse(target, res); err != nil {
  90539. return nil, err
  90540. }
  90541. return ret, nil
  90542. // {
  90543. // "description": "Deletes the specified TargetSslProxy resource.",
  90544. // "httpMethod": "DELETE",
  90545. // "id": "compute.targetSslProxies.delete",
  90546. // "parameterOrder": [
  90547. // "project",
  90548. // "targetSslProxy"
  90549. // ],
  90550. // "parameters": {
  90551. // "project": {
  90552. // "description": "Project ID for this request.",
  90553. // "location": "path",
  90554. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90555. // "required": true,
  90556. // "type": "string"
  90557. // },
  90558. // "requestId": {
  90559. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90560. // "location": "query",
  90561. // "type": "string"
  90562. // },
  90563. // "targetSslProxy": {
  90564. // "description": "Name of the TargetSslProxy resource to delete.",
  90565. // "location": "path",
  90566. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  90567. // "required": true,
  90568. // "type": "string"
  90569. // }
  90570. // },
  90571. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  90572. // "response": {
  90573. // "$ref": "Operation"
  90574. // },
  90575. // "scopes": [
  90576. // "https://www.googleapis.com/auth/cloud-platform",
  90577. // "https://www.googleapis.com/auth/compute"
  90578. // ]
  90579. // }
  90580. }
  90581. // method id "compute.targetSslProxies.get":
  90582. type TargetSslProxiesGetCall struct {
  90583. s *Service
  90584. project string
  90585. targetSslProxy string
  90586. urlParams_ gensupport.URLParams
  90587. ifNoneMatch_ string
  90588. ctx_ context.Context
  90589. header_ http.Header
  90590. }
  90591. // Get: Returns the specified TargetSslProxy resource. Gets a list of
  90592. // available target SSL proxies by making a list() request.
  90593. func (r *TargetSslProxiesService) Get(project string, targetSslProxy string) *TargetSslProxiesGetCall {
  90594. c := &TargetSslProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90595. c.project = project
  90596. c.targetSslProxy = targetSslProxy
  90597. return c
  90598. }
  90599. // Fields allows partial responses to be retrieved. See
  90600. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90601. // for more information.
  90602. func (c *TargetSslProxiesGetCall) Fields(s ...googleapi.Field) *TargetSslProxiesGetCall {
  90603. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90604. return c
  90605. }
  90606. // IfNoneMatch sets the optional parameter which makes the operation
  90607. // fail if the object's ETag matches the given value. This is useful for
  90608. // getting updates only after the object has changed since the last
  90609. // request. Use googleapi.IsNotModified to check whether the response
  90610. // error from Do is the result of In-None-Match.
  90611. func (c *TargetSslProxiesGetCall) IfNoneMatch(entityTag string) *TargetSslProxiesGetCall {
  90612. c.ifNoneMatch_ = entityTag
  90613. return c
  90614. }
  90615. // Context sets the context to be used in this call's Do method. Any
  90616. // pending HTTP request will be aborted if the provided context is
  90617. // canceled.
  90618. func (c *TargetSslProxiesGetCall) Context(ctx context.Context) *TargetSslProxiesGetCall {
  90619. c.ctx_ = ctx
  90620. return c
  90621. }
  90622. // Header returns an http.Header that can be modified by the caller to
  90623. // add HTTP headers to the request.
  90624. func (c *TargetSslProxiesGetCall) Header() http.Header {
  90625. if c.header_ == nil {
  90626. c.header_ = make(http.Header)
  90627. }
  90628. return c.header_
  90629. }
  90630. func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  90631. reqHeaders := make(http.Header)
  90632. for k, v := range c.header_ {
  90633. reqHeaders[k] = v
  90634. }
  90635. reqHeaders.Set("User-Agent", c.s.userAgent())
  90636. if c.ifNoneMatch_ != "" {
  90637. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90638. }
  90639. var body io.Reader = nil
  90640. c.urlParams_.Set("alt", alt)
  90641. c.urlParams_.Set("prettyPrint", "false")
  90642. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  90643. urls += "?" + c.urlParams_.Encode()
  90644. req, err := http.NewRequest("GET", urls, body)
  90645. if err != nil {
  90646. return nil, err
  90647. }
  90648. req.Header = reqHeaders
  90649. googleapi.Expand(req.URL, map[string]string{
  90650. "project": c.project,
  90651. "targetSslProxy": c.targetSslProxy,
  90652. })
  90653. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90654. }
  90655. // Do executes the "compute.targetSslProxies.get" call.
  90656. // Exactly one of *TargetSslProxy or error will be non-nil. Any non-2xx
  90657. // status code is an error. Response headers are in either
  90658. // *TargetSslProxy.ServerResponse.Header or (if a response was returned
  90659. // at all) in error.(*googleapi.Error).Header. Use
  90660. // googleapi.IsNotModified to check whether the returned error was
  90661. // because http.StatusNotModified was returned.
  90662. func (c *TargetSslProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetSslProxy, error) {
  90663. gensupport.SetOptions(c.urlParams_, opts...)
  90664. res, err := c.doRequest("json")
  90665. if res != nil && res.StatusCode == http.StatusNotModified {
  90666. if res.Body != nil {
  90667. res.Body.Close()
  90668. }
  90669. return nil, &googleapi.Error{
  90670. Code: res.StatusCode,
  90671. Header: res.Header,
  90672. }
  90673. }
  90674. if err != nil {
  90675. return nil, err
  90676. }
  90677. defer googleapi.CloseBody(res)
  90678. if err := googleapi.CheckResponse(res); err != nil {
  90679. return nil, err
  90680. }
  90681. ret := &TargetSslProxy{
  90682. ServerResponse: googleapi.ServerResponse{
  90683. Header: res.Header,
  90684. HTTPStatusCode: res.StatusCode,
  90685. },
  90686. }
  90687. target := &ret
  90688. if err := gensupport.DecodeResponse(target, res); err != nil {
  90689. return nil, err
  90690. }
  90691. return ret, nil
  90692. // {
  90693. // "description": "Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.",
  90694. // "httpMethod": "GET",
  90695. // "id": "compute.targetSslProxies.get",
  90696. // "parameterOrder": [
  90697. // "project",
  90698. // "targetSslProxy"
  90699. // ],
  90700. // "parameters": {
  90701. // "project": {
  90702. // "description": "Project ID for this request.",
  90703. // "location": "path",
  90704. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90705. // "required": true,
  90706. // "type": "string"
  90707. // },
  90708. // "targetSslProxy": {
  90709. // "description": "Name of the TargetSslProxy resource to return.",
  90710. // "location": "path",
  90711. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  90712. // "required": true,
  90713. // "type": "string"
  90714. // }
  90715. // },
  90716. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  90717. // "response": {
  90718. // "$ref": "TargetSslProxy"
  90719. // },
  90720. // "scopes": [
  90721. // "https://www.googleapis.com/auth/cloud-platform",
  90722. // "https://www.googleapis.com/auth/compute",
  90723. // "https://www.googleapis.com/auth/compute.readonly"
  90724. // ]
  90725. // }
  90726. }
  90727. // method id "compute.targetSslProxies.insert":
  90728. type TargetSslProxiesInsertCall struct {
  90729. s *Service
  90730. project string
  90731. targetsslproxy *TargetSslProxy
  90732. urlParams_ gensupport.URLParams
  90733. ctx_ context.Context
  90734. header_ http.Header
  90735. }
  90736. // Insert: Creates a TargetSslProxy resource in the specified project
  90737. // using the data included in the request.
  90738. func (r *TargetSslProxiesService) Insert(project string, targetsslproxy *TargetSslProxy) *TargetSslProxiesInsertCall {
  90739. c := &TargetSslProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90740. c.project = project
  90741. c.targetsslproxy = targetsslproxy
  90742. return c
  90743. }
  90744. // RequestId sets the optional parameter "requestId": An optional
  90745. // request ID to identify requests. Specify a unique request ID so that
  90746. // if you must retry your request, the server will know to ignore the
  90747. // request if it has already been completed.
  90748. //
  90749. // For example, consider a situation where you make an initial request
  90750. // and the request times out. If you make the request again with the
  90751. // same request ID, the server can check if original operation with the
  90752. // same request ID was received, and if so, will ignore the second
  90753. // request. This prevents clients from accidentally creating duplicate
  90754. // commitments.
  90755. //
  90756. // The request ID must be a valid UUID with the exception that zero UUID
  90757. // is not supported (00000000-0000-0000-0000-000000000000).
  90758. func (c *TargetSslProxiesInsertCall) RequestId(requestId string) *TargetSslProxiesInsertCall {
  90759. c.urlParams_.Set("requestId", requestId)
  90760. return c
  90761. }
  90762. // Fields allows partial responses to be retrieved. See
  90763. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90764. // for more information.
  90765. func (c *TargetSslProxiesInsertCall) Fields(s ...googleapi.Field) *TargetSslProxiesInsertCall {
  90766. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90767. return c
  90768. }
  90769. // Context sets the context to be used in this call's Do method. Any
  90770. // pending HTTP request will be aborted if the provided context is
  90771. // canceled.
  90772. func (c *TargetSslProxiesInsertCall) Context(ctx context.Context) *TargetSslProxiesInsertCall {
  90773. c.ctx_ = ctx
  90774. return c
  90775. }
  90776. // Header returns an http.Header that can be modified by the caller to
  90777. // add HTTP headers to the request.
  90778. func (c *TargetSslProxiesInsertCall) Header() http.Header {
  90779. if c.header_ == nil {
  90780. c.header_ = make(http.Header)
  90781. }
  90782. return c.header_
  90783. }
  90784. func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  90785. reqHeaders := make(http.Header)
  90786. for k, v := range c.header_ {
  90787. reqHeaders[k] = v
  90788. }
  90789. reqHeaders.Set("User-Agent", c.s.userAgent())
  90790. var body io.Reader = nil
  90791. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy)
  90792. if err != nil {
  90793. return nil, err
  90794. }
  90795. reqHeaders.Set("Content-Type", "application/json")
  90796. c.urlParams_.Set("alt", alt)
  90797. c.urlParams_.Set("prettyPrint", "false")
  90798. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  90799. urls += "?" + c.urlParams_.Encode()
  90800. req, err := http.NewRequest("POST", urls, body)
  90801. if err != nil {
  90802. return nil, err
  90803. }
  90804. req.Header = reqHeaders
  90805. googleapi.Expand(req.URL, map[string]string{
  90806. "project": c.project,
  90807. })
  90808. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90809. }
  90810. // Do executes the "compute.targetSslProxies.insert" call.
  90811. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90812. // status code is an error. Response headers are in either
  90813. // *Operation.ServerResponse.Header or (if a response was returned at
  90814. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90815. // to check whether the returned error was because
  90816. // http.StatusNotModified was returned.
  90817. func (c *TargetSslProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90818. gensupport.SetOptions(c.urlParams_, opts...)
  90819. res, err := c.doRequest("json")
  90820. if res != nil && res.StatusCode == http.StatusNotModified {
  90821. if res.Body != nil {
  90822. res.Body.Close()
  90823. }
  90824. return nil, &googleapi.Error{
  90825. Code: res.StatusCode,
  90826. Header: res.Header,
  90827. }
  90828. }
  90829. if err != nil {
  90830. return nil, err
  90831. }
  90832. defer googleapi.CloseBody(res)
  90833. if err := googleapi.CheckResponse(res); err != nil {
  90834. return nil, err
  90835. }
  90836. ret := &Operation{
  90837. ServerResponse: googleapi.ServerResponse{
  90838. Header: res.Header,
  90839. HTTPStatusCode: res.StatusCode,
  90840. },
  90841. }
  90842. target := &ret
  90843. if err := gensupport.DecodeResponse(target, res); err != nil {
  90844. return nil, err
  90845. }
  90846. return ret, nil
  90847. // {
  90848. // "description": "Creates a TargetSslProxy resource in the specified project using the data included in the request.",
  90849. // "httpMethod": "POST",
  90850. // "id": "compute.targetSslProxies.insert",
  90851. // "parameterOrder": [
  90852. // "project"
  90853. // ],
  90854. // "parameters": {
  90855. // "project": {
  90856. // "description": "Project ID for this request.",
  90857. // "location": "path",
  90858. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90859. // "required": true,
  90860. // "type": "string"
  90861. // },
  90862. // "requestId": {
  90863. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90864. // "location": "query",
  90865. // "type": "string"
  90866. // }
  90867. // },
  90868. // "path": "{project}/global/targetSslProxies",
  90869. // "request": {
  90870. // "$ref": "TargetSslProxy"
  90871. // },
  90872. // "response": {
  90873. // "$ref": "Operation"
  90874. // },
  90875. // "scopes": [
  90876. // "https://www.googleapis.com/auth/cloud-platform",
  90877. // "https://www.googleapis.com/auth/compute"
  90878. // ]
  90879. // }
  90880. }
  90881. // method id "compute.targetSslProxies.list":
  90882. type TargetSslProxiesListCall struct {
  90883. s *Service
  90884. project string
  90885. urlParams_ gensupport.URLParams
  90886. ifNoneMatch_ string
  90887. ctx_ context.Context
  90888. header_ http.Header
  90889. }
  90890. // List: Retrieves the list of TargetSslProxy resources available to the
  90891. // specified project.
  90892. func (r *TargetSslProxiesService) List(project string) *TargetSslProxiesListCall {
  90893. c := &TargetSslProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90894. c.project = project
  90895. return c
  90896. }
  90897. // Filter sets the optional parameter "filter": A filter expression that
  90898. // filters resources listed in the response. The expression must specify
  90899. // the field name, a comparison operator, and the value that you want to
  90900. // use for filtering. The value must be a string, a number, or a
  90901. // boolean. The comparison operator must be either =, !=, >, or <.
  90902. //
  90903. // For example, if you are filtering Compute Engine instances, you can
  90904. // exclude instances named example-instance by specifying name !=
  90905. // example-instance.
  90906. //
  90907. // You can also filter nested fields. For example, you could specify
  90908. // scheduling.automaticRestart = false to include instances only if they
  90909. // are not scheduled for automatic restarts. You can use filtering on
  90910. // nested fields to filter based on resource labels.
  90911. //
  90912. // To filter on multiple expressions, provide each separate expression
  90913. // within parentheses. For example, (scheduling.automaticRestart = true)
  90914. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  90915. // AND expression. However, you can include AND and OR expressions
  90916. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  90917. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  90918. // true).
  90919. func (c *TargetSslProxiesListCall) Filter(filter string) *TargetSslProxiesListCall {
  90920. c.urlParams_.Set("filter", filter)
  90921. return c
  90922. }
  90923. // MaxResults sets the optional parameter "maxResults": The maximum
  90924. // number of results per page that should be returned. If the number of
  90925. // available results is larger than maxResults, Compute Engine returns a
  90926. // nextPageToken that can be used to get the next page of results in
  90927. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  90928. // (Default: 500)
  90929. func (c *TargetSslProxiesListCall) MaxResults(maxResults int64) *TargetSslProxiesListCall {
  90930. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  90931. return c
  90932. }
  90933. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  90934. // a certain order. By default, results are returned in alphanumerical
  90935. // order based on the resource name.
  90936. //
  90937. // You can also sort results in descending order based on the creation
  90938. // timestamp using orderBy="creationTimestamp desc". This sorts results
  90939. // based on the creationTimestamp field in reverse chronological order
  90940. // (newest result first). Use this to sort resources like operations so
  90941. // that the newest operation is returned first.
  90942. //
  90943. // Currently, only sorting by name or creationTimestamp desc is
  90944. // supported.
  90945. func (c *TargetSslProxiesListCall) OrderBy(orderBy string) *TargetSslProxiesListCall {
  90946. c.urlParams_.Set("orderBy", orderBy)
  90947. return c
  90948. }
  90949. // PageToken sets the optional parameter "pageToken": Specifies a page
  90950. // token to use. Set pageToken to the nextPageToken returned by a
  90951. // previous list request to get the next page of results.
  90952. func (c *TargetSslProxiesListCall) PageToken(pageToken string) *TargetSslProxiesListCall {
  90953. c.urlParams_.Set("pageToken", pageToken)
  90954. return c
  90955. }
  90956. // Fields allows partial responses to be retrieved. See
  90957. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90958. // for more information.
  90959. func (c *TargetSslProxiesListCall) Fields(s ...googleapi.Field) *TargetSslProxiesListCall {
  90960. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90961. return c
  90962. }
  90963. // IfNoneMatch sets the optional parameter which makes the operation
  90964. // fail if the object's ETag matches the given value. This is useful for
  90965. // getting updates only after the object has changed since the last
  90966. // request. Use googleapi.IsNotModified to check whether the response
  90967. // error from Do is the result of In-None-Match.
  90968. func (c *TargetSslProxiesListCall) IfNoneMatch(entityTag string) *TargetSslProxiesListCall {
  90969. c.ifNoneMatch_ = entityTag
  90970. return c
  90971. }
  90972. // Context sets the context to be used in this call's Do method. Any
  90973. // pending HTTP request will be aborted if the provided context is
  90974. // canceled.
  90975. func (c *TargetSslProxiesListCall) Context(ctx context.Context) *TargetSslProxiesListCall {
  90976. c.ctx_ = ctx
  90977. return c
  90978. }
  90979. // Header returns an http.Header that can be modified by the caller to
  90980. // add HTTP headers to the request.
  90981. func (c *TargetSslProxiesListCall) Header() http.Header {
  90982. if c.header_ == nil {
  90983. c.header_ = make(http.Header)
  90984. }
  90985. return c.header_
  90986. }
  90987. func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) {
  90988. reqHeaders := make(http.Header)
  90989. for k, v := range c.header_ {
  90990. reqHeaders[k] = v
  90991. }
  90992. reqHeaders.Set("User-Agent", c.s.userAgent())
  90993. if c.ifNoneMatch_ != "" {
  90994. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90995. }
  90996. var body io.Reader = nil
  90997. c.urlParams_.Set("alt", alt)
  90998. c.urlParams_.Set("prettyPrint", "false")
  90999. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  91000. urls += "?" + c.urlParams_.Encode()
  91001. req, err := http.NewRequest("GET", urls, body)
  91002. if err != nil {
  91003. return nil, err
  91004. }
  91005. req.Header = reqHeaders
  91006. googleapi.Expand(req.URL, map[string]string{
  91007. "project": c.project,
  91008. })
  91009. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91010. }
  91011. // Do executes the "compute.targetSslProxies.list" call.
  91012. // Exactly one of *TargetSslProxyList or error will be non-nil. Any
  91013. // non-2xx status code is an error. Response headers are in either
  91014. // *TargetSslProxyList.ServerResponse.Header or (if a response was
  91015. // returned at all) in error.(*googleapi.Error).Header. Use
  91016. // googleapi.IsNotModified to check whether the returned error was
  91017. // because http.StatusNotModified was returned.
  91018. func (c *TargetSslProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetSslProxyList, error) {
  91019. gensupport.SetOptions(c.urlParams_, opts...)
  91020. res, err := c.doRequest("json")
  91021. if res != nil && res.StatusCode == http.StatusNotModified {
  91022. if res.Body != nil {
  91023. res.Body.Close()
  91024. }
  91025. return nil, &googleapi.Error{
  91026. Code: res.StatusCode,
  91027. Header: res.Header,
  91028. }
  91029. }
  91030. if err != nil {
  91031. return nil, err
  91032. }
  91033. defer googleapi.CloseBody(res)
  91034. if err := googleapi.CheckResponse(res); err != nil {
  91035. return nil, err
  91036. }
  91037. ret := &TargetSslProxyList{
  91038. ServerResponse: googleapi.ServerResponse{
  91039. Header: res.Header,
  91040. HTTPStatusCode: res.StatusCode,
  91041. },
  91042. }
  91043. target := &ret
  91044. if err := gensupport.DecodeResponse(target, res); err != nil {
  91045. return nil, err
  91046. }
  91047. return ret, nil
  91048. // {
  91049. // "description": "Retrieves the list of TargetSslProxy resources available to the specified project.",
  91050. // "httpMethod": "GET",
  91051. // "id": "compute.targetSslProxies.list",
  91052. // "parameterOrder": [
  91053. // "project"
  91054. // ],
  91055. // "parameters": {
  91056. // "filter": {
  91057. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  91058. // "location": "query",
  91059. // "type": "string"
  91060. // },
  91061. // "maxResults": {
  91062. // "default": "500",
  91063. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  91064. // "format": "uint32",
  91065. // "location": "query",
  91066. // "minimum": "0",
  91067. // "type": "integer"
  91068. // },
  91069. // "orderBy": {
  91070. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  91071. // "location": "query",
  91072. // "type": "string"
  91073. // },
  91074. // "pageToken": {
  91075. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  91076. // "location": "query",
  91077. // "type": "string"
  91078. // },
  91079. // "project": {
  91080. // "description": "Project ID for this request.",
  91081. // "location": "path",
  91082. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91083. // "required": true,
  91084. // "type": "string"
  91085. // }
  91086. // },
  91087. // "path": "{project}/global/targetSslProxies",
  91088. // "response": {
  91089. // "$ref": "TargetSslProxyList"
  91090. // },
  91091. // "scopes": [
  91092. // "https://www.googleapis.com/auth/cloud-platform",
  91093. // "https://www.googleapis.com/auth/compute",
  91094. // "https://www.googleapis.com/auth/compute.readonly"
  91095. // ]
  91096. // }
  91097. }
  91098. // Pages invokes f for each page of results.
  91099. // A non-nil error returned from f will halt the iteration.
  91100. // The provided context supersedes any context provided to the Context method.
  91101. func (c *TargetSslProxiesListCall) Pages(ctx context.Context, f func(*TargetSslProxyList) error) error {
  91102. c.ctx_ = ctx
  91103. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  91104. for {
  91105. x, err := c.Do()
  91106. if err != nil {
  91107. return err
  91108. }
  91109. if err := f(x); err != nil {
  91110. return err
  91111. }
  91112. if x.NextPageToken == "" {
  91113. return nil
  91114. }
  91115. c.PageToken(x.NextPageToken)
  91116. }
  91117. }
  91118. // method id "compute.targetSslProxies.setBackendService":
  91119. type TargetSslProxiesSetBackendServiceCall struct {
  91120. s *Service
  91121. project string
  91122. targetSslProxy string
  91123. targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest
  91124. urlParams_ gensupport.URLParams
  91125. ctx_ context.Context
  91126. header_ http.Header
  91127. }
  91128. // SetBackendService: Changes the BackendService for TargetSslProxy.
  91129. func (r *TargetSslProxiesService) SetBackendService(project string, targetSslProxy string, targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest) *TargetSslProxiesSetBackendServiceCall {
  91130. c := &TargetSslProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91131. c.project = project
  91132. c.targetSslProxy = targetSslProxy
  91133. c.targetsslproxiessetbackendservicerequest = targetsslproxiessetbackendservicerequest
  91134. return c
  91135. }
  91136. // RequestId sets the optional parameter "requestId": An optional
  91137. // request ID to identify requests. Specify a unique request ID so that
  91138. // if you must retry your request, the server will know to ignore the
  91139. // request if it has already been completed.
  91140. //
  91141. // For example, consider a situation where you make an initial request
  91142. // and the request times out. If you make the request again with the
  91143. // same request ID, the server can check if original operation with the
  91144. // same request ID was received, and if so, will ignore the second
  91145. // request. This prevents clients from accidentally creating duplicate
  91146. // commitments.
  91147. //
  91148. // The request ID must be a valid UUID with the exception that zero UUID
  91149. // is not supported (00000000-0000-0000-0000-000000000000).
  91150. func (c *TargetSslProxiesSetBackendServiceCall) RequestId(requestId string) *TargetSslProxiesSetBackendServiceCall {
  91151. c.urlParams_.Set("requestId", requestId)
  91152. return c
  91153. }
  91154. // Fields allows partial responses to be retrieved. See
  91155. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91156. // for more information.
  91157. func (c *TargetSslProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetBackendServiceCall {
  91158. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91159. return c
  91160. }
  91161. // Context sets the context to be used in this call's Do method. Any
  91162. // pending HTTP request will be aborted if the provided context is
  91163. // canceled.
  91164. func (c *TargetSslProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetSslProxiesSetBackendServiceCall {
  91165. c.ctx_ = ctx
  91166. return c
  91167. }
  91168. // Header returns an http.Header that can be modified by the caller to
  91169. // add HTTP headers to the request.
  91170. func (c *TargetSslProxiesSetBackendServiceCall) Header() http.Header {
  91171. if c.header_ == nil {
  91172. c.header_ = make(http.Header)
  91173. }
  91174. return c.header_
  91175. }
  91176. func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  91177. reqHeaders := make(http.Header)
  91178. for k, v := range c.header_ {
  91179. reqHeaders[k] = v
  91180. }
  91181. reqHeaders.Set("User-Agent", c.s.userAgent())
  91182. var body io.Reader = nil
  91183. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest)
  91184. if err != nil {
  91185. return nil, err
  91186. }
  91187. reqHeaders.Set("Content-Type", "application/json")
  91188. c.urlParams_.Set("alt", alt)
  91189. c.urlParams_.Set("prettyPrint", "false")
  91190. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")
  91191. urls += "?" + c.urlParams_.Encode()
  91192. req, err := http.NewRequest("POST", urls, body)
  91193. if err != nil {
  91194. return nil, err
  91195. }
  91196. req.Header = reqHeaders
  91197. googleapi.Expand(req.URL, map[string]string{
  91198. "project": c.project,
  91199. "targetSslProxy": c.targetSslProxy,
  91200. })
  91201. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91202. }
  91203. // Do executes the "compute.targetSslProxies.setBackendService" call.
  91204. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91205. // status code is an error. Response headers are in either
  91206. // *Operation.ServerResponse.Header or (if a response was returned at
  91207. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91208. // to check whether the returned error was because
  91209. // http.StatusNotModified was returned.
  91210. func (c *TargetSslProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91211. gensupport.SetOptions(c.urlParams_, opts...)
  91212. res, err := c.doRequest("json")
  91213. if res != nil && res.StatusCode == http.StatusNotModified {
  91214. if res.Body != nil {
  91215. res.Body.Close()
  91216. }
  91217. return nil, &googleapi.Error{
  91218. Code: res.StatusCode,
  91219. Header: res.Header,
  91220. }
  91221. }
  91222. if err != nil {
  91223. return nil, err
  91224. }
  91225. defer googleapi.CloseBody(res)
  91226. if err := googleapi.CheckResponse(res); err != nil {
  91227. return nil, err
  91228. }
  91229. ret := &Operation{
  91230. ServerResponse: googleapi.ServerResponse{
  91231. Header: res.Header,
  91232. HTTPStatusCode: res.StatusCode,
  91233. },
  91234. }
  91235. target := &ret
  91236. if err := gensupport.DecodeResponse(target, res); err != nil {
  91237. return nil, err
  91238. }
  91239. return ret, nil
  91240. // {
  91241. // "description": "Changes the BackendService for TargetSslProxy.",
  91242. // "httpMethod": "POST",
  91243. // "id": "compute.targetSslProxies.setBackendService",
  91244. // "parameterOrder": [
  91245. // "project",
  91246. // "targetSslProxy"
  91247. // ],
  91248. // "parameters": {
  91249. // "project": {
  91250. // "description": "Project ID for this request.",
  91251. // "location": "path",
  91252. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91253. // "required": true,
  91254. // "type": "string"
  91255. // },
  91256. // "requestId": {
  91257. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91258. // "location": "query",
  91259. // "type": "string"
  91260. // },
  91261. // "targetSslProxy": {
  91262. // "description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.",
  91263. // "location": "path",
  91264. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  91265. // "required": true,
  91266. // "type": "string"
  91267. // }
  91268. // },
  91269. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
  91270. // "request": {
  91271. // "$ref": "TargetSslProxiesSetBackendServiceRequest"
  91272. // },
  91273. // "response": {
  91274. // "$ref": "Operation"
  91275. // },
  91276. // "scopes": [
  91277. // "https://www.googleapis.com/auth/cloud-platform",
  91278. // "https://www.googleapis.com/auth/compute"
  91279. // ]
  91280. // }
  91281. }
  91282. // method id "compute.targetSslProxies.setProxyHeader":
  91283. type TargetSslProxiesSetProxyHeaderCall struct {
  91284. s *Service
  91285. project string
  91286. targetSslProxy string
  91287. targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest
  91288. urlParams_ gensupport.URLParams
  91289. ctx_ context.Context
  91290. header_ http.Header
  91291. }
  91292. // SetProxyHeader: Changes the ProxyHeaderType for TargetSslProxy.
  91293. func (r *TargetSslProxiesService) SetProxyHeader(project string, targetSslProxy string, targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest) *TargetSslProxiesSetProxyHeaderCall {
  91294. c := &TargetSslProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91295. c.project = project
  91296. c.targetSslProxy = targetSslProxy
  91297. c.targetsslproxiessetproxyheaderrequest = targetsslproxiessetproxyheaderrequest
  91298. return c
  91299. }
  91300. // RequestId sets the optional parameter "requestId": An optional
  91301. // request ID to identify requests. Specify a unique request ID so that
  91302. // if you must retry your request, the server will know to ignore the
  91303. // request if it has already been completed.
  91304. //
  91305. // For example, consider a situation where you make an initial request
  91306. // and the request times out. If you make the request again with the
  91307. // same request ID, the server can check if original operation with the
  91308. // same request ID was received, and if so, will ignore the second
  91309. // request. This prevents clients from accidentally creating duplicate
  91310. // commitments.
  91311. //
  91312. // The request ID must be a valid UUID with the exception that zero UUID
  91313. // is not supported (00000000-0000-0000-0000-000000000000).
  91314. func (c *TargetSslProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetSslProxiesSetProxyHeaderCall {
  91315. c.urlParams_.Set("requestId", requestId)
  91316. return c
  91317. }
  91318. // Fields allows partial responses to be retrieved. See
  91319. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91320. // for more information.
  91321. func (c *TargetSslProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetProxyHeaderCall {
  91322. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91323. return c
  91324. }
  91325. // Context sets the context to be used in this call's Do method. Any
  91326. // pending HTTP request will be aborted if the provided context is
  91327. // canceled.
  91328. func (c *TargetSslProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetSslProxiesSetProxyHeaderCall {
  91329. c.ctx_ = ctx
  91330. return c
  91331. }
  91332. // Header returns an http.Header that can be modified by the caller to
  91333. // add HTTP headers to the request.
  91334. func (c *TargetSslProxiesSetProxyHeaderCall) Header() http.Header {
  91335. if c.header_ == nil {
  91336. c.header_ = make(http.Header)
  91337. }
  91338. return c.header_
  91339. }
  91340. func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  91341. reqHeaders := make(http.Header)
  91342. for k, v := range c.header_ {
  91343. reqHeaders[k] = v
  91344. }
  91345. reqHeaders.Set("User-Agent", c.s.userAgent())
  91346. var body io.Reader = nil
  91347. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest)
  91348. if err != nil {
  91349. return nil, err
  91350. }
  91351. reqHeaders.Set("Content-Type", "application/json")
  91352. c.urlParams_.Set("alt", alt)
  91353. c.urlParams_.Set("prettyPrint", "false")
  91354. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")
  91355. urls += "?" + c.urlParams_.Encode()
  91356. req, err := http.NewRequest("POST", urls, body)
  91357. if err != nil {
  91358. return nil, err
  91359. }
  91360. req.Header = reqHeaders
  91361. googleapi.Expand(req.URL, map[string]string{
  91362. "project": c.project,
  91363. "targetSslProxy": c.targetSslProxy,
  91364. })
  91365. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91366. }
  91367. // Do executes the "compute.targetSslProxies.setProxyHeader" call.
  91368. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91369. // status code is an error. Response headers are in either
  91370. // *Operation.ServerResponse.Header or (if a response was returned at
  91371. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91372. // to check whether the returned error was because
  91373. // http.StatusNotModified was returned.
  91374. func (c *TargetSslProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91375. gensupport.SetOptions(c.urlParams_, opts...)
  91376. res, err := c.doRequest("json")
  91377. if res != nil && res.StatusCode == http.StatusNotModified {
  91378. if res.Body != nil {
  91379. res.Body.Close()
  91380. }
  91381. return nil, &googleapi.Error{
  91382. Code: res.StatusCode,
  91383. Header: res.Header,
  91384. }
  91385. }
  91386. if err != nil {
  91387. return nil, err
  91388. }
  91389. defer googleapi.CloseBody(res)
  91390. if err := googleapi.CheckResponse(res); err != nil {
  91391. return nil, err
  91392. }
  91393. ret := &Operation{
  91394. ServerResponse: googleapi.ServerResponse{
  91395. Header: res.Header,
  91396. HTTPStatusCode: res.StatusCode,
  91397. },
  91398. }
  91399. target := &ret
  91400. if err := gensupport.DecodeResponse(target, res); err != nil {
  91401. return nil, err
  91402. }
  91403. return ret, nil
  91404. // {
  91405. // "description": "Changes the ProxyHeaderType for TargetSslProxy.",
  91406. // "httpMethod": "POST",
  91407. // "id": "compute.targetSslProxies.setProxyHeader",
  91408. // "parameterOrder": [
  91409. // "project",
  91410. // "targetSslProxy"
  91411. // ],
  91412. // "parameters": {
  91413. // "project": {
  91414. // "description": "Project ID for this request.",
  91415. // "location": "path",
  91416. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91417. // "required": true,
  91418. // "type": "string"
  91419. // },
  91420. // "requestId": {
  91421. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91422. // "location": "query",
  91423. // "type": "string"
  91424. // },
  91425. // "targetSslProxy": {
  91426. // "description": "Name of the TargetSslProxy resource whose ProxyHeader is to be set.",
  91427. // "location": "path",
  91428. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  91429. // "required": true,
  91430. // "type": "string"
  91431. // }
  91432. // },
  91433. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader",
  91434. // "request": {
  91435. // "$ref": "TargetSslProxiesSetProxyHeaderRequest"
  91436. // },
  91437. // "response": {
  91438. // "$ref": "Operation"
  91439. // },
  91440. // "scopes": [
  91441. // "https://www.googleapis.com/auth/cloud-platform",
  91442. // "https://www.googleapis.com/auth/compute"
  91443. // ]
  91444. // }
  91445. }
  91446. // method id "compute.targetSslProxies.setSslCertificates":
  91447. type TargetSslProxiesSetSslCertificatesCall struct {
  91448. s *Service
  91449. project string
  91450. targetSslProxy string
  91451. targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest
  91452. urlParams_ gensupport.URLParams
  91453. ctx_ context.Context
  91454. header_ http.Header
  91455. }
  91456. // SetSslCertificates: Changes SslCertificates for TargetSslProxy.
  91457. func (r *TargetSslProxiesService) SetSslCertificates(project string, targetSslProxy string, targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest) *TargetSslProxiesSetSslCertificatesCall {
  91458. c := &TargetSslProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91459. c.project = project
  91460. c.targetSslProxy = targetSslProxy
  91461. c.targetsslproxiessetsslcertificatesrequest = targetsslproxiessetsslcertificatesrequest
  91462. return c
  91463. }
  91464. // RequestId sets the optional parameter "requestId": An optional
  91465. // request ID to identify requests. Specify a unique request ID so that
  91466. // if you must retry your request, the server will know to ignore the
  91467. // request if it has already been completed.
  91468. //
  91469. // For example, consider a situation where you make an initial request
  91470. // and the request times out. If you make the request again with the
  91471. // same request ID, the server can check if original operation with the
  91472. // same request ID was received, and if so, will ignore the second
  91473. // request. This prevents clients from accidentally creating duplicate
  91474. // commitments.
  91475. //
  91476. // The request ID must be a valid UUID with the exception that zero UUID
  91477. // is not supported (00000000-0000-0000-0000-000000000000).
  91478. func (c *TargetSslProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetSslProxiesSetSslCertificatesCall {
  91479. c.urlParams_.Set("requestId", requestId)
  91480. return c
  91481. }
  91482. // Fields allows partial responses to be retrieved. See
  91483. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91484. // for more information.
  91485. func (c *TargetSslProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslCertificatesCall {
  91486. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91487. return c
  91488. }
  91489. // Context sets the context to be used in this call's Do method. Any
  91490. // pending HTTP request will be aborted if the provided context is
  91491. // canceled.
  91492. func (c *TargetSslProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetSslProxiesSetSslCertificatesCall {
  91493. c.ctx_ = ctx
  91494. return c
  91495. }
  91496. // Header returns an http.Header that can be modified by the caller to
  91497. // add HTTP headers to the request.
  91498. func (c *TargetSslProxiesSetSslCertificatesCall) Header() http.Header {
  91499. if c.header_ == nil {
  91500. c.header_ = make(http.Header)
  91501. }
  91502. return c.header_
  91503. }
  91504. func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  91505. reqHeaders := make(http.Header)
  91506. for k, v := range c.header_ {
  91507. reqHeaders[k] = v
  91508. }
  91509. reqHeaders.Set("User-Agent", c.s.userAgent())
  91510. var body io.Reader = nil
  91511. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest)
  91512. if err != nil {
  91513. return nil, err
  91514. }
  91515. reqHeaders.Set("Content-Type", "application/json")
  91516. c.urlParams_.Set("alt", alt)
  91517. c.urlParams_.Set("prettyPrint", "false")
  91518. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")
  91519. urls += "?" + c.urlParams_.Encode()
  91520. req, err := http.NewRequest("POST", urls, body)
  91521. if err != nil {
  91522. return nil, err
  91523. }
  91524. req.Header = reqHeaders
  91525. googleapi.Expand(req.URL, map[string]string{
  91526. "project": c.project,
  91527. "targetSslProxy": c.targetSslProxy,
  91528. })
  91529. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91530. }
  91531. // Do executes the "compute.targetSslProxies.setSslCertificates" call.
  91532. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91533. // status code is an error. Response headers are in either
  91534. // *Operation.ServerResponse.Header or (if a response was returned at
  91535. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91536. // to check whether the returned error was because
  91537. // http.StatusNotModified was returned.
  91538. func (c *TargetSslProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91539. gensupport.SetOptions(c.urlParams_, opts...)
  91540. res, err := c.doRequest("json")
  91541. if res != nil && res.StatusCode == http.StatusNotModified {
  91542. if res.Body != nil {
  91543. res.Body.Close()
  91544. }
  91545. return nil, &googleapi.Error{
  91546. Code: res.StatusCode,
  91547. Header: res.Header,
  91548. }
  91549. }
  91550. if err != nil {
  91551. return nil, err
  91552. }
  91553. defer googleapi.CloseBody(res)
  91554. if err := googleapi.CheckResponse(res); err != nil {
  91555. return nil, err
  91556. }
  91557. ret := &Operation{
  91558. ServerResponse: googleapi.ServerResponse{
  91559. Header: res.Header,
  91560. HTTPStatusCode: res.StatusCode,
  91561. },
  91562. }
  91563. target := &ret
  91564. if err := gensupport.DecodeResponse(target, res); err != nil {
  91565. return nil, err
  91566. }
  91567. return ret, nil
  91568. // {
  91569. // "description": "Changes SslCertificates for TargetSslProxy.",
  91570. // "httpMethod": "POST",
  91571. // "id": "compute.targetSslProxies.setSslCertificates",
  91572. // "parameterOrder": [
  91573. // "project",
  91574. // "targetSslProxy"
  91575. // ],
  91576. // "parameters": {
  91577. // "project": {
  91578. // "description": "Project ID for this request.",
  91579. // "location": "path",
  91580. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91581. // "required": true,
  91582. // "type": "string"
  91583. // },
  91584. // "requestId": {
  91585. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91586. // "location": "query",
  91587. // "type": "string"
  91588. // },
  91589. // "targetSslProxy": {
  91590. // "description": "Name of the TargetSslProxy resource whose SslCertificate resource is to be set.",
  91591. // "location": "path",
  91592. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  91593. // "required": true,
  91594. // "type": "string"
  91595. // }
  91596. // },
  91597. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates",
  91598. // "request": {
  91599. // "$ref": "TargetSslProxiesSetSslCertificatesRequest"
  91600. // },
  91601. // "response": {
  91602. // "$ref": "Operation"
  91603. // },
  91604. // "scopes": [
  91605. // "https://www.googleapis.com/auth/cloud-platform",
  91606. // "https://www.googleapis.com/auth/compute"
  91607. // ]
  91608. // }
  91609. }
  91610. // method id "compute.targetSslProxies.setSslPolicy":
  91611. type TargetSslProxiesSetSslPolicyCall struct {
  91612. s *Service
  91613. project string
  91614. targetSslProxy string
  91615. sslpolicyreference *SslPolicyReference
  91616. urlParams_ gensupport.URLParams
  91617. ctx_ context.Context
  91618. header_ http.Header
  91619. }
  91620. // SetSslPolicy: Sets the SSL policy for TargetSslProxy. The SSL policy
  91621. // specifies the server-side support for SSL features. This affects
  91622. // connections between clients and the SSL proxy load balancer. They do
  91623. // not affect the connection between the load balancer and the backends.
  91624. func (r *TargetSslProxiesService) SetSslPolicy(project string, targetSslProxy string, sslpolicyreference *SslPolicyReference) *TargetSslProxiesSetSslPolicyCall {
  91625. c := &TargetSslProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91626. c.project = project
  91627. c.targetSslProxy = targetSslProxy
  91628. c.sslpolicyreference = sslpolicyreference
  91629. return c
  91630. }
  91631. // RequestId sets the optional parameter "requestId": An optional
  91632. // request ID to identify requests. Specify a unique request ID so that
  91633. // if you must retry your request, the server will know to ignore the
  91634. // request if it has already been completed.
  91635. //
  91636. // For example, consider a situation where you make an initial request
  91637. // and the request times out. If you make the request again with the
  91638. // same request ID, the server can check if original operation with the
  91639. // same request ID was received, and if so, will ignore the second
  91640. // request. This prevents clients from accidentally creating duplicate
  91641. // commitments.
  91642. //
  91643. // The request ID must be a valid UUID with the exception that zero UUID
  91644. // is not supported (00000000-0000-0000-0000-000000000000).
  91645. func (c *TargetSslProxiesSetSslPolicyCall) RequestId(requestId string) *TargetSslProxiesSetSslPolicyCall {
  91646. c.urlParams_.Set("requestId", requestId)
  91647. return c
  91648. }
  91649. // Fields allows partial responses to be retrieved. See
  91650. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91651. // for more information.
  91652. func (c *TargetSslProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslPolicyCall {
  91653. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91654. return c
  91655. }
  91656. // Context sets the context to be used in this call's Do method. Any
  91657. // pending HTTP request will be aborted if the provided context is
  91658. // canceled.
  91659. func (c *TargetSslProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetSslProxiesSetSslPolicyCall {
  91660. c.ctx_ = ctx
  91661. return c
  91662. }
  91663. // Header returns an http.Header that can be modified by the caller to
  91664. // add HTTP headers to the request.
  91665. func (c *TargetSslProxiesSetSslPolicyCall) Header() http.Header {
  91666. if c.header_ == nil {
  91667. c.header_ = make(http.Header)
  91668. }
  91669. return c.header_
  91670. }
  91671. func (c *TargetSslProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  91672. reqHeaders := make(http.Header)
  91673. for k, v := range c.header_ {
  91674. reqHeaders[k] = v
  91675. }
  91676. reqHeaders.Set("User-Agent", c.s.userAgent())
  91677. var body io.Reader = nil
  91678. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  91679. if err != nil {
  91680. return nil, err
  91681. }
  91682. reqHeaders.Set("Content-Type", "application/json")
  91683. c.urlParams_.Set("alt", alt)
  91684. c.urlParams_.Set("prettyPrint", "false")
  91685. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")
  91686. urls += "?" + c.urlParams_.Encode()
  91687. req, err := http.NewRequest("POST", urls, body)
  91688. if err != nil {
  91689. return nil, err
  91690. }
  91691. req.Header = reqHeaders
  91692. googleapi.Expand(req.URL, map[string]string{
  91693. "project": c.project,
  91694. "targetSslProxy": c.targetSslProxy,
  91695. })
  91696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91697. }
  91698. // Do executes the "compute.targetSslProxies.setSslPolicy" call.
  91699. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91700. // status code is an error. Response headers are in either
  91701. // *Operation.ServerResponse.Header or (if a response was returned at
  91702. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91703. // to check whether the returned error was because
  91704. // http.StatusNotModified was returned.
  91705. func (c *TargetSslProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91706. gensupport.SetOptions(c.urlParams_, opts...)
  91707. res, err := c.doRequest("json")
  91708. if res != nil && res.StatusCode == http.StatusNotModified {
  91709. if res.Body != nil {
  91710. res.Body.Close()
  91711. }
  91712. return nil, &googleapi.Error{
  91713. Code: res.StatusCode,
  91714. Header: res.Header,
  91715. }
  91716. }
  91717. if err != nil {
  91718. return nil, err
  91719. }
  91720. defer googleapi.CloseBody(res)
  91721. if err := googleapi.CheckResponse(res); err != nil {
  91722. return nil, err
  91723. }
  91724. ret := &Operation{
  91725. ServerResponse: googleapi.ServerResponse{
  91726. Header: res.Header,
  91727. HTTPStatusCode: res.StatusCode,
  91728. },
  91729. }
  91730. target := &ret
  91731. if err := gensupport.DecodeResponse(target, res); err != nil {
  91732. return nil, err
  91733. }
  91734. return ret, nil
  91735. // {
  91736. // "description": "Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends.",
  91737. // "httpMethod": "POST",
  91738. // "id": "compute.targetSslProxies.setSslPolicy",
  91739. // "parameterOrder": [
  91740. // "project",
  91741. // "targetSslProxy"
  91742. // ],
  91743. // "parameters": {
  91744. // "project": {
  91745. // "description": "Project ID for this request.",
  91746. // "location": "path",
  91747. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91748. // "required": true,
  91749. // "type": "string"
  91750. // },
  91751. // "requestId": {
  91752. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91753. // "location": "query",
  91754. // "type": "string"
  91755. // },
  91756. // "targetSslProxy": {
  91757. // "description": "Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035.",
  91758. // "location": "path",
  91759. // "required": true,
  91760. // "type": "string"
  91761. // }
  91762. // },
  91763. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy",
  91764. // "request": {
  91765. // "$ref": "SslPolicyReference"
  91766. // },
  91767. // "response": {
  91768. // "$ref": "Operation"
  91769. // },
  91770. // "scopes": [
  91771. // "https://www.googleapis.com/auth/cloud-platform",
  91772. // "https://www.googleapis.com/auth/compute"
  91773. // ]
  91774. // }
  91775. }
  91776. // method id "compute.targetTcpProxies.delete":
  91777. type TargetTcpProxiesDeleteCall struct {
  91778. s *Service
  91779. project string
  91780. targetTcpProxy string
  91781. urlParams_ gensupport.URLParams
  91782. ctx_ context.Context
  91783. header_ http.Header
  91784. }
  91785. // Delete: Deletes the specified TargetTcpProxy resource.
  91786. func (r *TargetTcpProxiesService) Delete(project string, targetTcpProxy string) *TargetTcpProxiesDeleteCall {
  91787. c := &TargetTcpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91788. c.project = project
  91789. c.targetTcpProxy = targetTcpProxy
  91790. return c
  91791. }
  91792. // RequestId sets the optional parameter "requestId": An optional
  91793. // request ID to identify requests. Specify a unique request ID so that
  91794. // if you must retry your request, the server will know to ignore the
  91795. // request if it has already been completed.
  91796. //
  91797. // For example, consider a situation where you make an initial request
  91798. // and the request times out. If you make the request again with the
  91799. // same request ID, the server can check if original operation with the
  91800. // same request ID was received, and if so, will ignore the second
  91801. // request. This prevents clients from accidentally creating duplicate
  91802. // commitments.
  91803. //
  91804. // The request ID must be a valid UUID with the exception that zero UUID
  91805. // is not supported (00000000-0000-0000-0000-000000000000).
  91806. func (c *TargetTcpProxiesDeleteCall) RequestId(requestId string) *TargetTcpProxiesDeleteCall {
  91807. c.urlParams_.Set("requestId", requestId)
  91808. return c
  91809. }
  91810. // Fields allows partial responses to be retrieved. See
  91811. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91812. // for more information.
  91813. func (c *TargetTcpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetTcpProxiesDeleteCall {
  91814. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91815. return c
  91816. }
  91817. // Context sets the context to be used in this call's Do method. Any
  91818. // pending HTTP request will be aborted if the provided context is
  91819. // canceled.
  91820. func (c *TargetTcpProxiesDeleteCall) Context(ctx context.Context) *TargetTcpProxiesDeleteCall {
  91821. c.ctx_ = ctx
  91822. return c
  91823. }
  91824. // Header returns an http.Header that can be modified by the caller to
  91825. // add HTTP headers to the request.
  91826. func (c *TargetTcpProxiesDeleteCall) Header() http.Header {
  91827. if c.header_ == nil {
  91828. c.header_ = make(http.Header)
  91829. }
  91830. return c.header_
  91831. }
  91832. func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  91833. reqHeaders := make(http.Header)
  91834. for k, v := range c.header_ {
  91835. reqHeaders[k] = v
  91836. }
  91837. reqHeaders.Set("User-Agent", c.s.userAgent())
  91838. var body io.Reader = nil
  91839. c.urlParams_.Set("alt", alt)
  91840. c.urlParams_.Set("prettyPrint", "false")
  91841. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  91842. urls += "?" + c.urlParams_.Encode()
  91843. req, err := http.NewRequest("DELETE", urls, body)
  91844. if err != nil {
  91845. return nil, err
  91846. }
  91847. req.Header = reqHeaders
  91848. googleapi.Expand(req.URL, map[string]string{
  91849. "project": c.project,
  91850. "targetTcpProxy": c.targetTcpProxy,
  91851. })
  91852. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91853. }
  91854. // Do executes the "compute.targetTcpProxies.delete" call.
  91855. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91856. // status code is an error. Response headers are in either
  91857. // *Operation.ServerResponse.Header or (if a response was returned at
  91858. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91859. // to check whether the returned error was because
  91860. // http.StatusNotModified was returned.
  91861. func (c *TargetTcpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91862. gensupport.SetOptions(c.urlParams_, opts...)
  91863. res, err := c.doRequest("json")
  91864. if res != nil && res.StatusCode == http.StatusNotModified {
  91865. if res.Body != nil {
  91866. res.Body.Close()
  91867. }
  91868. return nil, &googleapi.Error{
  91869. Code: res.StatusCode,
  91870. Header: res.Header,
  91871. }
  91872. }
  91873. if err != nil {
  91874. return nil, err
  91875. }
  91876. defer googleapi.CloseBody(res)
  91877. if err := googleapi.CheckResponse(res); err != nil {
  91878. return nil, err
  91879. }
  91880. ret := &Operation{
  91881. ServerResponse: googleapi.ServerResponse{
  91882. Header: res.Header,
  91883. HTTPStatusCode: res.StatusCode,
  91884. },
  91885. }
  91886. target := &ret
  91887. if err := gensupport.DecodeResponse(target, res); err != nil {
  91888. return nil, err
  91889. }
  91890. return ret, nil
  91891. // {
  91892. // "description": "Deletes the specified TargetTcpProxy resource.",
  91893. // "httpMethod": "DELETE",
  91894. // "id": "compute.targetTcpProxies.delete",
  91895. // "parameterOrder": [
  91896. // "project",
  91897. // "targetTcpProxy"
  91898. // ],
  91899. // "parameters": {
  91900. // "project": {
  91901. // "description": "Project ID for this request.",
  91902. // "location": "path",
  91903. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91904. // "required": true,
  91905. // "type": "string"
  91906. // },
  91907. // "requestId": {
  91908. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91909. // "location": "query",
  91910. // "type": "string"
  91911. // },
  91912. // "targetTcpProxy": {
  91913. // "description": "Name of the TargetTcpProxy resource to delete.",
  91914. // "location": "path",
  91915. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  91916. // "required": true,
  91917. // "type": "string"
  91918. // }
  91919. // },
  91920. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  91921. // "response": {
  91922. // "$ref": "Operation"
  91923. // },
  91924. // "scopes": [
  91925. // "https://www.googleapis.com/auth/cloud-platform",
  91926. // "https://www.googleapis.com/auth/compute"
  91927. // ]
  91928. // }
  91929. }
  91930. // method id "compute.targetTcpProxies.get":
  91931. type TargetTcpProxiesGetCall struct {
  91932. s *Service
  91933. project string
  91934. targetTcpProxy string
  91935. urlParams_ gensupport.URLParams
  91936. ifNoneMatch_ string
  91937. ctx_ context.Context
  91938. header_ http.Header
  91939. }
  91940. // Get: Returns the specified TargetTcpProxy resource. Gets a list of
  91941. // available target TCP proxies by making a list() request.
  91942. func (r *TargetTcpProxiesService) Get(project string, targetTcpProxy string) *TargetTcpProxiesGetCall {
  91943. c := &TargetTcpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91944. c.project = project
  91945. c.targetTcpProxy = targetTcpProxy
  91946. return c
  91947. }
  91948. // Fields allows partial responses to be retrieved. See
  91949. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91950. // for more information.
  91951. func (c *TargetTcpProxiesGetCall) Fields(s ...googleapi.Field) *TargetTcpProxiesGetCall {
  91952. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91953. return c
  91954. }
  91955. // IfNoneMatch sets the optional parameter which makes the operation
  91956. // fail if the object's ETag matches the given value. This is useful for
  91957. // getting updates only after the object has changed since the last
  91958. // request. Use googleapi.IsNotModified to check whether the response
  91959. // error from Do is the result of In-None-Match.
  91960. func (c *TargetTcpProxiesGetCall) IfNoneMatch(entityTag string) *TargetTcpProxiesGetCall {
  91961. c.ifNoneMatch_ = entityTag
  91962. return c
  91963. }
  91964. // Context sets the context to be used in this call's Do method. Any
  91965. // pending HTTP request will be aborted if the provided context is
  91966. // canceled.
  91967. func (c *TargetTcpProxiesGetCall) Context(ctx context.Context) *TargetTcpProxiesGetCall {
  91968. c.ctx_ = ctx
  91969. return c
  91970. }
  91971. // Header returns an http.Header that can be modified by the caller to
  91972. // add HTTP headers to the request.
  91973. func (c *TargetTcpProxiesGetCall) Header() http.Header {
  91974. if c.header_ == nil {
  91975. c.header_ = make(http.Header)
  91976. }
  91977. return c.header_
  91978. }
  91979. func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  91980. reqHeaders := make(http.Header)
  91981. for k, v := range c.header_ {
  91982. reqHeaders[k] = v
  91983. }
  91984. reqHeaders.Set("User-Agent", c.s.userAgent())
  91985. if c.ifNoneMatch_ != "" {
  91986. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91987. }
  91988. var body io.Reader = nil
  91989. c.urlParams_.Set("alt", alt)
  91990. c.urlParams_.Set("prettyPrint", "false")
  91991. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  91992. urls += "?" + c.urlParams_.Encode()
  91993. req, err := http.NewRequest("GET", urls, body)
  91994. if err != nil {
  91995. return nil, err
  91996. }
  91997. req.Header = reqHeaders
  91998. googleapi.Expand(req.URL, map[string]string{
  91999. "project": c.project,
  92000. "targetTcpProxy": c.targetTcpProxy,
  92001. })
  92002. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92003. }
  92004. // Do executes the "compute.targetTcpProxies.get" call.
  92005. // Exactly one of *TargetTcpProxy or error will be non-nil. Any non-2xx
  92006. // status code is an error. Response headers are in either
  92007. // *TargetTcpProxy.ServerResponse.Header or (if a response was returned
  92008. // at all) in error.(*googleapi.Error).Header. Use
  92009. // googleapi.IsNotModified to check whether the returned error was
  92010. // because http.StatusNotModified was returned.
  92011. func (c *TargetTcpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxy, error) {
  92012. gensupport.SetOptions(c.urlParams_, opts...)
  92013. res, err := c.doRequest("json")
  92014. if res != nil && res.StatusCode == http.StatusNotModified {
  92015. if res.Body != nil {
  92016. res.Body.Close()
  92017. }
  92018. return nil, &googleapi.Error{
  92019. Code: res.StatusCode,
  92020. Header: res.Header,
  92021. }
  92022. }
  92023. if err != nil {
  92024. return nil, err
  92025. }
  92026. defer googleapi.CloseBody(res)
  92027. if err := googleapi.CheckResponse(res); err != nil {
  92028. return nil, err
  92029. }
  92030. ret := &TargetTcpProxy{
  92031. ServerResponse: googleapi.ServerResponse{
  92032. Header: res.Header,
  92033. HTTPStatusCode: res.StatusCode,
  92034. },
  92035. }
  92036. target := &ret
  92037. if err := gensupport.DecodeResponse(target, res); err != nil {
  92038. return nil, err
  92039. }
  92040. return ret, nil
  92041. // {
  92042. // "description": "Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.",
  92043. // "httpMethod": "GET",
  92044. // "id": "compute.targetTcpProxies.get",
  92045. // "parameterOrder": [
  92046. // "project",
  92047. // "targetTcpProxy"
  92048. // ],
  92049. // "parameters": {
  92050. // "project": {
  92051. // "description": "Project ID for this request.",
  92052. // "location": "path",
  92053. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92054. // "required": true,
  92055. // "type": "string"
  92056. // },
  92057. // "targetTcpProxy": {
  92058. // "description": "Name of the TargetTcpProxy resource to return.",
  92059. // "location": "path",
  92060. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92061. // "required": true,
  92062. // "type": "string"
  92063. // }
  92064. // },
  92065. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  92066. // "response": {
  92067. // "$ref": "TargetTcpProxy"
  92068. // },
  92069. // "scopes": [
  92070. // "https://www.googleapis.com/auth/cloud-platform",
  92071. // "https://www.googleapis.com/auth/compute",
  92072. // "https://www.googleapis.com/auth/compute.readonly"
  92073. // ]
  92074. // }
  92075. }
  92076. // method id "compute.targetTcpProxies.insert":
  92077. type TargetTcpProxiesInsertCall struct {
  92078. s *Service
  92079. project string
  92080. targettcpproxy *TargetTcpProxy
  92081. urlParams_ gensupport.URLParams
  92082. ctx_ context.Context
  92083. header_ http.Header
  92084. }
  92085. // Insert: Creates a TargetTcpProxy resource in the specified project
  92086. // using the data included in the request.
  92087. func (r *TargetTcpProxiesService) Insert(project string, targettcpproxy *TargetTcpProxy) *TargetTcpProxiesInsertCall {
  92088. c := &TargetTcpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92089. c.project = project
  92090. c.targettcpproxy = targettcpproxy
  92091. return c
  92092. }
  92093. // RequestId sets the optional parameter "requestId": An optional
  92094. // request ID to identify requests. Specify a unique request ID so that
  92095. // if you must retry your request, the server will know to ignore the
  92096. // request if it has already been completed.
  92097. //
  92098. // For example, consider a situation where you make an initial request
  92099. // and the request times out. If you make the request again with the
  92100. // same request ID, the server can check if original operation with the
  92101. // same request ID was received, and if so, will ignore the second
  92102. // request. This prevents clients from accidentally creating duplicate
  92103. // commitments.
  92104. //
  92105. // The request ID must be a valid UUID with the exception that zero UUID
  92106. // is not supported (00000000-0000-0000-0000-000000000000).
  92107. func (c *TargetTcpProxiesInsertCall) RequestId(requestId string) *TargetTcpProxiesInsertCall {
  92108. c.urlParams_.Set("requestId", requestId)
  92109. return c
  92110. }
  92111. // Fields allows partial responses to be retrieved. See
  92112. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92113. // for more information.
  92114. func (c *TargetTcpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetTcpProxiesInsertCall {
  92115. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92116. return c
  92117. }
  92118. // Context sets the context to be used in this call's Do method. Any
  92119. // pending HTTP request will be aborted if the provided context is
  92120. // canceled.
  92121. func (c *TargetTcpProxiesInsertCall) Context(ctx context.Context) *TargetTcpProxiesInsertCall {
  92122. c.ctx_ = ctx
  92123. return c
  92124. }
  92125. // Header returns an http.Header that can be modified by the caller to
  92126. // add HTTP headers to the request.
  92127. func (c *TargetTcpProxiesInsertCall) Header() http.Header {
  92128. if c.header_ == nil {
  92129. c.header_ = make(http.Header)
  92130. }
  92131. return c.header_
  92132. }
  92133. func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  92134. reqHeaders := make(http.Header)
  92135. for k, v := range c.header_ {
  92136. reqHeaders[k] = v
  92137. }
  92138. reqHeaders.Set("User-Agent", c.s.userAgent())
  92139. var body io.Reader = nil
  92140. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy)
  92141. if err != nil {
  92142. return nil, err
  92143. }
  92144. reqHeaders.Set("Content-Type", "application/json")
  92145. c.urlParams_.Set("alt", alt)
  92146. c.urlParams_.Set("prettyPrint", "false")
  92147. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  92148. urls += "?" + c.urlParams_.Encode()
  92149. req, err := http.NewRequest("POST", urls, body)
  92150. if err != nil {
  92151. return nil, err
  92152. }
  92153. req.Header = reqHeaders
  92154. googleapi.Expand(req.URL, map[string]string{
  92155. "project": c.project,
  92156. })
  92157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92158. }
  92159. // Do executes the "compute.targetTcpProxies.insert" call.
  92160. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92161. // status code is an error. Response headers are in either
  92162. // *Operation.ServerResponse.Header or (if a response was returned at
  92163. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92164. // to check whether the returned error was because
  92165. // http.StatusNotModified was returned.
  92166. func (c *TargetTcpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92167. gensupport.SetOptions(c.urlParams_, opts...)
  92168. res, err := c.doRequest("json")
  92169. if res != nil && res.StatusCode == http.StatusNotModified {
  92170. if res.Body != nil {
  92171. res.Body.Close()
  92172. }
  92173. return nil, &googleapi.Error{
  92174. Code: res.StatusCode,
  92175. Header: res.Header,
  92176. }
  92177. }
  92178. if err != nil {
  92179. return nil, err
  92180. }
  92181. defer googleapi.CloseBody(res)
  92182. if err := googleapi.CheckResponse(res); err != nil {
  92183. return nil, err
  92184. }
  92185. ret := &Operation{
  92186. ServerResponse: googleapi.ServerResponse{
  92187. Header: res.Header,
  92188. HTTPStatusCode: res.StatusCode,
  92189. },
  92190. }
  92191. target := &ret
  92192. if err := gensupport.DecodeResponse(target, res); err != nil {
  92193. return nil, err
  92194. }
  92195. return ret, nil
  92196. // {
  92197. // "description": "Creates a TargetTcpProxy resource in the specified project using the data included in the request.",
  92198. // "httpMethod": "POST",
  92199. // "id": "compute.targetTcpProxies.insert",
  92200. // "parameterOrder": [
  92201. // "project"
  92202. // ],
  92203. // "parameters": {
  92204. // "project": {
  92205. // "description": "Project ID for this request.",
  92206. // "location": "path",
  92207. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92208. // "required": true,
  92209. // "type": "string"
  92210. // },
  92211. // "requestId": {
  92212. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92213. // "location": "query",
  92214. // "type": "string"
  92215. // }
  92216. // },
  92217. // "path": "{project}/global/targetTcpProxies",
  92218. // "request": {
  92219. // "$ref": "TargetTcpProxy"
  92220. // },
  92221. // "response": {
  92222. // "$ref": "Operation"
  92223. // },
  92224. // "scopes": [
  92225. // "https://www.googleapis.com/auth/cloud-platform",
  92226. // "https://www.googleapis.com/auth/compute"
  92227. // ]
  92228. // }
  92229. }
  92230. // method id "compute.targetTcpProxies.list":
  92231. type TargetTcpProxiesListCall struct {
  92232. s *Service
  92233. project string
  92234. urlParams_ gensupport.URLParams
  92235. ifNoneMatch_ string
  92236. ctx_ context.Context
  92237. header_ http.Header
  92238. }
  92239. // List: Retrieves the list of TargetTcpProxy resources available to the
  92240. // specified project.
  92241. func (r *TargetTcpProxiesService) List(project string) *TargetTcpProxiesListCall {
  92242. c := &TargetTcpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92243. c.project = project
  92244. return c
  92245. }
  92246. // Filter sets the optional parameter "filter": A filter expression that
  92247. // filters resources listed in the response. The expression must specify
  92248. // the field name, a comparison operator, and the value that you want to
  92249. // use for filtering. The value must be a string, a number, or a
  92250. // boolean. The comparison operator must be either =, !=, >, or <.
  92251. //
  92252. // For example, if you are filtering Compute Engine instances, you can
  92253. // exclude instances named example-instance by specifying name !=
  92254. // example-instance.
  92255. //
  92256. // You can also filter nested fields. For example, you could specify
  92257. // scheduling.automaticRestart = false to include instances only if they
  92258. // are not scheduled for automatic restarts. You can use filtering on
  92259. // nested fields to filter based on resource labels.
  92260. //
  92261. // To filter on multiple expressions, provide each separate expression
  92262. // within parentheses. For example, (scheduling.automaticRestart = true)
  92263. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  92264. // AND expression. However, you can include AND and OR expressions
  92265. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  92266. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  92267. // true).
  92268. func (c *TargetTcpProxiesListCall) Filter(filter string) *TargetTcpProxiesListCall {
  92269. c.urlParams_.Set("filter", filter)
  92270. return c
  92271. }
  92272. // MaxResults sets the optional parameter "maxResults": The maximum
  92273. // number of results per page that should be returned. If the number of
  92274. // available results is larger than maxResults, Compute Engine returns a
  92275. // nextPageToken that can be used to get the next page of results in
  92276. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  92277. // (Default: 500)
  92278. func (c *TargetTcpProxiesListCall) MaxResults(maxResults int64) *TargetTcpProxiesListCall {
  92279. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  92280. return c
  92281. }
  92282. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  92283. // a certain order. By default, results are returned in alphanumerical
  92284. // order based on the resource name.
  92285. //
  92286. // You can also sort results in descending order based on the creation
  92287. // timestamp using orderBy="creationTimestamp desc". This sorts results
  92288. // based on the creationTimestamp field in reverse chronological order
  92289. // (newest result first). Use this to sort resources like operations so
  92290. // that the newest operation is returned first.
  92291. //
  92292. // Currently, only sorting by name or creationTimestamp desc is
  92293. // supported.
  92294. func (c *TargetTcpProxiesListCall) OrderBy(orderBy string) *TargetTcpProxiesListCall {
  92295. c.urlParams_.Set("orderBy", orderBy)
  92296. return c
  92297. }
  92298. // PageToken sets the optional parameter "pageToken": Specifies a page
  92299. // token to use. Set pageToken to the nextPageToken returned by a
  92300. // previous list request to get the next page of results.
  92301. func (c *TargetTcpProxiesListCall) PageToken(pageToken string) *TargetTcpProxiesListCall {
  92302. c.urlParams_.Set("pageToken", pageToken)
  92303. return c
  92304. }
  92305. // Fields allows partial responses to be retrieved. See
  92306. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92307. // for more information.
  92308. func (c *TargetTcpProxiesListCall) Fields(s ...googleapi.Field) *TargetTcpProxiesListCall {
  92309. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92310. return c
  92311. }
  92312. // IfNoneMatch sets the optional parameter which makes the operation
  92313. // fail if the object's ETag matches the given value. This is useful for
  92314. // getting updates only after the object has changed since the last
  92315. // request. Use googleapi.IsNotModified to check whether the response
  92316. // error from Do is the result of In-None-Match.
  92317. func (c *TargetTcpProxiesListCall) IfNoneMatch(entityTag string) *TargetTcpProxiesListCall {
  92318. c.ifNoneMatch_ = entityTag
  92319. return c
  92320. }
  92321. // Context sets the context to be used in this call's Do method. Any
  92322. // pending HTTP request will be aborted if the provided context is
  92323. // canceled.
  92324. func (c *TargetTcpProxiesListCall) Context(ctx context.Context) *TargetTcpProxiesListCall {
  92325. c.ctx_ = ctx
  92326. return c
  92327. }
  92328. // Header returns an http.Header that can be modified by the caller to
  92329. // add HTTP headers to the request.
  92330. func (c *TargetTcpProxiesListCall) Header() http.Header {
  92331. if c.header_ == nil {
  92332. c.header_ = make(http.Header)
  92333. }
  92334. return c.header_
  92335. }
  92336. func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  92337. reqHeaders := make(http.Header)
  92338. for k, v := range c.header_ {
  92339. reqHeaders[k] = v
  92340. }
  92341. reqHeaders.Set("User-Agent", c.s.userAgent())
  92342. if c.ifNoneMatch_ != "" {
  92343. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92344. }
  92345. var body io.Reader = nil
  92346. c.urlParams_.Set("alt", alt)
  92347. c.urlParams_.Set("prettyPrint", "false")
  92348. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  92349. urls += "?" + c.urlParams_.Encode()
  92350. req, err := http.NewRequest("GET", urls, body)
  92351. if err != nil {
  92352. return nil, err
  92353. }
  92354. req.Header = reqHeaders
  92355. googleapi.Expand(req.URL, map[string]string{
  92356. "project": c.project,
  92357. })
  92358. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92359. }
  92360. // Do executes the "compute.targetTcpProxies.list" call.
  92361. // Exactly one of *TargetTcpProxyList or error will be non-nil. Any
  92362. // non-2xx status code is an error. Response headers are in either
  92363. // *TargetTcpProxyList.ServerResponse.Header or (if a response was
  92364. // returned at all) in error.(*googleapi.Error).Header. Use
  92365. // googleapi.IsNotModified to check whether the returned error was
  92366. // because http.StatusNotModified was returned.
  92367. func (c *TargetTcpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxyList, error) {
  92368. gensupport.SetOptions(c.urlParams_, opts...)
  92369. res, err := c.doRequest("json")
  92370. if res != nil && res.StatusCode == http.StatusNotModified {
  92371. if res.Body != nil {
  92372. res.Body.Close()
  92373. }
  92374. return nil, &googleapi.Error{
  92375. Code: res.StatusCode,
  92376. Header: res.Header,
  92377. }
  92378. }
  92379. if err != nil {
  92380. return nil, err
  92381. }
  92382. defer googleapi.CloseBody(res)
  92383. if err := googleapi.CheckResponse(res); err != nil {
  92384. return nil, err
  92385. }
  92386. ret := &TargetTcpProxyList{
  92387. ServerResponse: googleapi.ServerResponse{
  92388. Header: res.Header,
  92389. HTTPStatusCode: res.StatusCode,
  92390. },
  92391. }
  92392. target := &ret
  92393. if err := gensupport.DecodeResponse(target, res); err != nil {
  92394. return nil, err
  92395. }
  92396. return ret, nil
  92397. // {
  92398. // "description": "Retrieves the list of TargetTcpProxy resources available to the specified project.",
  92399. // "httpMethod": "GET",
  92400. // "id": "compute.targetTcpProxies.list",
  92401. // "parameterOrder": [
  92402. // "project"
  92403. // ],
  92404. // "parameters": {
  92405. // "filter": {
  92406. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  92407. // "location": "query",
  92408. // "type": "string"
  92409. // },
  92410. // "maxResults": {
  92411. // "default": "500",
  92412. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  92413. // "format": "uint32",
  92414. // "location": "query",
  92415. // "minimum": "0",
  92416. // "type": "integer"
  92417. // },
  92418. // "orderBy": {
  92419. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  92420. // "location": "query",
  92421. // "type": "string"
  92422. // },
  92423. // "pageToken": {
  92424. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  92425. // "location": "query",
  92426. // "type": "string"
  92427. // },
  92428. // "project": {
  92429. // "description": "Project ID for this request.",
  92430. // "location": "path",
  92431. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92432. // "required": true,
  92433. // "type": "string"
  92434. // }
  92435. // },
  92436. // "path": "{project}/global/targetTcpProxies",
  92437. // "response": {
  92438. // "$ref": "TargetTcpProxyList"
  92439. // },
  92440. // "scopes": [
  92441. // "https://www.googleapis.com/auth/cloud-platform",
  92442. // "https://www.googleapis.com/auth/compute",
  92443. // "https://www.googleapis.com/auth/compute.readonly"
  92444. // ]
  92445. // }
  92446. }
  92447. // Pages invokes f for each page of results.
  92448. // A non-nil error returned from f will halt the iteration.
  92449. // The provided context supersedes any context provided to the Context method.
  92450. func (c *TargetTcpProxiesListCall) Pages(ctx context.Context, f func(*TargetTcpProxyList) error) error {
  92451. c.ctx_ = ctx
  92452. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  92453. for {
  92454. x, err := c.Do()
  92455. if err != nil {
  92456. return err
  92457. }
  92458. if err := f(x); err != nil {
  92459. return err
  92460. }
  92461. if x.NextPageToken == "" {
  92462. return nil
  92463. }
  92464. c.PageToken(x.NextPageToken)
  92465. }
  92466. }
  92467. // method id "compute.targetTcpProxies.setBackendService":
  92468. type TargetTcpProxiesSetBackendServiceCall struct {
  92469. s *Service
  92470. project string
  92471. targetTcpProxy string
  92472. targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest
  92473. urlParams_ gensupport.URLParams
  92474. ctx_ context.Context
  92475. header_ http.Header
  92476. }
  92477. // SetBackendService: Changes the BackendService for TargetTcpProxy.
  92478. func (r *TargetTcpProxiesService) SetBackendService(project string, targetTcpProxy string, targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest) *TargetTcpProxiesSetBackendServiceCall {
  92479. c := &TargetTcpProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92480. c.project = project
  92481. c.targetTcpProxy = targetTcpProxy
  92482. c.targettcpproxiessetbackendservicerequest = targettcpproxiessetbackendservicerequest
  92483. return c
  92484. }
  92485. // RequestId sets the optional parameter "requestId": An optional
  92486. // request ID to identify requests. Specify a unique request ID so that
  92487. // if you must retry your request, the server will know to ignore the
  92488. // request if it has already been completed.
  92489. //
  92490. // For example, consider a situation where you make an initial request
  92491. // and the request times out. If you make the request again with the
  92492. // same request ID, the server can check if original operation with the
  92493. // same request ID was received, and if so, will ignore the second
  92494. // request. This prevents clients from accidentally creating duplicate
  92495. // commitments.
  92496. //
  92497. // The request ID must be a valid UUID with the exception that zero UUID
  92498. // is not supported (00000000-0000-0000-0000-000000000000).
  92499. func (c *TargetTcpProxiesSetBackendServiceCall) RequestId(requestId string) *TargetTcpProxiesSetBackendServiceCall {
  92500. c.urlParams_.Set("requestId", requestId)
  92501. return c
  92502. }
  92503. // Fields allows partial responses to be retrieved. See
  92504. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92505. // for more information.
  92506. func (c *TargetTcpProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetBackendServiceCall {
  92507. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92508. return c
  92509. }
  92510. // Context sets the context to be used in this call's Do method. Any
  92511. // pending HTTP request will be aborted if the provided context is
  92512. // canceled.
  92513. func (c *TargetTcpProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetTcpProxiesSetBackendServiceCall {
  92514. c.ctx_ = ctx
  92515. return c
  92516. }
  92517. // Header returns an http.Header that can be modified by the caller to
  92518. // add HTTP headers to the request.
  92519. func (c *TargetTcpProxiesSetBackendServiceCall) Header() http.Header {
  92520. if c.header_ == nil {
  92521. c.header_ = make(http.Header)
  92522. }
  92523. return c.header_
  92524. }
  92525. func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  92526. reqHeaders := make(http.Header)
  92527. for k, v := range c.header_ {
  92528. reqHeaders[k] = v
  92529. }
  92530. reqHeaders.Set("User-Agent", c.s.userAgent())
  92531. var body io.Reader = nil
  92532. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest)
  92533. if err != nil {
  92534. return nil, err
  92535. }
  92536. reqHeaders.Set("Content-Type", "application/json")
  92537. c.urlParams_.Set("alt", alt)
  92538. c.urlParams_.Set("prettyPrint", "false")
  92539. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")
  92540. urls += "?" + c.urlParams_.Encode()
  92541. req, err := http.NewRequest("POST", urls, body)
  92542. if err != nil {
  92543. return nil, err
  92544. }
  92545. req.Header = reqHeaders
  92546. googleapi.Expand(req.URL, map[string]string{
  92547. "project": c.project,
  92548. "targetTcpProxy": c.targetTcpProxy,
  92549. })
  92550. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92551. }
  92552. // Do executes the "compute.targetTcpProxies.setBackendService" call.
  92553. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92554. // status code is an error. Response headers are in either
  92555. // *Operation.ServerResponse.Header or (if a response was returned at
  92556. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92557. // to check whether the returned error was because
  92558. // http.StatusNotModified was returned.
  92559. func (c *TargetTcpProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92560. gensupport.SetOptions(c.urlParams_, opts...)
  92561. res, err := c.doRequest("json")
  92562. if res != nil && res.StatusCode == http.StatusNotModified {
  92563. if res.Body != nil {
  92564. res.Body.Close()
  92565. }
  92566. return nil, &googleapi.Error{
  92567. Code: res.StatusCode,
  92568. Header: res.Header,
  92569. }
  92570. }
  92571. if err != nil {
  92572. return nil, err
  92573. }
  92574. defer googleapi.CloseBody(res)
  92575. if err := googleapi.CheckResponse(res); err != nil {
  92576. return nil, err
  92577. }
  92578. ret := &Operation{
  92579. ServerResponse: googleapi.ServerResponse{
  92580. Header: res.Header,
  92581. HTTPStatusCode: res.StatusCode,
  92582. },
  92583. }
  92584. target := &ret
  92585. if err := gensupport.DecodeResponse(target, res); err != nil {
  92586. return nil, err
  92587. }
  92588. return ret, nil
  92589. // {
  92590. // "description": "Changes the BackendService for TargetTcpProxy.",
  92591. // "httpMethod": "POST",
  92592. // "id": "compute.targetTcpProxies.setBackendService",
  92593. // "parameterOrder": [
  92594. // "project",
  92595. // "targetTcpProxy"
  92596. // ],
  92597. // "parameters": {
  92598. // "project": {
  92599. // "description": "Project ID for this request.",
  92600. // "location": "path",
  92601. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92602. // "required": true,
  92603. // "type": "string"
  92604. // },
  92605. // "requestId": {
  92606. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92607. // "location": "query",
  92608. // "type": "string"
  92609. // },
  92610. // "targetTcpProxy": {
  92611. // "description": "Name of the TargetTcpProxy resource whose BackendService resource is to be set.",
  92612. // "location": "path",
  92613. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92614. // "required": true,
  92615. // "type": "string"
  92616. // }
  92617. // },
  92618. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService",
  92619. // "request": {
  92620. // "$ref": "TargetTcpProxiesSetBackendServiceRequest"
  92621. // },
  92622. // "response": {
  92623. // "$ref": "Operation"
  92624. // },
  92625. // "scopes": [
  92626. // "https://www.googleapis.com/auth/cloud-platform",
  92627. // "https://www.googleapis.com/auth/compute"
  92628. // ]
  92629. // }
  92630. }
  92631. // method id "compute.targetTcpProxies.setProxyHeader":
  92632. type TargetTcpProxiesSetProxyHeaderCall struct {
  92633. s *Service
  92634. project string
  92635. targetTcpProxy string
  92636. targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest
  92637. urlParams_ gensupport.URLParams
  92638. ctx_ context.Context
  92639. header_ http.Header
  92640. }
  92641. // SetProxyHeader: Changes the ProxyHeaderType for TargetTcpProxy.
  92642. func (r *TargetTcpProxiesService) SetProxyHeader(project string, targetTcpProxy string, targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest) *TargetTcpProxiesSetProxyHeaderCall {
  92643. c := &TargetTcpProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92644. c.project = project
  92645. c.targetTcpProxy = targetTcpProxy
  92646. c.targettcpproxiessetproxyheaderrequest = targettcpproxiessetproxyheaderrequest
  92647. return c
  92648. }
  92649. // RequestId sets the optional parameter "requestId": An optional
  92650. // request ID to identify requests. Specify a unique request ID so that
  92651. // if you must retry your request, the server will know to ignore the
  92652. // request if it has already been completed.
  92653. //
  92654. // For example, consider a situation where you make an initial request
  92655. // and the request times out. If you make the request again with the
  92656. // same request ID, the server can check if original operation with the
  92657. // same request ID was received, and if so, will ignore the second
  92658. // request. This prevents clients from accidentally creating duplicate
  92659. // commitments.
  92660. //
  92661. // The request ID must be a valid UUID with the exception that zero UUID
  92662. // is not supported (00000000-0000-0000-0000-000000000000).
  92663. func (c *TargetTcpProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetTcpProxiesSetProxyHeaderCall {
  92664. c.urlParams_.Set("requestId", requestId)
  92665. return c
  92666. }
  92667. // Fields allows partial responses to be retrieved. See
  92668. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92669. // for more information.
  92670. func (c *TargetTcpProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetProxyHeaderCall {
  92671. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92672. return c
  92673. }
  92674. // Context sets the context to be used in this call's Do method. Any
  92675. // pending HTTP request will be aborted if the provided context is
  92676. // canceled.
  92677. func (c *TargetTcpProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetTcpProxiesSetProxyHeaderCall {
  92678. c.ctx_ = ctx
  92679. return c
  92680. }
  92681. // Header returns an http.Header that can be modified by the caller to
  92682. // add HTTP headers to the request.
  92683. func (c *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header {
  92684. if c.header_ == nil {
  92685. c.header_ = make(http.Header)
  92686. }
  92687. return c.header_
  92688. }
  92689. func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  92690. reqHeaders := make(http.Header)
  92691. for k, v := range c.header_ {
  92692. reqHeaders[k] = v
  92693. }
  92694. reqHeaders.Set("User-Agent", c.s.userAgent())
  92695. var body io.Reader = nil
  92696. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest)
  92697. if err != nil {
  92698. return nil, err
  92699. }
  92700. reqHeaders.Set("Content-Type", "application/json")
  92701. c.urlParams_.Set("alt", alt)
  92702. c.urlParams_.Set("prettyPrint", "false")
  92703. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")
  92704. urls += "?" + c.urlParams_.Encode()
  92705. req, err := http.NewRequest("POST", urls, body)
  92706. if err != nil {
  92707. return nil, err
  92708. }
  92709. req.Header = reqHeaders
  92710. googleapi.Expand(req.URL, map[string]string{
  92711. "project": c.project,
  92712. "targetTcpProxy": c.targetTcpProxy,
  92713. })
  92714. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92715. }
  92716. // Do executes the "compute.targetTcpProxies.setProxyHeader" call.
  92717. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92718. // status code is an error. Response headers are in either
  92719. // *Operation.ServerResponse.Header or (if a response was returned at
  92720. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92721. // to check whether the returned error was because
  92722. // http.StatusNotModified was returned.
  92723. func (c *TargetTcpProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92724. gensupport.SetOptions(c.urlParams_, opts...)
  92725. res, err := c.doRequest("json")
  92726. if res != nil && res.StatusCode == http.StatusNotModified {
  92727. if res.Body != nil {
  92728. res.Body.Close()
  92729. }
  92730. return nil, &googleapi.Error{
  92731. Code: res.StatusCode,
  92732. Header: res.Header,
  92733. }
  92734. }
  92735. if err != nil {
  92736. return nil, err
  92737. }
  92738. defer googleapi.CloseBody(res)
  92739. if err := googleapi.CheckResponse(res); err != nil {
  92740. return nil, err
  92741. }
  92742. ret := &Operation{
  92743. ServerResponse: googleapi.ServerResponse{
  92744. Header: res.Header,
  92745. HTTPStatusCode: res.StatusCode,
  92746. },
  92747. }
  92748. target := &ret
  92749. if err := gensupport.DecodeResponse(target, res); err != nil {
  92750. return nil, err
  92751. }
  92752. return ret, nil
  92753. // {
  92754. // "description": "Changes the ProxyHeaderType for TargetTcpProxy.",
  92755. // "httpMethod": "POST",
  92756. // "id": "compute.targetTcpProxies.setProxyHeader",
  92757. // "parameterOrder": [
  92758. // "project",
  92759. // "targetTcpProxy"
  92760. // ],
  92761. // "parameters": {
  92762. // "project": {
  92763. // "description": "Project ID for this request.",
  92764. // "location": "path",
  92765. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92766. // "required": true,
  92767. // "type": "string"
  92768. // },
  92769. // "requestId": {
  92770. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92771. // "location": "query",
  92772. // "type": "string"
  92773. // },
  92774. // "targetTcpProxy": {
  92775. // "description": "Name of the TargetTcpProxy resource whose ProxyHeader is to be set.",
  92776. // "location": "path",
  92777. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92778. // "required": true,
  92779. // "type": "string"
  92780. // }
  92781. // },
  92782. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader",
  92783. // "request": {
  92784. // "$ref": "TargetTcpProxiesSetProxyHeaderRequest"
  92785. // },
  92786. // "response": {
  92787. // "$ref": "Operation"
  92788. // },
  92789. // "scopes": [
  92790. // "https://www.googleapis.com/auth/cloud-platform",
  92791. // "https://www.googleapis.com/auth/compute"
  92792. // ]
  92793. // }
  92794. }
  92795. // method id "compute.targetVpnGateways.aggregatedList":
  92796. type TargetVpnGatewaysAggregatedListCall struct {
  92797. s *Service
  92798. project string
  92799. urlParams_ gensupport.URLParams
  92800. ifNoneMatch_ string
  92801. ctx_ context.Context
  92802. header_ http.Header
  92803. }
  92804. // AggregatedList: Retrieves an aggregated list of target VPN gateways.
  92805. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {
  92806. c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92807. c.project = project
  92808. return c
  92809. }
  92810. // Filter sets the optional parameter "filter": A filter expression that
  92811. // filters resources listed in the response. The expression must specify
  92812. // the field name, a comparison operator, and the value that you want to
  92813. // use for filtering. The value must be a string, a number, or a
  92814. // boolean. The comparison operator must be either =, !=, >, or <.
  92815. //
  92816. // For example, if you are filtering Compute Engine instances, you can
  92817. // exclude instances named example-instance by specifying name !=
  92818. // example-instance.
  92819. //
  92820. // You can also filter nested fields. For example, you could specify
  92821. // scheduling.automaticRestart = false to include instances only if they
  92822. // are not scheduled for automatic restarts. You can use filtering on
  92823. // nested fields to filter based on resource labels.
  92824. //
  92825. // To filter on multiple expressions, provide each separate expression
  92826. // within parentheses. For example, (scheduling.automaticRestart = true)
  92827. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  92828. // AND expression. However, you can include AND and OR expressions
  92829. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  92830. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  92831. // true).
  92832. func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall {
  92833. c.urlParams_.Set("filter", filter)
  92834. return c
  92835. }
  92836. // MaxResults sets the optional parameter "maxResults": The maximum
  92837. // number of results per page that should be returned. If the number of
  92838. // available results is larger than maxResults, Compute Engine returns a
  92839. // nextPageToken that can be used to get the next page of results in
  92840. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  92841. // (Default: 500)
  92842. func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall {
  92843. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  92844. return c
  92845. }
  92846. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  92847. // a certain order. By default, results are returned in alphanumerical
  92848. // order based on the resource name.
  92849. //
  92850. // You can also sort results in descending order based on the creation
  92851. // timestamp using orderBy="creationTimestamp desc". This sorts results
  92852. // based on the creationTimestamp field in reverse chronological order
  92853. // (newest result first). Use this to sort resources like operations so
  92854. // that the newest operation is returned first.
  92855. //
  92856. // Currently, only sorting by name or creationTimestamp desc is
  92857. // supported.
  92858. func (c *TargetVpnGatewaysAggregatedListCall) OrderBy(orderBy string) *TargetVpnGatewaysAggregatedListCall {
  92859. c.urlParams_.Set("orderBy", orderBy)
  92860. return c
  92861. }
  92862. // PageToken sets the optional parameter "pageToken": Specifies a page
  92863. // token to use. Set pageToken to the nextPageToken returned by a
  92864. // previous list request to get the next page of results.
  92865. func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall {
  92866. c.urlParams_.Set("pageToken", pageToken)
  92867. return c
  92868. }
  92869. // Fields allows partial responses to be retrieved. See
  92870. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92871. // for more information.
  92872. func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall {
  92873. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92874. return c
  92875. }
  92876. // IfNoneMatch sets the optional parameter which makes the operation
  92877. // fail if the object's ETag matches the given value. This is useful for
  92878. // getting updates only after the object has changed since the last
  92879. // request. Use googleapi.IsNotModified to check whether the response
  92880. // error from Do is the result of In-None-Match.
  92881. func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall {
  92882. c.ifNoneMatch_ = entityTag
  92883. return c
  92884. }
  92885. // Context sets the context to be used in this call's Do method. Any
  92886. // pending HTTP request will be aborted if the provided context is
  92887. // canceled.
  92888. func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall {
  92889. c.ctx_ = ctx
  92890. return c
  92891. }
  92892. // Header returns an http.Header that can be modified by the caller to
  92893. // add HTTP headers to the request.
  92894. func (c *TargetVpnGatewaysAggregatedListCall) Header() http.Header {
  92895. if c.header_ == nil {
  92896. c.header_ = make(http.Header)
  92897. }
  92898. return c.header_
  92899. }
  92900. func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  92901. reqHeaders := make(http.Header)
  92902. for k, v := range c.header_ {
  92903. reqHeaders[k] = v
  92904. }
  92905. reqHeaders.Set("User-Agent", c.s.userAgent())
  92906. if c.ifNoneMatch_ != "" {
  92907. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92908. }
  92909. var body io.Reader = nil
  92910. c.urlParams_.Set("alt", alt)
  92911. c.urlParams_.Set("prettyPrint", "false")
  92912. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways")
  92913. urls += "?" + c.urlParams_.Encode()
  92914. req, err := http.NewRequest("GET", urls, body)
  92915. if err != nil {
  92916. return nil, err
  92917. }
  92918. req.Header = reqHeaders
  92919. googleapi.Expand(req.URL, map[string]string{
  92920. "project": c.project,
  92921. })
  92922. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92923. }
  92924. // Do executes the "compute.targetVpnGateways.aggregatedList" call.
  92925. // Exactly one of *TargetVpnGatewayAggregatedList or error will be
  92926. // non-nil. Any non-2xx status code is an error. Response headers are in
  92927. // either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a
  92928. // response was returned at all) in error.(*googleapi.Error).Header. Use
  92929. // googleapi.IsNotModified to check whether the returned error was
  92930. // because http.StatusNotModified was returned.
  92931. func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayAggregatedList, error) {
  92932. gensupport.SetOptions(c.urlParams_, opts...)
  92933. res, err := c.doRequest("json")
  92934. if res != nil && res.StatusCode == http.StatusNotModified {
  92935. if res.Body != nil {
  92936. res.Body.Close()
  92937. }
  92938. return nil, &googleapi.Error{
  92939. Code: res.StatusCode,
  92940. Header: res.Header,
  92941. }
  92942. }
  92943. if err != nil {
  92944. return nil, err
  92945. }
  92946. defer googleapi.CloseBody(res)
  92947. if err := googleapi.CheckResponse(res); err != nil {
  92948. return nil, err
  92949. }
  92950. ret := &TargetVpnGatewayAggregatedList{
  92951. ServerResponse: googleapi.ServerResponse{
  92952. Header: res.Header,
  92953. HTTPStatusCode: res.StatusCode,
  92954. },
  92955. }
  92956. target := &ret
  92957. if err := gensupport.DecodeResponse(target, res); err != nil {
  92958. return nil, err
  92959. }
  92960. return ret, nil
  92961. // {
  92962. // "description": "Retrieves an aggregated list of target VPN gateways.",
  92963. // "httpMethod": "GET",
  92964. // "id": "compute.targetVpnGateways.aggregatedList",
  92965. // "parameterOrder": [
  92966. // "project"
  92967. // ],
  92968. // "parameters": {
  92969. // "filter": {
  92970. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  92971. // "location": "query",
  92972. // "type": "string"
  92973. // },
  92974. // "maxResults": {
  92975. // "default": "500",
  92976. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  92977. // "format": "uint32",
  92978. // "location": "query",
  92979. // "minimum": "0",
  92980. // "type": "integer"
  92981. // },
  92982. // "orderBy": {
  92983. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  92984. // "location": "query",
  92985. // "type": "string"
  92986. // },
  92987. // "pageToken": {
  92988. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  92989. // "location": "query",
  92990. // "type": "string"
  92991. // },
  92992. // "project": {
  92993. // "description": "Project ID for this request.",
  92994. // "location": "path",
  92995. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92996. // "required": true,
  92997. // "type": "string"
  92998. // }
  92999. // },
  93000. // "path": "{project}/aggregated/targetVpnGateways",
  93001. // "response": {
  93002. // "$ref": "TargetVpnGatewayAggregatedList"
  93003. // },
  93004. // "scopes": [
  93005. // "https://www.googleapis.com/auth/cloud-platform",
  93006. // "https://www.googleapis.com/auth/compute",
  93007. // "https://www.googleapis.com/auth/compute.readonly"
  93008. // ]
  93009. // }
  93010. }
  93011. // Pages invokes f for each page of results.
  93012. // A non-nil error returned from f will halt the iteration.
  93013. // The provided context supersedes any context provided to the Context method.
  93014. func (c *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) error) error {
  93015. c.ctx_ = ctx
  93016. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  93017. for {
  93018. x, err := c.Do()
  93019. if err != nil {
  93020. return err
  93021. }
  93022. if err := f(x); err != nil {
  93023. return err
  93024. }
  93025. if x.NextPageToken == "" {
  93026. return nil
  93027. }
  93028. c.PageToken(x.NextPageToken)
  93029. }
  93030. }
  93031. // method id "compute.targetVpnGateways.delete":
  93032. type TargetVpnGatewaysDeleteCall struct {
  93033. s *Service
  93034. project string
  93035. region string
  93036. targetVpnGateway string
  93037. urlParams_ gensupport.URLParams
  93038. ctx_ context.Context
  93039. header_ http.Header
  93040. }
  93041. // Delete: Deletes the specified target VPN gateway.
  93042. func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall {
  93043. c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93044. c.project = project
  93045. c.region = region
  93046. c.targetVpnGateway = targetVpnGateway
  93047. return c
  93048. }
  93049. // RequestId sets the optional parameter "requestId": An optional
  93050. // request ID to identify requests. Specify a unique request ID so that
  93051. // if you must retry your request, the server will know to ignore the
  93052. // request if it has already been completed.
  93053. //
  93054. // For example, consider a situation where you make an initial request
  93055. // and the request times out. If you make the request again with the
  93056. // same request ID, the server can check if original operation with the
  93057. // same request ID was received, and if so, will ignore the second
  93058. // request. This prevents clients from accidentally creating duplicate
  93059. // commitments.
  93060. //
  93061. // The request ID must be a valid UUID with the exception that zero UUID
  93062. // is not supported (00000000-0000-0000-0000-000000000000).
  93063. func (c *TargetVpnGatewaysDeleteCall) RequestId(requestId string) *TargetVpnGatewaysDeleteCall {
  93064. c.urlParams_.Set("requestId", requestId)
  93065. return c
  93066. }
  93067. // Fields allows partial responses to be retrieved. See
  93068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93069. // for more information.
  93070. func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall {
  93071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93072. return c
  93073. }
  93074. // Context sets the context to be used in this call's Do method. Any
  93075. // pending HTTP request will be aborted if the provided context is
  93076. // canceled.
  93077. func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall {
  93078. c.ctx_ = ctx
  93079. return c
  93080. }
  93081. // Header returns an http.Header that can be modified by the caller to
  93082. // add HTTP headers to the request.
  93083. func (c *TargetVpnGatewaysDeleteCall) Header() http.Header {
  93084. if c.header_ == nil {
  93085. c.header_ = make(http.Header)
  93086. }
  93087. return c.header_
  93088. }
  93089. func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  93090. reqHeaders := make(http.Header)
  93091. for k, v := range c.header_ {
  93092. reqHeaders[k] = v
  93093. }
  93094. reqHeaders.Set("User-Agent", c.s.userAgent())
  93095. var body io.Reader = nil
  93096. c.urlParams_.Set("alt", alt)
  93097. c.urlParams_.Set("prettyPrint", "false")
  93098. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  93099. urls += "?" + c.urlParams_.Encode()
  93100. req, err := http.NewRequest("DELETE", urls, body)
  93101. if err != nil {
  93102. return nil, err
  93103. }
  93104. req.Header = reqHeaders
  93105. googleapi.Expand(req.URL, map[string]string{
  93106. "project": c.project,
  93107. "region": c.region,
  93108. "targetVpnGateway": c.targetVpnGateway,
  93109. })
  93110. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93111. }
  93112. // Do executes the "compute.targetVpnGateways.delete" call.
  93113. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93114. // status code is an error. Response headers are in either
  93115. // *Operation.ServerResponse.Header or (if a response was returned at
  93116. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93117. // to check whether the returned error was because
  93118. // http.StatusNotModified was returned.
  93119. func (c *TargetVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93120. gensupport.SetOptions(c.urlParams_, opts...)
  93121. res, err := c.doRequest("json")
  93122. if res != nil && res.StatusCode == http.StatusNotModified {
  93123. if res.Body != nil {
  93124. res.Body.Close()
  93125. }
  93126. return nil, &googleapi.Error{
  93127. Code: res.StatusCode,
  93128. Header: res.Header,
  93129. }
  93130. }
  93131. if err != nil {
  93132. return nil, err
  93133. }
  93134. defer googleapi.CloseBody(res)
  93135. if err := googleapi.CheckResponse(res); err != nil {
  93136. return nil, err
  93137. }
  93138. ret := &Operation{
  93139. ServerResponse: googleapi.ServerResponse{
  93140. Header: res.Header,
  93141. HTTPStatusCode: res.StatusCode,
  93142. },
  93143. }
  93144. target := &ret
  93145. if err := gensupport.DecodeResponse(target, res); err != nil {
  93146. return nil, err
  93147. }
  93148. return ret, nil
  93149. // {
  93150. // "description": "Deletes the specified target VPN gateway.",
  93151. // "httpMethod": "DELETE",
  93152. // "id": "compute.targetVpnGateways.delete",
  93153. // "parameterOrder": [
  93154. // "project",
  93155. // "region",
  93156. // "targetVpnGateway"
  93157. // ],
  93158. // "parameters": {
  93159. // "project": {
  93160. // "description": "Project ID for this request.",
  93161. // "location": "path",
  93162. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93163. // "required": true,
  93164. // "type": "string"
  93165. // },
  93166. // "region": {
  93167. // "description": "Name of the region for this request.",
  93168. // "location": "path",
  93169. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93170. // "required": true,
  93171. // "type": "string"
  93172. // },
  93173. // "requestId": {
  93174. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93175. // "location": "query",
  93176. // "type": "string"
  93177. // },
  93178. // "targetVpnGateway": {
  93179. // "description": "Name of the target VPN gateway to delete.",
  93180. // "location": "path",
  93181. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  93182. // "required": true,
  93183. // "type": "string"
  93184. // }
  93185. // },
  93186. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  93187. // "response": {
  93188. // "$ref": "Operation"
  93189. // },
  93190. // "scopes": [
  93191. // "https://www.googleapis.com/auth/cloud-platform",
  93192. // "https://www.googleapis.com/auth/compute"
  93193. // ]
  93194. // }
  93195. }
  93196. // method id "compute.targetVpnGateways.get":
  93197. type TargetVpnGatewaysGetCall struct {
  93198. s *Service
  93199. project string
  93200. region string
  93201. targetVpnGateway string
  93202. urlParams_ gensupport.URLParams
  93203. ifNoneMatch_ string
  93204. ctx_ context.Context
  93205. header_ http.Header
  93206. }
  93207. // Get: Returns the specified target VPN gateway. Gets a list of
  93208. // available target VPN gateways by making a list() request.
  93209. func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall {
  93210. c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93211. c.project = project
  93212. c.region = region
  93213. c.targetVpnGateway = targetVpnGateway
  93214. return c
  93215. }
  93216. // Fields allows partial responses to be retrieved. See
  93217. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93218. // for more information.
  93219. func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall {
  93220. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93221. return c
  93222. }
  93223. // IfNoneMatch sets the optional parameter which makes the operation
  93224. // fail if the object's ETag matches the given value. This is useful for
  93225. // getting updates only after the object has changed since the last
  93226. // request. Use googleapi.IsNotModified to check whether the response
  93227. // error from Do is the result of In-None-Match.
  93228. func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall {
  93229. c.ifNoneMatch_ = entityTag
  93230. return c
  93231. }
  93232. // Context sets the context to be used in this call's Do method. Any
  93233. // pending HTTP request will be aborted if the provided context is
  93234. // canceled.
  93235. func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall {
  93236. c.ctx_ = ctx
  93237. return c
  93238. }
  93239. // Header returns an http.Header that can be modified by the caller to
  93240. // add HTTP headers to the request.
  93241. func (c *TargetVpnGatewaysGetCall) Header() http.Header {
  93242. if c.header_ == nil {
  93243. c.header_ = make(http.Header)
  93244. }
  93245. return c.header_
  93246. }
  93247. func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  93248. reqHeaders := make(http.Header)
  93249. for k, v := range c.header_ {
  93250. reqHeaders[k] = v
  93251. }
  93252. reqHeaders.Set("User-Agent", c.s.userAgent())
  93253. if c.ifNoneMatch_ != "" {
  93254. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93255. }
  93256. var body io.Reader = nil
  93257. c.urlParams_.Set("alt", alt)
  93258. c.urlParams_.Set("prettyPrint", "false")
  93259. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  93260. urls += "?" + c.urlParams_.Encode()
  93261. req, err := http.NewRequest("GET", urls, body)
  93262. if err != nil {
  93263. return nil, err
  93264. }
  93265. req.Header = reqHeaders
  93266. googleapi.Expand(req.URL, map[string]string{
  93267. "project": c.project,
  93268. "region": c.region,
  93269. "targetVpnGateway": c.targetVpnGateway,
  93270. })
  93271. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93272. }
  93273. // Do executes the "compute.targetVpnGateways.get" call.
  93274. // Exactly one of *TargetVpnGateway or error will be non-nil. Any
  93275. // non-2xx status code is an error. Response headers are in either
  93276. // *TargetVpnGateway.ServerResponse.Header or (if a response was
  93277. // returned at all) in error.(*googleapi.Error).Header. Use
  93278. // googleapi.IsNotModified to check whether the returned error was
  93279. // because http.StatusNotModified was returned.
  93280. func (c *TargetVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*TargetVpnGateway, error) {
  93281. gensupport.SetOptions(c.urlParams_, opts...)
  93282. res, err := c.doRequest("json")
  93283. if res != nil && res.StatusCode == http.StatusNotModified {
  93284. if res.Body != nil {
  93285. res.Body.Close()
  93286. }
  93287. return nil, &googleapi.Error{
  93288. Code: res.StatusCode,
  93289. Header: res.Header,
  93290. }
  93291. }
  93292. if err != nil {
  93293. return nil, err
  93294. }
  93295. defer googleapi.CloseBody(res)
  93296. if err := googleapi.CheckResponse(res); err != nil {
  93297. return nil, err
  93298. }
  93299. ret := &TargetVpnGateway{
  93300. ServerResponse: googleapi.ServerResponse{
  93301. Header: res.Header,
  93302. HTTPStatusCode: res.StatusCode,
  93303. },
  93304. }
  93305. target := &ret
  93306. if err := gensupport.DecodeResponse(target, res); err != nil {
  93307. return nil, err
  93308. }
  93309. return ret, nil
  93310. // {
  93311. // "description": "Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.",
  93312. // "httpMethod": "GET",
  93313. // "id": "compute.targetVpnGateways.get",
  93314. // "parameterOrder": [
  93315. // "project",
  93316. // "region",
  93317. // "targetVpnGateway"
  93318. // ],
  93319. // "parameters": {
  93320. // "project": {
  93321. // "description": "Project ID for this request.",
  93322. // "location": "path",
  93323. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93324. // "required": true,
  93325. // "type": "string"
  93326. // },
  93327. // "region": {
  93328. // "description": "Name of the region for this request.",
  93329. // "location": "path",
  93330. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93331. // "required": true,
  93332. // "type": "string"
  93333. // },
  93334. // "targetVpnGateway": {
  93335. // "description": "Name of the target VPN gateway to return.",
  93336. // "location": "path",
  93337. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  93338. // "required": true,
  93339. // "type": "string"
  93340. // }
  93341. // },
  93342. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  93343. // "response": {
  93344. // "$ref": "TargetVpnGateway"
  93345. // },
  93346. // "scopes": [
  93347. // "https://www.googleapis.com/auth/cloud-platform",
  93348. // "https://www.googleapis.com/auth/compute",
  93349. // "https://www.googleapis.com/auth/compute.readonly"
  93350. // ]
  93351. // }
  93352. }
  93353. // method id "compute.targetVpnGateways.insert":
  93354. type TargetVpnGatewaysInsertCall struct {
  93355. s *Service
  93356. project string
  93357. region string
  93358. targetvpngateway *TargetVpnGateway
  93359. urlParams_ gensupport.URLParams
  93360. ctx_ context.Context
  93361. header_ http.Header
  93362. }
  93363. // Insert: Creates a target VPN gateway in the specified project and
  93364. // region using the data included in the request.
  93365. func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall {
  93366. c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93367. c.project = project
  93368. c.region = region
  93369. c.targetvpngateway = targetvpngateway
  93370. return c
  93371. }
  93372. // RequestId sets the optional parameter "requestId": An optional
  93373. // request ID to identify requests. Specify a unique request ID so that
  93374. // if you must retry your request, the server will know to ignore the
  93375. // request if it has already been completed.
  93376. //
  93377. // For example, consider a situation where you make an initial request
  93378. // and the request times out. If you make the request again with the
  93379. // same request ID, the server can check if original operation with the
  93380. // same request ID was received, and if so, will ignore the second
  93381. // request. This prevents clients from accidentally creating duplicate
  93382. // commitments.
  93383. //
  93384. // The request ID must be a valid UUID with the exception that zero UUID
  93385. // is not supported (00000000-0000-0000-0000-000000000000).
  93386. func (c *TargetVpnGatewaysInsertCall) RequestId(requestId string) *TargetVpnGatewaysInsertCall {
  93387. c.urlParams_.Set("requestId", requestId)
  93388. return c
  93389. }
  93390. // Fields allows partial responses to be retrieved. See
  93391. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93392. // for more information.
  93393. func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall {
  93394. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93395. return c
  93396. }
  93397. // Context sets the context to be used in this call's Do method. Any
  93398. // pending HTTP request will be aborted if the provided context is
  93399. // canceled.
  93400. func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall {
  93401. c.ctx_ = ctx
  93402. return c
  93403. }
  93404. // Header returns an http.Header that can be modified by the caller to
  93405. // add HTTP headers to the request.
  93406. func (c *TargetVpnGatewaysInsertCall) Header() http.Header {
  93407. if c.header_ == nil {
  93408. c.header_ = make(http.Header)
  93409. }
  93410. return c.header_
  93411. }
  93412. func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  93413. reqHeaders := make(http.Header)
  93414. for k, v := range c.header_ {
  93415. reqHeaders[k] = v
  93416. }
  93417. reqHeaders.Set("User-Agent", c.s.userAgent())
  93418. var body io.Reader = nil
  93419. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway)
  93420. if err != nil {
  93421. return nil, err
  93422. }
  93423. reqHeaders.Set("Content-Type", "application/json")
  93424. c.urlParams_.Set("alt", alt)
  93425. c.urlParams_.Set("prettyPrint", "false")
  93426. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  93427. urls += "?" + c.urlParams_.Encode()
  93428. req, err := http.NewRequest("POST", urls, body)
  93429. if err != nil {
  93430. return nil, err
  93431. }
  93432. req.Header = reqHeaders
  93433. googleapi.Expand(req.URL, map[string]string{
  93434. "project": c.project,
  93435. "region": c.region,
  93436. })
  93437. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93438. }
  93439. // Do executes the "compute.targetVpnGateways.insert" call.
  93440. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93441. // status code is an error. Response headers are in either
  93442. // *Operation.ServerResponse.Header or (if a response was returned at
  93443. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93444. // to check whether the returned error was because
  93445. // http.StatusNotModified was returned.
  93446. func (c *TargetVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93447. gensupport.SetOptions(c.urlParams_, opts...)
  93448. res, err := c.doRequest("json")
  93449. if res != nil && res.StatusCode == http.StatusNotModified {
  93450. if res.Body != nil {
  93451. res.Body.Close()
  93452. }
  93453. return nil, &googleapi.Error{
  93454. Code: res.StatusCode,
  93455. Header: res.Header,
  93456. }
  93457. }
  93458. if err != nil {
  93459. return nil, err
  93460. }
  93461. defer googleapi.CloseBody(res)
  93462. if err := googleapi.CheckResponse(res); err != nil {
  93463. return nil, err
  93464. }
  93465. ret := &Operation{
  93466. ServerResponse: googleapi.ServerResponse{
  93467. Header: res.Header,
  93468. HTTPStatusCode: res.StatusCode,
  93469. },
  93470. }
  93471. target := &ret
  93472. if err := gensupport.DecodeResponse(target, res); err != nil {
  93473. return nil, err
  93474. }
  93475. return ret, nil
  93476. // {
  93477. // "description": "Creates a target VPN gateway in the specified project and region using the data included in the request.",
  93478. // "httpMethod": "POST",
  93479. // "id": "compute.targetVpnGateways.insert",
  93480. // "parameterOrder": [
  93481. // "project",
  93482. // "region"
  93483. // ],
  93484. // "parameters": {
  93485. // "project": {
  93486. // "description": "Project ID for this request.",
  93487. // "location": "path",
  93488. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93489. // "required": true,
  93490. // "type": "string"
  93491. // },
  93492. // "region": {
  93493. // "description": "Name of the region for this request.",
  93494. // "location": "path",
  93495. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93496. // "required": true,
  93497. // "type": "string"
  93498. // },
  93499. // "requestId": {
  93500. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93501. // "location": "query",
  93502. // "type": "string"
  93503. // }
  93504. // },
  93505. // "path": "{project}/regions/{region}/targetVpnGateways",
  93506. // "request": {
  93507. // "$ref": "TargetVpnGateway"
  93508. // },
  93509. // "response": {
  93510. // "$ref": "Operation"
  93511. // },
  93512. // "scopes": [
  93513. // "https://www.googleapis.com/auth/cloud-platform",
  93514. // "https://www.googleapis.com/auth/compute"
  93515. // ]
  93516. // }
  93517. }
  93518. // method id "compute.targetVpnGateways.list":
  93519. type TargetVpnGatewaysListCall struct {
  93520. s *Service
  93521. project string
  93522. region string
  93523. urlParams_ gensupport.URLParams
  93524. ifNoneMatch_ string
  93525. ctx_ context.Context
  93526. header_ http.Header
  93527. }
  93528. // List: Retrieves a list of target VPN gateways available to the
  93529. // specified project and region.
  93530. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall {
  93531. c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93532. c.project = project
  93533. c.region = region
  93534. return c
  93535. }
  93536. // Filter sets the optional parameter "filter": A filter expression that
  93537. // filters resources listed in the response. The expression must specify
  93538. // the field name, a comparison operator, and the value that you want to
  93539. // use for filtering. The value must be a string, a number, or a
  93540. // boolean. The comparison operator must be either =, !=, >, or <.
  93541. //
  93542. // For example, if you are filtering Compute Engine instances, you can
  93543. // exclude instances named example-instance by specifying name !=
  93544. // example-instance.
  93545. //
  93546. // You can also filter nested fields. For example, you could specify
  93547. // scheduling.automaticRestart = false to include instances only if they
  93548. // are not scheduled for automatic restarts. You can use filtering on
  93549. // nested fields to filter based on resource labels.
  93550. //
  93551. // To filter on multiple expressions, provide each separate expression
  93552. // within parentheses. For example, (scheduling.automaticRestart = true)
  93553. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93554. // AND expression. However, you can include AND and OR expressions
  93555. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  93556. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  93557. // true).
  93558. func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall {
  93559. c.urlParams_.Set("filter", filter)
  93560. return c
  93561. }
  93562. // MaxResults sets the optional parameter "maxResults": The maximum
  93563. // number of results per page that should be returned. If the number of
  93564. // available results is larger than maxResults, Compute Engine returns a
  93565. // nextPageToken that can be used to get the next page of results in
  93566. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  93567. // (Default: 500)
  93568. func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall {
  93569. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  93570. return c
  93571. }
  93572. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  93573. // a certain order. By default, results are returned in alphanumerical
  93574. // order based on the resource name.
  93575. //
  93576. // You can also sort results in descending order based on the creation
  93577. // timestamp using orderBy="creationTimestamp desc". This sorts results
  93578. // based on the creationTimestamp field in reverse chronological order
  93579. // (newest result first). Use this to sort resources like operations so
  93580. // that the newest operation is returned first.
  93581. //
  93582. // Currently, only sorting by name or creationTimestamp desc is
  93583. // supported.
  93584. func (c *TargetVpnGatewaysListCall) OrderBy(orderBy string) *TargetVpnGatewaysListCall {
  93585. c.urlParams_.Set("orderBy", orderBy)
  93586. return c
  93587. }
  93588. // PageToken sets the optional parameter "pageToken": Specifies a page
  93589. // token to use. Set pageToken to the nextPageToken returned by a
  93590. // previous list request to get the next page of results.
  93591. func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall {
  93592. c.urlParams_.Set("pageToken", pageToken)
  93593. return c
  93594. }
  93595. // Fields allows partial responses to be retrieved. See
  93596. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93597. // for more information.
  93598. func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall {
  93599. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93600. return c
  93601. }
  93602. // IfNoneMatch sets the optional parameter which makes the operation
  93603. // fail if the object's ETag matches the given value. This is useful for
  93604. // getting updates only after the object has changed since the last
  93605. // request. Use googleapi.IsNotModified to check whether the response
  93606. // error from Do is the result of In-None-Match.
  93607. func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall {
  93608. c.ifNoneMatch_ = entityTag
  93609. return c
  93610. }
  93611. // Context sets the context to be used in this call's Do method. Any
  93612. // pending HTTP request will be aborted if the provided context is
  93613. // canceled.
  93614. func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall {
  93615. c.ctx_ = ctx
  93616. return c
  93617. }
  93618. // Header returns an http.Header that can be modified by the caller to
  93619. // add HTTP headers to the request.
  93620. func (c *TargetVpnGatewaysListCall) Header() http.Header {
  93621. if c.header_ == nil {
  93622. c.header_ = make(http.Header)
  93623. }
  93624. return c.header_
  93625. }
  93626. func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  93627. reqHeaders := make(http.Header)
  93628. for k, v := range c.header_ {
  93629. reqHeaders[k] = v
  93630. }
  93631. reqHeaders.Set("User-Agent", c.s.userAgent())
  93632. if c.ifNoneMatch_ != "" {
  93633. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93634. }
  93635. var body io.Reader = nil
  93636. c.urlParams_.Set("alt", alt)
  93637. c.urlParams_.Set("prettyPrint", "false")
  93638. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  93639. urls += "?" + c.urlParams_.Encode()
  93640. req, err := http.NewRequest("GET", urls, body)
  93641. if err != nil {
  93642. return nil, err
  93643. }
  93644. req.Header = reqHeaders
  93645. googleapi.Expand(req.URL, map[string]string{
  93646. "project": c.project,
  93647. "region": c.region,
  93648. })
  93649. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93650. }
  93651. // Do executes the "compute.targetVpnGateways.list" call.
  93652. // Exactly one of *TargetVpnGatewayList or error will be non-nil. Any
  93653. // non-2xx status code is an error. Response headers are in either
  93654. // *TargetVpnGatewayList.ServerResponse.Header or (if a response was
  93655. // returned at all) in error.(*googleapi.Error).Header. Use
  93656. // googleapi.IsNotModified to check whether the returned error was
  93657. // because http.StatusNotModified was returned.
  93658. func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayList, error) {
  93659. gensupport.SetOptions(c.urlParams_, opts...)
  93660. res, err := c.doRequest("json")
  93661. if res != nil && res.StatusCode == http.StatusNotModified {
  93662. if res.Body != nil {
  93663. res.Body.Close()
  93664. }
  93665. return nil, &googleapi.Error{
  93666. Code: res.StatusCode,
  93667. Header: res.Header,
  93668. }
  93669. }
  93670. if err != nil {
  93671. return nil, err
  93672. }
  93673. defer googleapi.CloseBody(res)
  93674. if err := googleapi.CheckResponse(res); err != nil {
  93675. return nil, err
  93676. }
  93677. ret := &TargetVpnGatewayList{
  93678. ServerResponse: googleapi.ServerResponse{
  93679. Header: res.Header,
  93680. HTTPStatusCode: res.StatusCode,
  93681. },
  93682. }
  93683. target := &ret
  93684. if err := gensupport.DecodeResponse(target, res); err != nil {
  93685. return nil, err
  93686. }
  93687. return ret, nil
  93688. // {
  93689. // "description": "Retrieves a list of target VPN gateways available to the specified project and region.",
  93690. // "httpMethod": "GET",
  93691. // "id": "compute.targetVpnGateways.list",
  93692. // "parameterOrder": [
  93693. // "project",
  93694. // "region"
  93695. // ],
  93696. // "parameters": {
  93697. // "filter": {
  93698. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  93699. // "location": "query",
  93700. // "type": "string"
  93701. // },
  93702. // "maxResults": {
  93703. // "default": "500",
  93704. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  93705. // "format": "uint32",
  93706. // "location": "query",
  93707. // "minimum": "0",
  93708. // "type": "integer"
  93709. // },
  93710. // "orderBy": {
  93711. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  93712. // "location": "query",
  93713. // "type": "string"
  93714. // },
  93715. // "pageToken": {
  93716. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  93717. // "location": "query",
  93718. // "type": "string"
  93719. // },
  93720. // "project": {
  93721. // "description": "Project ID for this request.",
  93722. // "location": "path",
  93723. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93724. // "required": true,
  93725. // "type": "string"
  93726. // },
  93727. // "region": {
  93728. // "description": "Name of the region for this request.",
  93729. // "location": "path",
  93730. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93731. // "required": true,
  93732. // "type": "string"
  93733. // }
  93734. // },
  93735. // "path": "{project}/regions/{region}/targetVpnGateways",
  93736. // "response": {
  93737. // "$ref": "TargetVpnGatewayList"
  93738. // },
  93739. // "scopes": [
  93740. // "https://www.googleapis.com/auth/cloud-platform",
  93741. // "https://www.googleapis.com/auth/compute",
  93742. // "https://www.googleapis.com/auth/compute.readonly"
  93743. // ]
  93744. // }
  93745. }
  93746. // Pages invokes f for each page of results.
  93747. // A non-nil error returned from f will halt the iteration.
  93748. // The provided context supersedes any context provided to the Context method.
  93749. func (c *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) error) error {
  93750. c.ctx_ = ctx
  93751. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  93752. for {
  93753. x, err := c.Do()
  93754. if err != nil {
  93755. return err
  93756. }
  93757. if err := f(x); err != nil {
  93758. return err
  93759. }
  93760. if x.NextPageToken == "" {
  93761. return nil
  93762. }
  93763. c.PageToken(x.NextPageToken)
  93764. }
  93765. }
  93766. // method id "compute.urlMaps.delete":
  93767. type UrlMapsDeleteCall struct {
  93768. s *Service
  93769. project string
  93770. urlMap string
  93771. urlParams_ gensupport.URLParams
  93772. ctx_ context.Context
  93773. header_ http.Header
  93774. }
  93775. // Delete: Deletes the specified UrlMap resource.
  93776. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete
  93777. func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall {
  93778. c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93779. c.project = project
  93780. c.urlMap = urlMap
  93781. return c
  93782. }
  93783. // RequestId sets the optional parameter "requestId": An optional
  93784. // request ID to identify requests. Specify a unique request ID so that
  93785. // if you must retry your request, the server will know to ignore the
  93786. // request if it has already been completed.
  93787. //
  93788. // For example, consider a situation where you make an initial request
  93789. // and the request times out. If you make the request again with the
  93790. // same request ID, the server can check if original operation with the
  93791. // same request ID was received, and if so, will ignore the second
  93792. // request. This prevents clients from accidentally creating duplicate
  93793. // commitments.
  93794. //
  93795. // The request ID must be a valid UUID with the exception that zero UUID
  93796. // is not supported (00000000-0000-0000-0000-000000000000).
  93797. func (c *UrlMapsDeleteCall) RequestId(requestId string) *UrlMapsDeleteCall {
  93798. c.urlParams_.Set("requestId", requestId)
  93799. return c
  93800. }
  93801. // Fields allows partial responses to be retrieved. See
  93802. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93803. // for more information.
  93804. func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall {
  93805. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93806. return c
  93807. }
  93808. // Context sets the context to be used in this call's Do method. Any
  93809. // pending HTTP request will be aborted if the provided context is
  93810. // canceled.
  93811. func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall {
  93812. c.ctx_ = ctx
  93813. return c
  93814. }
  93815. // Header returns an http.Header that can be modified by the caller to
  93816. // add HTTP headers to the request.
  93817. func (c *UrlMapsDeleteCall) Header() http.Header {
  93818. if c.header_ == nil {
  93819. c.header_ = make(http.Header)
  93820. }
  93821. return c.header_
  93822. }
  93823. func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  93824. reqHeaders := make(http.Header)
  93825. for k, v := range c.header_ {
  93826. reqHeaders[k] = v
  93827. }
  93828. reqHeaders.Set("User-Agent", c.s.userAgent())
  93829. var body io.Reader = nil
  93830. c.urlParams_.Set("alt", alt)
  93831. c.urlParams_.Set("prettyPrint", "false")
  93832. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  93833. urls += "?" + c.urlParams_.Encode()
  93834. req, err := http.NewRequest("DELETE", urls, body)
  93835. if err != nil {
  93836. return nil, err
  93837. }
  93838. req.Header = reqHeaders
  93839. googleapi.Expand(req.URL, map[string]string{
  93840. "project": c.project,
  93841. "urlMap": c.urlMap,
  93842. })
  93843. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93844. }
  93845. // Do executes the "compute.urlMaps.delete" call.
  93846. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93847. // status code is an error. Response headers are in either
  93848. // *Operation.ServerResponse.Header or (if a response was returned at
  93849. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93850. // to check whether the returned error was because
  93851. // http.StatusNotModified was returned.
  93852. func (c *UrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93853. gensupport.SetOptions(c.urlParams_, opts...)
  93854. res, err := c.doRequest("json")
  93855. if res != nil && res.StatusCode == http.StatusNotModified {
  93856. if res.Body != nil {
  93857. res.Body.Close()
  93858. }
  93859. return nil, &googleapi.Error{
  93860. Code: res.StatusCode,
  93861. Header: res.Header,
  93862. }
  93863. }
  93864. if err != nil {
  93865. return nil, err
  93866. }
  93867. defer googleapi.CloseBody(res)
  93868. if err := googleapi.CheckResponse(res); err != nil {
  93869. return nil, err
  93870. }
  93871. ret := &Operation{
  93872. ServerResponse: googleapi.ServerResponse{
  93873. Header: res.Header,
  93874. HTTPStatusCode: res.StatusCode,
  93875. },
  93876. }
  93877. target := &ret
  93878. if err := gensupport.DecodeResponse(target, res); err != nil {
  93879. return nil, err
  93880. }
  93881. return ret, nil
  93882. // {
  93883. // "description": "Deletes the specified UrlMap resource.",
  93884. // "httpMethod": "DELETE",
  93885. // "id": "compute.urlMaps.delete",
  93886. // "parameterOrder": [
  93887. // "project",
  93888. // "urlMap"
  93889. // ],
  93890. // "parameters": {
  93891. // "project": {
  93892. // "description": "Project ID for this request.",
  93893. // "location": "path",
  93894. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93895. // "required": true,
  93896. // "type": "string"
  93897. // },
  93898. // "requestId": {
  93899. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93900. // "location": "query",
  93901. // "type": "string"
  93902. // },
  93903. // "urlMap": {
  93904. // "description": "Name of the UrlMap resource to delete.",
  93905. // "location": "path",
  93906. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  93907. // "required": true,
  93908. // "type": "string"
  93909. // }
  93910. // },
  93911. // "path": "{project}/global/urlMaps/{urlMap}",
  93912. // "response": {
  93913. // "$ref": "Operation"
  93914. // },
  93915. // "scopes": [
  93916. // "https://www.googleapis.com/auth/cloud-platform",
  93917. // "https://www.googleapis.com/auth/compute"
  93918. // ]
  93919. // }
  93920. }
  93921. // method id "compute.urlMaps.get":
  93922. type UrlMapsGetCall struct {
  93923. s *Service
  93924. project string
  93925. urlMap string
  93926. urlParams_ gensupport.URLParams
  93927. ifNoneMatch_ string
  93928. ctx_ context.Context
  93929. header_ http.Header
  93930. }
  93931. // Get: Returns the specified UrlMap resource. Gets a list of available
  93932. // URL maps by making a list() request.
  93933. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get
  93934. func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall {
  93935. c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93936. c.project = project
  93937. c.urlMap = urlMap
  93938. return c
  93939. }
  93940. // Fields allows partial responses to be retrieved. See
  93941. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93942. // for more information.
  93943. func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall {
  93944. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93945. return c
  93946. }
  93947. // IfNoneMatch sets the optional parameter which makes the operation
  93948. // fail if the object's ETag matches the given value. This is useful for
  93949. // getting updates only after the object has changed since the last
  93950. // request. Use googleapi.IsNotModified to check whether the response
  93951. // error from Do is the result of In-None-Match.
  93952. func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall {
  93953. c.ifNoneMatch_ = entityTag
  93954. return c
  93955. }
  93956. // Context sets the context to be used in this call's Do method. Any
  93957. // pending HTTP request will be aborted if the provided context is
  93958. // canceled.
  93959. func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall {
  93960. c.ctx_ = ctx
  93961. return c
  93962. }
  93963. // Header returns an http.Header that can be modified by the caller to
  93964. // add HTTP headers to the request.
  93965. func (c *UrlMapsGetCall) Header() http.Header {
  93966. if c.header_ == nil {
  93967. c.header_ = make(http.Header)
  93968. }
  93969. return c.header_
  93970. }
  93971. func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  93972. reqHeaders := make(http.Header)
  93973. for k, v := range c.header_ {
  93974. reqHeaders[k] = v
  93975. }
  93976. reqHeaders.Set("User-Agent", c.s.userAgent())
  93977. if c.ifNoneMatch_ != "" {
  93978. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93979. }
  93980. var body io.Reader = nil
  93981. c.urlParams_.Set("alt", alt)
  93982. c.urlParams_.Set("prettyPrint", "false")
  93983. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  93984. urls += "?" + c.urlParams_.Encode()
  93985. req, err := http.NewRequest("GET", urls, body)
  93986. if err != nil {
  93987. return nil, err
  93988. }
  93989. req.Header = reqHeaders
  93990. googleapi.Expand(req.URL, map[string]string{
  93991. "project": c.project,
  93992. "urlMap": c.urlMap,
  93993. })
  93994. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93995. }
  93996. // Do executes the "compute.urlMaps.get" call.
  93997. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  93998. // code is an error. Response headers are in either
  93999. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  94000. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  94001. // check whether the returned error was because http.StatusNotModified
  94002. // was returned.
  94003. func (c *UrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  94004. gensupport.SetOptions(c.urlParams_, opts...)
  94005. res, err := c.doRequest("json")
  94006. if res != nil && res.StatusCode == http.StatusNotModified {
  94007. if res.Body != nil {
  94008. res.Body.Close()
  94009. }
  94010. return nil, &googleapi.Error{
  94011. Code: res.StatusCode,
  94012. Header: res.Header,
  94013. }
  94014. }
  94015. if err != nil {
  94016. return nil, err
  94017. }
  94018. defer googleapi.CloseBody(res)
  94019. if err := googleapi.CheckResponse(res); err != nil {
  94020. return nil, err
  94021. }
  94022. ret := &UrlMap{
  94023. ServerResponse: googleapi.ServerResponse{
  94024. Header: res.Header,
  94025. HTTPStatusCode: res.StatusCode,
  94026. },
  94027. }
  94028. target := &ret
  94029. if err := gensupport.DecodeResponse(target, res); err != nil {
  94030. return nil, err
  94031. }
  94032. return ret, nil
  94033. // {
  94034. // "description": "Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.",
  94035. // "httpMethod": "GET",
  94036. // "id": "compute.urlMaps.get",
  94037. // "parameterOrder": [
  94038. // "project",
  94039. // "urlMap"
  94040. // ],
  94041. // "parameters": {
  94042. // "project": {
  94043. // "description": "Project ID for this request.",
  94044. // "location": "path",
  94045. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94046. // "required": true,
  94047. // "type": "string"
  94048. // },
  94049. // "urlMap": {
  94050. // "description": "Name of the UrlMap resource to return.",
  94051. // "location": "path",
  94052. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  94053. // "required": true,
  94054. // "type": "string"
  94055. // }
  94056. // },
  94057. // "path": "{project}/global/urlMaps/{urlMap}",
  94058. // "response": {
  94059. // "$ref": "UrlMap"
  94060. // },
  94061. // "scopes": [
  94062. // "https://www.googleapis.com/auth/cloud-platform",
  94063. // "https://www.googleapis.com/auth/compute",
  94064. // "https://www.googleapis.com/auth/compute.readonly"
  94065. // ]
  94066. // }
  94067. }
  94068. // method id "compute.urlMaps.insert":
  94069. type UrlMapsInsertCall struct {
  94070. s *Service
  94071. project string
  94072. urlmap *UrlMap
  94073. urlParams_ gensupport.URLParams
  94074. ctx_ context.Context
  94075. header_ http.Header
  94076. }
  94077. // Insert: Creates a UrlMap resource in the specified project using the
  94078. // data included in the request.
  94079. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert
  94080. func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall {
  94081. c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94082. c.project = project
  94083. c.urlmap = urlmap
  94084. return c
  94085. }
  94086. // RequestId sets the optional parameter "requestId": An optional
  94087. // request ID to identify requests. Specify a unique request ID so that
  94088. // if you must retry your request, the server will know to ignore the
  94089. // request if it has already been completed.
  94090. //
  94091. // For example, consider a situation where you make an initial request
  94092. // and the request times out. If you make the request again with the
  94093. // same request ID, the server can check if original operation with the
  94094. // same request ID was received, and if so, will ignore the second
  94095. // request. This prevents clients from accidentally creating duplicate
  94096. // commitments.
  94097. //
  94098. // The request ID must be a valid UUID with the exception that zero UUID
  94099. // is not supported (00000000-0000-0000-0000-000000000000).
  94100. func (c *UrlMapsInsertCall) RequestId(requestId string) *UrlMapsInsertCall {
  94101. c.urlParams_.Set("requestId", requestId)
  94102. return c
  94103. }
  94104. // Fields allows partial responses to be retrieved. See
  94105. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94106. // for more information.
  94107. func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall {
  94108. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94109. return c
  94110. }
  94111. // Context sets the context to be used in this call's Do method. Any
  94112. // pending HTTP request will be aborted if the provided context is
  94113. // canceled.
  94114. func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall {
  94115. c.ctx_ = ctx
  94116. return c
  94117. }
  94118. // Header returns an http.Header that can be modified by the caller to
  94119. // add HTTP headers to the request.
  94120. func (c *UrlMapsInsertCall) Header() http.Header {
  94121. if c.header_ == nil {
  94122. c.header_ = make(http.Header)
  94123. }
  94124. return c.header_
  94125. }
  94126. func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  94127. reqHeaders := make(http.Header)
  94128. for k, v := range c.header_ {
  94129. reqHeaders[k] = v
  94130. }
  94131. reqHeaders.Set("User-Agent", c.s.userAgent())
  94132. var body io.Reader = nil
  94133. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  94134. if err != nil {
  94135. return nil, err
  94136. }
  94137. reqHeaders.Set("Content-Type", "application/json")
  94138. c.urlParams_.Set("alt", alt)
  94139. c.urlParams_.Set("prettyPrint", "false")
  94140. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  94141. urls += "?" + c.urlParams_.Encode()
  94142. req, err := http.NewRequest("POST", urls, body)
  94143. if err != nil {
  94144. return nil, err
  94145. }
  94146. req.Header = reqHeaders
  94147. googleapi.Expand(req.URL, map[string]string{
  94148. "project": c.project,
  94149. })
  94150. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94151. }
  94152. // Do executes the "compute.urlMaps.insert" call.
  94153. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94154. // status code is an error. Response headers are in either
  94155. // *Operation.ServerResponse.Header or (if a response was returned at
  94156. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94157. // to check whether the returned error was because
  94158. // http.StatusNotModified was returned.
  94159. func (c *UrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94160. gensupport.SetOptions(c.urlParams_, opts...)
  94161. res, err := c.doRequest("json")
  94162. if res != nil && res.StatusCode == http.StatusNotModified {
  94163. if res.Body != nil {
  94164. res.Body.Close()
  94165. }
  94166. return nil, &googleapi.Error{
  94167. Code: res.StatusCode,
  94168. Header: res.Header,
  94169. }
  94170. }
  94171. if err != nil {
  94172. return nil, err
  94173. }
  94174. defer googleapi.CloseBody(res)
  94175. if err := googleapi.CheckResponse(res); err != nil {
  94176. return nil, err
  94177. }
  94178. ret := &Operation{
  94179. ServerResponse: googleapi.ServerResponse{
  94180. Header: res.Header,
  94181. HTTPStatusCode: res.StatusCode,
  94182. },
  94183. }
  94184. target := &ret
  94185. if err := gensupport.DecodeResponse(target, res); err != nil {
  94186. return nil, err
  94187. }
  94188. return ret, nil
  94189. // {
  94190. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  94191. // "httpMethod": "POST",
  94192. // "id": "compute.urlMaps.insert",
  94193. // "parameterOrder": [
  94194. // "project"
  94195. // ],
  94196. // "parameters": {
  94197. // "project": {
  94198. // "description": "Project ID for this request.",
  94199. // "location": "path",
  94200. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94201. // "required": true,
  94202. // "type": "string"
  94203. // },
  94204. // "requestId": {
  94205. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94206. // "location": "query",
  94207. // "type": "string"
  94208. // }
  94209. // },
  94210. // "path": "{project}/global/urlMaps",
  94211. // "request": {
  94212. // "$ref": "UrlMap"
  94213. // },
  94214. // "response": {
  94215. // "$ref": "Operation"
  94216. // },
  94217. // "scopes": [
  94218. // "https://www.googleapis.com/auth/cloud-platform",
  94219. // "https://www.googleapis.com/auth/compute"
  94220. // ]
  94221. // }
  94222. }
  94223. // method id "compute.urlMaps.invalidateCache":
  94224. type UrlMapsInvalidateCacheCall struct {
  94225. s *Service
  94226. project string
  94227. urlMap string
  94228. cacheinvalidationrule *CacheInvalidationRule
  94229. urlParams_ gensupport.URLParams
  94230. ctx_ context.Context
  94231. header_ http.Header
  94232. }
  94233. // InvalidateCache: Initiates a cache invalidation operation,
  94234. // invalidating the specified path, scoped to the specified UrlMap.
  94235. func (r *UrlMapsService) InvalidateCache(project string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *UrlMapsInvalidateCacheCall {
  94236. c := &UrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94237. c.project = project
  94238. c.urlMap = urlMap
  94239. c.cacheinvalidationrule = cacheinvalidationrule
  94240. return c
  94241. }
  94242. // RequestId sets the optional parameter "requestId": An optional
  94243. // request ID to identify requests. Specify a unique request ID so that
  94244. // if you must retry your request, the server will know to ignore the
  94245. // request if it has already been completed.
  94246. //
  94247. // For example, consider a situation where you make an initial request
  94248. // and the request times out. If you make the request again with the
  94249. // same request ID, the server can check if original operation with the
  94250. // same request ID was received, and if so, will ignore the second
  94251. // request. This prevents clients from accidentally creating duplicate
  94252. // commitments.
  94253. //
  94254. // The request ID must be a valid UUID with the exception that zero UUID
  94255. // is not supported (00000000-0000-0000-0000-000000000000).
  94256. func (c *UrlMapsInvalidateCacheCall) RequestId(requestId string) *UrlMapsInvalidateCacheCall {
  94257. c.urlParams_.Set("requestId", requestId)
  94258. return c
  94259. }
  94260. // Fields allows partial responses to be retrieved. See
  94261. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94262. // for more information.
  94263. func (c *UrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *UrlMapsInvalidateCacheCall {
  94264. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94265. return c
  94266. }
  94267. // Context sets the context to be used in this call's Do method. Any
  94268. // pending HTTP request will be aborted if the provided context is
  94269. // canceled.
  94270. func (c *UrlMapsInvalidateCacheCall) Context(ctx context.Context) *UrlMapsInvalidateCacheCall {
  94271. c.ctx_ = ctx
  94272. return c
  94273. }
  94274. // Header returns an http.Header that can be modified by the caller to
  94275. // add HTTP headers to the request.
  94276. func (c *UrlMapsInvalidateCacheCall) Header() http.Header {
  94277. if c.header_ == nil {
  94278. c.header_ = make(http.Header)
  94279. }
  94280. return c.header_
  94281. }
  94282. func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
  94283. reqHeaders := make(http.Header)
  94284. for k, v := range c.header_ {
  94285. reqHeaders[k] = v
  94286. }
  94287. reqHeaders.Set("User-Agent", c.s.userAgent())
  94288. var body io.Reader = nil
  94289. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
  94290. if err != nil {
  94291. return nil, err
  94292. }
  94293. reqHeaders.Set("Content-Type", "application/json")
  94294. c.urlParams_.Set("alt", alt)
  94295. c.urlParams_.Set("prettyPrint", "false")
  94296. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/invalidateCache")
  94297. urls += "?" + c.urlParams_.Encode()
  94298. req, err := http.NewRequest("POST", urls, body)
  94299. if err != nil {
  94300. return nil, err
  94301. }
  94302. req.Header = reqHeaders
  94303. googleapi.Expand(req.URL, map[string]string{
  94304. "project": c.project,
  94305. "urlMap": c.urlMap,
  94306. })
  94307. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94308. }
  94309. // Do executes the "compute.urlMaps.invalidateCache" call.
  94310. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94311. // status code is an error. Response headers are in either
  94312. // *Operation.ServerResponse.Header or (if a response was returned at
  94313. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94314. // to check whether the returned error was because
  94315. // http.StatusNotModified was returned.
  94316. func (c *UrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94317. gensupport.SetOptions(c.urlParams_, opts...)
  94318. res, err := c.doRequest("json")
  94319. if res != nil && res.StatusCode == http.StatusNotModified {
  94320. if res.Body != nil {
  94321. res.Body.Close()
  94322. }
  94323. return nil, &googleapi.Error{
  94324. Code: res.StatusCode,
  94325. Header: res.Header,
  94326. }
  94327. }
  94328. if err != nil {
  94329. return nil, err
  94330. }
  94331. defer googleapi.CloseBody(res)
  94332. if err := googleapi.CheckResponse(res); err != nil {
  94333. return nil, err
  94334. }
  94335. ret := &Operation{
  94336. ServerResponse: googleapi.ServerResponse{
  94337. Header: res.Header,
  94338. HTTPStatusCode: res.StatusCode,
  94339. },
  94340. }
  94341. target := &ret
  94342. if err := gensupport.DecodeResponse(target, res); err != nil {
  94343. return nil, err
  94344. }
  94345. return ret, nil
  94346. // {
  94347. // "description": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.",
  94348. // "httpMethod": "POST",
  94349. // "id": "compute.urlMaps.invalidateCache",
  94350. // "parameterOrder": [
  94351. // "project",
  94352. // "urlMap"
  94353. // ],
  94354. // "parameters": {
  94355. // "project": {
  94356. // "description": "Project ID for this request.",
  94357. // "location": "path",
  94358. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94359. // "required": true,
  94360. // "type": "string"
  94361. // },
  94362. // "requestId": {
  94363. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94364. // "location": "query",
  94365. // "type": "string"
  94366. // },
  94367. // "urlMap": {
  94368. // "description": "Name of the UrlMap scoping this request.",
  94369. // "location": "path",
  94370. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  94371. // "required": true,
  94372. // "type": "string"
  94373. // }
  94374. // },
  94375. // "path": "{project}/global/urlMaps/{urlMap}/invalidateCache",
  94376. // "request": {
  94377. // "$ref": "CacheInvalidationRule"
  94378. // },
  94379. // "response": {
  94380. // "$ref": "Operation"
  94381. // },
  94382. // "scopes": [
  94383. // "https://www.googleapis.com/auth/cloud-platform",
  94384. // "https://www.googleapis.com/auth/compute"
  94385. // ]
  94386. // }
  94387. }
  94388. // method id "compute.urlMaps.list":
  94389. type UrlMapsListCall struct {
  94390. s *Service
  94391. project string
  94392. urlParams_ gensupport.URLParams
  94393. ifNoneMatch_ string
  94394. ctx_ context.Context
  94395. header_ http.Header
  94396. }
  94397. // List: Retrieves the list of UrlMap resources available to the
  94398. // specified project.
  94399. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list
  94400. func (r *UrlMapsService) List(project string) *UrlMapsListCall {
  94401. c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94402. c.project = project
  94403. return c
  94404. }
  94405. // Filter sets the optional parameter "filter": A filter expression that
  94406. // filters resources listed in the response. The expression must specify
  94407. // the field name, a comparison operator, and the value that you want to
  94408. // use for filtering. The value must be a string, a number, or a
  94409. // boolean. The comparison operator must be either =, !=, >, or <.
  94410. //
  94411. // For example, if you are filtering Compute Engine instances, you can
  94412. // exclude instances named example-instance by specifying name !=
  94413. // example-instance.
  94414. //
  94415. // You can also filter nested fields. For example, you could specify
  94416. // scheduling.automaticRestart = false to include instances only if they
  94417. // are not scheduled for automatic restarts. You can use filtering on
  94418. // nested fields to filter based on resource labels.
  94419. //
  94420. // To filter on multiple expressions, provide each separate expression
  94421. // within parentheses. For example, (scheduling.automaticRestart = true)
  94422. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  94423. // AND expression. However, you can include AND and OR expressions
  94424. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  94425. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  94426. // true).
  94427. func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall {
  94428. c.urlParams_.Set("filter", filter)
  94429. return c
  94430. }
  94431. // MaxResults sets the optional parameter "maxResults": The maximum
  94432. // number of results per page that should be returned. If the number of
  94433. // available results is larger than maxResults, Compute Engine returns a
  94434. // nextPageToken that can be used to get the next page of results in
  94435. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  94436. // (Default: 500)
  94437. func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall {
  94438. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  94439. return c
  94440. }
  94441. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  94442. // a certain order. By default, results are returned in alphanumerical
  94443. // order based on the resource name.
  94444. //
  94445. // You can also sort results in descending order based on the creation
  94446. // timestamp using orderBy="creationTimestamp desc". This sorts results
  94447. // based on the creationTimestamp field in reverse chronological order
  94448. // (newest result first). Use this to sort resources like operations so
  94449. // that the newest operation is returned first.
  94450. //
  94451. // Currently, only sorting by name or creationTimestamp desc is
  94452. // supported.
  94453. func (c *UrlMapsListCall) OrderBy(orderBy string) *UrlMapsListCall {
  94454. c.urlParams_.Set("orderBy", orderBy)
  94455. return c
  94456. }
  94457. // PageToken sets the optional parameter "pageToken": Specifies a page
  94458. // token to use. Set pageToken to the nextPageToken returned by a
  94459. // previous list request to get the next page of results.
  94460. func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall {
  94461. c.urlParams_.Set("pageToken", pageToken)
  94462. return c
  94463. }
  94464. // Fields allows partial responses to be retrieved. See
  94465. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94466. // for more information.
  94467. func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall {
  94468. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94469. return c
  94470. }
  94471. // IfNoneMatch sets the optional parameter which makes the operation
  94472. // fail if the object's ETag matches the given value. This is useful for
  94473. // getting updates only after the object has changed since the last
  94474. // request. Use googleapi.IsNotModified to check whether the response
  94475. // error from Do is the result of In-None-Match.
  94476. func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall {
  94477. c.ifNoneMatch_ = entityTag
  94478. return c
  94479. }
  94480. // Context sets the context to be used in this call's Do method. Any
  94481. // pending HTTP request will be aborted if the provided context is
  94482. // canceled.
  94483. func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall {
  94484. c.ctx_ = ctx
  94485. return c
  94486. }
  94487. // Header returns an http.Header that can be modified by the caller to
  94488. // add HTTP headers to the request.
  94489. func (c *UrlMapsListCall) Header() http.Header {
  94490. if c.header_ == nil {
  94491. c.header_ = make(http.Header)
  94492. }
  94493. return c.header_
  94494. }
  94495. func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  94496. reqHeaders := make(http.Header)
  94497. for k, v := range c.header_ {
  94498. reqHeaders[k] = v
  94499. }
  94500. reqHeaders.Set("User-Agent", c.s.userAgent())
  94501. if c.ifNoneMatch_ != "" {
  94502. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94503. }
  94504. var body io.Reader = nil
  94505. c.urlParams_.Set("alt", alt)
  94506. c.urlParams_.Set("prettyPrint", "false")
  94507. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  94508. urls += "?" + c.urlParams_.Encode()
  94509. req, err := http.NewRequest("GET", urls, body)
  94510. if err != nil {
  94511. return nil, err
  94512. }
  94513. req.Header = reqHeaders
  94514. googleapi.Expand(req.URL, map[string]string{
  94515. "project": c.project,
  94516. })
  94517. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94518. }
  94519. // Do executes the "compute.urlMaps.list" call.
  94520. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  94521. // status code is an error. Response headers are in either
  94522. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  94523. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94524. // to check whether the returned error was because
  94525. // http.StatusNotModified was returned.
  94526. func (c *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  94527. gensupport.SetOptions(c.urlParams_, opts...)
  94528. res, err := c.doRequest("json")
  94529. if res != nil && res.StatusCode == http.StatusNotModified {
  94530. if res.Body != nil {
  94531. res.Body.Close()
  94532. }
  94533. return nil, &googleapi.Error{
  94534. Code: res.StatusCode,
  94535. Header: res.Header,
  94536. }
  94537. }
  94538. if err != nil {
  94539. return nil, err
  94540. }
  94541. defer googleapi.CloseBody(res)
  94542. if err := googleapi.CheckResponse(res); err != nil {
  94543. return nil, err
  94544. }
  94545. ret := &UrlMapList{
  94546. ServerResponse: googleapi.ServerResponse{
  94547. Header: res.Header,
  94548. HTTPStatusCode: res.StatusCode,
  94549. },
  94550. }
  94551. target := &ret
  94552. if err := gensupport.DecodeResponse(target, res); err != nil {
  94553. return nil, err
  94554. }
  94555. return ret, nil
  94556. // {
  94557. // "description": "Retrieves the list of UrlMap resources available to the specified project.",
  94558. // "httpMethod": "GET",
  94559. // "id": "compute.urlMaps.list",
  94560. // "parameterOrder": [
  94561. // "project"
  94562. // ],
  94563. // "parameters": {
  94564. // "filter": {
  94565. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  94566. // "location": "query",
  94567. // "type": "string"
  94568. // },
  94569. // "maxResults": {
  94570. // "default": "500",
  94571. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  94572. // "format": "uint32",
  94573. // "location": "query",
  94574. // "minimum": "0",
  94575. // "type": "integer"
  94576. // },
  94577. // "orderBy": {
  94578. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  94579. // "location": "query",
  94580. // "type": "string"
  94581. // },
  94582. // "pageToken": {
  94583. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  94584. // "location": "query",
  94585. // "type": "string"
  94586. // },
  94587. // "project": {
  94588. // "description": "Project ID for this request.",
  94589. // "location": "path",
  94590. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94591. // "required": true,
  94592. // "type": "string"
  94593. // }
  94594. // },
  94595. // "path": "{project}/global/urlMaps",
  94596. // "response": {
  94597. // "$ref": "UrlMapList"
  94598. // },
  94599. // "scopes": [
  94600. // "https://www.googleapis.com/auth/cloud-platform",
  94601. // "https://www.googleapis.com/auth/compute",
  94602. // "https://www.googleapis.com/auth/compute.readonly"
  94603. // ]
  94604. // }
  94605. }
  94606. // Pages invokes f for each page of results.
  94607. // A non-nil error returned from f will halt the iteration.
  94608. // The provided context supersedes any context provided to the Context method.
  94609. func (c *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  94610. c.ctx_ = ctx
  94611. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  94612. for {
  94613. x, err := c.Do()
  94614. if err != nil {
  94615. return err
  94616. }
  94617. if err := f(x); err != nil {
  94618. return err
  94619. }
  94620. if x.NextPageToken == "" {
  94621. return nil
  94622. }
  94623. c.PageToken(x.NextPageToken)
  94624. }
  94625. }
  94626. // method id "compute.urlMaps.patch":
  94627. type UrlMapsPatchCall struct {
  94628. s *Service
  94629. project string
  94630. urlMap string
  94631. urlmap *UrlMap
  94632. urlParams_ gensupport.URLParams
  94633. ctx_ context.Context
  94634. header_ http.Header
  94635. }
  94636. // Patch: Patches the specified UrlMap resource with the data included
  94637. // in the request. This method supports PATCH semantics and uses the
  94638. // JSON merge patch format and processing rules.
  94639. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch
  94640. func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall {
  94641. c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94642. c.project = project
  94643. c.urlMap = urlMap
  94644. c.urlmap = urlmap
  94645. return c
  94646. }
  94647. // RequestId sets the optional parameter "requestId": An optional
  94648. // request ID to identify requests. Specify a unique request ID so that
  94649. // if you must retry your request, the server will know to ignore the
  94650. // request if it has already been completed.
  94651. //
  94652. // For example, consider a situation where you make an initial request
  94653. // and the request times out. If you make the request again with the
  94654. // same request ID, the server can check if original operation with the
  94655. // same request ID was received, and if so, will ignore the second
  94656. // request. This prevents clients from accidentally creating duplicate
  94657. // commitments.
  94658. //
  94659. // The request ID must be a valid UUID with the exception that zero UUID
  94660. // is not supported (00000000-0000-0000-0000-000000000000).
  94661. func (c *UrlMapsPatchCall) RequestId(requestId string) *UrlMapsPatchCall {
  94662. c.urlParams_.Set("requestId", requestId)
  94663. return c
  94664. }
  94665. // Fields allows partial responses to be retrieved. See
  94666. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94667. // for more information.
  94668. func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall {
  94669. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94670. return c
  94671. }
  94672. // Context sets the context to be used in this call's Do method. Any
  94673. // pending HTTP request will be aborted if the provided context is
  94674. // canceled.
  94675. func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall {
  94676. c.ctx_ = ctx
  94677. return c
  94678. }
  94679. // Header returns an http.Header that can be modified by the caller to
  94680. // add HTTP headers to the request.
  94681. func (c *UrlMapsPatchCall) Header() http.Header {
  94682. if c.header_ == nil {
  94683. c.header_ = make(http.Header)
  94684. }
  94685. return c.header_
  94686. }
  94687. func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  94688. reqHeaders := make(http.Header)
  94689. for k, v := range c.header_ {
  94690. reqHeaders[k] = v
  94691. }
  94692. reqHeaders.Set("User-Agent", c.s.userAgent())
  94693. var body io.Reader = nil
  94694. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  94695. if err != nil {
  94696. return nil, err
  94697. }
  94698. reqHeaders.Set("Content-Type", "application/json")
  94699. c.urlParams_.Set("alt", alt)
  94700. c.urlParams_.Set("prettyPrint", "false")
  94701. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  94702. urls += "?" + c.urlParams_.Encode()
  94703. req, err := http.NewRequest("PATCH", urls, body)
  94704. if err != nil {
  94705. return nil, err
  94706. }
  94707. req.Header = reqHeaders
  94708. googleapi.Expand(req.URL, map[string]string{
  94709. "project": c.project,
  94710. "urlMap": c.urlMap,
  94711. })
  94712. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94713. }
  94714. // Do executes the "compute.urlMaps.patch" call.
  94715. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94716. // status code is an error. Response headers are in either
  94717. // *Operation.ServerResponse.Header or (if a response was returned at
  94718. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94719. // to check whether the returned error was because
  94720. // http.StatusNotModified was returned.
  94721. func (c *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94722. gensupport.SetOptions(c.urlParams_, opts...)
  94723. res, err := c.doRequest("json")
  94724. if res != nil && res.StatusCode == http.StatusNotModified {
  94725. if res.Body != nil {
  94726. res.Body.Close()
  94727. }
  94728. return nil, &googleapi.Error{
  94729. Code: res.StatusCode,
  94730. Header: res.Header,
  94731. }
  94732. }
  94733. if err != nil {
  94734. return nil, err
  94735. }
  94736. defer googleapi.CloseBody(res)
  94737. if err := googleapi.CheckResponse(res); err != nil {
  94738. return nil, err
  94739. }
  94740. ret := &Operation{
  94741. ServerResponse: googleapi.ServerResponse{
  94742. Header: res.Header,
  94743. HTTPStatusCode: res.StatusCode,
  94744. },
  94745. }
  94746. target := &ret
  94747. if err := gensupport.DecodeResponse(target, res); err != nil {
  94748. return nil, err
  94749. }
  94750. return ret, nil
  94751. // {
  94752. // "description": "Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  94753. // "httpMethod": "PATCH",
  94754. // "id": "compute.urlMaps.patch",
  94755. // "parameterOrder": [
  94756. // "project",
  94757. // "urlMap"
  94758. // ],
  94759. // "parameters": {
  94760. // "project": {
  94761. // "description": "Project ID for this request.",
  94762. // "location": "path",
  94763. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94764. // "required": true,
  94765. // "type": "string"
  94766. // },
  94767. // "requestId": {
  94768. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94769. // "location": "query",
  94770. // "type": "string"
  94771. // },
  94772. // "urlMap": {
  94773. // "description": "Name of the UrlMap resource to patch.",
  94774. // "location": "path",
  94775. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  94776. // "required": true,
  94777. // "type": "string"
  94778. // }
  94779. // },
  94780. // "path": "{project}/global/urlMaps/{urlMap}",
  94781. // "request": {
  94782. // "$ref": "UrlMap"
  94783. // },
  94784. // "response": {
  94785. // "$ref": "Operation"
  94786. // },
  94787. // "scopes": [
  94788. // "https://www.googleapis.com/auth/cloud-platform",
  94789. // "https://www.googleapis.com/auth/compute"
  94790. // ]
  94791. // }
  94792. }
  94793. // method id "compute.urlMaps.update":
  94794. type UrlMapsUpdateCall struct {
  94795. s *Service
  94796. project string
  94797. urlMap string
  94798. urlmap *UrlMap
  94799. urlParams_ gensupport.URLParams
  94800. ctx_ context.Context
  94801. header_ http.Header
  94802. }
  94803. // Update: Updates the specified UrlMap resource with the data included
  94804. // in the request.
  94805. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update
  94806. func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall {
  94807. c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94808. c.project = project
  94809. c.urlMap = urlMap
  94810. c.urlmap = urlmap
  94811. return c
  94812. }
  94813. // RequestId sets the optional parameter "requestId": An optional
  94814. // request ID to identify requests. Specify a unique request ID so that
  94815. // if you must retry your request, the server will know to ignore the
  94816. // request if it has already been completed.
  94817. //
  94818. // For example, consider a situation where you make an initial request
  94819. // and the request times out. If you make the request again with the
  94820. // same request ID, the server can check if original operation with the
  94821. // same request ID was received, and if so, will ignore the second
  94822. // request. This prevents clients from accidentally creating duplicate
  94823. // commitments.
  94824. //
  94825. // The request ID must be a valid UUID with the exception that zero UUID
  94826. // is not supported (00000000-0000-0000-0000-000000000000).
  94827. func (c *UrlMapsUpdateCall) RequestId(requestId string) *UrlMapsUpdateCall {
  94828. c.urlParams_.Set("requestId", requestId)
  94829. return c
  94830. }
  94831. // Fields allows partial responses to be retrieved. See
  94832. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94833. // for more information.
  94834. func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall {
  94835. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94836. return c
  94837. }
  94838. // Context sets the context to be used in this call's Do method. Any
  94839. // pending HTTP request will be aborted if the provided context is
  94840. // canceled.
  94841. func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall {
  94842. c.ctx_ = ctx
  94843. return c
  94844. }
  94845. // Header returns an http.Header that can be modified by the caller to
  94846. // add HTTP headers to the request.
  94847. func (c *UrlMapsUpdateCall) Header() http.Header {
  94848. if c.header_ == nil {
  94849. c.header_ = make(http.Header)
  94850. }
  94851. return c.header_
  94852. }
  94853. func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  94854. reqHeaders := make(http.Header)
  94855. for k, v := range c.header_ {
  94856. reqHeaders[k] = v
  94857. }
  94858. reqHeaders.Set("User-Agent", c.s.userAgent())
  94859. var body io.Reader = nil
  94860. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  94861. if err != nil {
  94862. return nil, err
  94863. }
  94864. reqHeaders.Set("Content-Type", "application/json")
  94865. c.urlParams_.Set("alt", alt)
  94866. c.urlParams_.Set("prettyPrint", "false")
  94867. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  94868. urls += "?" + c.urlParams_.Encode()
  94869. req, err := http.NewRequest("PUT", urls, body)
  94870. if err != nil {
  94871. return nil, err
  94872. }
  94873. req.Header = reqHeaders
  94874. googleapi.Expand(req.URL, map[string]string{
  94875. "project": c.project,
  94876. "urlMap": c.urlMap,
  94877. })
  94878. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94879. }
  94880. // Do executes the "compute.urlMaps.update" call.
  94881. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94882. // status code is an error. Response headers are in either
  94883. // *Operation.ServerResponse.Header or (if a response was returned at
  94884. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94885. // to check whether the returned error was because
  94886. // http.StatusNotModified was returned.
  94887. func (c *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94888. gensupport.SetOptions(c.urlParams_, opts...)
  94889. res, err := c.doRequest("json")
  94890. if res != nil && res.StatusCode == http.StatusNotModified {
  94891. if res.Body != nil {
  94892. res.Body.Close()
  94893. }
  94894. return nil, &googleapi.Error{
  94895. Code: res.StatusCode,
  94896. Header: res.Header,
  94897. }
  94898. }
  94899. if err != nil {
  94900. return nil, err
  94901. }
  94902. defer googleapi.CloseBody(res)
  94903. if err := googleapi.CheckResponse(res); err != nil {
  94904. return nil, err
  94905. }
  94906. ret := &Operation{
  94907. ServerResponse: googleapi.ServerResponse{
  94908. Header: res.Header,
  94909. HTTPStatusCode: res.StatusCode,
  94910. },
  94911. }
  94912. target := &ret
  94913. if err := gensupport.DecodeResponse(target, res); err != nil {
  94914. return nil, err
  94915. }
  94916. return ret, nil
  94917. // {
  94918. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  94919. // "httpMethod": "PUT",
  94920. // "id": "compute.urlMaps.update",
  94921. // "parameterOrder": [
  94922. // "project",
  94923. // "urlMap"
  94924. // ],
  94925. // "parameters": {
  94926. // "project": {
  94927. // "description": "Project ID for this request.",
  94928. // "location": "path",
  94929. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94930. // "required": true,
  94931. // "type": "string"
  94932. // },
  94933. // "requestId": {
  94934. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94935. // "location": "query",
  94936. // "type": "string"
  94937. // },
  94938. // "urlMap": {
  94939. // "description": "Name of the UrlMap resource to update.",
  94940. // "location": "path",
  94941. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  94942. // "required": true,
  94943. // "type": "string"
  94944. // }
  94945. // },
  94946. // "path": "{project}/global/urlMaps/{urlMap}",
  94947. // "request": {
  94948. // "$ref": "UrlMap"
  94949. // },
  94950. // "response": {
  94951. // "$ref": "Operation"
  94952. // },
  94953. // "scopes": [
  94954. // "https://www.googleapis.com/auth/cloud-platform",
  94955. // "https://www.googleapis.com/auth/compute"
  94956. // ]
  94957. // }
  94958. }
  94959. // method id "compute.urlMaps.validate":
  94960. type UrlMapsValidateCall struct {
  94961. s *Service
  94962. project string
  94963. urlMap string
  94964. urlmapsvalidaterequest *UrlMapsValidateRequest
  94965. urlParams_ gensupport.URLParams
  94966. ctx_ context.Context
  94967. header_ http.Header
  94968. }
  94969. // Validate: Runs static validation for the UrlMap. In particular, the
  94970. // tests of the provided UrlMap will be run. Calling this method does
  94971. // NOT create the UrlMap.
  94972. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate
  94973. func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall {
  94974. c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94975. c.project = project
  94976. c.urlMap = urlMap
  94977. c.urlmapsvalidaterequest = urlmapsvalidaterequest
  94978. return c
  94979. }
  94980. // Fields allows partial responses to be retrieved. See
  94981. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94982. // for more information.
  94983. func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall {
  94984. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94985. return c
  94986. }
  94987. // Context sets the context to be used in this call's Do method. Any
  94988. // pending HTTP request will be aborted if the provided context is
  94989. // canceled.
  94990. func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall {
  94991. c.ctx_ = ctx
  94992. return c
  94993. }
  94994. // Header returns an http.Header that can be modified by the caller to
  94995. // add HTTP headers to the request.
  94996. func (c *UrlMapsValidateCall) Header() http.Header {
  94997. if c.header_ == nil {
  94998. c.header_ = make(http.Header)
  94999. }
  95000. return c.header_
  95001. }
  95002. func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  95003. reqHeaders := make(http.Header)
  95004. for k, v := range c.header_ {
  95005. reqHeaders[k] = v
  95006. }
  95007. reqHeaders.Set("User-Agent", c.s.userAgent())
  95008. var body io.Reader = nil
  95009. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest)
  95010. if err != nil {
  95011. return nil, err
  95012. }
  95013. reqHeaders.Set("Content-Type", "application/json")
  95014. c.urlParams_.Set("alt", alt)
  95015. c.urlParams_.Set("prettyPrint", "false")
  95016. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate")
  95017. urls += "?" + c.urlParams_.Encode()
  95018. req, err := http.NewRequest("POST", urls, body)
  95019. if err != nil {
  95020. return nil, err
  95021. }
  95022. req.Header = reqHeaders
  95023. googleapi.Expand(req.URL, map[string]string{
  95024. "project": c.project,
  95025. "urlMap": c.urlMap,
  95026. })
  95027. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95028. }
  95029. // Do executes the "compute.urlMaps.validate" call.
  95030. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  95031. // non-2xx status code is an error. Response headers are in either
  95032. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  95033. // returned at all) in error.(*googleapi.Error).Header. Use
  95034. // googleapi.IsNotModified to check whether the returned error was
  95035. // because http.StatusNotModified was returned.
  95036. func (c *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  95037. gensupport.SetOptions(c.urlParams_, opts...)
  95038. res, err := c.doRequest("json")
  95039. if res != nil && res.StatusCode == http.StatusNotModified {
  95040. if res.Body != nil {
  95041. res.Body.Close()
  95042. }
  95043. return nil, &googleapi.Error{
  95044. Code: res.StatusCode,
  95045. Header: res.Header,
  95046. }
  95047. }
  95048. if err != nil {
  95049. return nil, err
  95050. }
  95051. defer googleapi.CloseBody(res)
  95052. if err := googleapi.CheckResponse(res); err != nil {
  95053. return nil, err
  95054. }
  95055. ret := &UrlMapsValidateResponse{
  95056. ServerResponse: googleapi.ServerResponse{
  95057. Header: res.Header,
  95058. HTTPStatusCode: res.StatusCode,
  95059. },
  95060. }
  95061. target := &ret
  95062. if err := gensupport.DecodeResponse(target, res); err != nil {
  95063. return nil, err
  95064. }
  95065. return ret, nil
  95066. // {
  95067. // "description": "Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.",
  95068. // "httpMethod": "POST",
  95069. // "id": "compute.urlMaps.validate",
  95070. // "parameterOrder": [
  95071. // "project",
  95072. // "urlMap"
  95073. // ],
  95074. // "parameters": {
  95075. // "project": {
  95076. // "description": "Project ID for this request.",
  95077. // "location": "path",
  95078. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95079. // "required": true,
  95080. // "type": "string"
  95081. // },
  95082. // "urlMap": {
  95083. // "description": "Name of the UrlMap resource to be validated as.",
  95084. // "location": "path",
  95085. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  95086. // "required": true,
  95087. // "type": "string"
  95088. // }
  95089. // },
  95090. // "path": "{project}/global/urlMaps/{urlMap}/validate",
  95091. // "request": {
  95092. // "$ref": "UrlMapsValidateRequest"
  95093. // },
  95094. // "response": {
  95095. // "$ref": "UrlMapsValidateResponse"
  95096. // },
  95097. // "scopes": [
  95098. // "https://www.googleapis.com/auth/cloud-platform",
  95099. // "https://www.googleapis.com/auth/compute"
  95100. // ]
  95101. // }
  95102. }
  95103. // method id "compute.vpnTunnels.aggregatedList":
  95104. type VpnTunnelsAggregatedListCall struct {
  95105. s *Service
  95106. project string
  95107. urlParams_ gensupport.URLParams
  95108. ifNoneMatch_ string
  95109. ctx_ context.Context
  95110. header_ http.Header
  95111. }
  95112. // AggregatedList: Retrieves an aggregated list of VPN tunnels.
  95113. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {
  95114. c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95115. c.project = project
  95116. return c
  95117. }
  95118. // Filter sets the optional parameter "filter": A filter expression that
  95119. // filters resources listed in the response. The expression must specify
  95120. // the field name, a comparison operator, and the value that you want to
  95121. // use for filtering. The value must be a string, a number, or a
  95122. // boolean. The comparison operator must be either =, !=, >, or <.
  95123. //
  95124. // For example, if you are filtering Compute Engine instances, you can
  95125. // exclude instances named example-instance by specifying name !=
  95126. // example-instance.
  95127. //
  95128. // You can also filter nested fields. For example, you could specify
  95129. // scheduling.automaticRestart = false to include instances only if they
  95130. // are not scheduled for automatic restarts. You can use filtering on
  95131. // nested fields to filter based on resource labels.
  95132. //
  95133. // To filter on multiple expressions, provide each separate expression
  95134. // within parentheses. For example, (scheduling.automaticRestart = true)
  95135. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  95136. // AND expression. However, you can include AND and OR expressions
  95137. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  95138. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  95139. // true).
  95140. func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall {
  95141. c.urlParams_.Set("filter", filter)
  95142. return c
  95143. }
  95144. // MaxResults sets the optional parameter "maxResults": The maximum
  95145. // number of results per page that should be returned. If the number of
  95146. // available results is larger than maxResults, Compute Engine returns a
  95147. // nextPageToken that can be used to get the next page of results in
  95148. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  95149. // (Default: 500)
  95150. func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall {
  95151. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  95152. return c
  95153. }
  95154. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  95155. // a certain order. By default, results are returned in alphanumerical
  95156. // order based on the resource name.
  95157. //
  95158. // You can also sort results in descending order based on the creation
  95159. // timestamp using orderBy="creationTimestamp desc". This sorts results
  95160. // based on the creationTimestamp field in reverse chronological order
  95161. // (newest result first). Use this to sort resources like operations so
  95162. // that the newest operation is returned first.
  95163. //
  95164. // Currently, only sorting by name or creationTimestamp desc is
  95165. // supported.
  95166. func (c *VpnTunnelsAggregatedListCall) OrderBy(orderBy string) *VpnTunnelsAggregatedListCall {
  95167. c.urlParams_.Set("orderBy", orderBy)
  95168. return c
  95169. }
  95170. // PageToken sets the optional parameter "pageToken": Specifies a page
  95171. // token to use. Set pageToken to the nextPageToken returned by a
  95172. // previous list request to get the next page of results.
  95173. func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall {
  95174. c.urlParams_.Set("pageToken", pageToken)
  95175. return c
  95176. }
  95177. // Fields allows partial responses to be retrieved. See
  95178. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95179. // for more information.
  95180. func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall {
  95181. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95182. return c
  95183. }
  95184. // IfNoneMatch sets the optional parameter which makes the operation
  95185. // fail if the object's ETag matches the given value. This is useful for
  95186. // getting updates only after the object has changed since the last
  95187. // request. Use googleapi.IsNotModified to check whether the response
  95188. // error from Do is the result of In-None-Match.
  95189. func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall {
  95190. c.ifNoneMatch_ = entityTag
  95191. return c
  95192. }
  95193. // Context sets the context to be used in this call's Do method. Any
  95194. // pending HTTP request will be aborted if the provided context is
  95195. // canceled.
  95196. func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall {
  95197. c.ctx_ = ctx
  95198. return c
  95199. }
  95200. // Header returns an http.Header that can be modified by the caller to
  95201. // add HTTP headers to the request.
  95202. func (c *VpnTunnelsAggregatedListCall) Header() http.Header {
  95203. if c.header_ == nil {
  95204. c.header_ = make(http.Header)
  95205. }
  95206. return c.header_
  95207. }
  95208. func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  95209. reqHeaders := make(http.Header)
  95210. for k, v := range c.header_ {
  95211. reqHeaders[k] = v
  95212. }
  95213. reqHeaders.Set("User-Agent", c.s.userAgent())
  95214. if c.ifNoneMatch_ != "" {
  95215. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95216. }
  95217. var body io.Reader = nil
  95218. c.urlParams_.Set("alt", alt)
  95219. c.urlParams_.Set("prettyPrint", "false")
  95220. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels")
  95221. urls += "?" + c.urlParams_.Encode()
  95222. req, err := http.NewRequest("GET", urls, body)
  95223. if err != nil {
  95224. return nil, err
  95225. }
  95226. req.Header = reqHeaders
  95227. googleapi.Expand(req.URL, map[string]string{
  95228. "project": c.project,
  95229. })
  95230. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95231. }
  95232. // Do executes the "compute.vpnTunnels.aggregatedList" call.
  95233. // Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any
  95234. // non-2xx status code is an error. Response headers are in either
  95235. // *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was
  95236. // returned at all) in error.(*googleapi.Error).Header. Use
  95237. // googleapi.IsNotModified to check whether the returned error was
  95238. // because http.StatusNotModified was returned.
  95239. func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelAggregatedList, error) {
  95240. gensupport.SetOptions(c.urlParams_, opts...)
  95241. res, err := c.doRequest("json")
  95242. if res != nil && res.StatusCode == http.StatusNotModified {
  95243. if res.Body != nil {
  95244. res.Body.Close()
  95245. }
  95246. return nil, &googleapi.Error{
  95247. Code: res.StatusCode,
  95248. Header: res.Header,
  95249. }
  95250. }
  95251. if err != nil {
  95252. return nil, err
  95253. }
  95254. defer googleapi.CloseBody(res)
  95255. if err := googleapi.CheckResponse(res); err != nil {
  95256. return nil, err
  95257. }
  95258. ret := &VpnTunnelAggregatedList{
  95259. ServerResponse: googleapi.ServerResponse{
  95260. Header: res.Header,
  95261. HTTPStatusCode: res.StatusCode,
  95262. },
  95263. }
  95264. target := &ret
  95265. if err := gensupport.DecodeResponse(target, res); err != nil {
  95266. return nil, err
  95267. }
  95268. return ret, nil
  95269. // {
  95270. // "description": "Retrieves an aggregated list of VPN tunnels.",
  95271. // "httpMethod": "GET",
  95272. // "id": "compute.vpnTunnels.aggregatedList",
  95273. // "parameterOrder": [
  95274. // "project"
  95275. // ],
  95276. // "parameters": {
  95277. // "filter": {
  95278. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  95279. // "location": "query",
  95280. // "type": "string"
  95281. // },
  95282. // "maxResults": {
  95283. // "default": "500",
  95284. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  95285. // "format": "uint32",
  95286. // "location": "query",
  95287. // "minimum": "0",
  95288. // "type": "integer"
  95289. // },
  95290. // "orderBy": {
  95291. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  95292. // "location": "query",
  95293. // "type": "string"
  95294. // },
  95295. // "pageToken": {
  95296. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  95297. // "location": "query",
  95298. // "type": "string"
  95299. // },
  95300. // "project": {
  95301. // "description": "Project ID for this request.",
  95302. // "location": "path",
  95303. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95304. // "required": true,
  95305. // "type": "string"
  95306. // }
  95307. // },
  95308. // "path": "{project}/aggregated/vpnTunnels",
  95309. // "response": {
  95310. // "$ref": "VpnTunnelAggregatedList"
  95311. // },
  95312. // "scopes": [
  95313. // "https://www.googleapis.com/auth/cloud-platform",
  95314. // "https://www.googleapis.com/auth/compute",
  95315. // "https://www.googleapis.com/auth/compute.readonly"
  95316. // ]
  95317. // }
  95318. }
  95319. // Pages invokes f for each page of results.
  95320. // A non-nil error returned from f will halt the iteration.
  95321. // The provided context supersedes any context provided to the Context method.
  95322. func (c *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) error) error {
  95323. c.ctx_ = ctx
  95324. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  95325. for {
  95326. x, err := c.Do()
  95327. if err != nil {
  95328. return err
  95329. }
  95330. if err := f(x); err != nil {
  95331. return err
  95332. }
  95333. if x.NextPageToken == "" {
  95334. return nil
  95335. }
  95336. c.PageToken(x.NextPageToken)
  95337. }
  95338. }
  95339. // method id "compute.vpnTunnels.delete":
  95340. type VpnTunnelsDeleteCall struct {
  95341. s *Service
  95342. project string
  95343. region string
  95344. vpnTunnel string
  95345. urlParams_ gensupport.URLParams
  95346. ctx_ context.Context
  95347. header_ http.Header
  95348. }
  95349. // Delete: Deletes the specified VpnTunnel resource.
  95350. func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall {
  95351. c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95352. c.project = project
  95353. c.region = region
  95354. c.vpnTunnel = vpnTunnel
  95355. return c
  95356. }
  95357. // RequestId sets the optional parameter "requestId": An optional
  95358. // request ID to identify requests. Specify a unique request ID so that
  95359. // if you must retry your request, the server will know to ignore the
  95360. // request if it has already been completed.
  95361. //
  95362. // For example, consider a situation where you make an initial request
  95363. // and the request times out. If you make the request again with the
  95364. // same request ID, the server can check if original operation with the
  95365. // same request ID was received, and if so, will ignore the second
  95366. // request. This prevents clients from accidentally creating duplicate
  95367. // commitments.
  95368. //
  95369. // The request ID must be a valid UUID with the exception that zero UUID
  95370. // is not supported (00000000-0000-0000-0000-000000000000).
  95371. func (c *VpnTunnelsDeleteCall) RequestId(requestId string) *VpnTunnelsDeleteCall {
  95372. c.urlParams_.Set("requestId", requestId)
  95373. return c
  95374. }
  95375. // Fields allows partial responses to be retrieved. See
  95376. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95377. // for more information.
  95378. func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall {
  95379. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95380. return c
  95381. }
  95382. // Context sets the context to be used in this call's Do method. Any
  95383. // pending HTTP request will be aborted if the provided context is
  95384. // canceled.
  95385. func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall {
  95386. c.ctx_ = ctx
  95387. return c
  95388. }
  95389. // Header returns an http.Header that can be modified by the caller to
  95390. // add HTTP headers to the request.
  95391. func (c *VpnTunnelsDeleteCall) Header() http.Header {
  95392. if c.header_ == nil {
  95393. c.header_ = make(http.Header)
  95394. }
  95395. return c.header_
  95396. }
  95397. func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  95398. reqHeaders := make(http.Header)
  95399. for k, v := range c.header_ {
  95400. reqHeaders[k] = v
  95401. }
  95402. reqHeaders.Set("User-Agent", c.s.userAgent())
  95403. var body io.Reader = nil
  95404. c.urlParams_.Set("alt", alt)
  95405. c.urlParams_.Set("prettyPrint", "false")
  95406. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  95407. urls += "?" + c.urlParams_.Encode()
  95408. req, err := http.NewRequest("DELETE", urls, body)
  95409. if err != nil {
  95410. return nil, err
  95411. }
  95412. req.Header = reqHeaders
  95413. googleapi.Expand(req.URL, map[string]string{
  95414. "project": c.project,
  95415. "region": c.region,
  95416. "vpnTunnel": c.vpnTunnel,
  95417. })
  95418. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95419. }
  95420. // Do executes the "compute.vpnTunnels.delete" call.
  95421. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95422. // status code is an error. Response headers are in either
  95423. // *Operation.ServerResponse.Header or (if a response was returned at
  95424. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95425. // to check whether the returned error was because
  95426. // http.StatusNotModified was returned.
  95427. func (c *VpnTunnelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95428. gensupport.SetOptions(c.urlParams_, opts...)
  95429. res, err := c.doRequest("json")
  95430. if res != nil && res.StatusCode == http.StatusNotModified {
  95431. if res.Body != nil {
  95432. res.Body.Close()
  95433. }
  95434. return nil, &googleapi.Error{
  95435. Code: res.StatusCode,
  95436. Header: res.Header,
  95437. }
  95438. }
  95439. if err != nil {
  95440. return nil, err
  95441. }
  95442. defer googleapi.CloseBody(res)
  95443. if err := googleapi.CheckResponse(res); err != nil {
  95444. return nil, err
  95445. }
  95446. ret := &Operation{
  95447. ServerResponse: googleapi.ServerResponse{
  95448. Header: res.Header,
  95449. HTTPStatusCode: res.StatusCode,
  95450. },
  95451. }
  95452. target := &ret
  95453. if err := gensupport.DecodeResponse(target, res); err != nil {
  95454. return nil, err
  95455. }
  95456. return ret, nil
  95457. // {
  95458. // "description": "Deletes the specified VpnTunnel resource.",
  95459. // "httpMethod": "DELETE",
  95460. // "id": "compute.vpnTunnels.delete",
  95461. // "parameterOrder": [
  95462. // "project",
  95463. // "region",
  95464. // "vpnTunnel"
  95465. // ],
  95466. // "parameters": {
  95467. // "project": {
  95468. // "description": "Project ID for this request.",
  95469. // "location": "path",
  95470. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95471. // "required": true,
  95472. // "type": "string"
  95473. // },
  95474. // "region": {
  95475. // "description": "Name of the region for this request.",
  95476. // "location": "path",
  95477. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95478. // "required": true,
  95479. // "type": "string"
  95480. // },
  95481. // "requestId": {
  95482. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95483. // "location": "query",
  95484. // "type": "string"
  95485. // },
  95486. // "vpnTunnel": {
  95487. // "description": "Name of the VpnTunnel resource to delete.",
  95488. // "location": "path",
  95489. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  95490. // "required": true,
  95491. // "type": "string"
  95492. // }
  95493. // },
  95494. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  95495. // "response": {
  95496. // "$ref": "Operation"
  95497. // },
  95498. // "scopes": [
  95499. // "https://www.googleapis.com/auth/cloud-platform",
  95500. // "https://www.googleapis.com/auth/compute"
  95501. // ]
  95502. // }
  95503. }
  95504. // method id "compute.vpnTunnels.get":
  95505. type VpnTunnelsGetCall struct {
  95506. s *Service
  95507. project string
  95508. region string
  95509. vpnTunnel string
  95510. urlParams_ gensupport.URLParams
  95511. ifNoneMatch_ string
  95512. ctx_ context.Context
  95513. header_ http.Header
  95514. }
  95515. // Get: Returns the specified VpnTunnel resource. Gets a list of
  95516. // available VPN tunnels by making a list() request.
  95517. func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall {
  95518. c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95519. c.project = project
  95520. c.region = region
  95521. c.vpnTunnel = vpnTunnel
  95522. return c
  95523. }
  95524. // Fields allows partial responses to be retrieved. See
  95525. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95526. // for more information.
  95527. func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall {
  95528. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95529. return c
  95530. }
  95531. // IfNoneMatch sets the optional parameter which makes the operation
  95532. // fail if the object's ETag matches the given value. This is useful for
  95533. // getting updates only after the object has changed since the last
  95534. // request. Use googleapi.IsNotModified to check whether the response
  95535. // error from Do is the result of In-None-Match.
  95536. func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall {
  95537. c.ifNoneMatch_ = entityTag
  95538. return c
  95539. }
  95540. // Context sets the context to be used in this call's Do method. Any
  95541. // pending HTTP request will be aborted if the provided context is
  95542. // canceled.
  95543. func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall {
  95544. c.ctx_ = ctx
  95545. return c
  95546. }
  95547. // Header returns an http.Header that can be modified by the caller to
  95548. // add HTTP headers to the request.
  95549. func (c *VpnTunnelsGetCall) Header() http.Header {
  95550. if c.header_ == nil {
  95551. c.header_ = make(http.Header)
  95552. }
  95553. return c.header_
  95554. }
  95555. func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) {
  95556. reqHeaders := make(http.Header)
  95557. for k, v := range c.header_ {
  95558. reqHeaders[k] = v
  95559. }
  95560. reqHeaders.Set("User-Agent", c.s.userAgent())
  95561. if c.ifNoneMatch_ != "" {
  95562. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95563. }
  95564. var body io.Reader = nil
  95565. c.urlParams_.Set("alt", alt)
  95566. c.urlParams_.Set("prettyPrint", "false")
  95567. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  95568. urls += "?" + c.urlParams_.Encode()
  95569. req, err := http.NewRequest("GET", urls, body)
  95570. if err != nil {
  95571. return nil, err
  95572. }
  95573. req.Header = reqHeaders
  95574. googleapi.Expand(req.URL, map[string]string{
  95575. "project": c.project,
  95576. "region": c.region,
  95577. "vpnTunnel": c.vpnTunnel,
  95578. })
  95579. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95580. }
  95581. // Do executes the "compute.vpnTunnels.get" call.
  95582. // Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx
  95583. // status code is an error. Response headers are in either
  95584. // *VpnTunnel.ServerResponse.Header or (if a response was returned at
  95585. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95586. // to check whether the returned error was because
  95587. // http.StatusNotModified was returned.
  95588. func (c *VpnTunnelsGetCall) Do(opts ...googleapi.CallOption) (*VpnTunnel, error) {
  95589. gensupport.SetOptions(c.urlParams_, opts...)
  95590. res, err := c.doRequest("json")
  95591. if res != nil && res.StatusCode == http.StatusNotModified {
  95592. if res.Body != nil {
  95593. res.Body.Close()
  95594. }
  95595. return nil, &googleapi.Error{
  95596. Code: res.StatusCode,
  95597. Header: res.Header,
  95598. }
  95599. }
  95600. if err != nil {
  95601. return nil, err
  95602. }
  95603. defer googleapi.CloseBody(res)
  95604. if err := googleapi.CheckResponse(res); err != nil {
  95605. return nil, err
  95606. }
  95607. ret := &VpnTunnel{
  95608. ServerResponse: googleapi.ServerResponse{
  95609. Header: res.Header,
  95610. HTTPStatusCode: res.StatusCode,
  95611. },
  95612. }
  95613. target := &ret
  95614. if err := gensupport.DecodeResponse(target, res); err != nil {
  95615. return nil, err
  95616. }
  95617. return ret, nil
  95618. // {
  95619. // "description": "Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.",
  95620. // "httpMethod": "GET",
  95621. // "id": "compute.vpnTunnels.get",
  95622. // "parameterOrder": [
  95623. // "project",
  95624. // "region",
  95625. // "vpnTunnel"
  95626. // ],
  95627. // "parameters": {
  95628. // "project": {
  95629. // "description": "Project ID for this request.",
  95630. // "location": "path",
  95631. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95632. // "required": true,
  95633. // "type": "string"
  95634. // },
  95635. // "region": {
  95636. // "description": "Name of the region for this request.",
  95637. // "location": "path",
  95638. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95639. // "required": true,
  95640. // "type": "string"
  95641. // },
  95642. // "vpnTunnel": {
  95643. // "description": "Name of the VpnTunnel resource to return.",
  95644. // "location": "path",
  95645. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  95646. // "required": true,
  95647. // "type": "string"
  95648. // }
  95649. // },
  95650. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  95651. // "response": {
  95652. // "$ref": "VpnTunnel"
  95653. // },
  95654. // "scopes": [
  95655. // "https://www.googleapis.com/auth/cloud-platform",
  95656. // "https://www.googleapis.com/auth/compute",
  95657. // "https://www.googleapis.com/auth/compute.readonly"
  95658. // ]
  95659. // }
  95660. }
  95661. // method id "compute.vpnTunnels.insert":
  95662. type VpnTunnelsInsertCall struct {
  95663. s *Service
  95664. project string
  95665. region string
  95666. vpntunnel *VpnTunnel
  95667. urlParams_ gensupport.URLParams
  95668. ctx_ context.Context
  95669. header_ http.Header
  95670. }
  95671. // Insert: Creates a VpnTunnel resource in the specified project and
  95672. // region using the data included in the request.
  95673. func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall {
  95674. c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95675. c.project = project
  95676. c.region = region
  95677. c.vpntunnel = vpntunnel
  95678. return c
  95679. }
  95680. // RequestId sets the optional parameter "requestId": An optional
  95681. // request ID to identify requests. Specify a unique request ID so that
  95682. // if you must retry your request, the server will know to ignore the
  95683. // request if it has already been completed.
  95684. //
  95685. // For example, consider a situation where you make an initial request
  95686. // and the request times out. If you make the request again with the
  95687. // same request ID, the server can check if original operation with the
  95688. // same request ID was received, and if so, will ignore the second
  95689. // request. This prevents clients from accidentally creating duplicate
  95690. // commitments.
  95691. //
  95692. // The request ID must be a valid UUID with the exception that zero UUID
  95693. // is not supported (00000000-0000-0000-0000-000000000000).
  95694. func (c *VpnTunnelsInsertCall) RequestId(requestId string) *VpnTunnelsInsertCall {
  95695. c.urlParams_.Set("requestId", requestId)
  95696. return c
  95697. }
  95698. // Fields allows partial responses to be retrieved. See
  95699. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95700. // for more information.
  95701. func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall {
  95702. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95703. return c
  95704. }
  95705. // Context sets the context to be used in this call's Do method. Any
  95706. // pending HTTP request will be aborted if the provided context is
  95707. // canceled.
  95708. func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall {
  95709. c.ctx_ = ctx
  95710. return c
  95711. }
  95712. // Header returns an http.Header that can be modified by the caller to
  95713. // add HTTP headers to the request.
  95714. func (c *VpnTunnelsInsertCall) Header() http.Header {
  95715. if c.header_ == nil {
  95716. c.header_ = make(http.Header)
  95717. }
  95718. return c.header_
  95719. }
  95720. func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) {
  95721. reqHeaders := make(http.Header)
  95722. for k, v := range c.header_ {
  95723. reqHeaders[k] = v
  95724. }
  95725. reqHeaders.Set("User-Agent", c.s.userAgent())
  95726. var body io.Reader = nil
  95727. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel)
  95728. if err != nil {
  95729. return nil, err
  95730. }
  95731. reqHeaders.Set("Content-Type", "application/json")
  95732. c.urlParams_.Set("alt", alt)
  95733. c.urlParams_.Set("prettyPrint", "false")
  95734. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  95735. urls += "?" + c.urlParams_.Encode()
  95736. req, err := http.NewRequest("POST", urls, body)
  95737. if err != nil {
  95738. return nil, err
  95739. }
  95740. req.Header = reqHeaders
  95741. googleapi.Expand(req.URL, map[string]string{
  95742. "project": c.project,
  95743. "region": c.region,
  95744. })
  95745. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95746. }
  95747. // Do executes the "compute.vpnTunnels.insert" call.
  95748. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95749. // status code is an error. Response headers are in either
  95750. // *Operation.ServerResponse.Header or (if a response was returned at
  95751. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95752. // to check whether the returned error was because
  95753. // http.StatusNotModified was returned.
  95754. func (c *VpnTunnelsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95755. gensupport.SetOptions(c.urlParams_, opts...)
  95756. res, err := c.doRequest("json")
  95757. if res != nil && res.StatusCode == http.StatusNotModified {
  95758. if res.Body != nil {
  95759. res.Body.Close()
  95760. }
  95761. return nil, &googleapi.Error{
  95762. Code: res.StatusCode,
  95763. Header: res.Header,
  95764. }
  95765. }
  95766. if err != nil {
  95767. return nil, err
  95768. }
  95769. defer googleapi.CloseBody(res)
  95770. if err := googleapi.CheckResponse(res); err != nil {
  95771. return nil, err
  95772. }
  95773. ret := &Operation{
  95774. ServerResponse: googleapi.ServerResponse{
  95775. Header: res.Header,
  95776. HTTPStatusCode: res.StatusCode,
  95777. },
  95778. }
  95779. target := &ret
  95780. if err := gensupport.DecodeResponse(target, res); err != nil {
  95781. return nil, err
  95782. }
  95783. return ret, nil
  95784. // {
  95785. // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.",
  95786. // "httpMethod": "POST",
  95787. // "id": "compute.vpnTunnels.insert",
  95788. // "parameterOrder": [
  95789. // "project",
  95790. // "region"
  95791. // ],
  95792. // "parameters": {
  95793. // "project": {
  95794. // "description": "Project ID for this request.",
  95795. // "location": "path",
  95796. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95797. // "required": true,
  95798. // "type": "string"
  95799. // },
  95800. // "region": {
  95801. // "description": "Name of the region for this request.",
  95802. // "location": "path",
  95803. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95804. // "required": true,
  95805. // "type": "string"
  95806. // },
  95807. // "requestId": {
  95808. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95809. // "location": "query",
  95810. // "type": "string"
  95811. // }
  95812. // },
  95813. // "path": "{project}/regions/{region}/vpnTunnels",
  95814. // "request": {
  95815. // "$ref": "VpnTunnel"
  95816. // },
  95817. // "response": {
  95818. // "$ref": "Operation"
  95819. // },
  95820. // "scopes": [
  95821. // "https://www.googleapis.com/auth/cloud-platform",
  95822. // "https://www.googleapis.com/auth/compute"
  95823. // ]
  95824. // }
  95825. }
  95826. // method id "compute.vpnTunnels.list":
  95827. type VpnTunnelsListCall struct {
  95828. s *Service
  95829. project string
  95830. region string
  95831. urlParams_ gensupport.URLParams
  95832. ifNoneMatch_ string
  95833. ctx_ context.Context
  95834. header_ http.Header
  95835. }
  95836. // List: Retrieves a list of VpnTunnel resources contained in the
  95837. // specified project and region.
  95838. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall {
  95839. c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95840. c.project = project
  95841. c.region = region
  95842. return c
  95843. }
  95844. // Filter sets the optional parameter "filter": A filter expression that
  95845. // filters resources listed in the response. The expression must specify
  95846. // the field name, a comparison operator, and the value that you want to
  95847. // use for filtering. The value must be a string, a number, or a
  95848. // boolean. The comparison operator must be either =, !=, >, or <.
  95849. //
  95850. // For example, if you are filtering Compute Engine instances, you can
  95851. // exclude instances named example-instance by specifying name !=
  95852. // example-instance.
  95853. //
  95854. // You can also filter nested fields. For example, you could specify
  95855. // scheduling.automaticRestart = false to include instances only if they
  95856. // are not scheduled for automatic restarts. You can use filtering on
  95857. // nested fields to filter based on resource labels.
  95858. //
  95859. // To filter on multiple expressions, provide each separate expression
  95860. // within parentheses. For example, (scheduling.automaticRestart = true)
  95861. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  95862. // AND expression. However, you can include AND and OR expressions
  95863. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  95864. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  95865. // true).
  95866. func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall {
  95867. c.urlParams_.Set("filter", filter)
  95868. return c
  95869. }
  95870. // MaxResults sets the optional parameter "maxResults": The maximum
  95871. // number of results per page that should be returned. If the number of
  95872. // available results is larger than maxResults, Compute Engine returns a
  95873. // nextPageToken that can be used to get the next page of results in
  95874. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  95875. // (Default: 500)
  95876. func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall {
  95877. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  95878. return c
  95879. }
  95880. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  95881. // a certain order. By default, results are returned in alphanumerical
  95882. // order based on the resource name.
  95883. //
  95884. // You can also sort results in descending order based on the creation
  95885. // timestamp using orderBy="creationTimestamp desc". This sorts results
  95886. // based on the creationTimestamp field in reverse chronological order
  95887. // (newest result first). Use this to sort resources like operations so
  95888. // that the newest operation is returned first.
  95889. //
  95890. // Currently, only sorting by name or creationTimestamp desc is
  95891. // supported.
  95892. func (c *VpnTunnelsListCall) OrderBy(orderBy string) *VpnTunnelsListCall {
  95893. c.urlParams_.Set("orderBy", orderBy)
  95894. return c
  95895. }
  95896. // PageToken sets the optional parameter "pageToken": Specifies a page
  95897. // token to use. Set pageToken to the nextPageToken returned by a
  95898. // previous list request to get the next page of results.
  95899. func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall {
  95900. c.urlParams_.Set("pageToken", pageToken)
  95901. return c
  95902. }
  95903. // Fields allows partial responses to be retrieved. See
  95904. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95905. // for more information.
  95906. func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall {
  95907. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95908. return c
  95909. }
  95910. // IfNoneMatch sets the optional parameter which makes the operation
  95911. // fail if the object's ETag matches the given value. This is useful for
  95912. // getting updates only after the object has changed since the last
  95913. // request. Use googleapi.IsNotModified to check whether the response
  95914. // error from Do is the result of In-None-Match.
  95915. func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall {
  95916. c.ifNoneMatch_ = entityTag
  95917. return c
  95918. }
  95919. // Context sets the context to be used in this call's Do method. Any
  95920. // pending HTTP request will be aborted if the provided context is
  95921. // canceled.
  95922. func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall {
  95923. c.ctx_ = ctx
  95924. return c
  95925. }
  95926. // Header returns an http.Header that can be modified by the caller to
  95927. // add HTTP headers to the request.
  95928. func (c *VpnTunnelsListCall) Header() http.Header {
  95929. if c.header_ == nil {
  95930. c.header_ = make(http.Header)
  95931. }
  95932. return c.header_
  95933. }
  95934. func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) {
  95935. reqHeaders := make(http.Header)
  95936. for k, v := range c.header_ {
  95937. reqHeaders[k] = v
  95938. }
  95939. reqHeaders.Set("User-Agent", c.s.userAgent())
  95940. if c.ifNoneMatch_ != "" {
  95941. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95942. }
  95943. var body io.Reader = nil
  95944. c.urlParams_.Set("alt", alt)
  95945. c.urlParams_.Set("prettyPrint", "false")
  95946. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  95947. urls += "?" + c.urlParams_.Encode()
  95948. req, err := http.NewRequest("GET", urls, body)
  95949. if err != nil {
  95950. return nil, err
  95951. }
  95952. req.Header = reqHeaders
  95953. googleapi.Expand(req.URL, map[string]string{
  95954. "project": c.project,
  95955. "region": c.region,
  95956. })
  95957. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95958. }
  95959. // Do executes the "compute.vpnTunnels.list" call.
  95960. // Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx
  95961. // status code is an error. Response headers are in either
  95962. // *VpnTunnelList.ServerResponse.Header or (if a response was returned
  95963. // at all) in error.(*googleapi.Error).Header. Use
  95964. // googleapi.IsNotModified to check whether the returned error was
  95965. // because http.StatusNotModified was returned.
  95966. func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, error) {
  95967. gensupport.SetOptions(c.urlParams_, opts...)
  95968. res, err := c.doRequest("json")
  95969. if res != nil && res.StatusCode == http.StatusNotModified {
  95970. if res.Body != nil {
  95971. res.Body.Close()
  95972. }
  95973. return nil, &googleapi.Error{
  95974. Code: res.StatusCode,
  95975. Header: res.Header,
  95976. }
  95977. }
  95978. if err != nil {
  95979. return nil, err
  95980. }
  95981. defer googleapi.CloseBody(res)
  95982. if err := googleapi.CheckResponse(res); err != nil {
  95983. return nil, err
  95984. }
  95985. ret := &VpnTunnelList{
  95986. ServerResponse: googleapi.ServerResponse{
  95987. Header: res.Header,
  95988. HTTPStatusCode: res.StatusCode,
  95989. },
  95990. }
  95991. target := &ret
  95992. if err := gensupport.DecodeResponse(target, res); err != nil {
  95993. return nil, err
  95994. }
  95995. return ret, nil
  95996. // {
  95997. // "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.",
  95998. // "httpMethod": "GET",
  95999. // "id": "compute.vpnTunnels.list",
  96000. // "parameterOrder": [
  96001. // "project",
  96002. // "region"
  96003. // ],
  96004. // "parameters": {
  96005. // "filter": {
  96006. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  96007. // "location": "query",
  96008. // "type": "string"
  96009. // },
  96010. // "maxResults": {
  96011. // "default": "500",
  96012. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  96013. // "format": "uint32",
  96014. // "location": "query",
  96015. // "minimum": "0",
  96016. // "type": "integer"
  96017. // },
  96018. // "orderBy": {
  96019. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  96020. // "location": "query",
  96021. // "type": "string"
  96022. // },
  96023. // "pageToken": {
  96024. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  96025. // "location": "query",
  96026. // "type": "string"
  96027. // },
  96028. // "project": {
  96029. // "description": "Project ID for this request.",
  96030. // "location": "path",
  96031. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96032. // "required": true,
  96033. // "type": "string"
  96034. // },
  96035. // "region": {
  96036. // "description": "Name of the region for this request.",
  96037. // "location": "path",
  96038. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96039. // "required": true,
  96040. // "type": "string"
  96041. // }
  96042. // },
  96043. // "path": "{project}/regions/{region}/vpnTunnels",
  96044. // "response": {
  96045. // "$ref": "VpnTunnelList"
  96046. // },
  96047. // "scopes": [
  96048. // "https://www.googleapis.com/auth/cloud-platform",
  96049. // "https://www.googleapis.com/auth/compute",
  96050. // "https://www.googleapis.com/auth/compute.readonly"
  96051. // ]
  96052. // }
  96053. }
  96054. // Pages invokes f for each page of results.
  96055. // A non-nil error returned from f will halt the iteration.
  96056. // The provided context supersedes any context provided to the Context method.
  96057. func (c *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) error) error {
  96058. c.ctx_ = ctx
  96059. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  96060. for {
  96061. x, err := c.Do()
  96062. if err != nil {
  96063. return err
  96064. }
  96065. if err := f(x); err != nil {
  96066. return err
  96067. }
  96068. if x.NextPageToken == "" {
  96069. return nil
  96070. }
  96071. c.PageToken(x.NextPageToken)
  96072. }
  96073. }
  96074. // method id "compute.zoneOperations.delete":
  96075. type ZoneOperationsDeleteCall struct {
  96076. s *Service
  96077. project string
  96078. zone string
  96079. operation string
  96080. urlParams_ gensupport.URLParams
  96081. ctx_ context.Context
  96082. header_ http.Header
  96083. }
  96084. // Delete: Deletes the specified zone-specific Operations resource.
  96085. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete
  96086. func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall {
  96087. c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96088. c.project = project
  96089. c.zone = zone
  96090. c.operation = operation
  96091. return c
  96092. }
  96093. // Fields allows partial responses to be retrieved. See
  96094. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96095. // for more information.
  96096. func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall {
  96097. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96098. return c
  96099. }
  96100. // Context sets the context to be used in this call's Do method. Any
  96101. // pending HTTP request will be aborted if the provided context is
  96102. // canceled.
  96103. func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall {
  96104. c.ctx_ = ctx
  96105. return c
  96106. }
  96107. // Header returns an http.Header that can be modified by the caller to
  96108. // add HTTP headers to the request.
  96109. func (c *ZoneOperationsDeleteCall) Header() http.Header {
  96110. if c.header_ == nil {
  96111. c.header_ = make(http.Header)
  96112. }
  96113. return c.header_
  96114. }
  96115. func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  96116. reqHeaders := make(http.Header)
  96117. for k, v := range c.header_ {
  96118. reqHeaders[k] = v
  96119. }
  96120. reqHeaders.Set("User-Agent", c.s.userAgent())
  96121. var body io.Reader = nil
  96122. c.urlParams_.Set("alt", alt)
  96123. c.urlParams_.Set("prettyPrint", "false")
  96124. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  96125. urls += "?" + c.urlParams_.Encode()
  96126. req, err := http.NewRequest("DELETE", urls, body)
  96127. if err != nil {
  96128. return nil, err
  96129. }
  96130. req.Header = reqHeaders
  96131. googleapi.Expand(req.URL, map[string]string{
  96132. "project": c.project,
  96133. "zone": c.zone,
  96134. "operation": c.operation,
  96135. })
  96136. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96137. }
  96138. // Do executes the "compute.zoneOperations.delete" call.
  96139. func (c *ZoneOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  96140. gensupport.SetOptions(c.urlParams_, opts...)
  96141. res, err := c.doRequest("json")
  96142. if err != nil {
  96143. return err
  96144. }
  96145. defer googleapi.CloseBody(res)
  96146. if err := googleapi.CheckResponse(res); err != nil {
  96147. return err
  96148. }
  96149. return nil
  96150. // {
  96151. // "description": "Deletes the specified zone-specific Operations resource.",
  96152. // "httpMethod": "DELETE",
  96153. // "id": "compute.zoneOperations.delete",
  96154. // "parameterOrder": [
  96155. // "project",
  96156. // "zone",
  96157. // "operation"
  96158. // ],
  96159. // "parameters": {
  96160. // "operation": {
  96161. // "description": "Name of the Operations resource to delete.",
  96162. // "location": "path",
  96163. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96164. // "required": true,
  96165. // "type": "string"
  96166. // },
  96167. // "project": {
  96168. // "description": "Project ID for this request.",
  96169. // "location": "path",
  96170. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96171. // "required": true,
  96172. // "type": "string"
  96173. // },
  96174. // "zone": {
  96175. // "description": "Name of the zone for this request.",
  96176. // "location": "path",
  96177. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96178. // "required": true,
  96179. // "type": "string"
  96180. // }
  96181. // },
  96182. // "path": "{project}/zones/{zone}/operations/{operation}",
  96183. // "scopes": [
  96184. // "https://www.googleapis.com/auth/cloud-platform",
  96185. // "https://www.googleapis.com/auth/compute"
  96186. // ]
  96187. // }
  96188. }
  96189. // method id "compute.zoneOperations.get":
  96190. type ZoneOperationsGetCall struct {
  96191. s *Service
  96192. project string
  96193. zone string
  96194. operation string
  96195. urlParams_ gensupport.URLParams
  96196. ifNoneMatch_ string
  96197. ctx_ context.Context
  96198. header_ http.Header
  96199. }
  96200. // Get: Retrieves the specified zone-specific Operations resource.
  96201. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get
  96202. func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
  96203. c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96204. c.project = project
  96205. c.zone = zone
  96206. c.operation = operation
  96207. return c
  96208. }
  96209. // Fields allows partial responses to be retrieved. See
  96210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96211. // for more information.
  96212. func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
  96213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96214. return c
  96215. }
  96216. // IfNoneMatch sets the optional parameter which makes the operation
  96217. // fail if the object's ETag matches the given value. This is useful for
  96218. // getting updates only after the object has changed since the last
  96219. // request. Use googleapi.IsNotModified to check whether the response
  96220. // error from Do is the result of In-None-Match.
  96221. func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall {
  96222. c.ifNoneMatch_ = entityTag
  96223. return c
  96224. }
  96225. // Context sets the context to be used in this call's Do method. Any
  96226. // pending HTTP request will be aborted if the provided context is
  96227. // canceled.
  96228. func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall {
  96229. c.ctx_ = ctx
  96230. return c
  96231. }
  96232. // Header returns an http.Header that can be modified by the caller to
  96233. // add HTTP headers to the request.
  96234. func (c *ZoneOperationsGetCall) Header() http.Header {
  96235. if c.header_ == nil {
  96236. c.header_ = make(http.Header)
  96237. }
  96238. return c.header_
  96239. }
  96240. func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  96241. reqHeaders := make(http.Header)
  96242. for k, v := range c.header_ {
  96243. reqHeaders[k] = v
  96244. }
  96245. reqHeaders.Set("User-Agent", c.s.userAgent())
  96246. if c.ifNoneMatch_ != "" {
  96247. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96248. }
  96249. var body io.Reader = nil
  96250. c.urlParams_.Set("alt", alt)
  96251. c.urlParams_.Set("prettyPrint", "false")
  96252. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  96253. urls += "?" + c.urlParams_.Encode()
  96254. req, err := http.NewRequest("GET", urls, body)
  96255. if err != nil {
  96256. return nil, err
  96257. }
  96258. req.Header = reqHeaders
  96259. googleapi.Expand(req.URL, map[string]string{
  96260. "project": c.project,
  96261. "zone": c.zone,
  96262. "operation": c.operation,
  96263. })
  96264. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96265. }
  96266. // Do executes the "compute.zoneOperations.get" call.
  96267. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96268. // status code is an error. Response headers are in either
  96269. // *Operation.ServerResponse.Header or (if a response was returned at
  96270. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96271. // to check whether the returned error was because
  96272. // http.StatusNotModified was returned.
  96273. func (c *ZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96274. gensupport.SetOptions(c.urlParams_, opts...)
  96275. res, err := c.doRequest("json")
  96276. if res != nil && res.StatusCode == http.StatusNotModified {
  96277. if res.Body != nil {
  96278. res.Body.Close()
  96279. }
  96280. return nil, &googleapi.Error{
  96281. Code: res.StatusCode,
  96282. Header: res.Header,
  96283. }
  96284. }
  96285. if err != nil {
  96286. return nil, err
  96287. }
  96288. defer googleapi.CloseBody(res)
  96289. if err := googleapi.CheckResponse(res); err != nil {
  96290. return nil, err
  96291. }
  96292. ret := &Operation{
  96293. ServerResponse: googleapi.ServerResponse{
  96294. Header: res.Header,
  96295. HTTPStatusCode: res.StatusCode,
  96296. },
  96297. }
  96298. target := &ret
  96299. if err := gensupport.DecodeResponse(target, res); err != nil {
  96300. return nil, err
  96301. }
  96302. return ret, nil
  96303. // {
  96304. // "description": "Retrieves the specified zone-specific Operations resource.",
  96305. // "httpMethod": "GET",
  96306. // "id": "compute.zoneOperations.get",
  96307. // "parameterOrder": [
  96308. // "project",
  96309. // "zone",
  96310. // "operation"
  96311. // ],
  96312. // "parameters": {
  96313. // "operation": {
  96314. // "description": "Name of the Operations resource to return.",
  96315. // "location": "path",
  96316. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96317. // "required": true,
  96318. // "type": "string"
  96319. // },
  96320. // "project": {
  96321. // "description": "Project ID for this request.",
  96322. // "location": "path",
  96323. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96324. // "required": true,
  96325. // "type": "string"
  96326. // },
  96327. // "zone": {
  96328. // "description": "Name of the zone for this request.",
  96329. // "location": "path",
  96330. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96331. // "required": true,
  96332. // "type": "string"
  96333. // }
  96334. // },
  96335. // "path": "{project}/zones/{zone}/operations/{operation}",
  96336. // "response": {
  96337. // "$ref": "Operation"
  96338. // },
  96339. // "scopes": [
  96340. // "https://www.googleapis.com/auth/cloud-platform",
  96341. // "https://www.googleapis.com/auth/compute",
  96342. // "https://www.googleapis.com/auth/compute.readonly"
  96343. // ]
  96344. // }
  96345. }
  96346. // method id "compute.zoneOperations.list":
  96347. type ZoneOperationsListCall struct {
  96348. s *Service
  96349. project string
  96350. zone string
  96351. urlParams_ gensupport.URLParams
  96352. ifNoneMatch_ string
  96353. ctx_ context.Context
  96354. header_ http.Header
  96355. }
  96356. // List: Retrieves a list of Operation resources contained within the
  96357. // specified zone.
  96358. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list
  96359. func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
  96360. c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96361. c.project = project
  96362. c.zone = zone
  96363. return c
  96364. }
  96365. // Filter sets the optional parameter "filter": A filter expression that
  96366. // filters resources listed in the response. The expression must specify
  96367. // the field name, a comparison operator, and the value that you want to
  96368. // use for filtering. The value must be a string, a number, or a
  96369. // boolean. The comparison operator must be either =, !=, >, or <.
  96370. //
  96371. // For example, if you are filtering Compute Engine instances, you can
  96372. // exclude instances named example-instance by specifying name !=
  96373. // example-instance.
  96374. //
  96375. // You can also filter nested fields. For example, you could specify
  96376. // scheduling.automaticRestart = false to include instances only if they
  96377. // are not scheduled for automatic restarts. You can use filtering on
  96378. // nested fields to filter based on resource labels.
  96379. //
  96380. // To filter on multiple expressions, provide each separate expression
  96381. // within parentheses. For example, (scheduling.automaticRestart = true)
  96382. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  96383. // AND expression. However, you can include AND and OR expressions
  96384. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  96385. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  96386. // true).
  96387. func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
  96388. c.urlParams_.Set("filter", filter)
  96389. return c
  96390. }
  96391. // MaxResults sets the optional parameter "maxResults": The maximum
  96392. // number of results per page that should be returned. If the number of
  96393. // available results is larger than maxResults, Compute Engine returns a
  96394. // nextPageToken that can be used to get the next page of results in
  96395. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  96396. // (Default: 500)
  96397. func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
  96398. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  96399. return c
  96400. }
  96401. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  96402. // a certain order. By default, results are returned in alphanumerical
  96403. // order based on the resource name.
  96404. //
  96405. // You can also sort results in descending order based on the creation
  96406. // timestamp using orderBy="creationTimestamp desc". This sorts results
  96407. // based on the creationTimestamp field in reverse chronological order
  96408. // (newest result first). Use this to sort resources like operations so
  96409. // that the newest operation is returned first.
  96410. //
  96411. // Currently, only sorting by name or creationTimestamp desc is
  96412. // supported.
  96413. func (c *ZoneOperationsListCall) OrderBy(orderBy string) *ZoneOperationsListCall {
  96414. c.urlParams_.Set("orderBy", orderBy)
  96415. return c
  96416. }
  96417. // PageToken sets the optional parameter "pageToken": Specifies a page
  96418. // token to use. Set pageToken to the nextPageToken returned by a
  96419. // previous list request to get the next page of results.
  96420. func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
  96421. c.urlParams_.Set("pageToken", pageToken)
  96422. return c
  96423. }
  96424. // Fields allows partial responses to be retrieved. See
  96425. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96426. // for more information.
  96427. func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
  96428. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96429. return c
  96430. }
  96431. // IfNoneMatch sets the optional parameter which makes the operation
  96432. // fail if the object's ETag matches the given value. This is useful for
  96433. // getting updates only after the object has changed since the last
  96434. // request. Use googleapi.IsNotModified to check whether the response
  96435. // error from Do is the result of In-None-Match.
  96436. func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall {
  96437. c.ifNoneMatch_ = entityTag
  96438. return c
  96439. }
  96440. // Context sets the context to be used in this call's Do method. Any
  96441. // pending HTTP request will be aborted if the provided context is
  96442. // canceled.
  96443. func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall {
  96444. c.ctx_ = ctx
  96445. return c
  96446. }
  96447. // Header returns an http.Header that can be modified by the caller to
  96448. // add HTTP headers to the request.
  96449. func (c *ZoneOperationsListCall) Header() http.Header {
  96450. if c.header_ == nil {
  96451. c.header_ = make(http.Header)
  96452. }
  96453. return c.header_
  96454. }
  96455. func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  96456. reqHeaders := make(http.Header)
  96457. for k, v := range c.header_ {
  96458. reqHeaders[k] = v
  96459. }
  96460. reqHeaders.Set("User-Agent", c.s.userAgent())
  96461. if c.ifNoneMatch_ != "" {
  96462. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96463. }
  96464. var body io.Reader = nil
  96465. c.urlParams_.Set("alt", alt)
  96466. c.urlParams_.Set("prettyPrint", "false")
  96467. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations")
  96468. urls += "?" + c.urlParams_.Encode()
  96469. req, err := http.NewRequest("GET", urls, body)
  96470. if err != nil {
  96471. return nil, err
  96472. }
  96473. req.Header = reqHeaders
  96474. googleapi.Expand(req.URL, map[string]string{
  96475. "project": c.project,
  96476. "zone": c.zone,
  96477. })
  96478. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96479. }
  96480. // Do executes the "compute.zoneOperations.list" call.
  96481. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  96482. // status code is an error. Response headers are in either
  96483. // *OperationList.ServerResponse.Header or (if a response was returned
  96484. // at all) in error.(*googleapi.Error).Header. Use
  96485. // googleapi.IsNotModified to check whether the returned error was
  96486. // because http.StatusNotModified was returned.
  96487. func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  96488. gensupport.SetOptions(c.urlParams_, opts...)
  96489. res, err := c.doRequest("json")
  96490. if res != nil && res.StatusCode == http.StatusNotModified {
  96491. if res.Body != nil {
  96492. res.Body.Close()
  96493. }
  96494. return nil, &googleapi.Error{
  96495. Code: res.StatusCode,
  96496. Header: res.Header,
  96497. }
  96498. }
  96499. if err != nil {
  96500. return nil, err
  96501. }
  96502. defer googleapi.CloseBody(res)
  96503. if err := googleapi.CheckResponse(res); err != nil {
  96504. return nil, err
  96505. }
  96506. ret := &OperationList{
  96507. ServerResponse: googleapi.ServerResponse{
  96508. Header: res.Header,
  96509. HTTPStatusCode: res.StatusCode,
  96510. },
  96511. }
  96512. target := &ret
  96513. if err := gensupport.DecodeResponse(target, res); err != nil {
  96514. return nil, err
  96515. }
  96516. return ret, nil
  96517. // {
  96518. // "description": "Retrieves a list of Operation resources contained within the specified zone.",
  96519. // "httpMethod": "GET",
  96520. // "id": "compute.zoneOperations.list",
  96521. // "parameterOrder": [
  96522. // "project",
  96523. // "zone"
  96524. // ],
  96525. // "parameters": {
  96526. // "filter": {
  96527. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  96528. // "location": "query",
  96529. // "type": "string"
  96530. // },
  96531. // "maxResults": {
  96532. // "default": "500",
  96533. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  96534. // "format": "uint32",
  96535. // "location": "query",
  96536. // "minimum": "0",
  96537. // "type": "integer"
  96538. // },
  96539. // "orderBy": {
  96540. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  96541. // "location": "query",
  96542. // "type": "string"
  96543. // },
  96544. // "pageToken": {
  96545. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  96546. // "location": "query",
  96547. // "type": "string"
  96548. // },
  96549. // "project": {
  96550. // "description": "Project ID for this request.",
  96551. // "location": "path",
  96552. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96553. // "required": true,
  96554. // "type": "string"
  96555. // },
  96556. // "zone": {
  96557. // "description": "Name of the zone for request.",
  96558. // "location": "path",
  96559. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96560. // "required": true,
  96561. // "type": "string"
  96562. // }
  96563. // },
  96564. // "path": "{project}/zones/{zone}/operations",
  96565. // "response": {
  96566. // "$ref": "OperationList"
  96567. // },
  96568. // "scopes": [
  96569. // "https://www.googleapis.com/auth/cloud-platform",
  96570. // "https://www.googleapis.com/auth/compute",
  96571. // "https://www.googleapis.com/auth/compute.readonly"
  96572. // ]
  96573. // }
  96574. }
  96575. // Pages invokes f for each page of results.
  96576. // A non-nil error returned from f will halt the iteration.
  96577. // The provided context supersedes any context provided to the Context method.
  96578. func (c *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  96579. c.ctx_ = ctx
  96580. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  96581. for {
  96582. x, err := c.Do()
  96583. if err != nil {
  96584. return err
  96585. }
  96586. if err := f(x); err != nil {
  96587. return err
  96588. }
  96589. if x.NextPageToken == "" {
  96590. return nil
  96591. }
  96592. c.PageToken(x.NextPageToken)
  96593. }
  96594. }
  96595. // method id "compute.zones.get":
  96596. type ZonesGetCall struct {
  96597. s *Service
  96598. project string
  96599. zone string
  96600. urlParams_ gensupport.URLParams
  96601. ifNoneMatch_ string
  96602. ctx_ context.Context
  96603. header_ http.Header
  96604. }
  96605. // Get: Returns the specified Zone resource. Gets a list of available
  96606. // zones by making a list() request.
  96607. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get
  96608. func (r *ZonesService) Get(project string, zone string) *ZonesGetCall {
  96609. c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96610. c.project = project
  96611. c.zone = zone
  96612. return c
  96613. }
  96614. // Fields allows partial responses to be retrieved. See
  96615. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96616. // for more information.
  96617. func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall {
  96618. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96619. return c
  96620. }
  96621. // IfNoneMatch sets the optional parameter which makes the operation
  96622. // fail if the object's ETag matches the given value. This is useful for
  96623. // getting updates only after the object has changed since the last
  96624. // request. Use googleapi.IsNotModified to check whether the response
  96625. // error from Do is the result of In-None-Match.
  96626. func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall {
  96627. c.ifNoneMatch_ = entityTag
  96628. return c
  96629. }
  96630. // Context sets the context to be used in this call's Do method. Any
  96631. // pending HTTP request will be aborted if the provided context is
  96632. // canceled.
  96633. func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall {
  96634. c.ctx_ = ctx
  96635. return c
  96636. }
  96637. // Header returns an http.Header that can be modified by the caller to
  96638. // add HTTP headers to the request.
  96639. func (c *ZonesGetCall) Header() http.Header {
  96640. if c.header_ == nil {
  96641. c.header_ = make(http.Header)
  96642. }
  96643. return c.header_
  96644. }
  96645. func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) {
  96646. reqHeaders := make(http.Header)
  96647. for k, v := range c.header_ {
  96648. reqHeaders[k] = v
  96649. }
  96650. reqHeaders.Set("User-Agent", c.s.userAgent())
  96651. if c.ifNoneMatch_ != "" {
  96652. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96653. }
  96654. var body io.Reader = nil
  96655. c.urlParams_.Set("alt", alt)
  96656. c.urlParams_.Set("prettyPrint", "false")
  96657. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}")
  96658. urls += "?" + c.urlParams_.Encode()
  96659. req, err := http.NewRequest("GET", urls, body)
  96660. if err != nil {
  96661. return nil, err
  96662. }
  96663. req.Header = reqHeaders
  96664. googleapi.Expand(req.URL, map[string]string{
  96665. "project": c.project,
  96666. "zone": c.zone,
  96667. })
  96668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96669. }
  96670. // Do executes the "compute.zones.get" call.
  96671. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  96672. // code is an error. Response headers are in either
  96673. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  96674. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  96675. // whether the returned error was because http.StatusNotModified was
  96676. // returned.
  96677. func (c *ZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  96678. gensupport.SetOptions(c.urlParams_, opts...)
  96679. res, err := c.doRequest("json")
  96680. if res != nil && res.StatusCode == http.StatusNotModified {
  96681. if res.Body != nil {
  96682. res.Body.Close()
  96683. }
  96684. return nil, &googleapi.Error{
  96685. Code: res.StatusCode,
  96686. Header: res.Header,
  96687. }
  96688. }
  96689. if err != nil {
  96690. return nil, err
  96691. }
  96692. defer googleapi.CloseBody(res)
  96693. if err := googleapi.CheckResponse(res); err != nil {
  96694. return nil, err
  96695. }
  96696. ret := &Zone{
  96697. ServerResponse: googleapi.ServerResponse{
  96698. Header: res.Header,
  96699. HTTPStatusCode: res.StatusCode,
  96700. },
  96701. }
  96702. target := &ret
  96703. if err := gensupport.DecodeResponse(target, res); err != nil {
  96704. return nil, err
  96705. }
  96706. return ret, nil
  96707. // {
  96708. // "description": "Returns the specified Zone resource. Gets a list of available zones by making a list() request.",
  96709. // "httpMethod": "GET",
  96710. // "id": "compute.zones.get",
  96711. // "parameterOrder": [
  96712. // "project",
  96713. // "zone"
  96714. // ],
  96715. // "parameters": {
  96716. // "project": {
  96717. // "description": "Project ID for this request.",
  96718. // "location": "path",
  96719. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96720. // "required": true,
  96721. // "type": "string"
  96722. // },
  96723. // "zone": {
  96724. // "description": "Name of the zone resource to return.",
  96725. // "location": "path",
  96726. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96727. // "required": true,
  96728. // "type": "string"
  96729. // }
  96730. // },
  96731. // "path": "{project}/zones/{zone}",
  96732. // "response": {
  96733. // "$ref": "Zone"
  96734. // },
  96735. // "scopes": [
  96736. // "https://www.googleapis.com/auth/cloud-platform",
  96737. // "https://www.googleapis.com/auth/compute",
  96738. // "https://www.googleapis.com/auth/compute.readonly"
  96739. // ]
  96740. // }
  96741. }
  96742. // method id "compute.zones.list":
  96743. type ZonesListCall struct {
  96744. s *Service
  96745. project string
  96746. urlParams_ gensupport.URLParams
  96747. ifNoneMatch_ string
  96748. ctx_ context.Context
  96749. header_ http.Header
  96750. }
  96751. // List: Retrieves the list of Zone resources available to the specified
  96752. // project.
  96753. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list
  96754. func (r *ZonesService) List(project string) *ZonesListCall {
  96755. c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96756. c.project = project
  96757. return c
  96758. }
  96759. // Filter sets the optional parameter "filter": A filter expression that
  96760. // filters resources listed in the response. The expression must specify
  96761. // the field name, a comparison operator, and the value that you want to
  96762. // use for filtering. The value must be a string, a number, or a
  96763. // boolean. The comparison operator must be either =, !=, >, or <.
  96764. //
  96765. // For example, if you are filtering Compute Engine instances, you can
  96766. // exclude instances named example-instance by specifying name !=
  96767. // example-instance.
  96768. //
  96769. // You can also filter nested fields. For example, you could specify
  96770. // scheduling.automaticRestart = false to include instances only if they
  96771. // are not scheduled for automatic restarts. You can use filtering on
  96772. // nested fields to filter based on resource labels.
  96773. //
  96774. // To filter on multiple expressions, provide each separate expression
  96775. // within parentheses. For example, (scheduling.automaticRestart = true)
  96776. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  96777. // AND expression. However, you can include AND and OR expressions
  96778. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  96779. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  96780. // true).
  96781. func (c *ZonesListCall) Filter(filter string) *ZonesListCall {
  96782. c.urlParams_.Set("filter", filter)
  96783. return c
  96784. }
  96785. // MaxResults sets the optional parameter "maxResults": The maximum
  96786. // number of results per page that should be returned. If the number of
  96787. // available results is larger than maxResults, Compute Engine returns a
  96788. // nextPageToken that can be used to get the next page of results in
  96789. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  96790. // (Default: 500)
  96791. func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall {
  96792. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  96793. return c
  96794. }
  96795. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  96796. // a certain order. By default, results are returned in alphanumerical
  96797. // order based on the resource name.
  96798. //
  96799. // You can also sort results in descending order based on the creation
  96800. // timestamp using orderBy="creationTimestamp desc". This sorts results
  96801. // based on the creationTimestamp field in reverse chronological order
  96802. // (newest result first). Use this to sort resources like operations so
  96803. // that the newest operation is returned first.
  96804. //
  96805. // Currently, only sorting by name or creationTimestamp desc is
  96806. // supported.
  96807. func (c *ZonesListCall) OrderBy(orderBy string) *ZonesListCall {
  96808. c.urlParams_.Set("orderBy", orderBy)
  96809. return c
  96810. }
  96811. // PageToken sets the optional parameter "pageToken": Specifies a page
  96812. // token to use. Set pageToken to the nextPageToken returned by a
  96813. // previous list request to get the next page of results.
  96814. func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall {
  96815. c.urlParams_.Set("pageToken", pageToken)
  96816. return c
  96817. }
  96818. // Fields allows partial responses to be retrieved. See
  96819. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96820. // for more information.
  96821. func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall {
  96822. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96823. return c
  96824. }
  96825. // IfNoneMatch sets the optional parameter which makes the operation
  96826. // fail if the object's ETag matches the given value. This is useful for
  96827. // getting updates only after the object has changed since the last
  96828. // request. Use googleapi.IsNotModified to check whether the response
  96829. // error from Do is the result of In-None-Match.
  96830. func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall {
  96831. c.ifNoneMatch_ = entityTag
  96832. return c
  96833. }
  96834. // Context sets the context to be used in this call's Do method. Any
  96835. // pending HTTP request will be aborted if the provided context is
  96836. // canceled.
  96837. func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall {
  96838. c.ctx_ = ctx
  96839. return c
  96840. }
  96841. // Header returns an http.Header that can be modified by the caller to
  96842. // add HTTP headers to the request.
  96843. func (c *ZonesListCall) Header() http.Header {
  96844. if c.header_ == nil {
  96845. c.header_ = make(http.Header)
  96846. }
  96847. return c.header_
  96848. }
  96849. func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) {
  96850. reqHeaders := make(http.Header)
  96851. for k, v := range c.header_ {
  96852. reqHeaders[k] = v
  96853. }
  96854. reqHeaders.Set("User-Agent", c.s.userAgent())
  96855. if c.ifNoneMatch_ != "" {
  96856. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96857. }
  96858. var body io.Reader = nil
  96859. c.urlParams_.Set("alt", alt)
  96860. c.urlParams_.Set("prettyPrint", "false")
  96861. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones")
  96862. urls += "?" + c.urlParams_.Encode()
  96863. req, err := http.NewRequest("GET", urls, body)
  96864. if err != nil {
  96865. return nil, err
  96866. }
  96867. req.Header = reqHeaders
  96868. googleapi.Expand(req.URL, map[string]string{
  96869. "project": c.project,
  96870. })
  96871. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96872. }
  96873. // Do executes the "compute.zones.list" call.
  96874. // Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
  96875. // code is an error. Response headers are in either
  96876. // *ZoneList.ServerResponse.Header or (if a response was returned at
  96877. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96878. // to check whether the returned error was because
  96879. // http.StatusNotModified was returned.
  96880. func (c *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, error) {
  96881. gensupport.SetOptions(c.urlParams_, opts...)
  96882. res, err := c.doRequest("json")
  96883. if res != nil && res.StatusCode == http.StatusNotModified {
  96884. if res.Body != nil {
  96885. res.Body.Close()
  96886. }
  96887. return nil, &googleapi.Error{
  96888. Code: res.StatusCode,
  96889. Header: res.Header,
  96890. }
  96891. }
  96892. if err != nil {
  96893. return nil, err
  96894. }
  96895. defer googleapi.CloseBody(res)
  96896. if err := googleapi.CheckResponse(res); err != nil {
  96897. return nil, err
  96898. }
  96899. ret := &ZoneList{
  96900. ServerResponse: googleapi.ServerResponse{
  96901. Header: res.Header,
  96902. HTTPStatusCode: res.StatusCode,
  96903. },
  96904. }
  96905. target := &ret
  96906. if err := gensupport.DecodeResponse(target, res); err != nil {
  96907. return nil, err
  96908. }
  96909. return ret, nil
  96910. // {
  96911. // "description": "Retrieves the list of Zone resources available to the specified project.",
  96912. // "httpMethod": "GET",
  96913. // "id": "compute.zones.list",
  96914. // "parameterOrder": [
  96915. // "project"
  96916. // ],
  96917. // "parameters": {
  96918. // "filter": {
  96919. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  96920. // "location": "query",
  96921. // "type": "string"
  96922. // },
  96923. // "maxResults": {
  96924. // "default": "500",
  96925. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  96926. // "format": "uint32",
  96927. // "location": "query",
  96928. // "minimum": "0",
  96929. // "type": "integer"
  96930. // },
  96931. // "orderBy": {
  96932. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  96933. // "location": "query",
  96934. // "type": "string"
  96935. // },
  96936. // "pageToken": {
  96937. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  96938. // "location": "query",
  96939. // "type": "string"
  96940. // },
  96941. // "project": {
  96942. // "description": "Project ID for this request.",
  96943. // "location": "path",
  96944. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96945. // "required": true,
  96946. // "type": "string"
  96947. // }
  96948. // },
  96949. // "path": "{project}/zones",
  96950. // "response": {
  96951. // "$ref": "ZoneList"
  96952. // },
  96953. // "scopes": [
  96954. // "https://www.googleapis.com/auth/cloud-platform",
  96955. // "https://www.googleapis.com/auth/compute",
  96956. // "https://www.googleapis.com/auth/compute.readonly"
  96957. // ]
  96958. // }
  96959. }
  96960. // Pages invokes f for each page of results.
  96961. // A non-nil error returned from f will halt the iteration.
  96962. // The provided context supersedes any context provided to the Context method.
  96963. func (c *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) error) error {
  96964. c.ctx_ = ctx
  96965. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  96966. for {
  96967. x, err := c.Do()
  96968. if err != nil {
  96969. return err
  96970. }
  96971. if err := f(x); err != nil {
  96972. return err
  96973. }
  96974. if x.NextPageToken == "" {
  96975. return nil
  96976. }
  96977. c.PageToken(x.NextPageToken)
  96978. }
  96979. }